gw-gis-standard-global-vue3 1.1.84 → 1.1.85
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/gw-gis-standard-global.js +44 -32
- package/package.json +1 -1
|
@@ -1626,7 +1626,13 @@ var constType = {
|
|
|
1626
1626
|
// 横排菜单
|
|
1627
1627
|
HORIZONTAL: 1,
|
|
1628
1628
|
// 竖排菜单
|
|
1629
|
-
VERTICAL: 2
|
|
1629
|
+
VERTICAL: 2,
|
|
1630
|
+
// 横排
|
|
1631
|
+
NAVBAR: 'navbar',
|
|
1632
|
+
// 二级导航栏
|
|
1633
|
+
SUB_NAVBAR: 'subNavbar',
|
|
1634
|
+
// 侧边栏
|
|
1635
|
+
SIDEBAR: 'sidebar'
|
|
1630
1636
|
},
|
|
1631
1637
|
// 非layout路由名称
|
|
1632
1638
|
NO_IN_LAYOUT_MSG: {
|
|
@@ -2897,34 +2903,39 @@ var GisPermission = /*#__PURE__*/function () {
|
|
|
2897
2903
|
var lastRouteMsg = to.matched.at(-1);
|
|
2898
2904
|
// 进入主页,主页如果已被隐藏则进去第一个显示的页面
|
|
2899
2905
|
if ((_to$meta = to.meta) !== null && _to$meta !== void 0 && _to$meta.isHomePage && (to === null || to === void 0 || (_to$redirectedFrom = to.redirectedFrom) === null || _to$redirectedFrom === void 0 ? void 0 : _to$redirectedFrom.path) === '/') {
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2906
|
+
if (to.meta.hasOwnProperty('visible') && !to.meta.visible) {
|
|
2907
|
+
var hasShowHomePage = undefined;
|
|
2908
|
+
var childList = to.matched[0].children;
|
|
2909
|
+
for (var i = 0; i < childList.length; i++) {
|
|
2910
|
+
if (!childList[i].meta.hasOwnProperty('visible') || childList[i].meta.visible) {
|
|
2911
|
+
var _childList$i;
|
|
2912
|
+
if (((_childList$i = childList[i]) === null || _childList$i === void 0 || (_childList$i = _childList$i.children) === null || _childList$i === void 0 ? void 0 : _childList$i.length) > 0) {
|
|
2913
|
+
hasShowHomePage = recursionRouteFn(childList[i].children);
|
|
2914
|
+
if (hasShowHomePage) {
|
|
2915
|
+
break;
|
|
2916
|
+
}
|
|
2917
|
+
} else {
|
|
2918
|
+
hasShowHomePage = childList[i];
|
|
2919
|
+
if (hasShowHomePage) {
|
|
2920
|
+
break;
|
|
2921
|
+
}
|
|
2914
2922
|
}
|
|
2915
2923
|
}
|
|
2916
2924
|
}
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
}
|
|
2925
|
+
if (hasShowHomePage) {
|
|
2926
|
+
var _hasShowHomePage;
|
|
2927
|
+
getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
|
|
2928
|
+
next({
|
|
2929
|
+
path: hasShowHomePage.path,
|
|
2930
|
+
query: (_hasShowHomePage = hasShowHomePage) === null || _hasShowHomePage === void 0 || (_hasShowHomePage = _hasShowHomePage.meta) === null || _hasShowHomePage === void 0 ? void 0 : _hasShowHomePage.query
|
|
2931
|
+
});
|
|
2932
|
+
} else {
|
|
2933
|
+
getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
|
|
2934
|
+
next(constType.NO_IN_LAYOUT_MSG.FORBIDDEN);
|
|
2935
|
+
}
|
|
2925
2936
|
} else {
|
|
2926
2937
|
getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
|
|
2927
|
-
next(
|
|
2938
|
+
// next(to.fullPath)
|
|
2928
2939
|
}
|
|
2929
2940
|
} else if ((_to$meta2 = to.meta) !== null && _to$meta2 !== void 0 && _to$meta2.gisInfoSetHideRole && to.meta.hasOwnProperty('visible') && !to.meta.visible) {
|
|
2930
2941
|
getCache(constType.SESSION_STORAGE).remove(constType.TOP_MENU);
|
|
@@ -3323,7 +3334,7 @@ var IGlobal = /*#__PURE__*/function () {
|
|
|
3323
3334
|
homePageMsg = Global.deepClone(getHomePageFn(list));
|
|
3324
3335
|
delete homePageMsg.children;
|
|
3325
3336
|
// 用户角色重定向
|
|
3326
|
-
var roleHomeMsg = getCache$1(constType
|
|
3337
|
+
var roleHomeMsg = getCache$1(constType.SESSION_STORAGE).get(constType.ROLE_HOME_MSG);
|
|
3327
3338
|
if (roleHomeMsg) {
|
|
3328
3339
|
this.mainRouter[0].redirect = function (to) {
|
|
3329
3340
|
return {
|
|
@@ -3372,7 +3383,7 @@ var IGlobal = /*#__PURE__*/function () {
|
|
|
3372
3383
|
value: function emptyHomeRedirectFn() {
|
|
3373
3384
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
3374
3385
|
if (type && window['gisConfig'] && window['gisConfig'].VITE_APP_PERMISSION === 'true') {
|
|
3375
|
-
var roleHomeMsg = getCache$1(constType
|
|
3386
|
+
var roleHomeMsg = getCache$1(constType.SESSION_STORAGE).get(constType.ROLE_HOME_MSG);
|
|
3376
3387
|
if (!roleHomeMsg) {
|
|
3377
3388
|
this.mainRouter[0].redirect = '';
|
|
3378
3389
|
}
|
|
@@ -3610,7 +3621,7 @@ function _getLastRouterMsgFn() {
|
|
|
3610
3621
|
getSearchTreeArr(routerList, 'name', list.name);
|
|
3611
3622
|
}
|
|
3612
3623
|
if (getLastRouter) {
|
|
3613
|
-
cacheMsg = getCache$1(constType
|
|
3624
|
+
cacheMsg = getCache$1(constType.LOCAL_STORAGE).get(constType.GIS_CONFIG); // 非微应用 才可以获取缓存和显示组件信息
|
|
3614
3625
|
if (!((_window$gisConfig = window.gisConfig) !== null && _window$gisConfig !== void 0 && _window$gisConfig.VITE_APP_IS_MAIN_MICRO_APP) || ((_window$gisConfig2 = window.gisConfig) === null || _window$gisConfig2 === void 0 ? void 0 : _window$gisConfig2.VITE_APP_IS_MAIN_MICRO_APP) === 'false') {
|
|
3615
3626
|
if (cacheMsg) {
|
|
3616
3627
|
if ((_cacheMsg$headerConfi = cacheMsg.headerConfig) !== null && _cacheMsg$headerConfi !== void 0 && _cacheMsg$headerConfi.isShowTags) {
|
|
@@ -3692,13 +3703,14 @@ function getHomePageFn(list) {
|
|
|
3692
3703
|
|
|
3693
3704
|
// 获取头部菜单数据
|
|
3694
3705
|
function getTopMenuListFn(list) {
|
|
3706
|
+
var _constType$MENU_TYPE_, _constType$MENU_TYPE_2, _constType$MENU_TYPE_3;
|
|
3695
3707
|
if (!list || !Array.isArray(list)) {
|
|
3696
|
-
return;
|
|
3708
|
+
return [];
|
|
3697
3709
|
}
|
|
3710
|
+
var typeList = [constType === null || constType === void 0 || (_constType$MENU_TYPE_ = constType.MENU_TYPE_MSG) === null || _constType$MENU_TYPE_ === void 0 ? void 0 : _constType$MENU_TYPE_.HORIZONTAL, constType === null || constType === void 0 || (_constType$MENU_TYPE_2 = constType.MENU_TYPE_MSG) === null || _constType$MENU_TYPE_2 === void 0 ? void 0 : _constType$MENU_TYPE_2.NAVBAR, constType === null || constType === void 0 || (_constType$MENU_TYPE_3 = constType.MENU_TYPE_MSG) === null || _constType$MENU_TYPE_3 === void 0 ? void 0 : _constType$MENU_TYPE_3.SUB_NAVBAR, 1];
|
|
3698
3711
|
for (var i = 0; i < list.length; i++) {
|
|
3699
3712
|
if (list[i].meta) {
|
|
3700
|
-
|
|
3701
|
-
if (list[i].meta.type !== ((constType$1 === null || constType$1 === void 0 || (_constType$MENU_TYPE_ = constType$1.MENU_TYPE_MSG) === null || _constType$MENU_TYPE_ === void 0 ? void 0 : _constType$MENU_TYPE_.HORIZONTAL) || 1)) {
|
|
3713
|
+
if (!typeList.includes(list[i].meta.type)) {
|
|
3702
3714
|
list.splice(i, 1);
|
|
3703
3715
|
i--;
|
|
3704
3716
|
}
|
|
@@ -3743,7 +3755,7 @@ function setSameMsgFn(sameRouterMsg) {
|
|
|
3743
3755
|
if (sameRouterMsg[key].list.length > 1) {
|
|
3744
3756
|
for (var i = 1; i < sameRouterMsg[key].list.length; i++) {
|
|
3745
3757
|
// sameRouterMsg[key].list[i].name = sameRouterMsg[key].list[i].name + i
|
|
3746
|
-
sameRouterMsg[key].list[i].name = sameRouterMsg[key].list[i].name + constType
|
|
3758
|
+
sameRouterMsg[key].list[i].name = sameRouterMsg[key].list[i].name + constType._MULTIPLE_ROUTE_JOIN_STR + sameRouterMsg[key].list[i].meta.code;
|
|
3747
3759
|
}
|
|
3748
3760
|
}
|
|
3749
3761
|
}
|
|
@@ -3767,7 +3779,7 @@ var createRouteComponent = function createRouteComponent(component, name, code)
|
|
|
3767
3779
|
});
|
|
3768
3780
|
// 包装异步组件并设置名称
|
|
3769
3781
|
return defineComponent({
|
|
3770
|
-
name: "".concat(name).concat(constType
|
|
3782
|
+
name: "".concat(name).concat(constType._ROUTE_PAGE_JOIN_STR).concat(code),
|
|
3771
3783
|
setup: function setup() {
|
|
3772
3784
|
return function () {
|
|
3773
3785
|
return h(asyncComponent);
|