n20-common-lib 2.6.53 → 2.6.54
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
CHANGED
|
@@ -169,6 +169,7 @@ export default {
|
|
|
169
169
|
},
|
|
170
170
|
beforeDestroy() {
|
|
171
171
|
removeListener(this.$refs['content-wrap'], this.contentChange)
|
|
172
|
+
|
|
172
173
|
this.setTabList()
|
|
173
174
|
|
|
174
175
|
window.removeEventListener('message', this.setMainTab)
|
|
@@ -207,7 +208,8 @@ export default {
|
|
|
207
208
|
m.route = base + m.route.replace(/\/$/, '')
|
|
208
209
|
m.route || (m.route = '/')
|
|
209
210
|
m.uuid = m.route
|
|
210
|
-
|
|
211
|
+
// 新增一个字段用于接收初始化的url携带参数的处理之后的url
|
|
212
|
+
m.originPath = getBeforeQuestionMark(m.route)
|
|
211
213
|
menuList.push(m)
|
|
212
214
|
}
|
|
213
215
|
})
|
|
@@ -226,6 +228,7 @@ export default {
|
|
|
226
228
|
this.menusC = menus
|
|
227
229
|
this.menuList = menuList
|
|
228
230
|
},
|
|
231
|
+
|
|
229
232
|
getTabList() {
|
|
230
233
|
let tabList = JSON.parse(window.sessionStorage.getItem('tab-list')) || []
|
|
231
234
|
this.tabList = tabList
|
|
@@ -274,7 +277,6 @@ export default {
|
|
|
274
277
|
},
|
|
275
278
|
tabClick(tab) {
|
|
276
279
|
this.activeNav = tab.uuid
|
|
277
|
-
|
|
278
280
|
this.routerPush({
|
|
279
281
|
path: tab.route,
|
|
280
282
|
query: tab.query
|
|
@@ -473,8 +475,18 @@ export default {
|
|
|
473
475
|
}
|
|
474
476
|
}
|
|
475
477
|
|
|
478
|
+
// 处理携带参数的url,只取参数之前的路径
|
|
479
|
+
function getBeforeQuestionMark(url) {
|
|
480
|
+
const questionMarkIndex = url.indexOf('?')
|
|
481
|
+
if (questionMarkIndex !== -1) {
|
|
482
|
+
return url.slice(0, questionMarkIndex)
|
|
483
|
+
}
|
|
484
|
+
return url
|
|
485
|
+
}
|
|
486
|
+
|
|
476
487
|
function getShowUuid(uuid, list) {
|
|
477
|
-
|
|
488
|
+
// 拿uuid去菜单中找对应的uuid或者originPath,originPath主要用与匹配初始化的菜单上携带参数的问题
|
|
489
|
+
let menu = list.find((m) => m.uuid === uuid || m.originPath === uuid)
|
|
478
490
|
if (menu) {
|
|
479
491
|
return menu.hide ? menu.pid : menu.uuid
|
|
480
492
|
}
|