index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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" style="margin-left:30px;color:black">
  11. <p><span>专题库名称:</span>{{ projectName }}</p>
  12. </div>
  13. </div>
  14. <div class="header-right">
  15. <user-bar/>
  16. </div>
  17. </div>
  18. </el-header>
  19. <el-main style="padding:0;padding-top:0px;overflow:auto;background:white" >
  20. <!-- <el-header style="height:30px;color:brown;">
  21. <marquee behavior="scroll" direction="left" scrollamount="5" scrolldelay="100" hspace="10" vspace="10" align="middle" face="" color="white" size="">{{ text }}</marquee>
  22. </el-header> -->
  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. </div>
  33. </template>
  34. <script>
  35. import { mapGetters } from "vuex";
  36. import UserBar from "./components/UserBar";
  37. import { webSocket } from "./mixins";
  38. import { guide } from "./components/guide";
  39. import contextMenu from "./components/contextMenu.vue";
  40. export default {
  41. components: {
  42. UserBar,
  43. contextMenu
  44. },
  45. mixins: [webSocket,guide],
  46. data() {
  47. return {
  48. showProjectName:false,
  49. projectName:'',
  50. id: this.$route.query.id,
  51. key: this.$route.query.key,
  52. button: [],
  53. show: false,
  54. btnLoading: false,
  55. text:''
  56. }
  57. },
  58. watch: {
  59. $route() {
  60. this.button = this.$route.meta.button || []
  61. this.showProjectName = this.$route.meta.showProjectName
  62. this.openGuide(this.$route.meta.title)
  63. },
  64. showProjectName(val){
  65. this.projectName = this.$s.getSession('projectName')
  66. }
  67. },
  68. computed: {
  69. ...mapGetters(['projectId', 'userinfo','webSocket']),
  70. },
  71. created(){
  72. this.getPermissionList()
  73. },
  74. async mounted() {
  75. this.$store.commit('SET_PREFIX', '/')
  76. this.getUserInfo()
  77. this.getRouter()
  78. this.DictMessage()
  79. await this.getPermissions()
  80. if (this.id) {
  81. this.$store.commit('SET_PROJECT_ID', parseInt(this.id))
  82. }
  83. if (this.key) {
  84. this.$store.commit('SET_PATENT_KEY', this.key)
  85. await this.$store.dispatch('getCustomField', this.projectId)
  86. await this.$store.dispatch('getSystemField', this.projectId)
  87. }
  88. this.openGuide(this.$route.meta.title)
  89. },
  90. methods: {
  91. //获取专题库权限
  92. async getPermissions() {
  93. const response = await this.$api.getPermissions()
  94. this.$store.commit('SET_PERMISSIONS', response.data)
  95. },
  96. //获取字典项
  97. DictMessage() {
  98. this.$api.DictMessage().then(response => {
  99. // console.log("response", response);
  100. this.$store.commit("SET_DictMessage",response.data)
  101. })
  102. },
  103. //获取路由信息
  104. getRouter(){
  105. this.button = this.$route.meta.button || []
  106. this.showProjectName = this.$route.meta.showProjectName
  107. },
  108. //点击图标
  109. handleClick(){
  110. this.$router.push({
  111. path: '/home'
  112. })
  113. },
  114. //修改权限
  115. changePermission(){
  116. this.webSocket.onmessage = (e) => {
  117. if(JSON.parse(e.data).code=='903' ){
  118. this.getPermissionList()
  119. }
  120. }
  121. },
  122. //获取权限
  123. getPermissionList(){
  124. var code = "6a8d3f4d1d5f11eda41c00163e2f0200;5051395c24e311eda41c00163e2f0200;a97c468b924111ed905500163e2f0200"
  125. this.$api.getPermissionList({code:code}).then(response=>{
  126. this.$store.commit('SET_ADMIN_PERMISSION', response.data)
  127. }).catch(error=>{
  128. this.$store.commit('SET_ADMIN_PERMISSION', [])
  129. })
  130. },
  131. //获取个人信息
  132. getUserInfo() {
  133. this.$api.getUserInfo().then(response => {
  134. localStorage.tenant = response.data.tenantId
  135. this.text = `欢迎${response.data.name}登录本系统`
  136. this.$store.commit('SET_USERINFO', response.data)
  137. this.connectWebSocket(response.data.id)
  138. })
  139. },
  140. }
  141. }
  142. </script>
  143. <style lang="scss">
  144. .tenant .el-input__inner{
  145. height: 32px;
  146. line-height: 32px;
  147. }
  148. .role .el-icon-close{
  149. display: none;
  150. }
  151. </style>
  152. <style lang="scss">
  153. #work-platform {
  154. width: 100%;
  155. height: 100%;
  156. .header {
  157. width: 100%;
  158. height: 60px;
  159. background: #fff;
  160. box-shadow: 0 1px 3px 0 rgba(0,0,0,.12), 0 0 3px 0 rgba(0,0,0,.04);
  161. color: #fff;
  162. display: flex;
  163. justify-content: space-between;
  164. border-bottom: 10px solid #e6e6e6;
  165. .logo-bar {
  166. font-size: 20px;
  167. font-weight: bold;
  168. display: flex;
  169. align-items: center;
  170. cursor: pointer;
  171. .logo {
  172. margin-right: 10px;
  173. // width: 140px;
  174. height: 40px;
  175. }
  176. }
  177. }
  178. .header-left {
  179. display: flex;
  180. align-items: center;
  181. padding-left: 20px;
  182. }
  183. .header-right {
  184. display: flex;
  185. align-items: center;
  186. }
  187. .wrapper {
  188. width: 100%;
  189. height: calc(100%);
  190. background: white;
  191. #view {
  192. height: calc(100% - 0px)
  193. }
  194. }
  195. }
  196. </style>
  197. <style lang="scss">
  198. .introjs-helperLayer{
  199. box-shadow: rgba(33, 33, 33, 0.8) 0px 0px 1px 0px, rgba(33, 33, 33, 0.5) 0px 0px 0px 5000px!important;
  200. border: 3px dashed #409eff;
  201. }
  202. .new-tips{
  203. color: #409eff;
  204. line-height: 80px;
  205. cursor: pointer;
  206. }
  207. .introjs-tooltip-title{
  208. font-size: 16px;
  209. width: 80%;
  210. padding-top: 10px;
  211. }
  212. .warper {
  213. width: 200px;
  214. height: 100px;
  215. line-height: 100px;
  216. text-align: center;
  217. border: 1px solid saddlebrown;
  218. }
  219. /* 重置引导组件样式(类似element-ui个人使用) */
  220. .intro-tooltip {
  221. color: #ffff;
  222. background: #2c3e50;
  223. }
  224. /* 引导提示框的位置 */
  225. .introjs-bottom-left-aligned {
  226. left: 45% !important;
  227. }
  228. .introjs-right,
  229. .introjs-left {
  230. top: 30%;
  231. }
  232. .intro-highlight {
  233. background: rgba(255,255,255,0.5);
  234. }
  235. .introjs-arrow.left {
  236. border-right-color: #2c3e50;
  237. }
  238. .introjs-arrow.top {
  239. border-bottom-color: #2c3e50;
  240. }
  241. .introjs-arrow.right {
  242. border-left-color: #2c3e50;
  243. }
  244. .introjs-arrow.bottom {
  245. border-top-color: #2c3e50;
  246. }
  247. /* 提示框头部区域 */
  248. .introjs-tooltip-header {
  249. padding-right: 0 !important;
  250. padding-top: 0 !important;
  251. }
  252. .introjs-skipbutton {
  253. color: #409eff !important;
  254. font-size: 14px !important;
  255. font-weight: normal !important;
  256. // padding: 8px 10px !important ;
  257. }
  258. .introjs-tooltipbuttons {
  259. border: none !important;
  260. }
  261. .introjs-tooltiptext {
  262. font-size: 14px !important;
  263. padding: 15px !important;
  264. }
  265. /* 提示框按钮 */
  266. .introjs-tooltipbuttons {
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. }
  271. .introjs-button {
  272. width: 50px !important;
  273. text-align: center;
  274. padding: 4px !important;
  275. font-size: 12px !important;
  276. font-weight: 500 !important;
  277. border-radius: 3px !important;
  278. border: none !important;
  279. }
  280. .introjs-button:last-child {
  281. margin-left: 10px;
  282. }
  283. .introjs-prevbutton {
  284. color: #606266 !important;
  285. background: #fff !important;
  286. border: 1px solid #dcdfe6 !important;
  287. }
  288. .introjs-nextbutton {
  289. color: #fff !important;
  290. background-color: #409eff !important;
  291. border-color: #409eff !important;
  292. }
  293. .introjs-disabled {
  294. color: #9e9e9e !important;
  295. border-color: #bdbdbd !important;
  296. background-color: #f4f4f4 !important;
  297. }
  298. </style>