@indfnd/common 1.1.17 → 1.1.19
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/CHANGELOG.md +16 -0
- package/dist/ind-common.es.js +214 -79
- package/dist/ind-common.umd.cjs +76 -76
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.19](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.18...v1.1.19) (2025-11-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 修改页面帮助组件 ([eefe6af](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/eefe6af7ab5f8af7a0317a13b57f5e4e2e12bc6f))
|
|
11
|
+
|
|
12
|
+
### [1.1.18](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.17...v1.1.18) (2025-11-06)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 表格组件修改 ([3b0f8e1](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/3b0f8e1179aa7eedfa9e57de3a3b83ef26819d5b))
|
|
18
|
+
* 路由升级 ([4c452b8](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/4c452b82991d4df843bf593e67b90a04006201df))
|
|
19
|
+
* 路由升级 ([f248b56](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/f248b56d827b22fe1dd7683f81c0b5c84b37aeef))
|
|
20
|
+
|
|
5
21
|
### [1.1.17](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.16...v1.1.17) (2025-11-03)
|
|
6
22
|
|
|
7
23
|
|
package/dist/ind-common.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button as Button$1, ButtonGroup as ButtonGroup$1, Input, Drawer as Drawer$1, Dropdown as Dropdown$1, Modal as Modal$1, Form, FormItem, Select as Select$1, Option, Row, Col, Menu, MenuItem, Submenu, Badge, DropdownMenu, DropdownItem, Tag, Header, Layout, Content, Spin, Poptip as Poptip$1, CheckboxGroup, Checkbox, RadioGroup, Radio, Card, Message, LoadingBar } from "view-design";
|
|
2
|
-
import { isNil, getSessionStorage, putOssFileApi, formatDate as formatDate$1, useConfig, getQuarterNum, formatQuarter, str2Date, isDate as isDate$1, isArray as isArray$1, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios as axios$3, getPreviewUrlApi, getToken, isFunction as isFunction$1, isString as isString$1, uuid, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi,
|
|
2
|
+
import { isNil, getSessionStorage, putOssFileApi, formatDate as formatDate$1, useConfig, getQuarterNum, formatQuarter, str2Date, isDate as isDate$1, isArray as isArray$1, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios as axios$3, getPreviewUrlApi, getToken, isFunction as isFunction$1, isString as isString$1, uuid, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, isEqual, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, getLocalStorage, getPermissionCache, listItemTreeApi, getPriceInfo, MIME_TYPE, base64ToBlob, getCaptchaURL, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, putOssFileUrl, getOssFileUrl, responseInterceptors, listComTreeApi, listUserTreeApi, UC_ENUM, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, setSessionStorage, getAppListApi, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi, getIndexDescCache, listIndexDescApi, setIndexDescCache } from "@indfnd/utils";
|
|
3
3
|
import Vue$1 from "vue";
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5
5
|
function getAugmentedNamespace(n) {
|
|
@@ -5460,7 +5460,7 @@ var lodash = { exports: {} };
|
|
|
5460
5460
|
})(lodash, lodash.exports);
|
|
5461
5461
|
var _ = lodash.exports;
|
|
5462
5462
|
const name$1 = "@indfnd/common";
|
|
5463
|
-
const version = "1.1.
|
|
5463
|
+
const version = "1.1.18";
|
|
5464
5464
|
const author = "huxuetong";
|
|
5465
5465
|
const publishConfig = {
|
|
5466
5466
|
registry: "https://registry.npmjs.org/"
|
|
@@ -53503,7 +53503,8 @@ const __vue2_script$14 = {
|
|
|
53503
53503
|
return data2.treeLevelFlag;
|
|
53504
53504
|
},
|
|
53505
53505
|
autoGroupColumnDef: null,
|
|
53506
|
-
groupDisplayType: ""
|
|
53506
|
+
groupDisplayType: "",
|
|
53507
|
+
inited: false
|
|
53507
53508
|
};
|
|
53508
53509
|
},
|
|
53509
53510
|
computed: {
|
|
@@ -53744,7 +53745,13 @@ const __vue2_script$14 = {
|
|
|
53744
53745
|
this.renderSumRow();
|
|
53745
53746
|
}
|
|
53746
53747
|
},
|
|
53747
|
-
|
|
53748
|
+
created() {
|
|
53749
|
+
if (this.autoRefresh) {
|
|
53750
|
+
this.tableRefresh();
|
|
53751
|
+
this.inited = true;
|
|
53752
|
+
}
|
|
53753
|
+
},
|
|
53754
|
+
async mounted() {
|
|
53748
53755
|
var _a;
|
|
53749
53756
|
this.tableRef = this;
|
|
53750
53757
|
this.unitType = this.defaultTableUnitType;
|
|
@@ -53773,7 +53780,10 @@ const __vue2_script$14 = {
|
|
|
53773
53780
|
activated() {
|
|
53774
53781
|
console.log(this._uid + "activated");
|
|
53775
53782
|
if (this.autoRefresh) {
|
|
53776
|
-
this.
|
|
53783
|
+
if (!this.inited) {
|
|
53784
|
+
this.tableRefresh();
|
|
53785
|
+
}
|
|
53786
|
+
this.inited = false;
|
|
53777
53787
|
}
|
|
53778
53788
|
},
|
|
53779
53789
|
destroyed() {
|
|
@@ -57595,8 +57605,11 @@ const __vue2_script$_ = {
|
|
|
57595
57605
|
watchUrlParamsProp() {
|
|
57596
57606
|
this.$watch(
|
|
57597
57607
|
"urlParams",
|
|
57598
|
-
() => {
|
|
57599
|
-
|
|
57608
|
+
(newVal, oldVal) => {
|
|
57609
|
+
let flag = isEqual(newVal, oldVal);
|
|
57610
|
+
if (!flag) {
|
|
57611
|
+
this.init();
|
|
57612
|
+
}
|
|
57600
57613
|
},
|
|
57601
57614
|
{ immediate: true }
|
|
57602
57615
|
);
|
|
@@ -60622,17 +60635,30 @@ var render$G = function() {
|
|
|
60622
60635
|
var staticRenderFns$G = [];
|
|
60623
60636
|
const __vue2_script$H = {
|
|
60624
60637
|
name: "IndEmptyLayout",
|
|
60638
|
+
data() {
|
|
60639
|
+
return {
|
|
60640
|
+
tagNavList: []
|
|
60641
|
+
};
|
|
60642
|
+
},
|
|
60625
60643
|
computed: {
|
|
60626
|
-
tagNavList() {
|
|
60627
|
-
return this.$store.state.app.tagNavList;
|
|
60628
|
-
},
|
|
60629
60644
|
notCacheName() {
|
|
60630
60645
|
return [this.$route.meta && this.$route.meta.notCache ? this.$route.name : ""];
|
|
60631
60646
|
},
|
|
60632
60647
|
cacheList() {
|
|
60633
|
-
const list = (this.tagNavList || []).filter((item2) => !(item2.meta && item2.meta.notCache)).map((item2) =>
|
|
60648
|
+
const list = (this.tagNavList || []).filter((item2) => !(item2.meta && item2.meta.notCache)).map((item2) => {
|
|
60649
|
+
var _a, _b;
|
|
60650
|
+
return (_b = (_a = item2.meta) == null ? void 0 : _a.data) == null ? void 0 : _b.permissionValue;
|
|
60651
|
+
});
|
|
60634
60652
|
return ["IndEmptyLayout", ...list];
|
|
60635
60653
|
}
|
|
60654
|
+
},
|
|
60655
|
+
watch: {
|
|
60656
|
+
$route: {
|
|
60657
|
+
handler() {
|
|
60658
|
+
this.tagNavList = getLocalStorage("ibp-sc-tagNavList");
|
|
60659
|
+
},
|
|
60660
|
+
immediate: true
|
|
60661
|
+
}
|
|
60636
60662
|
}
|
|
60637
60663
|
};
|
|
60638
60664
|
const __cssModules$H = {};
|
|
@@ -60681,7 +60707,7 @@ function __vue2_injectStyles$G(context) {
|
|
|
60681
60707
|
this[o] = __cssModules$G[o];
|
|
60682
60708
|
}
|
|
60683
60709
|
}
|
|
60684
|
-
var
|
|
60710
|
+
var PageLayout = /* @__PURE__ */ function() {
|
|
60685
60711
|
return __component__$G.exports;
|
|
60686
60712
|
}();
|
|
60687
60713
|
var render$E = function() {
|
|
@@ -60696,16 +60722,17 @@ var render$E = function() {
|
|
|
60696
60722
|
_vm.show = false;
|
|
60697
60723
|
} }, model: { value: _vm.show, callback: function($$v) {
|
|
60698
60724
|
_vm.show = $$v;
|
|
60699
|
-
}, expression: "show" } }, [_vm.menuInfo.menuDesc ?
|
|
60725
|
+
}, expression: "show" } }, [_vm.theContext != "" ? [_c("div", { domProps: { "innerHTML": _vm._s(_vm.theContext) } })] : [_vm.menuInfo.menuDesc ? _c("div", { staticClass: "ind-menu-help-panel" }, [_c("div", { staticClass: "ind-flex" }, [_c("div", { staticClass: "ind-menu-title" }, [_vm._v("\u529F\u80FD\u8BF4\u660E\uFF1A")]), _c("div", { staticClass: "ind-menu-title-content" }, [_vm._v(" " + _vm._s(_vm.menuInfo.menuDesc) + " ")])]), _c("div", { staticClass: "ind-menu-title" }, [_vm._v("\u6307\u6807\u5B9A\u4E49\uFF1A")]), _vm._l(_vm.menuInfo.indexList, function(item2, idx) {
|
|
60700
60726
|
return _c("div", { key: "index" + idx, staticClass: "ind-menu-line-item" }, [_c("div", { staticClass: "ind-intent-1 ind-flex-no-shrink" }, [_vm._v(_vm._s(item2.indexName))]), _c("div", { staticClass: "ind-menu-desc-content" }, [_vm._v(" " + _vm._s(item2.indexRule) + " ")])]);
|
|
60701
|
-
})], 2)
|
|
60727
|
+
})], 2) : _c("div", { staticClass: "ind-empty" }, [_vm._v("\u6682\u65E0")])]], 2)], 1);
|
|
60702
60728
|
};
|
|
60703
60729
|
var staticRenderFns$E = [];
|
|
60704
60730
|
const __vue2_script$F = {
|
|
60705
60731
|
props: {
|
|
60706
60732
|
title: { type: String, default: "\u9875\u9762\u5E2E\u52A9" },
|
|
60707
60733
|
width: { type: Number, default: 1060 },
|
|
60708
|
-
height: { type: Number, default: 650 }
|
|
60734
|
+
height: { type: Number, default: 650 },
|
|
60735
|
+
theContext: { type: String, default: "" }
|
|
60709
60736
|
},
|
|
60710
60737
|
data() {
|
|
60711
60738
|
return {
|
|
@@ -60809,18 +60836,24 @@ function __vue2_injectStyles$E(context) {
|
|
|
60809
60836
|
var detailView = /* @__PURE__ */ function() {
|
|
60810
60837
|
return __component__$E.exports;
|
|
60811
60838
|
}();
|
|
60839
|
+
`${config.ismAmServerContext}/manage/item`;
|
|
60840
|
+
function getIndexPreset(params) {
|
|
60841
|
+
return axios$3.get(`/ind-uc-ext-server/manage/ind-index-manage-preset/get`, { params });
|
|
60842
|
+
}
|
|
60812
60843
|
var render$C = function() {
|
|
60813
60844
|
var _vm = this;
|
|
60814
60845
|
var _h = _vm.$createElement;
|
|
60815
60846
|
var _c = _vm._self._c || _h;
|
|
60816
|
-
return _c("div", { staticClass: "ind-page-view ind-flex-column" }, [_vm.isShowHeader ? _c("div", { staticClass: "ind-flex-no-shrink header" }, [_vm.isShowBackBtn ? _c("Button", { staticClass: "back-btn", attrs: { "bizType": "back" }, on: { "click": _vm.$backToMenu } }, [_vm._v("\u8FD4\u56DE")]) : _vm._e(), _c("span", { staticClass: "title" }, [_vm._v(_vm._s(_vm.customTitle || _vm.title))]), _c("MenuDesc"), _c("div", { staticClass: "function-wrapper" }, [_vm._t("headerButton")], 2)], 1) : _vm._e(), _c("IndLoadingPanel", { staticClass: "ind-flex-column ind-flex-grow content", attrs: { "loading": _vm.loading } }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.topSearch, expression: "$slots.topSearch" }], staticClass: "ind-flex-no-shrink ind-panel top-search-content search" }, [_vm._t("topSearch")], 2), _c("div", { staticClass: "ind-flex-grow body-content" }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.leftContent, expression: "$slots.leftContent" }], staticClass: "ind-panel body-left-content" }, [_vm._t("leftContent")], 2), _c("div", { staticClass: "ind-panel ind-flex-column body-right-content" }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.search, expression: "$slots.search" }], staticClass: "ind-flex-no-shrink search" }, [_vm._t("search")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.tip, expression: "$slots.tip" }], staticClass: "tip" }, [_vm._t("tip")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots["important-tip"], expression: "$slots['important-tip']" }], staticClass: "important-tip" }, [_c("Icons", { attrs: { "type": "md-information-circle" } }), _vm._t("important-tip")], 2), _c("div", { staticClass: "ind-flex-grow main-content" }, [_vm._t("default")], 2), _c("div", { staticClass: "ind-flex-no-shrink body-right-content-footer" }, [_vm._t("footer")], 2)])]), _c("div", { staticClass: "ind-flex-no-shrink bottom" }, [_vm._t("bottom")], 2)])], 1);
|
|
60847
|
+
return _c("div", { staticClass: "ind-page-view ind-flex-column" }, [_vm.isShowHeader ? _c("div", { staticClass: "ind-flex-no-shrink header" }, [_vm.isShowBackBtn ? _c("Button", { staticClass: "back-btn", attrs: { "bizType": "back" }, on: { "click": _vm.$backToMenu } }, [_vm._v("\u8FD4\u56DE")]) : _vm._e(), _c("span", { staticClass: "title" }, [_vm._v(_vm._s(_vm.customTitle || _vm.title))]), _c("MenuDesc", { attrs: { "theContext": _vm.indexDesc } }), _c("div", { staticStyle: { "width": "70%", "height": "100%", "display": "flex", "align-items": "center", "padding": "5px" } }, [_vm._v(" " + _vm._s(_vm.functionDesc) + " ")]), _c("div", { staticClass: "function-wrapper" }, [_vm._t("headerButton")], 2)], 1) : _vm._e(), _c("IndLoadingPanel", { staticClass: "ind-flex-column ind-flex-grow content", attrs: { "loading": _vm.loading } }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.topSearch, expression: "$slots.topSearch" }], staticClass: "ind-flex-no-shrink ind-panel top-search-content search" }, [_vm._t("topSearch")], 2), _c("div", { staticClass: "ind-flex-grow body-content" }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.leftContent, expression: "$slots.leftContent" }], staticClass: "ind-panel body-left-content" }, [_vm._t("leftContent")], 2), _c("div", { staticClass: "ind-panel ind-flex-column body-right-content" }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.search, expression: "$slots.search" }], staticClass: "ind-flex-no-shrink search" }, [_vm._t("search")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.tip, expression: "$slots.tip" }], staticClass: "tip" }, [_vm._t("tip")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots["important-tip"], expression: "$slots['important-tip']" }], staticClass: "important-tip" }, [_c("Icons", { attrs: { "type": "md-information-circle" } }), _vm._t("important-tip")], 2), _c("div", { staticClass: "ind-flex-grow main-content" }, [_vm._t("default")], 2), _c("div", { staticClass: "ind-flex-no-shrink body-right-content-footer" }, [_vm._t("footer")], 2)])]), _c("div", { staticClass: "ind-flex-no-shrink bottom" }, [_vm._t("bottom")], 2)])], 1);
|
|
60817
60848
|
};
|
|
60818
60849
|
var staticRenderFns$C = [];
|
|
60819
60850
|
const __vue2_script$D = {
|
|
60820
60851
|
name: "IndPageView",
|
|
60821
60852
|
data() {
|
|
60822
60853
|
return {
|
|
60823
|
-
title: ""
|
|
60854
|
+
title: "",
|
|
60855
|
+
functionDesc: "",
|
|
60856
|
+
indexDesc: ""
|
|
60824
60857
|
};
|
|
60825
60858
|
},
|
|
60826
60859
|
components: { ButtonGroup, Button, Icons, Col, Row, MenuDesc },
|
|
@@ -60848,8 +60881,22 @@ const __vue2_script$D = {
|
|
|
60848
60881
|
}
|
|
60849
60882
|
}
|
|
60850
60883
|
},
|
|
60851
|
-
mounted() {
|
|
60884
|
+
async mounted() {
|
|
60852
60885
|
this.calcTitle();
|
|
60886
|
+
let params = {
|
|
60887
|
+
userId: this.$route.meta.permissionId,
|
|
60888
|
+
funId: "pageHelpSet"
|
|
60889
|
+
};
|
|
60890
|
+
let res = await getIndexPreset(params);
|
|
60891
|
+
if (res.code == "1") {
|
|
60892
|
+
if (res.data != "") {
|
|
60893
|
+
let data2 = JSON.parse(res.data);
|
|
60894
|
+
this.functionDesc = data2.functionDesc;
|
|
60895
|
+
this.indexDesc = data2.indexDesc;
|
|
60896
|
+
} else {
|
|
60897
|
+
this.functionDesc = "";
|
|
60898
|
+
}
|
|
60899
|
+
}
|
|
60853
60900
|
}
|
|
60854
60901
|
};
|
|
60855
60902
|
const __cssModules$D = {};
|
|
@@ -71571,7 +71618,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
71571
71618
|
User,
|
|
71572
71619
|
BasicLayout,
|
|
71573
71620
|
EmptyLayout,
|
|
71574
|
-
PageLayout
|
|
71621
|
+
PageLayout,
|
|
71575
71622
|
DetailView: detailView,
|
|
71576
71623
|
PageView: pageView,
|
|
71577
71624
|
Login,
|
|
@@ -71733,8 +71780,44 @@ const PERMISSION_TYPE = {
|
|
|
71733
71780
|
function isMenuPermissionType(type) {
|
|
71734
71781
|
return [PERMISSION_TYPE.DIRECTORY, PERMISSION_TYPE.MENU].includes(type);
|
|
71735
71782
|
}
|
|
71783
|
+
function getPermissionType(type) {
|
|
71784
|
+
return Object.keys(PERMISSION_TYPE).find((key) => PERMISSION_TYPE[key] === type);
|
|
71785
|
+
}
|
|
71736
71786
|
function filterMicroPermissionList(microType, permissionList = []) {
|
|
71737
|
-
|
|
71787
|
+
if (!microType)
|
|
71788
|
+
return permissionList;
|
|
71789
|
+
return permissionList.filter((item2) => {
|
|
71790
|
+
const itemName = item2 && item2.permissionValue || "";
|
|
71791
|
+
return itemName.startsWith(microType) || itemName.startsWith(`${config$1.routerBase}-${microType}`);
|
|
71792
|
+
});
|
|
71793
|
+
}
|
|
71794
|
+
function permission2Router(list, microType) {
|
|
71795
|
+
console.log("permission2Router params", list, microType);
|
|
71796
|
+
if (!list) {
|
|
71797
|
+
return [];
|
|
71798
|
+
}
|
|
71799
|
+
let tempList = [];
|
|
71800
|
+
for (const item2 of list) {
|
|
71801
|
+
tempList.push({
|
|
71802
|
+
path: dealRoutePath(item2.uri, microType),
|
|
71803
|
+
uri: item2.uri,
|
|
71804
|
+
name: item2.permissionValue,
|
|
71805
|
+
meta: {
|
|
71806
|
+
appId: item2.appId,
|
|
71807
|
+
permissionId: item2.permissionId,
|
|
71808
|
+
title: item2.label,
|
|
71809
|
+
icon: item2.icon,
|
|
71810
|
+
crumbs: [
|
|
71811
|
+
{ icon: item2.icon, name: item2.permissionValue, title: item2.label, type: item2.type }
|
|
71812
|
+
],
|
|
71813
|
+
activeName: item2.permissionValue,
|
|
71814
|
+
data: item2
|
|
71815
|
+
},
|
|
71816
|
+
component: item2.permissionValue
|
|
71817
|
+
});
|
|
71818
|
+
}
|
|
71819
|
+
console.log("permission2Router result", tempList);
|
|
71820
|
+
return tempList;
|
|
71738
71821
|
}
|
|
71739
71822
|
function listToMenuTree({ list, menuTree, pageNode, parentId, crumbs, root, microType }) {
|
|
71740
71823
|
if (!list)
|
|
@@ -71836,29 +71919,6 @@ function generatorMenuTree(permissionList = []) {
|
|
|
71836
71919
|
});
|
|
71837
71920
|
return menuTree;
|
|
71838
71921
|
}
|
|
71839
|
-
function generatorDynamicRouter(permissionList = [], microType) {
|
|
71840
|
-
const menuTree = [];
|
|
71841
|
-
const pageNode = {
|
|
71842
|
-
path: "/page",
|
|
71843
|
-
name: "page",
|
|
71844
|
-
meta: { hideInMenu: true, notCache: true },
|
|
71845
|
-
component: "EmptyLayoutNotCache",
|
|
71846
|
-
children: []
|
|
71847
|
-
};
|
|
71848
|
-
listToMenuTree({
|
|
71849
|
-
list: permissionList,
|
|
71850
|
-
menuTree,
|
|
71851
|
-
pageNode,
|
|
71852
|
-
parentId: "0",
|
|
71853
|
-
crumbs: [],
|
|
71854
|
-
root: true,
|
|
71855
|
-
microType
|
|
71856
|
-
});
|
|
71857
|
-
if (pageNode.children.length) {
|
|
71858
|
-
menuTree.push(pageNode);
|
|
71859
|
-
}
|
|
71860
|
-
return generator(menuTree);
|
|
71861
|
-
}
|
|
71862
71922
|
function generator(menuData = []) {
|
|
71863
71923
|
for (let item2 of menuData) {
|
|
71864
71924
|
if (item2.component) {
|
|
@@ -71880,31 +71940,96 @@ function generator(menuData = []) {
|
|
|
71880
71940
|
}
|
|
71881
71941
|
return menuData;
|
|
71882
71942
|
}
|
|
71883
|
-
|
|
71884
|
-
|
|
71885
|
-
|
|
71886
|
-
|
|
71887
|
-
|
|
71888
|
-
|
|
71943
|
+
function generatorRouteByPermission(item2) {
|
|
71944
|
+
if (window.loadComponentHandler) {
|
|
71945
|
+
item2.component = window.loadComponentHandler(item2.path, item2.name) || NotFound;
|
|
71946
|
+
} else {
|
|
71947
|
+
console.error(`\u627E\u4E0D\u5230\u7EC4\u4EF6\u5B9A\u4E49:${item2.component},\u8BF7\u6392\u67E5\u8D44\u6E90\u8DEF\u5F84\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
|
|
71948
|
+
item2.component = NotFound;
|
|
71949
|
+
}
|
|
71950
|
+
return item2;
|
|
71951
|
+
}
|
|
71952
|
+
const isAdded = (router, route) => {
|
|
71953
|
+
var _a, _b;
|
|
71954
|
+
let rlt = router.resolve(route);
|
|
71955
|
+
return !!((_b = (_a = rlt == null ? void 0 : rlt.resolved) == null ? void 0 : _a.matched) == null ? void 0 : _b.length);
|
|
71956
|
+
};
|
|
71957
|
+
const pageRoute = {
|
|
71958
|
+
path: "/page",
|
|
71959
|
+
name: "page",
|
|
71960
|
+
meta: { hideInMenu: true, notCache: true },
|
|
71961
|
+
component: PageLayout,
|
|
71962
|
+
children: []
|
|
71963
|
+
};
|
|
71964
|
+
async function renderRoutes({
|
|
71965
|
+
router,
|
|
71966
|
+
store: store2,
|
|
71967
|
+
microType,
|
|
71968
|
+
allowPermissionList,
|
|
71969
|
+
routerOptionsBak,
|
|
71970
|
+
to
|
|
71971
|
+
}) {
|
|
71972
|
+
let isInitilaze = !store2.state.user.userName;
|
|
71973
|
+
if (isAdded(router, to) && !isInitilaze) {
|
|
71974
|
+
return;
|
|
71975
|
+
}
|
|
71976
|
+
if (isInitilaze) {
|
|
71977
|
+
await store2.dispatch("getUserInfo");
|
|
71978
|
+
await store2.dispatch("getAppListData");
|
|
71979
|
+
await store2.dispatch("getPermissionData", {
|
|
71980
|
+
constantRouterComponents,
|
|
71981
|
+
permissionStoreKeyParams: "ibp-sc-permission"
|
|
71982
|
+
});
|
|
71983
|
+
router.options = _.cloneDeep(routerOptionsBak);
|
|
71984
|
+
}
|
|
71985
|
+
const permissionData = getPermissionCache();
|
|
71889
71986
|
const microPermissionData = filterMicroPermissionList(microType, permissionData);
|
|
71890
|
-
const dynamicRouters = generatorDynamicRouter(microPermissionData, microType);
|
|
71891
|
-
console.log("dynamicROuters", dynamicRouters);
|
|
71892
71987
|
const rootRoute2 = router.options.routes.find((item2) => item2.path === "/");
|
|
71893
|
-
|
|
71894
|
-
router.addRoute(rootRoute2.name,
|
|
71895
|
-
rootRoute2.children.push(
|
|
71988
|
+
if (isInitilaze) {
|
|
71989
|
+
router.addRoute(rootRoute2.name, pageRoute);
|
|
71990
|
+
rootRoute2.children.push(pageRoute);
|
|
71896
71991
|
}
|
|
71897
|
-
|
|
71898
|
-
|
|
71899
|
-
|
|
71900
|
-
|
|
71901
|
-
|
|
71902
|
-
|
|
71903
|
-
|
|
71904
|
-
|
|
71905
|
-
|
|
71906
|
-
|
|
71907
|
-
|
|
71992
|
+
if (!isAdded(router, to)) {
|
|
71993
|
+
let tempPer = microPermissionData.find((item2) => {
|
|
71994
|
+
return item2.permissionValue == to.name || item2.name == to.name;
|
|
71995
|
+
});
|
|
71996
|
+
if (!tempPer && to.path != "/") {
|
|
71997
|
+
tempPer = microPermissionData.find((item2) => {
|
|
71998
|
+
var _a, _b, _c;
|
|
71999
|
+
return ((_a = item2 == null ? void 0 : item2.uri) == null ? void 0 : _a.includes("?")) ? (_b = item2 == null ? void 0 : item2.uri) == null ? void 0 : _b.includes(to.path) : (_c = item2 == null ? void 0 : item2.uri) == null ? void 0 : _c.endsWith(to.path);
|
|
72000
|
+
});
|
|
72001
|
+
}
|
|
72002
|
+
const perType = getPermissionType(tempPer.type || "");
|
|
72003
|
+
let tmpRoute = generatorRouteByPermission(permission2Router([tempPer], microType)[0]);
|
|
72004
|
+
if (perType == "PAGE") {
|
|
72005
|
+
router.addRoute(pageRoute.name, {
|
|
72006
|
+
...tmpRoute,
|
|
72007
|
+
meta: { ...tmpRoute.meta, notCache: true }
|
|
72008
|
+
});
|
|
72009
|
+
pageRoute.children.push(tmpRoute);
|
|
72010
|
+
}
|
|
72011
|
+
if (perType == "MENU") {
|
|
72012
|
+
router.addRoute(rootRoute2.name, tmpRoute);
|
|
72013
|
+
rootRoute2.children.push(tmpRoute);
|
|
72014
|
+
}
|
|
72015
|
+
}
|
|
72016
|
+
if (isInitilaze) {
|
|
72017
|
+
const microAllowPermissionList = filterMicroPermissionList(microType, allowPermissionList);
|
|
72018
|
+
const needAddRoutes = microAllowPermissionList.filter((permission2) => {
|
|
72019
|
+
return router.options.routes.findIndex((route) => permission2.name === route.name) === -1;
|
|
72020
|
+
});
|
|
72021
|
+
needAddRoutes.forEach((item2) => {
|
|
72022
|
+
item2.component = item2.name;
|
|
72023
|
+
item2.meta = {
|
|
72024
|
+
hideInMenu: true,
|
|
72025
|
+
title: item2.label,
|
|
72026
|
+
activeName: item2.name
|
|
72027
|
+
};
|
|
72028
|
+
});
|
|
72029
|
+
const dynamicDetailRouters = generator(needAddRoutes);
|
|
72030
|
+
for (const item2 of dynamicDetailRouters) {
|
|
72031
|
+
router.addRoute(config.rootRouteName, item2);
|
|
72032
|
+
}
|
|
71908
72033
|
}
|
|
71909
72034
|
}
|
|
71910
72035
|
function addRouterGuards({ router, store: store2, microType, allowPermissionList }) {
|
|
@@ -71919,13 +72044,7 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
71919
72044
|
if (url.endsWith("/login"))
|
|
71920
72045
|
return;
|
|
71921
72046
|
if (window.confirm("\u4F1A\u8BDD\u5DF2\u5931\u6548\uFF0C\u662F\u5426\u91CD\u65B0\u767B\u5F55\uFF1F")) {
|
|
71922
|
-
|
|
71923
|
-
router.push({ name: LOGIN_PAGE_NAME }, () => {
|
|
71924
|
-
window.location.reload();
|
|
71925
|
-
});
|
|
71926
|
-
} else {
|
|
71927
|
-
top.location = "/ibp-sc/login";
|
|
71928
|
-
}
|
|
72047
|
+
top.location = "/ibp-sc/login";
|
|
71929
72048
|
}
|
|
71930
72049
|
};
|
|
71931
72050
|
window.apiErrorHandler = function(msg) {
|
|
@@ -71954,9 +72073,11 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
71954
72073
|
return false;
|
|
71955
72074
|
};
|
|
71956
72075
|
router.beforeEach(async (to, from, next) => {
|
|
72076
|
+
var _a;
|
|
71957
72077
|
LoadingBar.start();
|
|
71958
72078
|
let token = getToken();
|
|
71959
72079
|
let search = location.search;
|
|
72080
|
+
let tempToken = false;
|
|
71960
72081
|
if (search) {
|
|
71961
72082
|
let rlt = getQueryVariable("token");
|
|
71962
72083
|
if (rlt) {
|
|
@@ -71965,17 +72086,18 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
71965
72086
|
store2.dispatch("loginSuccess", token);
|
|
71966
72087
|
}
|
|
71967
72088
|
}
|
|
71968
|
-
let ssoToken = getQueryVariable("sso_token");
|
|
72089
|
+
let ssoToken = getQueryVariable("sso_token") || sessionStorage.getItem("sso_token");
|
|
71969
72090
|
if (ssoToken) {
|
|
71970
|
-
|
|
72091
|
+
tempToken = true;
|
|
71971
72092
|
sessionStorage.setItem("sso_token", ssoToken);
|
|
71972
72093
|
}
|
|
71973
72094
|
}
|
|
71974
|
-
|
|
72095
|
+
let isInitilaze = !store2.state.user.userName;
|
|
72096
|
+
if (!tempToken && !token && to.name !== LOGIN_PAGE_NAME) {
|
|
71975
72097
|
next({ name: LOGIN_PAGE_NAME });
|
|
71976
72098
|
} else if (to.name === LOGIN_PAGE_NAME) {
|
|
71977
72099
|
next();
|
|
71978
|
-
} else if (
|
|
72100
|
+
} else if (isInitilaze || top !== self || location.href.includes("imarket-analysis")) {
|
|
71979
72101
|
Spin.show();
|
|
71980
72102
|
try {
|
|
71981
72103
|
await renderRoutes({
|
|
@@ -71983,10 +72105,23 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
71983
72105
|
store: store2,
|
|
71984
72106
|
microType,
|
|
71985
72107
|
allowPermissionList,
|
|
71986
|
-
routerOptionsBak
|
|
72108
|
+
routerOptionsBak,
|
|
72109
|
+
to
|
|
71987
72110
|
});
|
|
71988
|
-
|
|
72111
|
+
if (isInitilaze || !((_a = to.matched) == null ? void 0 : _a.length)) {
|
|
72112
|
+
console.log("\u8DEF\u7531\u6CA1\u6709\u5339\u914D\u5230", to);
|
|
72113
|
+
if (to.name && to.path == "/") {
|
|
72114
|
+
next({ name: to.name, query: to.query });
|
|
72115
|
+
} else {
|
|
72116
|
+
console.log("\u8DEF\u7531\u5339\u914D\u5230\uFF0C\u8DF3", to);
|
|
72117
|
+
next({ ...to });
|
|
72118
|
+
}
|
|
72119
|
+
} else {
|
|
72120
|
+
console.log("\u8DEF\u7531\u5339\u914D\u5230\uFF0C\u8DF32", to);
|
|
72121
|
+
next();
|
|
72122
|
+
}
|
|
71989
72123
|
} catch (error) {
|
|
72124
|
+
console.log("router.beforeeach err", error);
|
|
71990
72125
|
next({ name: LOGIN_PAGE_NAME });
|
|
71991
72126
|
}
|
|
71992
72127
|
Spin.hide();
|
|
@@ -73562,4 +73697,4 @@ const API = {
|
|
|
73562
73697
|
getDefaultTheme,
|
|
73563
73698
|
doChangeTheme
|
|
73564
73699
|
};
|
|
73565
|
-
export { AppMenu, auditLogModal as AuditLogModal, auditModal as AuditModal, BackTop, backTopPanel as BackTopPanel, BasicLayout, brandInputModal as BrandInputModal, Button, ButtonGroup, Collect, comInputModal as ComInputModal, ConditionPanel, datePicker as DatePicker, detailView as DetailView, Drawer, Dropdown, dropdownItem as DropdownItem, dropdownMenu as DropdownMenu, EmptyLayout, ErrorContent, errorStore as ErrorStore, index$4 as ExcelFlowModal, FormWrap, Fullscreen as FullScreen, helpTableModal as HelpTableModal, helpTreeModal as HelpTreeModal, Icons, imagePreview as ImagePreview, configPlugin as IndConfigPlugin, routerPlugin as IndRouterPlugin, index$2 as ItemCompInputModal, itemInputModal as ItemInputModal, itemTypeCombineSelect as ItemTypeCombineSelect, language as Language, LoadingPanel, Login, materialItemModal as MaterialItemModal, mobileindex as MobileTable, Modal, NotFound, IndOption as Option, optionGroup as OptionGroup, OtherMenu,
|
|
73700
|
+
export { AppMenu, auditLogModal as AuditLogModal, auditModal as AuditModal, BackTop, backTopPanel as BackTopPanel, BasicLayout, brandInputModal as BrandInputModal, Button, ButtonGroup, Collect, comInputModal as ComInputModal, ConditionPanel, datePicker as DatePicker, detailView as DetailView, Drawer, Dropdown, dropdownItem as DropdownItem, dropdownMenu as DropdownMenu, EmptyLayout, ErrorContent, errorStore as ErrorStore, index$4 as ExcelFlowModal, FormWrap, Fullscreen as FullScreen, helpTableModal as HelpTableModal, helpTreeModal as HelpTreeModal, Icons, imagePreview as ImagePreview, configPlugin as IndConfigPlugin, routerPlugin as IndRouterPlugin, index$2 as ItemCompInputModal, itemInputModal as ItemInputModal, itemTypeCombineSelect as ItemTypeCombineSelect, language as Language, LoadingPanel, Login, materialItemModal as MaterialItemModal, mobileindex as MobileTable, Modal, NotFound, IndOption as Option, optionGroup as OptionGroup, OtherMenu, PageLayout, pageView as PageView, Poptip, reportIndexModal as ReportIndexModal, reportOptionModal as ReportOptionModal, roleAuth as RoleAuth, index$1 as RowSumSettingInputModal, Select, SideMenu, SideMenuItem, SiderTrigger, Sign, signModal as SignModal, index as StepTrack, Table, TagsNav, Tooltip, Tree, index$3 as TreeModal, ImpTreeSelect as TreeSelect, unitRadio as UnitRadio, uploadFile as UploadFile, uploadImg as UploadImg, User, userAuth as UserAuth, editor as WangEditor, zeroRadio as ZeroRadio, addRouterGuards, clickOutside, createMacroBasicRoutes, createMicroBasicRoutes, API as default, install, permission, print, routerOptions, store, transferDom };
|