n20-common-lib 2.7.0-beta.5 → 2.7.0-beta.7
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.
- package/package.json +1 -1
- package/src/assets/css/cl-layout-header.scss +23 -1
- package/src/components/Layout/HeaderWrap/indexN.vue +67 -88
- package/src/components/Layout/HeaderWrap/menuDrawer.vue +41 -10
- package/src/components/LoginTemporary/indexN.vue +2 -0
- package/style/index.css +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
package/package.json
CHANGED
|
@@ -290,16 +290,38 @@ $--header-color: #3d4a57;
|
|
|
290
290
|
&-system-item {
|
|
291
291
|
flex: 0 0 33.33%;
|
|
292
292
|
padding-top: 32px;
|
|
293
|
+
|
|
294
|
+
&_title {
|
|
295
|
+
|
|
296
|
+
display: inline-block;
|
|
297
|
+
padding: 4px;
|
|
298
|
+
|
|
299
|
+
&:hover {
|
|
300
|
+
background-color: #f5f5f5;
|
|
301
|
+
border-radius: $--border-radius-base;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
293
304
|
}
|
|
294
305
|
|
|
295
306
|
&-system-child {
|
|
296
307
|
padding-top: 16px;
|
|
297
|
-
padding-left:
|
|
308
|
+
padding-left: 36px;
|
|
298
309
|
}
|
|
299
310
|
|
|
300
311
|
&-first-item {
|
|
301
312
|
flex: 0 0 33.33%;
|
|
302
313
|
margin-bottom: 16px;
|
|
314
|
+
|
|
315
|
+
&_title {
|
|
316
|
+
|
|
317
|
+
display: inline-block;
|
|
318
|
+
padding: 4px;
|
|
319
|
+
|
|
320
|
+
&:hover {
|
|
321
|
+
background-color: #f5f5f5;
|
|
322
|
+
border-radius: $--border-radius-base;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
303
325
|
}
|
|
304
326
|
}
|
|
305
327
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<use xlink:href="#n20-icon-lujing"></use>
|
|
30
30
|
</svg>
|
|
31
31
|
</div>
|
|
32
|
-
<menuDrawer :visible.sync="menuDrawer" :menus="headerSystem"
|
|
32
|
+
<menuDrawer :visible.sync="menuDrawer" :menus="headerSystem"></menuDrawer>
|
|
33
33
|
|
|
34
34
|
<span v-if="byLabel && !inBack" class="header-uif-by">{{ byLabel }}</span>
|
|
35
35
|
<!-- YSCW -->
|
|
@@ -78,20 +78,12 @@
|
|
|
78
78
|
</el-dropdown-menu>
|
|
79
79
|
</el-dropdown>
|
|
80
80
|
|
|
81
|
-
<el-tooltip v-if="!hideHelpDoc" :content="'帮助文档' | $lc">
|
|
82
|
-
<span class="set-user-btn iconfont icon-bangzhuwendang header-color m-l-lg" @click="openHelp"></span>
|
|
83
|
-
</el-tooltip>
|
|
84
|
-
|
|
85
|
-
<el-tooltip v-if="!hideDowApp" :content="'客户端下载' | $lc">
|
|
86
|
-
<span class="set-user-btn iconfont icon-kehuduanxiazai header-color m-l-lg" @click="dowApp"></span>
|
|
87
|
-
</el-tooltip>
|
|
88
|
-
|
|
89
81
|
<el-badge :hidden="noticeNum + afficheNum === 0" :value="noticeNum + afficheNum">
|
|
90
82
|
<span v-if="!noticeDrw" v-popover:noticePop class="news-btn iconfont icon-xiaoxi header-color"></span>
|
|
91
83
|
<span v-else class="news-btn iconfont icon-xiaoxi header-color" @click="customOpt.noticeDrawer"></span>
|
|
92
84
|
</el-badge>
|
|
93
85
|
|
|
94
|
-
<el-popover ref="by_popover" v-model="byV" placement="bottom-start" trigger="manual" popper-class="uby-w">
|
|
86
|
+
<!-- <el-popover ref="by_popover" v-model="byV" placement="bottom-start" trigger="manual" popper-class="uby-w">
|
|
95
87
|
<div class="uby-h flex-box flex-v">
|
|
96
88
|
<i class="uby-h-icon iconfont icon-icon_huanyingmoshi"></i>
|
|
97
89
|
<span
|
|
@@ -103,7 +95,7 @@
|
|
|
103
95
|
<div class="text-r">
|
|
104
96
|
<el-button type="primary" @click="byV = false">{{ '知道了' | $lc }}</el-button>
|
|
105
97
|
</div>
|
|
106
|
-
</el-popover>
|
|
98
|
+
</el-popover> -->
|
|
107
99
|
|
|
108
100
|
<el-dropdown
|
|
109
101
|
ref="userDrop"
|
|
@@ -215,26 +207,24 @@
|
|
|
215
207
|
</el-dropdown-menu>
|
|
216
208
|
</el-dropdown>
|
|
217
209
|
</el-dropdown-item>
|
|
218
|
-
<!-- 系统切换 -->
|
|
219
|
-
<el-dropdown-item v-if="systemChange && systemList && systemList.length">
|
|
220
|
-
<el-dropdown trigger="hover" size="medium" placement="left-start" style="width: 100%">
|
|
221
|
-
<div class="flex-box flex-v">
|
|
222
|
-
<span>{{ '系统切换' | $lc }}</span>
|
|
223
|
-
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
224
|
-
</div>
|
|
225
|
-
<el-dropdown-menu slot="dropdown">
|
|
226
|
-
<el-dropdown-item v-for="(item, i) in systemList" :key="i" @click.native="clickSystem(item)">
|
|
227
|
-
<span>{{ item.NAME }}</span>
|
|
228
|
-
</el-dropdown-item>
|
|
229
|
-
</el-dropdown-menu>
|
|
230
|
-
</el-dropdown>
|
|
231
|
-
</el-dropdown-item>
|
|
232
210
|
<el-dropdown-item v-if="!inBack" command="toBack">
|
|
233
211
|
<div class="flex-box flex-v">
|
|
234
212
|
<span>{{ '后台管理' | $lc }}</span>
|
|
235
213
|
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
236
214
|
</div>
|
|
237
215
|
</el-dropdown-item>
|
|
216
|
+
<el-dropdown-item v-if="!hideHelpDoc" command="openHelp">
|
|
217
|
+
<div class="flex-box flex-v">
|
|
218
|
+
<span>{{ '帮助文档' | $lc }}</span>
|
|
219
|
+
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
220
|
+
</div>
|
|
221
|
+
</el-dropdown-item>
|
|
222
|
+
<el-dropdown-item v-if="!hideDowApp" command="dowApp">
|
|
223
|
+
<div class="flex-box flex-v">
|
|
224
|
+
<span>{{ '客户端下载' | $lc }}</span>
|
|
225
|
+
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
226
|
+
</div>
|
|
227
|
+
</el-dropdown-item>
|
|
238
228
|
<slot name="header-dropdown"></slot>
|
|
239
229
|
<el-dropdown-item command="logOut">
|
|
240
230
|
<div class="flex-box flex-v">
|
|
@@ -420,7 +410,6 @@ export default {
|
|
|
420
410
|
}
|
|
421
411
|
})
|
|
422
412
|
})
|
|
423
|
-
this.systemChange && this.getSystemList()
|
|
424
413
|
this.getNNum()
|
|
425
414
|
document.addEventListener('visibilitychange', this.getNNum)
|
|
426
415
|
window.addEventListener('message', this.updateNotice)
|
|
@@ -440,75 +429,59 @@ export default {
|
|
|
440
429
|
window.removeEventListener('message', this.updateNotice)
|
|
441
430
|
},
|
|
442
431
|
methods: {
|
|
443
|
-
handleChangeSystem() {
|
|
444
|
-
|
|
432
|
+
async handleChangeSystem() {
|
|
433
|
+
let menuTree = JSON.parse(sessionStorage.getItem('allMenuTree'))
|
|
434
|
+
if (!menuTree) {
|
|
435
|
+
this.getTreeList().finally(() => {
|
|
436
|
+
let tree = JSON.parse(sessionStorage.getItem('allMenuTree'))
|
|
437
|
+
this.setMenuData(tree)
|
|
438
|
+
})
|
|
439
|
+
} else {
|
|
440
|
+
this.setMenuData(menuTree)
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
setMenuData(menuTree) {
|
|
445
444
|
let system_list = JSON.parse(localStorage.getItem('SYSTEM_LIST'))
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
this.headerSystem = system_list.map((system) => {
|
|
446
|
+
const icon =
|
|
447
|
+
{
|
|
448
|
+
CSZHYW: '#n20-icon-zhcsyw',
|
|
449
|
+
CSYWGL: '#n20-icon-bianzu',
|
|
450
|
+
CSFZJC: '#n20-icon-a-bianzu70',
|
|
451
|
+
CSWY: '#n20-icon-a-bianzu69',
|
|
452
|
+
JTZL: '#n20-icon-a-bianzu3',
|
|
453
|
+
JRWG: '#n20-icon-a-bianzu1',
|
|
454
|
+
JTSKYWGK: '#n20-icon-a-bianzu701',
|
|
455
|
+
JTSKSJFX: '#n20-icon-a-bianzu2'
|
|
456
|
+
}[system.NO] || ''
|
|
448
457
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
case 'JRWG':
|
|
467
|
-
system_list[i].icon = '#n20-icon-a-bianzu1'
|
|
468
|
-
break
|
|
469
|
-
case 'JTSKYWGK':
|
|
470
|
-
system_list[i].icon = '#n20-icon-a-bianzu701'
|
|
471
|
-
break
|
|
472
|
-
case 'JTSKSJFX':
|
|
473
|
-
system_list[i].icon = '#n20-icon-a-bianzu2'
|
|
474
|
-
break
|
|
475
|
-
}
|
|
476
|
-
system_list[i].menuTree = []
|
|
477
|
-
for (let j = 0; j < menuTree.length; j++) {
|
|
478
|
-
if (system_list[i].NO === menuTree[j].systemNo&& menuTree[j].isBackmenu === '0') {
|
|
479
|
-
|
|
480
|
-
system_list[i].menuTree.push(menuTree[j])
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
458
|
+
system.icon = icon
|
|
459
|
+
system.menuTree = menuTree
|
|
460
|
+
?.filter((menu) => menu.systemNo === system.NO && menu.isBackmenu === '0')
|
|
461
|
+
.map((menu) => ({
|
|
462
|
+
...menu,
|
|
463
|
+
icon:
|
|
464
|
+
{
|
|
465
|
+
CSZHYW: '#n20-icon-zhcsyw',
|
|
466
|
+
CSYWGL: '#n20-icon-bianzu',
|
|
467
|
+
CSFZJC: '#n20-icon-a-bianzu70',
|
|
468
|
+
CSWY: '#n20-icon-a-bianzu69',
|
|
469
|
+
JTZL: '#n20-icon-a-bianzu3',
|
|
470
|
+
JRWG: '#n20-icon-a-bianzu1',
|
|
471
|
+
JTSKYWGK: '#n20-icon-a-bianzu701',
|
|
472
|
+
JTSKSJFX: '#n20-icon-a-bianzu2'
|
|
473
|
+
}[menu.NO] || ''
|
|
474
|
+
}))
|
|
485
475
|
|
|
486
|
-
|
|
476
|
+
return system
|
|
477
|
+
})
|
|
487
478
|
this.menuDrawer = true
|
|
488
|
-
console.log(this.headerSystem)
|
|
489
|
-
},
|
|
490
|
-
clickMenu(row) {
|
|
491
|
-
this.$router.push(row.route)
|
|
492
479
|
},
|
|
493
480
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
*/
|
|
497
|
-
getSystemList() {
|
|
498
|
-
this.systemList = JSON.parse(localStorage.getItem('SYSTEM_LIST'))
|
|
499
|
-
},
|
|
500
|
-
async getTreeList(item = {}, resType = 1) {
|
|
501
|
-
const systemNo = item?.NO
|
|
502
|
-
let { data } = await axios.get(
|
|
503
|
-
`/bems/1.0/menuTree/tree?t=${Date.now()}`,
|
|
504
|
-
{
|
|
505
|
-
resType,
|
|
506
|
-
systemNo
|
|
507
|
-
},
|
|
508
|
-
{ loading: false }
|
|
509
|
-
)
|
|
481
|
+
async getTreeList(item = {}) {
|
|
482
|
+
let { data } = await axios.get(`/bems/1.0/menuTree/tree?t=${Date.now()}`, item, { loading: false })
|
|
510
483
|
let layoutMenus = siteTree2menus(data || [])
|
|
511
|
-
sessionStorage.setItem('
|
|
484
|
+
sessionStorage.setItem('allMenuTree', JSON.stringify(layoutMenus))
|
|
512
485
|
},
|
|
513
486
|
|
|
514
487
|
handleUser() {
|
|
@@ -605,6 +578,12 @@ export default {
|
|
|
605
578
|
case 'toBack':
|
|
606
579
|
this.toBack()
|
|
607
580
|
break
|
|
581
|
+
case 'dowApp':
|
|
582
|
+
this.dowApp()
|
|
583
|
+
break
|
|
584
|
+
case 'openHelp':
|
|
585
|
+
this.openHelp()
|
|
586
|
+
break
|
|
608
587
|
default:
|
|
609
588
|
this.$emit('custom-event', { type: c })
|
|
610
589
|
break
|
|
@@ -16,11 +16,16 @@
|
|
|
16
16
|
>
|
|
17
17
|
<use :xlink:href="item.icon"></use>
|
|
18
18
|
</svg>
|
|
19
|
-
<span class="m-l-s">{{ item.NAME }}</span>
|
|
19
|
+
<span class="m-l-s menu-system-item_title">{{ item.NAME }}</span>
|
|
20
20
|
</div>
|
|
21
21
|
<div v-if="item.menuTree.length" class="flex-box flex-wrap menu-system-child">
|
|
22
|
-
<div
|
|
23
|
-
|
|
22
|
+
<div
|
|
23
|
+
v-for="(row, i) in item.menuTree"
|
|
24
|
+
:key="i"
|
|
25
|
+
class="menu-first-item"
|
|
26
|
+
@click="clickMenu(row, item.menuTree)"
|
|
27
|
+
>
|
|
28
|
+
<span class="menu-first-item_title">{{ row.title }}</span>
|
|
24
29
|
</div>
|
|
25
30
|
</div>
|
|
26
31
|
</div>
|
|
@@ -29,6 +34,7 @@
|
|
|
29
34
|
</template>
|
|
30
35
|
|
|
31
36
|
<script>
|
|
37
|
+
import { siteTree2menus } from '../../LoginTemporary/utils'
|
|
32
38
|
export default {
|
|
33
39
|
name: 'MenuDrawer',
|
|
34
40
|
props: {
|
|
@@ -56,22 +62,47 @@ export default {
|
|
|
56
62
|
}
|
|
57
63
|
},
|
|
58
64
|
methods: {
|
|
65
|
+
async getTreeList(item) {
|
|
66
|
+
let { data } = await axios.get(
|
|
67
|
+
`/bems/1.0/menuTree/tree?t=${Date.now()}`,
|
|
68
|
+
{
|
|
69
|
+
resType: 1,
|
|
70
|
+
systemNo: item.NO
|
|
71
|
+
},
|
|
72
|
+
{ loading: false }
|
|
73
|
+
)
|
|
74
|
+
let layoutMenus = siteTree2menus(data || [])
|
|
75
|
+
sessionStorage.setItem('menuTree', JSON.stringify(layoutMenus))
|
|
76
|
+
},
|
|
59
77
|
async clickSystem(item) {
|
|
60
|
-
await this.
|
|
61
|
-
// localStorage.setItem('pageInType', 'toFront')
|
|
78
|
+
await this.getTreeList(item)
|
|
62
79
|
window.localStorage.setItem('pageInSystemNo', item.NO)
|
|
63
80
|
// 切换系统的时候清除缓存的页签
|
|
64
81
|
window.sessionStorage.removeItem('tab-list')
|
|
65
82
|
let { base = '/' } = this.$router.options
|
|
66
83
|
if (!/\/$/.test(base)) base += '/'
|
|
67
|
-
|
|
68
84
|
window.location.href = window.location.origin + base + 'dashboard/workplace'
|
|
69
85
|
},
|
|
70
|
-
clickMenu(row) {
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
async clickMenu(row, MenuTre) {
|
|
87
|
+
let pageInSystemNo = window.localStorage.getItem('pageInSystemNo')
|
|
88
|
+
window.localStorage.setItem('pageInType', 'toFront')
|
|
89
|
+
if (pageInSystemNo === row.systemNo) {
|
|
90
|
+
if (row?.children?.length) {
|
|
91
|
+
this.$router.push(row.children[0].route)
|
|
92
|
+
} else {
|
|
93
|
+
this.$router.push(row.route)
|
|
94
|
+
}
|
|
73
95
|
} else {
|
|
74
|
-
|
|
96
|
+
window.localStorage.setItem('pageInSystemNo', row.systemNo)
|
|
97
|
+
window.sessionStorage.setItem('menuTree', JSON.stringify(MenuTre))
|
|
98
|
+
// 切换系统的时候清除缓存的页签
|
|
99
|
+
window.sessionStorage.removeItem('tab-list')
|
|
100
|
+
if (row?.children?.length) {
|
|
101
|
+
window.location.href =
|
|
102
|
+
window.location.origin + row.children[0].route + `?token=${window.sessionStorage.getItem('token')}`
|
|
103
|
+
} else {
|
|
104
|
+
window.location.href = window.location.origin + row.route + `?token=${window.sessionStorage.getItem('token')}`
|
|
105
|
+
}
|
|
75
106
|
}
|
|
76
107
|
this.$emit('update:visible', false)
|
|
77
108
|
}
|