@mu-cabin/opms-permission 0.8.10 → 0.8.12

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
@@ -298,6 +298,9 @@ var DataHandler = {
298
298
  // 获取菜单数据, 包含菜单列表和菜单map
299
299
  getMenuData(resources) {
300
300
  return createMenuList(resources);
301
+ },
302
+ getFirstUnitOrgCode(orgTree) {
303
+ return findFirstEnableCode([orgTree]) ?? "";
301
304
  }
302
305
  };
303
306
  var Permission = class {
package/dist/index.d.mts CHANGED
@@ -49,11 +49,6 @@ interface Option {
49
49
  label: string;
50
50
  value: string;
51
51
  }
52
-
53
- interface PermissionOptions {
54
- systemId: string;
55
- baseUrl: string;
56
- }
57
52
  interface OrgTreeItem {
58
53
  label: string;
59
54
  value: string;
@@ -65,6 +60,11 @@ interface OrgTreeItem {
65
60
  orgType: string;
66
61
  orgId: string;
67
62
  }
63
+
64
+ interface PermissionOptions {
65
+ systemId: string;
66
+ baseUrl: string;
67
+ }
68
68
  /**
69
69
  * 组织树处理工具
70
70
  */
@@ -87,6 +87,7 @@ declare const DataHandler: {
87
87
  [path: string]: MenuItem;
88
88
  };
89
89
  };
90
+ getFirstUnitOrgCode(orgTree: OrgTreeItem): string;
90
91
  };
91
92
  declare class Permission {
92
93
  private _userInfo;
@@ -178,4 +179,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
178
179
  clientId?: string;
179
180
  }): void;
180
181
 
181
- export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
182
+ 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,6 @@ interface Option {
49
49
  label: string;
50
50
  value: string;
51
51
  }
52
-
53
- interface PermissionOptions {
54
- systemId: string;
55
- baseUrl: string;
56
- }
57
52
  interface OrgTreeItem {
58
53
  label: string;
59
54
  value: string;
@@ -65,6 +60,11 @@ interface OrgTreeItem {
65
60
  orgType: string;
66
61
  orgId: string;
67
62
  }
63
+
64
+ interface PermissionOptions {
65
+ systemId: string;
66
+ baseUrl: string;
67
+ }
68
68
  /**
69
69
  * 组织树处理工具
70
70
  */
@@ -87,6 +87,7 @@ declare const DataHandler: {
87
87
  [path: string]: MenuItem;
88
88
  };
89
89
  };
90
+ getFirstUnitOrgCode(orgTree: OrgTreeItem): string;
90
91
  };
91
92
  declare class Permission {
92
93
  private _userInfo;
@@ -178,4 +179,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
178
179
  clientId?: string;
179
180
  }): void;
180
181
 
181
- export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
182
+ export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
package/dist/index.mjs CHANGED
@@ -259,6 +259,9 @@ var DataHandler = {
259
259
  // 获取菜单数据, 包含菜单列表和菜单map
260
260
  getMenuData(resources) {
261
261
  return createMenuList(resources);
262
+ },
263
+ getFirstUnitOrgCode(orgTree) {
264
+ return findFirstEnableCode([orgTree]) ?? "";
262
265
  }
263
266
  };
264
267
  var Permission = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.8.10",
3
+ "version": "0.8.12",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",