index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div id="work-platform">
  3. <el-container>
  4. <el-header>
  5. <div class="header">
  6. <div class="header-left">
  7. <div class="logo-bar" @click="handleClick">
  8. <img src="@/assets/logo-3.png" class="logo">
  9. </div>
  10. <!-- <div v-if="showProjectName" class="projectName">
  11. <p><span>专利数据库名称:</span>{{ projectName }}</p>
  12. </div> -->
  13. <div class="projectName">
  14. <p>{{ projectName }}</p>
  15. </div>
  16. </div>
  17. <div class="header-right">
  18. <user-bar/>
  19. </div>
  20. </div>
  21. </el-header>
  22. <el-main class="main">
  23. <section class="wrapper">
  24. <keep-alive>
  25. <router-view id="view" v-if="$route.meta.keepAlive"></router-view>
  26. </keep-alive>
  27. <router-view id="view" v-if="!$route.meta.keepAlive"></router-view>
  28. <contextMenu></contextMenu>
  29. </section>
  30. </el-main>
  31. </el-container>
  32. <help></help>
  33. </div>
  34. </template>
  35. <script>
  36. import { mapGetters } from "vuex";
  37. import UserBar from "./components/UserBar";
  38. import { webSocket } from "./mixins";
  39. import { guide } from "./components/guide";
  40. import contextMenu from "./components/contextMenu.vue";
  41. import help from "./components/help.vue";
  42. export default {
  43. components: {
  44. UserBar,
  45. contextMenu,
  46. help
  47. },
  48. mixins: [webSocket,guide],
  49. data() {
  50. return {
  51. showProjectName:false,
  52. projectName:'',
  53. id: this.$route.query.id,
  54. key: this.$route.query.key,
  55. button: [],
  56. show: false,
  57. btnLoading: false,
  58. }
  59. },
  60. watch: {
  61. $route() {
  62. this.getProjectName()
  63. this.button = this.$route.meta.button || []
  64. this.guide()
  65. },
  66. },
  67. computed: {
  68. ...mapGetters(['projectId', 'userinfo','webSocket']),
  69. },
  70. created(){
  71. this.connectWebSocket(this.userinfo.id)
  72. },
  73. async mounted() {
  74. this.getProjectName()
  75. this.$store.commit('SET_PREFIX', '/')
  76. this.getRouter()
  77. if (this.id) {
  78. this.$store.commit('SET_PROJECT_ID', parseInt(this.id))
  79. }
  80. if (this.key) {
  81. this.$store.commit('SET_PATENT_KEY', this.key)
  82. await this.$store.dispatch('getCustomField', this.projectId)
  83. await this.$store.dispatch('getSystemField', this.projectId)
  84. }
  85. this.guide()
  86. },
  87. methods: {
  88. getProjectName(){
  89. var params = this.$route.query
  90. if(params.projectName && params.projectType){
  91. var obj = {
  92. 1:'专题库',
  93. 2:'报告',
  94. 3:'产品',
  95. // 4:'标注库'
  96. }
  97. if(obj[params.projectType]){
  98. this.projectName = obj[params.projectType] + '名称:' + params.projectName
  99. }
  100. }else{
  101. this.projectName = ''
  102. }
  103. },
  104. guide(){
  105. if(this.$route.meta.sign == 'home'){
  106. this.openGuide(this.$route.meta.sign)
  107. }
  108. },
  109. //获取路由信息
  110. getRouter(){
  111. this.button = this.$route.meta.button || []
  112. this.showProjectName = this.$route.meta.showProjectName
  113. },
  114. //点击图标
  115. handleClick(){
  116. this.$router.push({
  117. path: '/home'
  118. })
  119. },
  120. },
  121. }
  122. </script>
  123. <style lang="scss">
  124. .tenant .el-input__inner{
  125. height: 32px;
  126. line-height: 32px;
  127. }
  128. .role .el-icon-close{
  129. display: none;
  130. }
  131. </style>
  132. <style lang="scss" scoped>
  133. #work-platform {
  134. width: 100%;
  135. min-width: 1200px;
  136. height: 100%;
  137. .header {
  138. width: 100%;
  139. height: 60px;
  140. background: #fff;
  141. box-shadow: 0 1px 3px 0 rgba(0,0,0,.12), 0 0 3px 0 rgba(0,0,0,.04);
  142. color: #fff;
  143. display: flex;
  144. justify-content: space-between;
  145. border-bottom: 10px solid #e6e6e6;
  146. .logo-bar {
  147. font-size: 20px;
  148. font-weight: bold;
  149. display: flex;
  150. align-items: center;
  151. cursor: pointer;
  152. .logo {
  153. margin-right: 10px;
  154. // width: 140px;
  155. height: 40px;
  156. }
  157. }
  158. }
  159. .projectName{
  160. margin-left:30px;
  161. color:black
  162. }
  163. .header-left {
  164. display: flex;
  165. align-items: center;
  166. padding-left: 20px;
  167. }
  168. .header-right {
  169. display: flex;
  170. align-items: center;
  171. }
  172. .main{
  173. padding:0 !important;
  174. padding-top:0px !important;
  175. overflow:auto !important;
  176. background:white !important;
  177. }
  178. .wrapper {
  179. width: 100%;
  180. height: 100%;
  181. background: white;
  182. #view {
  183. height: 100%
  184. }
  185. }
  186. }
  187. </style>