@mu-cabin/opms-permission 0.9.14 → 0.9.16

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
@@ -872,10 +872,23 @@ var Permission = class {
872
872
  const { obj } = await this.api.queryOrgCustom({
873
873
  orgCodes: missingOrgCodes
874
874
  });
875
- for (const org of obj) {
876
- const orgCode = org.orgCode;
877
- result[orgCode] = org;
878
- cachedOrgMap[orgCode] = org;
875
+ const list = iterateNestedArray(obj, (item) => {
876
+ return {
877
+ label: item.orgShortName,
878
+ value: item.orgCode,
879
+ title: item.orgShortName,
880
+ key: item.orgCode,
881
+ nodeLevel: item.nodeLevel,
882
+ children: item.children,
883
+ disabled: !item.hasPermission,
884
+ orgType: item.orgType,
885
+ orgId: item.orgId
886
+ };
887
+ });
888
+ for (const org of list) {
889
+ const value = org.value;
890
+ result[value] = org;
891
+ cachedOrgMap[value] = org;
879
892
  }
880
893
  this.storage.setItem(USER_ORG_NO_AUTH_KEY, cachedOrgMap, cacheTimeout);
881
894
  } catch (error) {
package/dist/index.d.mts CHANGED
@@ -474,7 +474,7 @@ declare class Permission {
474
474
  force?: boolean;
475
475
  cacheTimeout?: number;
476
476
  }): Promise<{
477
- [orgCode: string]: OrgRecord$1;
477
+ [orgCode: string]: OrgTreeItem;
478
478
  }>;
479
479
  /**
480
480
  * Get current storage version
package/dist/index.d.ts CHANGED
@@ -474,7 +474,7 @@ declare class Permission {
474
474
  force?: boolean;
475
475
  cacheTimeout?: number;
476
476
  }): Promise<{
477
- [orgCode: string]: OrgRecord$1;
477
+ [orgCode: string]: OrgTreeItem;
478
478
  }>;
479
479
  /**
480
480
  * Get current storage version
package/dist/index.mjs CHANGED
@@ -823,10 +823,23 @@ var Permission = class {
823
823
  const { obj } = await this.api.queryOrgCustom({
824
824
  orgCodes: missingOrgCodes
825
825
  });
826
- for (const org of obj) {
827
- const orgCode = org.orgCode;
828
- result[orgCode] = org;
829
- cachedOrgMap[orgCode] = org;
826
+ const list = iterateNestedArray(obj, (item) => {
827
+ return {
828
+ label: item.orgShortName,
829
+ value: item.orgCode,
830
+ title: item.orgShortName,
831
+ key: item.orgCode,
832
+ nodeLevel: item.nodeLevel,
833
+ children: item.children,
834
+ disabled: !item.hasPermission,
835
+ orgType: item.orgType,
836
+ orgId: item.orgId
837
+ };
838
+ });
839
+ for (const org of list) {
840
+ const value = org.value;
841
+ result[value] = org;
842
+ cachedOrgMap[value] = org;
830
843
  }
831
844
  this.storage.setItem(USER_ORG_NO_AUTH_KEY, cachedOrgMap, cacheTimeout);
832
845
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",