module-menu-vue 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +24 -24
  2. package/babel.config.js +5 -5
  3. package/index.js +4 -4
  4. package/jsconfig.json +19 -19
  5. package/package.json +48 -48
  6. package/public/index.html +14 -14
  7. package/src/App.vue +29 -29
  8. package/src/assets/admin_logo.svg +48 -48
  9. package/src/assets/admin_slogo.svg +48 -48
  10. package/src/assets/alert_logo.svg +26 -26
  11. package/src/assets/alert_slogo.svg +26 -26
  12. package/src/assets/childIcon.svg +10 -10
  13. package/src/assets/dataManager_logo.svg +42 -42
  14. package/src/assets/dataanalytic_logo.svg +44 -44
  15. package/src/assets/dataanalytic_slogo.svg +47 -47
  16. package/src/assets/dataasset_logo.svg +52 -52
  17. package/src/assets/dataasset_slogo.svg +52 -52
  18. package/src/assets/datacollection_logo.svg +70 -70
  19. package/src/assets/datacollection_slogo.svg +70 -70
  20. package/src/assets/datadev_logo.svg +26 -26
  21. package/src/assets/datadev_slogo.svg +26 -26
  22. package/src/assets/datalabel_logo.svg +26 -26
  23. package/src/assets/datalabel_slogo.svg +26 -26
  24. package/src/assets/datamanager_slogo.svg +42 -42
  25. package/src/assets/dataservice_logo.svg +209 -209
  26. package/src/assets/dataservice_slogo.svg +209 -209
  27. package/src/assets/datasharing_logo.svg +28 -28
  28. package/src/assets/datasharing_slogo.svg +28 -28
  29. package/src/assets/exchange_portal_logo.svg +9 -9
  30. package/src/assets/home.svg +12 -12
  31. package/src/assets/ic_biaoqianfenxi.png +0 -0
  32. package/src/assets/ic_gonggongmokuai_m.svg +5 -5
  33. package/src/assets/ic_shujuhuiju_m.svg +5 -5
  34. package/src/assets/ic_shujukaifa_m.svg +15 -15
  35. package/src/assets/ic_shujukaifang_m.svg +5 -5
  36. package/src/assets/ic_shujuyingyong_m.svg +5 -5
  37. package/src/assets/ic_shujuzhili_m.svg +5 -5
  38. package/src/assets/metadata_logo.svg +25 -25
  39. package/src/assets/metadata_slogo.svg +25 -25
  40. package/src/assets/module.svg +12 -12
  41. package/src/assets/operate_logo.svg +63 -63
  42. package/src/assets/operate_slogo.svg +63 -63
  43. package/src/assets/personalCenter.svg +15 -15
  44. package/src/assets/quality_logo.svg +26 -26
  45. package/src/assets/quality_slogo.svg +26 -26
  46. package/src/assets/systemManage.svg +15 -15
  47. package/src/assets/wordorder_logo.svg +57 -57
  48. package/src/assets/workorder_slogo.svg +54 -54
  49. package/src/components/Menu/ModuleMenu.vue +344 -341
  50. package/src/components/Menu/constant.js +560 -545
  51. package/src/components/Menu/menu.css +122 -122
  52. package/src/components/Menu/service.js +25 -25
  53. package/src/components/Portal/PortalBtn.vue +30 -30
  54. package/src/components/Tenant/TenantList.vue +74 -74
  55. package/src/components/Tenant/service.js +17 -17
  56. package/src/components/User/UserInfo.vue +227 -227
  57. package/src/components/User/constant.js +11 -11
  58. package/src/components/User/service.js +14 -14
  59. package/src/components/Util/axios.js +89 -89
  60. package/src/components/Util/config.js +13 -13
  61. package/src/components/Util/permessionUtils.js +46 -46
  62. package/src/components/Util/userInfo.js +96 -96
  63. package/src/main.js +11 -11
  64. package/vue.config.js +34 -34
