@mu-cabin/opms-permission 0.8.32 → 0.8.33

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/dist/index.cjs CHANGED
@@ -315,6 +315,7 @@ var DataHandler = {
315
315
  };
316
316
  });
317
317
  },
318
+ iterateNestedArray,
318
319
  // 获取单位组织
319
320
  // getUnitOptions(orgTree: OrgTreeItem[]): Option[] {
320
321
  // if (!orgTree) return [];
package/dist/index.d.mts CHANGED
@@ -81,6 +81,13 @@ interface OrgRecord$1 {
81
81
  systemList: any[];
82
82
  }
83
83
 
84
+ /**
85
+ * 遍历嵌套数组并返回处理后的值
86
+ * @param items 数组
87
+ * @param callback 回调函数
88
+ * @returns 处理后的数组
89
+ */
90
+ declare function iterateNestedArray<T = any>(items: T[], callback: (item: T, parent?: T) => T): T[];
84
91
  declare function findFirstEnableNode(data: OrgTreeItem[]): OrgTreeItem | null;
85
92
 
86
93
  interface OrgRecord {
@@ -102,6 +109,7 @@ interface PermissionOptions {
102
109
  */
103
110
  declare const DataHandler: {
104
111
  iterateOrgTree(orgTree: OrgRecord[]): OrgTreeItem[];
112
+ iterateNestedArray: typeof iterateNestedArray;
105
113
  getAllUnitOptions(orgTree: OrgTreeItem[]): Option[];
106
114
  getCompaniesOptions(orgTree: OrgTreeItem[], hasRootAuth: boolean): Option[];
107
115
  topLevelUnitOrgCodes(orgTree: OrgTreeItem[]): string[];
package/dist/index.d.ts CHANGED
@@ -81,6 +81,13 @@ interface OrgRecord$1 {
81
81
  systemList: any[];
82
82
  }
83
83
 
84
+ /**
85
+ * 遍历嵌套数组并返回处理后的值
86
+ * @param items 数组
87
+ * @param callback 回调函数
88
+ * @returns 处理后的数组
89
+ */
90
+ declare function iterateNestedArray<T = any>(items: T[], callback: (item: T, parent?: T) => T): T[];
84
91
  declare function findFirstEnableNode(data: OrgTreeItem[]): OrgTreeItem | null;
85
92
 
86
93
  interface OrgRecord {
@@ -102,6 +109,7 @@ interface PermissionOptions {
102
109
  */
103
110
  declare const DataHandler: {
104
111
  iterateOrgTree(orgTree: OrgRecord[]): OrgTreeItem[];
112
+ iterateNestedArray: typeof iterateNestedArray;
105
113
  getAllUnitOptions(orgTree: OrgTreeItem[]): Option[];
106
114
  getCompaniesOptions(orgTree: OrgTreeItem[], hasRootAuth: boolean): Option[];
107
115
  topLevelUnitOrgCodes(orgTree: OrgTreeItem[]): string[];
package/dist/index.mjs CHANGED
@@ -276,6 +276,7 @@ var DataHandler = {
276
276
  };
277
277
  });
278
278
  },
279
+ iterateNestedArray,
279
280
  // 获取单位组织
280
281
  // getUnitOptions(orgTree: OrgTreeItem[]): Option[] {
281
282
  // if (!orgTree) return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.8.32",
3
+ "version": "0.8.33",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",