@mu-cabin/opms-permission 0.8.9 → 0.8.11

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
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ DataHandler: () => DataHandler,
33
34
  OpmsPermission: () => Permission,
34
35
  jumpToSSOLogin: () => jumpToSSOLogin,
35
36
  jumpToSSOLogout: () => jumpToSSOLogout
@@ -573,6 +574,7 @@ function jumpToSSOLogout({
573
574
  }
574
575
  // Annotate the CommonJS export names for ESM import in node:
575
576
  0 && (module.exports = {
577
+ DataHandler,
576
578
  OpmsPermission,
577
579
  jumpToSSOLogin,
578
580
  jumpToSSOLogout
package/dist/index.d.mts CHANGED
@@ -49,11 +49,45 @@ interface Option {
49
49
  label: string;
50
50
  value: string;
51
51
  }
52
+ interface OrgTreeItem {
53
+ label: string;
54
+ value: string;
55
+ title: string;
56
+ key: string;
57
+ nodeLevel: number;
58
+ children: OrgTreeItem[];
59
+ disabled: boolean;
60
+ orgType: string;
61
+ orgId: string;
62
+ }
52
63
 
53
64
  interface PermissionOptions {
54
65
  systemId: string;
55
66
  baseUrl: string;
56
67
  }
68
+ /**
69
+ * 组织树处理工具
70
+ */
71
+ declare const DataHandler: {
72
+ getUnitOptions(orgTree: OrgTreeItem): Option[];
73
+ getAllUnitOptions(orgTree: OrgTreeItem): Option[];
74
+ getCompaniesOptions(orgTree: OrgTreeItem, hasRootAuth: boolean): Option[];
75
+ topLevelUnitOrgCodes(orgTree: OrgTreeItem): string[];
76
+ getResourceData(resources: Resource[]): {
77
+ resourceMap: {
78
+ [path: string]: Resource;
79
+ };
80
+ widgetMap: {
81
+ [path: string]: Resource;
82
+ };
83
+ };
84
+ getMenuData(resources: Resource[]): {
85
+ menuList: MenuItem[];
86
+ menuMap: {
87
+ [path: string]: MenuItem;
88
+ };
89
+ };
90
+ };
57
91
  declare class Permission {
58
92
  private _userInfo;
59
93
  private _orgTree;
@@ -144,4 +178,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
144
178
  clientId?: string;
145
179
  }): void;
146
180
 
147
- export { type MenuItem, Permission as OpmsPermission, type Option, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
181
+ export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
package/dist/index.d.ts CHANGED
@@ -49,11 +49,45 @@ interface Option {
49
49
  label: string;
50
50
  value: string;
51
51
  }
52
+ interface OrgTreeItem {
53
+ label: string;
54
+ value: string;
55
+ title: string;
56
+ key: string;
57
+ nodeLevel: number;
58
+ children: OrgTreeItem[];
59
+ disabled: boolean;
60
+ orgType: string;
61
+ orgId: string;
62
+ }
52
63
 
53
64
  interface PermissionOptions {
54
65
  systemId: string;
55
66
  baseUrl: string;
56
67
  }
68
+ /**
69
+ * 组织树处理工具
70
+ */
71
+ declare const DataHandler: {
72
+ getUnitOptions(orgTree: OrgTreeItem): Option[];
73
+ getAllUnitOptions(orgTree: OrgTreeItem): Option[];
74
+ getCompaniesOptions(orgTree: OrgTreeItem, hasRootAuth: boolean): Option[];
75
+ topLevelUnitOrgCodes(orgTree: OrgTreeItem): string[];
76
+ getResourceData(resources: Resource[]): {
77
+ resourceMap: {
78
+ [path: string]: Resource;
79
+ };
80
+ widgetMap: {
81
+ [path: string]: Resource;
82
+ };
83
+ };
84
+ getMenuData(resources: Resource[]): {
85
+ menuList: MenuItem[];
86
+ menuMap: {
87
+ [path: string]: MenuItem;
88
+ };
89
+ };
90
+ };
57
91
  declare class Permission {
58
92
  private _userInfo;
59
93
  private _orgTree;
@@ -144,4 +178,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
144
178
  clientId?: string;
145
179
  }): void;
146
180
 
147
- export { type MenuItem, Permission as OpmsPermission, type Option, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
181
+ export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
package/dist/index.mjs CHANGED
@@ -534,6 +534,7 @@ function jumpToSSOLogout({
534
534
  window.location.href = logoutUrl.toString();
535
535
  }
536
536
  export {
537
+ DataHandler,
537
538
  Permission as OpmsPermission,
538
539
  jumpToSSOLogin,
539
540
  jumpToSSOLogout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",