n20-common-lib 2.18.12 → 2.18.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.
- package/package.json +1 -1
- package/src/components/Layout/indexN.vue +32 -57
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="layout-wrap">
|
|
3
3
|
<headerWrap
|
|
4
|
+
v-if="!isMobile"
|
|
4
5
|
class="header-wrap"
|
|
5
6
|
:ectad="ectad"
|
|
6
7
|
:system-change="systemChange"
|
|
7
8
|
:operation-status="operationStatus"
|
|
8
9
|
:before-logout="beforeLogout"
|
|
9
10
|
:after-logout="afterLogout"
|
|
10
|
-
:
|
|
11
|
+
:drawer-visible.sync="showDrawerBox"
|
|
11
12
|
@clickSystem="clickSystem"
|
|
12
13
|
@custom-event="(par) => $emit('custom-event', par)"
|
|
13
14
|
>
|
|
14
15
|
<slot slot="header-ectad" name="header-ectad"></slot>
|
|
15
16
|
<slot slot="header-dropdown" name="header-dropdown"></slot>
|
|
16
17
|
</headerWrap>
|
|
17
|
-
<div
|
|
18
|
-
v-if="showDrawerBox"
|
|
19
|
-
class="wrapper-mask"
|
|
20
|
-
@click="showDrawerBox = false"
|
|
21
|
-
></div>
|
|
18
|
+
<div v-if="showDrawerBox && !isMobile" class="wrapper-mask" @click="showDrawerBox = false"></div>
|
|
22
19
|
<menuDrawer
|
|
20
|
+
v-if="!isMobile"
|
|
23
21
|
:class="showDrawerBox ? 'show_drawer' : ''"
|
|
24
22
|
:menus="systemMenu"
|
|
25
23
|
@clickMenu="(row) => (this.showDrawerBox = row)"
|
|
26
|
-
|
|
24
|
+
/>
|
|
27
25
|
<asideNav
|
|
26
|
+
v-if="!isMobile"
|
|
28
27
|
:menus="menusC"
|
|
29
28
|
:active-nav="activeNavC"
|
|
30
29
|
:collapse.sync="collapse"
|
|
31
30
|
@menu-click="menuClick"
|
|
32
31
|
/>
|
|
33
32
|
<tabsNav
|
|
33
|
+
v-if="!isMobile"
|
|
34
34
|
class="tabs-nav-wrap"
|
|
35
35
|
:tab-list="tabList"
|
|
36
36
|
:active-nav="activeNav"
|
|
@@ -40,20 +40,11 @@
|
|
|
40
40
|
@tab-close-others="tabCloseOthers"
|
|
41
41
|
@tab-refresh="tabRefresh"
|
|
42
42
|
/>
|
|
43
|
-
<div ref="content-wrap" class="content-wrap">
|
|
43
|
+
<div ref="content-wrap" class="content-wrap" :class="{ isMobile: isMobile }">
|
|
44
44
|
<keep-alive v-if="dnsKey" :max="32">
|
|
45
|
-
<router-view
|
|
46
|
-
v-if="!$route.meta.noCache"
|
|
47
|
-
ref="content-cache"
|
|
48
|
-
:key="$route | keyF"
|
|
49
|
-
class="content-box"
|
|
50
|
-
/>
|
|
45
|
+
<router-view v-if="!$route.meta.noCache" ref="content-cache" :key="$route | keyF" class="content-box" />
|
|
51
46
|
</keep-alive>
|
|
52
|
-
<router-view
|
|
53
|
-
v-if="!dnsKey || $route.meta.noCache"
|
|
54
|
-
:key="$route | keyF"
|
|
55
|
-
class="content-box"
|
|
56
|
-
/>
|
|
47
|
+
<router-view v-if="!dnsKey || $route.meta.noCache" :key="$route | keyF" class="content-box" />
|
|
57
48
|
</div>
|
|
58
49
|
</div>
|
|
59
50
|
</template>
|
|
@@ -84,13 +75,7 @@ export default {
|
|
|
84
75
|
},
|
|
85
76
|
filters: {
|
|
86
77
|
keyF({ path, query = {} }) {
|
|
87
|
-
return (
|
|
88
|
-
path +
|
|
89
|
-
'^' +
|
|
90
|
-
JSON.stringify({ ...query, _fromNo: undefined }) +
|
|
91
|
-
'^' +
|
|
92
|
-
window._tab_route_key[path]
|
|
93
|
-
)
|
|
78
|
+
return path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
|
|
94
79
|
}
|
|
95
80
|
},
|
|
96
81
|
props: {
|
|
@@ -140,13 +125,11 @@ export default {
|
|
|
140
125
|
dnsKey:
|
|
141
126
|
this.isCache ||
|
|
142
127
|
this.isTest ||
|
|
143
|
-
(process.env.NODE_ENV === 'production' &&
|
|
144
|
-
process.env.VUE_APP_KEEP_ALIVE === 'true'),
|
|
128
|
+
(process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true'),
|
|
145
129
|
headerH,
|
|
146
130
|
tabsH,
|
|
147
131
|
clientM,
|
|
148
|
-
clientHeight:
|
|
149
|
-
document.documentElement.offsetHeight - headerH - tabsH - 1 * clientM,
|
|
132
|
+
clientHeight: document.documentElement.offsetHeight - headerH - tabsH - 1 * clientM,
|
|
150
133
|
collapse: window.localStorage.getItem('aside-nav-collapse') === 'true',
|
|
151
134
|
showDrawerBox: false,
|
|
152
135
|
systemMenu: [],
|
|
@@ -157,6 +140,9 @@ export default {
|
|
|
157
140
|
}
|
|
158
141
|
},
|
|
159
142
|
computed: {
|
|
143
|
+
isMobile() {
|
|
144
|
+
return window.innerWidth <= 768
|
|
145
|
+
},
|
|
160
146
|
activeNavC() {
|
|
161
147
|
let acTab = this.tabList.find((t) => t.uuid === this.activeNav)
|
|
162
148
|
let acNav = acTab?.query?.startPath || this.activeNav
|
|
@@ -182,9 +168,7 @@ export default {
|
|
|
182
168
|
},
|
|
183
169
|
clientHeight: {
|
|
184
170
|
handler(val) {
|
|
185
|
-
document
|
|
186
|
-
.querySelector('body')
|
|
187
|
-
.style.setProperty('--client-height', val + 'px')
|
|
171
|
+
document.querySelector('body').style.setProperty('--client-height', val + 'px')
|
|
188
172
|
},
|
|
189
173
|
immediate: true
|
|
190
174
|
}
|
|
@@ -238,15 +222,7 @@ export default {
|
|
|
238
222
|
}
|
|
239
223
|
},
|
|
240
224
|
setMainTab(ev) {
|
|
241
|
-
const {
|
|
242
|
-
targetName,
|
|
243
|
-
replaceTab,
|
|
244
|
-
addTab,
|
|
245
|
-
closeTab,
|
|
246
|
-
setTabName,
|
|
247
|
-
addTabO,
|
|
248
|
-
refreshTab
|
|
249
|
-
} = ev.data
|
|
225
|
+
const { targetName, replaceTab, addTab, closeTab, setTabName, addTabO, refreshTab } = ev.data
|
|
250
226
|
|
|
251
227
|
if (targetName === 'main') {
|
|
252
228
|
replaceTab && this.tabReplace(replaceTab)
|
|
@@ -261,8 +237,7 @@ export default {
|
|
|
261
237
|
this.systemMenu = menu
|
|
262
238
|
},
|
|
263
239
|
getCollapse() {
|
|
264
|
-
this.collapse =
|
|
265
|
-
window.localStorage.getItem('aside-nav-collapse') === 'true'
|
|
240
|
+
this.collapse = window.localStorage.getItem('aside-nav-collapse') === 'true'
|
|
266
241
|
},
|
|
267
242
|
contentChange(dom) {
|
|
268
243
|
this.clientHeight = dom.clientHeight - 2 * this.clientM
|
|
@@ -316,9 +291,7 @@ export default {
|
|
|
316
291
|
}
|
|
317
292
|
},
|
|
318
293
|
getActiveNav() {
|
|
319
|
-
let tab = this.tabList.find(
|
|
320
|
-
(t) => this.$route.path === t.uuid || this.$route.path === t.route
|
|
321
|
-
)
|
|
294
|
+
let tab = this.tabList.find((t) => this.$route.path === t.uuid || this.$route.path === t.route)
|
|
322
295
|
if (tab) {
|
|
323
296
|
this.activeNav = tab.uuid
|
|
324
297
|
} else if (this.keepTab) {
|
|
@@ -492,10 +465,7 @@ export default {
|
|
|
492
465
|
if (tab) {
|
|
493
466
|
this.addRouterKey(tab.route, tab.query)
|
|
494
467
|
if (this.activeNav === tab.uuid) {
|
|
495
|
-
if (
|
|
496
|
-
this.$route.matched.length &&
|
|
497
|
-
this.$route.matched[0]['path'] !== '*'
|
|
498
|
-
) {
|
|
468
|
+
if (this.$route.matched.length && this.$route.matched[0]['path'] !== '*') {
|
|
499
469
|
this.$forceUpdate()
|
|
500
470
|
} else {
|
|
501
471
|
window.postMessage({
|
|
@@ -523,17 +493,13 @@ export default {
|
|
|
523
493
|
removeCacheTimerFn() {
|
|
524
494
|
this.removeCacheTimer = setInterval(() => {
|
|
525
495
|
if (this.$refs['content-cache']) {
|
|
526
|
-
let cache =
|
|
527
|
-
this.$refs['content-cache'].$vnode.parent.componentInstance.cache
|
|
496
|
+
let cache = this.$refs['content-cache'].$vnode.parent.componentInstance.cache
|
|
528
497
|
for (let k in cache) {
|
|
529
498
|
if (cache[k]) {
|
|
530
499
|
let kM = k.split('^')
|
|
531
500
|
let _K = kM[0]
|
|
532
501
|
let _V = kM[2]
|
|
533
|
-
if (
|
|
534
|
-
window._tab_route_key[_K] &&
|
|
535
|
-
window._tab_route_key[_K] !== Number(_V)
|
|
536
|
-
) {
|
|
502
|
+
if (window._tab_route_key[_K] && window._tab_route_key[_K] !== Number(_V)) {
|
|
537
503
|
cache[k].componentInstance.destroy?.()
|
|
538
504
|
cache[k] = null
|
|
539
505
|
}
|
|
@@ -578,3 +544,12 @@ function getShowUuid(uuid, list) {
|
|
|
578
544
|
return '/'
|
|
579
545
|
}
|
|
580
546
|
</script>
|
|
547
|
+
<style>
|
|
548
|
+
.isMobile {
|
|
549
|
+
left: 0 !important;
|
|
550
|
+
top: 8px !important;
|
|
551
|
+
}
|
|
552
|
+
.isMobile .content-box {
|
|
553
|
+
height: calc(100vh - 16px) !important;
|
|
554
|
+
}
|
|
555
|
+
</style>
|