@indfnd/common 1.0.89 → 1.0.91
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 +19 -0
- package/dist/ind-common.es.js +81 -32
- package/dist/ind-common.umd.cjs +48 -48
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
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.91](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.90...v1.0.91) (2025-02-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 表格的enter键换行 ([06cc403](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/06cc403fa2f1c265089e4e63702d07c3ce5fff1e))
|
|
11
|
+
|
|
12
|
+
### [1.0.90](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.89...v1.0.90) (2025-02-06)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* 给IndTree增加api ([1ef72f3](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/1ef72f39d4ecda9c79ad6f3b07c4a3b8025a749c))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* router组织路由修改 ([c982f4e](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/c982f4e28370c7aabcdad9a0062ba12c35e04b6a))
|
|
23
|
+
|
|
5
24
|
### [1.0.89](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.0.88...v1.0.89) (2025-01-23)
|
|
6
25
|
|
|
7
26
|
|
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.90";
|
|
5464
5464
|
const author = "huxuetong";
|
|
5465
5465
|
const publishConfig = {
|
|
5466
5466
|
registry: "https://registry.npmjs.org/"
|
|
@@ -51443,7 +51443,7 @@ var AgTooltip = /* @__PURE__ */ function() {
|
|
|
51443
51443
|
const __vue2_script$1d = {
|
|
51444
51444
|
name: "IndAgInput",
|
|
51445
51445
|
render(h) {
|
|
51446
|
-
const { value, data, colDef, scaleFn } = this.params;
|
|
51446
|
+
const { value, data, colDef, scaleFn, api, node, column } = this.params;
|
|
51447
51447
|
const { props } = (colDef == null ? void 0 : colDef.cellRendererParams) || {};
|
|
51448
51448
|
const { type, disabled: disabledDef, textCondition } = props || {};
|
|
51449
51449
|
const disabled = disabledDef instanceof Function ? disabledDef(data) : disabledDef;
|
|
@@ -51471,6 +51471,16 @@ const __vue2_script$1d = {
|
|
|
51471
51471
|
disabled
|
|
51472
51472
|
},
|
|
51473
51473
|
on: {
|
|
51474
|
+
"on-enter": () => {
|
|
51475
|
+
let nextRowIndex = node.rowIndex + 1;
|
|
51476
|
+
window.gridApi.ensureIndexVisible(nextRowIndex);
|
|
51477
|
+
window.gridApi.ensureColumnVisible(column);
|
|
51478
|
+
setTimeout(() => {
|
|
51479
|
+
window.gridApi.gridBodyCtrl.rowRenderer.rowCtrlsByRowIndex[nextRowIndex].centerGui.element.getElementsByTagName("input")[1].focus();
|
|
51480
|
+
}, 0);
|
|
51481
|
+
},
|
|
51482
|
+
"on-keypress": () => {
|
|
51483
|
+
},
|
|
51474
51484
|
"on-blur": (event) => {
|
|
51475
51485
|
let v = event.target.value;
|
|
51476
51486
|
let updateV = null;
|
|
@@ -67442,7 +67452,7 @@ var routerPlugin = {
|
|
|
67442
67452
|
install(Vue2, { router, store: store2 }) {
|
|
67443
67453
|
Vue2.prototype.$backToMenu = function() {
|
|
67444
67454
|
console.log("trigger $backToMenu");
|
|
67445
|
-
if (
|
|
67455
|
+
if (top == self) {
|
|
67446
67456
|
const breadCrumbList = store2.state.app.breadCrumbList;
|
|
67447
67457
|
store2.commit("closeTag", {
|
|
67448
67458
|
$router: router,
|
|
@@ -67558,9 +67568,37 @@ const PERMISSION_TYPE = {
|
|
|
67558
67568
|
function isMenuPermissionType(type) {
|
|
67559
67569
|
return [PERMISSION_TYPE.DIRECTORY, PERMISSION_TYPE.MENU].includes(type);
|
|
67560
67570
|
}
|
|
67571
|
+
function getPermissionType(type) {
|
|
67572
|
+
return Object.keys(PERMISSION_TYPE).find((key) => PERMISSION_TYPE[key] === type);
|
|
67573
|
+
}
|
|
67561
67574
|
function filterMicroPermissionList(microType, permissionList = []) {
|
|
67562
67575
|
return permissionList;
|
|
67563
67576
|
}
|
|
67577
|
+
function permission2Router(list, microType) {
|
|
67578
|
+
if (!list) {
|
|
67579
|
+
return [];
|
|
67580
|
+
}
|
|
67581
|
+
let tempList = [];
|
|
67582
|
+
for (const item2 of list) {
|
|
67583
|
+
tempList.push({
|
|
67584
|
+
path: dealRoutePath(item2.uri, microType),
|
|
67585
|
+
name: item2.permissionValue,
|
|
67586
|
+
meta: {
|
|
67587
|
+
appId: item2.appId,
|
|
67588
|
+
permissionId: item2.permissionId,
|
|
67589
|
+
title: item2.label,
|
|
67590
|
+
icon: item2.icon,
|
|
67591
|
+
crumbs: [
|
|
67592
|
+
{ icon: item2.icon, name: item2.permissionValue, title: item2.label, type: item2.type }
|
|
67593
|
+
],
|
|
67594
|
+
activeName: item2.permissionValue,
|
|
67595
|
+
data: item2
|
|
67596
|
+
},
|
|
67597
|
+
component: item2.permissionValue
|
|
67598
|
+
});
|
|
67599
|
+
}
|
|
67600
|
+
return tempList;
|
|
67601
|
+
}
|
|
67564
67602
|
function listToMenuTree({ list, menuTree, pageNode, parentId, crumbs, root, microType }) {
|
|
67565
67603
|
if (!list)
|
|
67566
67604
|
return;
|
|
@@ -67661,29 +67699,6 @@ function generatorMenuTree(permissionList = []) {
|
|
|
67661
67699
|
});
|
|
67662
67700
|
return menuTree;
|
|
67663
67701
|
}
|
|
67664
|
-
function generatorDynamicRouter(permissionList = [], microType) {
|
|
67665
|
-
const menuTree = [];
|
|
67666
|
-
const pageNode = {
|
|
67667
|
-
path: "/page",
|
|
67668
|
-
name: "page",
|
|
67669
|
-
meta: { hideInMenu: true, notCache: true },
|
|
67670
|
-
component: "EmptyLayoutNotCache",
|
|
67671
|
-
children: []
|
|
67672
|
-
};
|
|
67673
|
-
listToMenuTree({
|
|
67674
|
-
list: permissionList,
|
|
67675
|
-
menuTree,
|
|
67676
|
-
pageNode,
|
|
67677
|
-
parentId: "0",
|
|
67678
|
-
crumbs: [],
|
|
67679
|
-
root: true,
|
|
67680
|
-
microType
|
|
67681
|
-
});
|
|
67682
|
-
if (pageNode.children.length) {
|
|
67683
|
-
menuTree.push(pageNode);
|
|
67684
|
-
}
|
|
67685
|
-
return generator(menuTree);
|
|
67686
|
-
}
|
|
67687
67702
|
function generator(menuData = []) {
|
|
67688
67703
|
for (let item2 of menuData) {
|
|
67689
67704
|
if (item2.component) {
|
|
@@ -67705,20 +67720,51 @@ function generator(menuData = []) {
|
|
|
67705
67720
|
}
|
|
67706
67721
|
return menuData;
|
|
67707
67722
|
}
|
|
67708
|
-
async function renderRoutes({
|
|
67723
|
+
async function renderRoutes({
|
|
67724
|
+
router,
|
|
67725
|
+
store: store2,
|
|
67726
|
+
microType,
|
|
67727
|
+
allowPermissionList,
|
|
67728
|
+
routerOptionsBak,
|
|
67729
|
+
to
|
|
67730
|
+
}) {
|
|
67731
|
+
var _a;
|
|
67709
67732
|
store2.dispatch("getIndexInfo");
|
|
67710
67733
|
await store2.dispatch("getUserInfo");
|
|
67711
67734
|
await store2.dispatch("getAppListData");
|
|
67712
67735
|
const permissionData = await store2.dispatch("getPermissionData");
|
|
67713
67736
|
router.options = _.cloneDeep(routerOptionsBak);
|
|
67714
67737
|
const microPermissionData = filterMicroPermissionList(microType, permissionData);
|
|
67715
|
-
const
|
|
67716
|
-
|
|
67738
|
+
const tempPerList = microPermissionData.filter((item2) => item2.uri.includes(to.path));
|
|
67739
|
+
const perType = getPermissionType(tempPerList[0].type || "");
|
|
67740
|
+
let dynamicRouters = [];
|
|
67741
|
+
dynamicRouters.push({
|
|
67742
|
+
path: "/page",
|
|
67743
|
+
name: "page",
|
|
67744
|
+
meta: { hideInMenu: true, notCache: true },
|
|
67745
|
+
component: "EmptyLayoutNotCache",
|
|
67746
|
+
children: []
|
|
67747
|
+
});
|
|
67748
|
+
if (perType == "PAGE") {
|
|
67749
|
+
dynamicRouters[dynamicRouters.length - 1].children = dynamicRouters[dynamicRouters.length - 1].children.concat(tempPerList);
|
|
67750
|
+
}
|
|
67751
|
+
if (perType == "MENU") {
|
|
67752
|
+
const tempPerId = ((_a = tempPerList[0]) == null ? void 0 : _a.permissionId) || "";
|
|
67753
|
+
const tempChildren = microPermissionData.filter((item2) => item2.pid == tempPerId);
|
|
67754
|
+
dynamicRouters.unshift(...permission2Router(tempPerList, microType));
|
|
67755
|
+
dynamicRouters[dynamicRouters.length - 1].children = permission2Router(
|
|
67756
|
+
dynamicRouters[dynamicRouters.length - 1].children.concat(tempChildren),
|
|
67757
|
+
microType
|
|
67758
|
+
);
|
|
67759
|
+
}
|
|
67760
|
+
console.log("dynamicROuters111", dynamicRouters);
|
|
67717
67761
|
const rootRoute2 = router.options.routes.find((item2) => item2.path === "/");
|
|
67718
|
-
|
|
67762
|
+
const dynamicRouters1 = generator(dynamicRouters);
|
|
67763
|
+
for (const item2 of dynamicRouters1) {
|
|
67719
67764
|
router.addRoute(rootRoute2.name, item2);
|
|
67720
67765
|
rootRoute2.children.push(item2);
|
|
67721
67766
|
}
|
|
67767
|
+
console.log("router after render", router);
|
|
67722
67768
|
const microAllowPermissionList = filterMicroPermissionList(microType, allowPermissionList);
|
|
67723
67769
|
const needAddRoutes = microAllowPermissionList.filter((permission2) => {
|
|
67724
67770
|
return router.options.routes.findIndex((route) => permission2.name === route.name) === -1;
|
|
@@ -67808,7 +67854,8 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
67808
67854
|
store: store2,
|
|
67809
67855
|
microType,
|
|
67810
67856
|
allowPermissionList,
|
|
67811
|
-
routerOptionsBak
|
|
67857
|
+
routerOptionsBak,
|
|
67858
|
+
to
|
|
67812
67859
|
});
|
|
67813
67860
|
next({ ...to, replace: true });
|
|
67814
67861
|
} catch (error) {
|
|
@@ -68097,7 +68144,9 @@ var app = {
|
|
|
68097
68144
|
}
|
|
68098
68145
|
commit2("setPermissionList", permissionList);
|
|
68099
68146
|
commit2("setPermission", permission2);
|
|
68100
|
-
|
|
68147
|
+
if (top == self) {
|
|
68148
|
+
commit2("setMenuTreeList", generatorMenuTree(permissionList));
|
|
68149
|
+
}
|
|
68101
68150
|
return permissionList;
|
|
68102
68151
|
}
|
|
68103
68152
|
try {
|