@@ -1,341 +1,344 @@
1
- <template>
2
- <div :style = "{ background: stash === 'HBJK' ? '#1373FF' : '#fff' }">
3
- <div class='menuPopupAndTitle' :style="{height: stash === 'LNRD' ? '75px': 'auto'}">
4
- <div class='menuIcon' :style="{background: stash === 'LNRD' ? '#EA1A1A' : '#4091f7',height: stash === 'LNRD' ? '75px' : '50px', width: stash === 'LNRD' ? '75px' : '60px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
5
- <img class="menuIcon_img" :src="menuIconSrc" :style="{verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}"/>
6
- </div>
7
- <div :class="'menu_title_content'" v-show="showCollapse" @click="toHref()" :style="{lineHeight: stash === 'LNRD' ? '53px' : '49px' }">
8
- <img v-if="stash !== 'HBJK'" class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" :style="{verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}"/>
9
- <span class='menu_title' :style="{color: stash === 'LNRD' || stash === 'HBJK'? '#fff' : '#1373FF',verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}">{{getLogoAndTitle().title}}</span>
10
- </div>
11
- </div>
12
- <div class='menu_list_content' :style="{ display: showMenuList ? 'block' : 'none', top: stash === 'LNRD' ? '75px' : '50px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
13
- <div v-for="(item, index) in menuList" :key="item.path">
14
- <div :key="item.name" class="cardLine" :style="{height: item.children.length > 3 ? '90px' : ''}">
15
- <div class='leftMenu'
16
- :style="{
17
- height: item.children.length > 3 ? '96px' : '70px',
18
- lineHeight: item.children.length > 3 ? '45px' : '70px',
19
- }">
20
- <img :src="item.url" class="middle imgWidth" />
21
- <span class="middle textPad" :class="stash === 'LNRD' ? 'LNRD_menu_title' : 'textPad'" @click="toHomePage(index)">{{item.name}}</span>
22
- </div>
23
- <div class='rightMenu'
24
- :style="{
25
- height: item.children.length > 6 ? '140px' : item.children.length > 3 ? '96px' : '70px',
26
- lineHeight: item.children.length > 3 ? '45px' : '70px',
27
- borderBottom: index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
28
- }">
29
- <span v-show="index === 0 && isExist">
30
- <img :src="require('./../../assets/exchange_portal_logo.svg')" class="middle exchangeCss" />
31
- <span class="middle textPad" @click="toExchangePage()">政务共享交换平台</span>
32
- </span>
33
- <span v-for="child in item.children" :key="child.url" class="menu-item-wrapper">
34
- <span :key="child.childName" class="menu-item-content">
35
- <img :src="child.url" class="middle iconPad" />
36
- <span :class="stash === 'LNRD' ? 'LNRD_menu_title childMenu textPad' : 'childMenu textPad middle'" @click="toModulePage(child.childName)">{{child.childName}}</span>
37
- </span>
38
- </span>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- </template>
45
-
46
- <script>
47
- import { getMenuList as getMenuListInit, menuList_PANWEI, menuIconSrc, sysNameMap, lnrdMenuList, lnrdSysNameMap, menuList_HBJK} from './constant.js'
48
- import './menu.css'
49
- import { getMenuList, isLogoutThird, getInfoByName, getUrlByInfo } from './service.js'
50
- export default {
51
- name: 'ModuleMenu',
52
- props: {
53
- sysName: {
54
- type: String,
55
- default: 'admin'
56
- },
57
- collapse: {
58
- type: Boolean,
59
- default: true,
60
- },
61
- stash: {
62
- type: String,
63
- default: ''
64
- }
65
- },
66
- watch: {
67
- collapse: {
68
- handler: function (newVal, oldVal) {
69
- console.log('---', newVal, oldVal)
70
- this.showCollapse = newVal
71
- },
72
- deep: true
73
- }
74
- },
75
- data () {
76
- return {
77
- showMenuList: false,
78
- menuIconSrc: menuIconSrc,
79
- menuList: [],
80
- sessionMenu: [],
81
- menuListInit: getMenuListInit(this.stash),
82
- menuList_PANWEI,
83
- lnrdMenuList,
84
- lnrdSysNameMap,
85
- sysNameMap: sysNameMap,
86
- showCollapse: true,
87
- isExist: false,
88
- systemPath: ''
89
- }
90
- },
91
- created () {
92
- this.getSessionMenu();
93
- if (!["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
94
- this.getNewMenuList();
95
- }
96
- },
97
- methods: {
98
- // 跳转政务共享交换平台
99
- toExchangePage() {
100
- isLogoutThird().then((rsp) => {
101
- const rspObj = rsp.data
102
- console.log('isLogoutThird rspObj: ', rspObj);
103
- if (rspObj && rspObj.data !== '1') {
104
- location.href = rsp.data;
105
- }
106
- });
107
- },
108
- toHref () {
109
- if (this.sysName === 'admin') {
110
- let url = ''
111
- if (this.stash === "GZW") {
112
- url = `/data-platform/#${this.systemPath}`
113
- } else if (this.stash === 'PANWEI') {
114
- url = `/bigdata-portal/#${this.systemPath}`
115
- } else if (!["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
116
- url = `/#${this.systemPath}`
117
- }
118
- location.href = url
119
- }
120
- },
121
- async getSessionMenu () {
122
- // 一体化
123
- if (["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
124
- const rsp = await getMenuList()
125
- const rspData = rsp.data.data
126
- if (rspData && rspData.length > 0) {
127
- const routesList = rspData[0].routes
128
- if (rsp.data.data) {
129
- const pathList = routesList.map(item => {
130
- if (item.path.indexOf('appSystem') !== -1) {
131
- let appSysMenuList = []
132
- let appSysNameList = []
133
- item.routes.forEach(obj => {
134
- appSysMenuList.push('/' + obj.path)
135
- appSysNameList.push(obj.name)
136
- }) || []
137
- localStorage.setItem('appSysMenuList', JSON.stringify(appSysMenuList))
138
- localStorage.setItem('appSysNameList', JSON.stringify(appSysNameList))
139
- }
140
- return {
141
- ...item,
142
- path: item.path.indexOf('/') === -1 ? '/' + item.path : item.path
143
- }
144
- })
145
- this.sessionMenu = [...pathList]
146
- this.getNewMenuList();
147
- }
148
- }
149
- } else {
150
- // 轻量级
151
- const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
152
- if (menuObj) {
153
- this.sessionMenu = [...menuObj.content]
154
- // 判断是否展示 政务共享平台 菜单(烟台需求)
155
- this.isExist = this.sessionMenu.some(obj => {
156
- if (obj.name === '权限管理' && obj.children.length > 0) {
157
- this.systemPath = obj.children[0].path
158
- }
159
- return obj.path === '/exchange'
160
- })
161
- }
162
- }
163
- },
164
- // 获取系统logo及title
165
- getLogoAndTitle () {
166
- const newMap = this.stash === 'LNRD' ? this.lnrdSysNameMap : this.sysNameMap
167
- let sysInfo = newMap.find(item => item.sysName === this.sysName);
168
- let logoAndTitle = { logoSrc: "", title: "" };
169
- if (sysInfo) {
170
- logoAndTitle.logoSrc = sysInfo.logoSrc;
171
- logoAndTitle.title = sysInfo.title;
172
- }
173
- return logoAndTitle;
174
- },
175
- async getUrl(name) {
176
- let res = null;
177
- let obj = {}
178
- res = await getInfoByName(name)
179
- obj = {
180
- clientId: res.data.data.clientId,
181
- redirectUrl: encodeURIComponent(res.data.data.redirectUris[0]),
182
- }
183
- res = await getUrlByInfo(obj)
184
- return res.data.data
185
- },
186
- // 跳转各个模块
187
- async toModulePage (nameStr) {
188
- // 针对HBJK的标签管理,从菜单权限数据中获取动态路径
189
- if (this.stash === 'HBJK' && nameStr === '标签管理') {
190
- const menuItem = this.sessionMenu.find(item => item.name === '标签管理');
191
- if (menuItem && menuItem.path) {
192
- window.open(menuItem.path, '_blank');
193
- return;
194
- }
195
- }
196
-
197
- let thirdPartyServiceJumpPath = ""; // 第三方服务跳转路径
198
- switch (nameStr) {
199
- case '平台运行总览':
200
- thirdPartyServiceJumpPath = '/dataadmin/#/overview'
201
- return;
202
- case '知识图谱':
203
- thirdPartyServiceJumpPath = await this.getUrl('knowledge')
204
- break;
205
- case '数据可视化':
206
- thirdPartyServiceJumpPath = await this.getUrl('dataview')
207
- break;
208
- case '数据填报':
209
- thirdPartyServiceJumpPath = await this.getUrl('datafill')
210
- break;
211
- case '指标管理':
212
- thirdPartyServiceJumpPath = await this.getUrl('indicator')
213
- break
214
- case '数据标签':
215
- thirdPartyServiceJumpPath = '/datatag/';
216
- break;
217
- case "数据集成":
218
- thirdPartyServiceJumpPath = "/datacollect/";
219
- break;
220
- case "数据治理":
221
- thirdPartyServiceJumpPath = "/datamanage/";
222
- break;
223
- case "元数据管理":
224
- thirdPartyServiceJumpPath = "/metadata/";
225
- break;
226
- case "数据质量":
227
- thirdPartyServiceJumpPath = "/quality/";
228
- break;
229
- case "离线开发":
230
- thirdPartyServiceJumpPath = "/datadev/";
231
- break;
232
- case "实时开发":
233
- thirdPartyServiceJumpPath = "/dataanalytic/";
234
- break;
235
- case "数据服务":
236
- thirdPartyServiceJumpPath = "/dataservice/";
237
- break;
238
- case "数据资产":
239
- thirdPartyServiceJumpPath = "/dataasset/";
240
- break;
241
- case "数据共享":
242
- thirdPartyServiceJumpPath = "/datasharing/";
243
- break;
244
- case "运维中心":
245
- thirdPartyServiceJumpPath = "/operate/";
246
- break;
247
- case "消息中心":
248
- thirdPartyServiceJumpPath = "/alert/";
249
- break;
250
- case "数据安全":
251
- thirdPartyServiceJumpPath = "/datasecurity/";
252
- break;
253
- case "目录管理":
254
- thirdPartyServiceJumpPath = "/admin-ui/catalog";
255
- break;
256
- case "资源管理":
257
- thirdPartyServiceJumpPath = "/admin-ui/resource/tableResource/list";
258
- break;
259
- case "供需对接":
260
- thirdPartyServiceJumpPath = '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
261
- break;
262
- case "数据直达":
263
- thirdPartyServiceJumpPath = '/admin-ui/cascade';
264
- break;
265
- case '综合评价系统':
266
- thirdPartyServiceJumpPath = '/admin-ui/evaluate';
267
- break;
268
- default:
269
- break;
270
- }
271
- if (['公共卫生监测人口库', '电子传染病档案库', '应急资源库', '传染病防控知识库', '主题库'].includes(nameStr)) {
272
- thirdPartyServiceJumpPath = `/data-resource-center/data-source/list?menuName=${nameStr}`
273
- }
274
- if (['平台运行总览', '知识图谱', '数据可视化', '数据填报', '指标管理'].includes(nameStr)) {
275
- window.open(thirdPartyServiceJumpPath, '_blank')
276
- } else {
277
- location.href = thirdPartyServiceJumpPath
278
- }
279
- },
280
- // 跳转首页
281
- toHomePage (index) {
282
- if (index === 0) {
283
- let url = ''
284
- if (["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
285
- url = '/dataadmin/#/index'
286
- } else if (this.stash === "GZW") {
287
- url = '/data-platform/#/index'
288
- } else if (this.stash === "PANWEI") {
289
- url = '/bigdata-portal/#/index'
290
- } else {
291
- url = '/#/index'
292
- }
293
- location.href = url
294
- }
295
- },
296
- getNewMenuList () {
297
- let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : this.stash === 'PANWEI' ? [...this.menuList_PANWEI] : [...this.menuListInit];
298
- if (this.sessionMenu) {
299
- const pathList = [...this.sessionMenu].map(item => item.path)
300
- const nameList = [...this.sessionMenu].map((item) => item.name); // 添加按名称匹配的列表
301
-
302
- // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
303
- for (let index = newMenuList.length - 1; index >= 0; index--) {
304
- const menuItem = newMenuList[index]
305
- for (let index_ch = menuItem.children.length - 1; index_ch >= 0; index_ch--) {
306
- const child = menuItem.children[index_ch]
307
-
308
- // 对于HBJK的标签管理,使用名称匹配而不是path匹配
309
- const hasPermission = (this.stash === 'HBJK' && child.childName === '标签管理')
310
- ? nameList.includes('标签管理')
311
- : pathList.includes(child.path);
312
-
313
- if (!hasPermission) {
314
- newMenuList[index].children.splice(index_ch, 1)
315
- }
316
- }
317
- if (menuItem.children.length === 0 && menuItem.name !== '首页') {
318
- newMenuList.splice(index, 1)
319
- }
320
- }
321
- }
322
- console.log("menuList_HBJK")
323
- if (this.stash === 'HBJK') {
324
- newMenuList = [...newMenuList, ...menuList_HBJK]
325
- console.log("add menuList_HBJK===", newMenuList)
326
- }
327
- this.menuList = [...newMenuList];
328
- console.log("finally menuList===", newMenuList)
329
- },
330
- }
331
- }
332
- </script>
333
- <style scoped>
334
- .iconPad{
335
- width: 15px;
336
- height: 15px;
337
- }
338
- .imgWidth{
339
- width: 20px;
340
- }
341
- </style>
1
+ <template>
2
+ <div :style = "{ background: stash === 'HBJK' ? '#1373FF' : '#fff' }">
3
+ <div class='menuPopupAndTitle' :style="{height: stash === 'LNRD' ? '75px': 'auto'}">
4
+ <div class='menuIcon' :style="{background: stash === 'LNRD' ? '#EA1A1A' : '#4091f7',height: stash === 'LNRD' ? '75px' : '50px', width: stash === 'LNRD' ? '75px' : '60px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
5
+ <img class="menuIcon_img" :src="menuIconSrc" :style="{verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}"/>
6
+ </div>
7
+ <div :class="'menu_title_content'" v-show="showCollapse" @click="toHref()" :style="{lineHeight: stash === 'LNRD' ? '53px' : '49px' }">
8
+ <img v-if="stash !== 'HBJK'" class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" :style="{verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}"/>
9
+ <span class='menu_title' :style="{color: stash === 'LNRD' || stash === 'HBJK'? '#fff' : '#1373FF',verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}">{{getLogoAndTitle().title}}</span>
10
+ </div>
11
+ </div>
12
+ <div class='menu_list_content' :style="{ display: showMenuList ? 'block' : 'none', top: stash === 'LNRD' ? '75px' : '50px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
13
+ <div v-for="(item, index) in menuList" :key="item.path">
14
+ <div :key="item.name" class="cardLine" :style="{height: item.children.length > 3 ? '90px' : ''}">
15
+ <div class='leftMenu'
16
+ :style="{
17
+ height: item.children.length > 3 ? '96px' : '70px',
18
+ lineHeight: item.children.length > 3 ? '45px' : '70px',
19
+ }">
20
+ <img :src="item.url" class="middle imgWidth" />
21
+ <span class="middle textPad" :class="stash === 'LNRD' ? 'LNRD_menu_title' : 'textPad'" @click="toHomePage(index)">{{item.name}}</span>
22
+ </div>
23
+ <div class='rightMenu'
24
+ :style="{
25
+ height: item.children.length > 6 ? '140px' : item.children.length > 3 ? '96px' : '70px',
26
+ lineHeight: item.children.length > 3 ? '45px' : '70px',
27
+ borderBottom: index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
28
+ }">
29
+ <span v-show="index === 0 && isExist">
30
+ <img :src="require('./../../assets/exchange_portal_logo.svg')" class="middle exchangeCss" />
31
+ <span class="middle textPad" @click="toExchangePage()">政务共享交换平台</span>
32
+ </span>
33
+ <span v-for="child in item.children" :key="child.url" class="menu-item-wrapper">
34
+ <span :key="child.childName" class="menu-item-content">
35
+ <img :src="child.url" class="middle iconPad" />
36
+ <span :class="stash === 'LNRD' ? 'LNRD_menu_title childMenu textPad' : 'childMenu textPad middle'" @click="toModulePage(child.childName)">{{child.childName}}</span>
37
+ </span>
38
+ </span>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import { getMenuList as getMenuListInit, menuList_PANWEI, menuIconSrc, sysNameMap, lnrdMenuList, lnrdSysNameMap, menuList_HBJK} from './constant.js'
48
+ import './menu.css'
49
+ import { getMenuList, isLogoutThird, getInfoByName, getUrlByInfo } from './service.js'
50
+ export default {
51
+ name: 'ModuleMenu',
52
+ props: {
53
+ sysName: {
54
+ type: String,
55
+ default: 'admin'
56
+ },
57
+ collapse: {
58
+ type: Boolean,
59
+ default: true,
60
+ },
61
+ stash: {
62
+ type: String,
63
+ default: 'integration'
64
+ }
65
+ },
66
+ watch: {
67
+ collapse: {
68
+ handler: function (newVal, oldVal) {
69
+ console.log('---', newVal, oldVal)
70
+ this.showCollapse = newVal
71
+ },
72
+ deep: true
73
+ }
74
+ },
75
+ data () {
76
+ return {
77
+ showMenuList: false,
78
+ menuIconSrc: menuIconSrc,
79
+ menuList: [],
80
+ sessionMenu: [],
81
+ menuListInit: getMenuListInit(this.stash),
82
+ menuList_PANWEI,
83
+ lnrdMenuList,
84
+ lnrdSysNameMap,
85
+ sysNameMap: sysNameMap,
86
+ showCollapse: true,
87
+ isExist: false,
88
+ systemPath: ''
89
+ }
90
+ },
91
+ created () {
92
+ this.getSessionMenu();
93
+ if (!["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
94
+ this.getNewMenuList();
95
+ }
96
+ },
97
+ methods: {
98
+ // 跳转政务共享交换平台
99
+ toExchangePage() {
100
+ isLogoutThird().then((rsp) => {
101
+ const rspObj = rsp.data
102
+ console.log('isLogoutThird rspObj: ', rspObj);
103
+ if (rspObj && rspObj.data !== '1') {
104
+ location.href = rsp.data;
105
+ }
106
+ });
107
+ },
108
+ toHref () {
109
+ if (this.sysName === 'admin') {
110
+ let url = ''
111
+ if (this.stash === "GZW") {
112
+ url = `/data-platform/#${this.systemPath}`
113
+ } else if (this.stash === 'PANWEI') {
114
+ url = `/bigdata-portal/#${this.systemPath}`
115
+ } else if (!["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
116
+ url = `/#${this.systemPath}`
117
+ }
118
+ location.href = url
119
+ }
120
+ },
121
+ async getSessionMenu () {
122
+ // 一体化
123
+ if (["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
124
+ const rsp = await getMenuList()
125
+ const rspData = rsp.data.data
126
+ if (rspData && rspData.length > 0) {
127
+ const routesList = rspData[0].routes
128
+ if (rsp.data.data) {
129
+ const pathList = routesList.map(item => {
130
+ if (item.path.indexOf('appSystem') !== -1) {
131
+ let appSysMenuList = []
132
+ let appSysNameList = []
133
+ item.routes.forEach(obj => {
134
+ appSysMenuList.push('/' + obj.path)
135
+ appSysNameList.push(obj.name)
136
+ }) || []
137
+ localStorage.setItem('appSysMenuList', JSON.stringify(appSysMenuList))
138
+ localStorage.setItem('appSysNameList', JSON.stringify(appSysNameList))
139
+ }
140
+ return {
141
+ ...item,
142
+ path: item.path.indexOf('/') === -1 ? '/' + item.path : item.path
143
+ }
144
+ })
145
+ this.sessionMenu = [...pathList]
146
+ this.getNewMenuList();
147
+ }
148
+ }
149
+ } else {
150
+ // 轻量级
151
+ const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
152
+ if (menuObj) {
153
+ this.sessionMenu = [...menuObj.content]
154
+ // 判断是否展示 政务共享平台 菜单(烟台需求)
155
+ this.isExist = this.sessionMenu.some(obj => {
156
+ if (obj.name === '权限管理' && obj.children.length > 0) {
157
+ this.systemPath = obj.children[0].path
158
+ }
159
+ return obj.path === '/exchange'
160
+ })
161
+ }
162
+ }
163
+ },
164
+ // 获取系统logo及title
165
+ getLogoAndTitle () {
166
+ const newMap = this.stash === 'LNRD' ? this.lnrdSysNameMap : this.sysNameMap
167
+ let sysInfo = newMap.find(item => item.sysName === this.sysName);
168
+ let logoAndTitle = { logoSrc: "", title: "" };
169
+ if (sysInfo) {
170
+ logoAndTitle.logoSrc = sysInfo.logoSrc;
171
+ logoAndTitle.title = sysInfo.title;
172
+ }
173
+ return logoAndTitle;
174
+ },
175
+ async getUrl(name) {
176
+ let res = null;
177
+ let obj = {}
178
+ res = await getInfoByName(name)
179
+ obj = {
180
+ clientId: res.data.data.clientId,
181
+ redirectUrl: encodeURIComponent(res.data.data.redirectUris[0]),
182
+ }
183
+ res = await getUrlByInfo(obj)
184
+ return res.data.data
185
+ },
186
+ // 跳转各个模块
187
+ async toModulePage (nameStr) {
188
+ // 针对HBJK的标签管理,从菜单权限数据中获取动态路径
189
+ if (this.stash === 'HBJK' && nameStr === '标签管理') {
190
+ const menuItem = this.sessionMenu.find(item => item.name === '标签管理');
191
+ if (menuItem && menuItem.path) {
192
+ window.open(menuItem.path, '_blank');
193
+ return;
194
+ }
195
+ }
196
+
197
+ let thirdPartyServiceJumpPath = ""; // 第三方服务跳转路径
198
+ switch (nameStr) {
199
+ case '平台运行总览':
200
+ thirdPartyServiceJumpPath = '/dataadmin/#/overview'
201
+ return;
202
+ case '知识图谱':
203
+ thirdPartyServiceJumpPath = await this.getUrl('knowledge')
204
+ break;
205
+ case '数据可视化':
206
+ thirdPartyServiceJumpPath = await this.getUrl('dataview')
207
+ break;
208
+ case '数据填报':
209
+ thirdPartyServiceJumpPath = await this.getUrl('datafill')
210
+ break;
211
+ case '指标管理':
212
+ thirdPartyServiceJumpPath = await this.getUrl('indicator')
213
+ break
214
+ case '标签分析':
215
+ thirdPartyServiceJumpPath = await this.getUrl('taganalysis')
216
+ break
217
+ case '数据标签':
218
+ thirdPartyServiceJumpPath = '/datatag/';
219
+ break;
220
+ case "数据集成":
221
+ thirdPartyServiceJumpPath = "/datacollect/";
222
+ break;
223
+ case "数据治理":
224
+ thirdPartyServiceJumpPath = "/datamanage/";
225
+ break;
226
+ case "元数据管理":
227
+ thirdPartyServiceJumpPath = "/metadata/";
228
+ break;
229
+ case "数据质量":
230
+ thirdPartyServiceJumpPath = "/quality/";
231
+ break;
232
+ case "离线开发":
233
+ thirdPartyServiceJumpPath = "/datadev/";
234
+ break;
235
+ case "实时开发":
236
+ thirdPartyServiceJumpPath = "/dataanalytic/";
237
+ break;
238
+ case "数据服务":
239
+ thirdPartyServiceJumpPath = "/dataservice/";
240
+ break;
241
+ case "数据资产":
242
+ thirdPartyServiceJumpPath = "/dataasset/";
243
+ break;
244
+ case "数据共享":
245
+ thirdPartyServiceJumpPath = "/datasharing/";
246
+ break;
247
+ case "运维中心":
248
+ thirdPartyServiceJumpPath = "/operate/";
249
+ break;
250
+ case "消息中心":
251
+ thirdPartyServiceJumpPath = "/alert/";
252
+ break;
253
+ case "数据安全":
254
+ thirdPartyServiceJumpPath = "/datasecurity/";
255
+ break;
256
+ case "目录管理":
257
+ thirdPartyServiceJumpPath = "/admin-ui/catalog";
258
+ break;
259
+ case "资源管理":
260
+ thirdPartyServiceJumpPath = "/admin-ui/resource/tableResource/list";
261
+ break;
262
+ case "供需对接":
263
+ thirdPartyServiceJumpPath = '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
264
+ break;
265
+ case "数据直达":
266
+ thirdPartyServiceJumpPath = '/admin-ui/cascade';
267
+ break;
268
+ case '综合评价系统':
269
+ thirdPartyServiceJumpPath = '/admin-ui/evaluate';
270
+ break;
271
+ default:
272
+ break;
273
+ }
274
+ if (['公共卫生监测人口库', '电子传染病档案库', '应急资源库', '传染病防控知识库', '主题库'].includes(nameStr)) {
275
+ thirdPartyServiceJumpPath = `/data-resource-center/data-source/list?menuName=${nameStr}`
276
+ }
277
+ if (['平台运行总览', '知识图谱', '数据可视化', '数据填报', '指标管理', '标签分析'].includes(nameStr)) {
278
+ window.open(thirdPartyServiceJumpPath, '_blank')
279
+ } else {
280
+ location.href = thirdPartyServiceJumpPath
281
+ }
282
+ },
283
+ // 跳转首页
284
+ toHomePage (index) {
285
+ if (index === 0) {
286
+ let url = ''
287
+ if (["integration", 'LNRD', 'HBJK'].includes(this.stash)) {
288
+ url = '/dataadmin/#/index'
289
+ } else if (this.stash === "GZW") {
290
+ url = '/data-platform/#/index'
291
+ } else if (this.stash === "PANWEI") {
292
+ url = '/bigdata-portal/#/index'
293
+ } else {
294
+ url = '/#/index'
295
+ }
296
+ location.href = url
297
+ }
298
+ },
299
+ getNewMenuList () {
300
+ let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : this.stash === 'PANWEI' ? [...this.menuList_PANWEI] : [...this.menuListInit];
301
+ if (this.sessionMenu) {
302
+ const pathList = [...this.sessionMenu].map(item => item.path)
303
+ const nameList = [...this.sessionMenu].map((item) => item.name); // 添加按名称匹配的列表
304
+
305
+ // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
306
+ for (let index = newMenuList.length - 1; index >= 0; index--) {
307
+ const menuItem = newMenuList[index]
308
+ for (let index_ch = menuItem.children.length - 1; index_ch >= 0; index_ch--) {
309
+ const child = menuItem.children[index_ch]
310
+
311
+ // 对于HBJK的标签管理,使用名称匹配而不是path匹配
312
+ const hasPermission = (this.stash === 'HBJK' && child.childName === '标签管理')
313
+ ? nameList.includes('标签管理')
314
+ : pathList.includes(child.path);
315
+
316
+ if (!hasPermission) {
317
+ newMenuList[index].children.splice(index_ch, 1)
318
+ }
319
+ }
320
+ if (menuItem.children.length === 0 && menuItem.name !== '首页') {
321
+ newMenuList.splice(index, 1)
322
+ }
323
+ }
324
+ }
325
+ console.log("menuList_HBJK")
326
+ if (this.stash === 'HBJK') {
327
+ newMenuList = [...newMenuList, ...menuList_HBJK]
328
+ console.log("add menuList_HBJK===", newMenuList)
329
+ }
330
+ this.menuList = [...newMenuList];
331
+ console.log("finally menuList===", newMenuList)
332
+ },
333
+ }
334
+ }
335
+ </script>
336
+ <style scoped>
337
+ .iconPad{
338
+ width: 15px;
339
+ height: 15px;
340
+ }
341
+ .imgWidth{
342
+ width: 20px;
343
+ }
344
+ </style>