@indfnd/common 1.0.96 → 1.0.99
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 +31 -135
- package/dist/ind-common.umd.cjs +49 -49
- 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.0.99](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.98...v1.0.99) (2025-02-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 回退版本 ([23b018a](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/23b018a0b597133694fdfdb9b474a8f49ae8047c))
|
|
11
|
+
|
|
12
|
+
### [1.0.98](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.97...v1.0.98) (2025-02-21)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 修改路由第一次跳转页面url参数丢失问题 ([3a8afce](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/3a8afcea48de55e73ae43c9b78a4dcbb84c76d0e))
|
|
18
|
+
|
|
19
|
+
### [1.0.97](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.96...v1.0.97) (2025-02-18)
|
|
20
|
+
|
|
5
21
|
### [1.0.96](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.95...v1.0.96) (2025-02-08)
|
|
6
22
|
|
|
7
23
|
|
package/dist/ind-common.es.js
CHANGED
|
@@ -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.0.
|
|
5463
|
+
const version = "1.0.98";
|
|
5464
5464
|
const author = "huxuetong";
|
|
5465
5465
|
const publishConfig = {
|
|
5466
5466
|
registry: "https://registry.npmjs.org/"
|
|
@@ -59820,7 +59820,7 @@ var render$F = function() {
|
|
|
59820
59820
|
var _vm = this;
|
|
59821
59821
|
var _h = _vm.$createElement;
|
|
59822
59822
|
var _c = _vm._self._c || _h;
|
|
59823
|
-
return _c("KeepAlive", { attrs: { "exclude": _vm.notCacheName } }, [_c("RouterView", { ref: "child" })], 1);
|
|
59823
|
+
return _c("KeepAlive", { attrs: { "include": _vm.cacheList, "exclude": _vm.notCacheName } }, [_c("RouterView", { ref: "child" })], 1);
|
|
59824
59824
|
};
|
|
59825
59825
|
var staticRenderFns$F = [];
|
|
59826
59826
|
const __vue2_script$G = {
|
|
@@ -59884,7 +59884,7 @@ function __vue2_injectStyles$F(context) {
|
|
|
59884
59884
|
this[o] = __cssModules$F[o];
|
|
59885
59885
|
}
|
|
59886
59886
|
}
|
|
59887
|
-
var
|
|
59887
|
+
var pageLayout = /* @__PURE__ */ function() {
|
|
59888
59888
|
return __component__$F.exports;
|
|
59889
59889
|
}();
|
|
59890
59890
|
var render$D = function() {
|
|
@@ -67446,7 +67446,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
67446
67446
|
User,
|
|
67447
67447
|
BasicLayout,
|
|
67448
67448
|
EmptyLayout,
|
|
67449
|
-
PageLayout,
|
|
67449
|
+
PageLayout: pageLayout,
|
|
67450
67450
|
DetailView: detailView,
|
|
67451
67451
|
PageView: pageView,
|
|
67452
67452
|
Login,
|
|
@@ -67607,40 +67607,9 @@ const PERMISSION_TYPE = {
|
|
|
67607
67607
|
function isMenuPermissionType(type) {
|
|
67608
67608
|
return [PERMISSION_TYPE.DIRECTORY, PERMISSION_TYPE.MENU].includes(type);
|
|
67609
67609
|
}
|
|
67610
|
-
function getPermissionType(type) {
|
|
67611
|
-
return Object.keys(PERMISSION_TYPE).find((key) => PERMISSION_TYPE[key] === type);
|
|
67612
|
-
}
|
|
67613
67610
|
function filterMicroPermissionList(microType, permissionList = []) {
|
|
67614
67611
|
return permissionList;
|
|
67615
67612
|
}
|
|
67616
|
-
function permission2Router(list, microType) {
|
|
67617
|
-
console.log("permission2Router params", list, microType);
|
|
67618
|
-
if (!list) {
|
|
67619
|
-
return [];
|
|
67620
|
-
}
|
|
67621
|
-
let tempList = [];
|
|
67622
|
-
for (const item2 of list) {
|
|
67623
|
-
tempList.push({
|
|
67624
|
-
path: dealRoutePath(item2.uri, microType),
|
|
67625
|
-
uri: item2.uri,
|
|
67626
|
-
name: item2.permissionValue,
|
|
67627
|
-
meta: {
|
|
67628
|
-
appId: item2.appId,
|
|
67629
|
-
permissionId: item2.permissionId,
|
|
67630
|
-
title: item2.label,
|
|
67631
|
-
icon: item2.icon,
|
|
67632
|
-
crumbs: [
|
|
67633
|
-
{ icon: item2.icon, name: item2.permissionValue, title: item2.label, type: item2.type }
|
|
67634
|
-
],
|
|
67635
|
-
activeName: item2.permissionValue,
|
|
67636
|
-
data: item2
|
|
67637
|
-
},
|
|
67638
|
-
component: item2.permissionValue
|
|
67639
|
-
});
|
|
67640
|
-
}
|
|
67641
|
-
console.log("permission2Router result", tempList);
|
|
67642
|
-
return tempList;
|
|
67643
|
-
}
|
|
67644
67613
|
function listToMenuTree({ list, menuTree, pageNode, parentId, crumbs, root, microType }) {
|
|
67645
67614
|
if (!list)
|
|
67646
67615
|
return;
|
|
@@ -67785,94 +67754,31 @@ function generator(menuData = []) {
|
|
|
67785
67754
|
}
|
|
67786
67755
|
return menuData;
|
|
67787
67756
|
}
|
|
67788
|
-
function
|
|
67789
|
-
|
|
67790
|
-
|
|
67791
|
-
|
|
67792
|
-
|
|
67793
|
-
|
|
67794
|
-
}
|
|
67795
|
-
return item2;
|
|
67796
|
-
}
|
|
67797
|
-
const isAdded = (router, route) => {
|
|
67798
|
-
var _a, _b;
|
|
67799
|
-
let rlt = router.resolve(route);
|
|
67800
|
-
return !!((_b = (_a = rlt == null ? void 0 : rlt.resolved) == null ? void 0 : _a.matched) == null ? void 0 : _b.length);
|
|
67801
|
-
};
|
|
67802
|
-
const pageRoute = {
|
|
67803
|
-
path: "/page",
|
|
67804
|
-
name: "page",
|
|
67805
|
-
meta: { hideInMenu: true, notCache: true },
|
|
67806
|
-
component: PageLayout,
|
|
67807
|
-
children: []
|
|
67808
|
-
};
|
|
67809
|
-
async function renderRoutes({
|
|
67810
|
-
router,
|
|
67811
|
-
store: store2,
|
|
67812
|
-
microType,
|
|
67813
|
-
allowPermissionList,
|
|
67814
|
-
routerOptionsBak,
|
|
67815
|
-
to
|
|
67816
|
-
}) {
|
|
67817
|
-
let isInitilaze = !store2.state.user.userName;
|
|
67818
|
-
if (isAdded(router, to) && !isInitilaze) {
|
|
67819
|
-
return;
|
|
67820
|
-
}
|
|
67821
|
-
if (isInitilaze) {
|
|
67822
|
-
store2.dispatch("getIndexInfo");
|
|
67823
|
-
await store2.dispatch("getUserInfo");
|
|
67824
|
-
await store2.dispatch("getAppListData");
|
|
67825
|
-
await store2.dispatch("getPermissionData");
|
|
67826
|
-
router.options = _.cloneDeep(routerOptionsBak);
|
|
67827
|
-
}
|
|
67828
|
-
const permissionData = getPermissionCache();
|
|
67757
|
+
async function renderRoutes({ router, store: store2, microType, allowPermissionList, routerOptionsBak }) {
|
|
67758
|
+
store2.dispatch("getIndexInfo");
|
|
67759
|
+
await store2.dispatch("getUserInfo");
|
|
67760
|
+
await store2.dispatch("getAppListData");
|
|
67761
|
+
const permissionData = await store2.dispatch("getPermissionData");
|
|
67762
|
+
router.options = _.cloneDeep(routerOptionsBak);
|
|
67829
67763
|
const microPermissionData = filterMicroPermissionList(microType, permissionData);
|
|
67830
|
-
|
|
67831
|
-
|
|
67832
|
-
|
|
67833
|
-
|
|
67834
|
-
|
|
67835
|
-
|
|
67836
|
-
}
|
|
67837
|
-
} else {
|
|
67838
|
-
const rootRoute2 = router.options.routes.find((item2) => item2.path === "/");
|
|
67839
|
-
if (isInitilaze) {
|
|
67840
|
-
router.addRoute(pageRoute);
|
|
67841
|
-
}
|
|
67842
|
-
if (!isAdded(router, to)) {
|
|
67843
|
-
let tempPer = microPermissionData.find((item2) => {
|
|
67844
|
-
return item2.permissionValue == to.name;
|
|
67845
|
-
});
|
|
67846
|
-
if (!tempPer) {
|
|
67847
|
-
tempPer = microPermissionData.find((item2) => {
|
|
67848
|
-
return item2.uri.endsWith(to.path);
|
|
67849
|
-
});
|
|
67850
|
-
}
|
|
67851
|
-
const perType = getPermissionType(tempPer.type || "");
|
|
67852
|
-
let tmpRoute = generatorRouteByPermission(permission2Router([tempPer], microType)[0]);
|
|
67853
|
-
if (perType == "PAGE") {
|
|
67854
|
-
router.addRoute(pageRoute.name, { ...tmpRoute, meta: { ...tmpRoute.meta, notCache: true } });
|
|
67855
|
-
pageRoute.children.push(tmpRoute);
|
|
67856
|
-
}
|
|
67857
|
-
if (perType == "MENU") {
|
|
67858
|
-
router.addRoute(rootRoute2.name, tmpRoute);
|
|
67859
|
-
rootRoute2.children.push(tmpRoute);
|
|
67860
|
-
}
|
|
67861
|
-
}
|
|
67764
|
+
const dynamicRouters = generatorDynamicRouter(microPermissionData, microType);
|
|
67765
|
+
console.log("dynamicROuters", dynamicRouters);
|
|
67766
|
+
const rootRoute2 = router.options.routes.find((item2) => item2.path === "/");
|
|
67767
|
+
for (const item2 of dynamicRouters) {
|
|
67768
|
+
router.addRoute(rootRoute2.name, item2);
|
|
67769
|
+
rootRoute2.children.push(item2);
|
|
67862
67770
|
}
|
|
67863
|
-
|
|
67864
|
-
|
|
67865
|
-
|
|
67866
|
-
|
|
67867
|
-
|
|
67868
|
-
|
|
67869
|
-
|
|
67870
|
-
|
|
67871
|
-
|
|
67872
|
-
|
|
67873
|
-
|
|
67874
|
-
router.addRoute(config.rootRouteName, item2);
|
|
67875
|
-
}
|
|
67771
|
+
const microAllowPermissionList = filterMicroPermissionList(microType, allowPermissionList);
|
|
67772
|
+
const needAddRoutes = microAllowPermissionList.filter((permission2) => {
|
|
67773
|
+
return router.options.routes.findIndex((route) => permission2.name === route.name) === -1;
|
|
67774
|
+
});
|
|
67775
|
+
needAddRoutes.forEach((item2) => {
|
|
67776
|
+
item2.component = item2.name;
|
|
67777
|
+
item2.meta = { hideInMenu: true, title: item2.label, activeName: item2.name };
|
|
67778
|
+
});
|
|
67779
|
+
const dynamicDetailRouters = generator(needAddRoutes);
|
|
67780
|
+
for (const item2 of dynamicDetailRouters) {
|
|
67781
|
+
router.addRoute(config.rootRouteName, item2);
|
|
67876
67782
|
}
|
|
67877
67783
|
}
|
|
67878
67784
|
function addRouterGuards({ router, store: store2, microType, allowPermissionList }) {
|
|
@@ -67939,12 +67845,11 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
67939
67845
|
sessionStorage.setItem("sso_token", ssoToken);
|
|
67940
67846
|
}
|
|
67941
67847
|
}
|
|
67942
|
-
let isInitilaze = !store2.state.user.userName;
|
|
67943
67848
|
if (!token && to.name !== LOGIN_PAGE_NAME) {
|
|
67944
67849
|
next({ name: LOGIN_PAGE_NAME });
|
|
67945
67850
|
} else if (to.name === LOGIN_PAGE_NAME) {
|
|
67946
67851
|
next();
|
|
67947
|
-
} else if (
|
|
67852
|
+
} else if (!store2.state.user.userName) {
|
|
67948
67853
|
Spin.show();
|
|
67949
67854
|
try {
|
|
67950
67855
|
await renderRoutes({
|
|
@@ -67952,18 +67857,9 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
67952
67857
|
store: store2,
|
|
67953
67858
|
microType,
|
|
67954
67859
|
allowPermissionList,
|
|
67955
|
-
routerOptionsBak
|
|
67956
|
-
to
|
|
67860
|
+
routerOptionsBak
|
|
67957
67861
|
});
|
|
67958
|
-
|
|
67959
|
-
if (to.name && to.path == "/") {
|
|
67960
|
-
next({ name: to.name });
|
|
67961
|
-
} else {
|
|
67962
|
-
next({ ...to });
|
|
67963
|
-
}
|
|
67964
|
-
} else {
|
|
67965
|
-
next();
|
|
67966
|
-
}
|
|
67862
|
+
next({ ...to, replace: true });
|
|
67967
67863
|
} catch (error) {
|
|
67968
67864
|
next({ name: LOGIN_PAGE_NAME });
|
|
67969
67865
|
}
|
|
@@ -68420,4 +68316,4 @@ const API = {
|
|
|
68420
68316
|
getDefaultTheme,
|
|
68421
68317
|
doChangeTheme
|
|
68422
68318
|
};
|
|
68423
|
-
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, zeroRadio as ZeroRadio, addRouterGuards, clickOutside, createMacroBasicRoutes, createMicroBasicRoutes, API as default, permission, print, routerOptions, store, transferDom };
|
|
68319
|
+
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 as 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, zeroRadio as ZeroRadio, addRouterGuards, clickOutside, createMacroBasicRoutes, createMicroBasicRoutes, API as default, permission, print, routerOptions, store, transferDom };
|