@mu-cabin/opms-permission 0.9.26 → 0.9.28
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 +5 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -323,7 +323,11 @@ var filterTreeByOrgCodes = (tree, orgCodes) => {
|
|
|
323
323
|
const shouldDisableNode = (node) => {
|
|
324
324
|
const isTarget = orgCodes.includes(node.value);
|
|
325
325
|
if (!isTarget) return true;
|
|
326
|
-
|
|
326
|
+
const hasDescendants = hasTargetDescendants(node);
|
|
327
|
+
if (hasDescendants) {
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
return node.disabled;
|
|
327
331
|
};
|
|
328
332
|
const buildFilteredTree = (node) => {
|
|
329
333
|
const isTarget = orgCodes.includes(node.value);
|
package/dist/index.d.mts
CHANGED
|
@@ -217,6 +217,7 @@ interface QueryOrgCustomParams {
|
|
|
217
217
|
orgTypes?: OrgType[];
|
|
218
218
|
orgCodes?: string[];
|
|
219
219
|
}
|
|
220
|
+
type CrewStatus = 'NORMAL' | 'STOP' | 'DIMISSION';
|
|
220
221
|
interface SearchUserInfoPageParams {
|
|
221
222
|
pageNum: number;
|
|
222
223
|
pageSize: number;
|
|
@@ -226,6 +227,9 @@ interface SearchUserInfoPageParams {
|
|
|
226
227
|
includeSub?: boolean;
|
|
227
228
|
onlyPrimary?: boolean;
|
|
228
229
|
}
|
|
230
|
+
interface SearchCabinUserInfoPageParams extends SearchUserInfoPageParams {
|
|
231
|
+
status?: CrewStatus[];
|
|
232
|
+
}
|
|
229
233
|
interface QueryUserInfoParams {
|
|
230
234
|
keys: string[];
|
|
231
235
|
queryField: string;
|
|
@@ -490,7 +494,7 @@ declare class Permission {
|
|
|
490
494
|
} | null>;
|
|
491
495
|
queryUserInfoByKeys(params: QueryUserInfoParams): Promise<ApiResponse<OpmsUserInfo[]>>;
|
|
492
496
|
searchUserInfoPage(params: SearchUserInfoPageParams): Promise<ApiResponse<BaseListResponse<OpmsUserInfo[]>>>;
|
|
493
|
-
searchCabinUserInfoPage(params:
|
|
497
|
+
searchCabinUserInfoPage(params: SearchCabinUserInfoPageParams): Promise<ApiResponse<BaseListResponse<CabinUserInfo[]>>>;
|
|
494
498
|
queryCabinUserInfo(params: QueryUserInfoParams): Promise<ApiResponse<CabinUserInfo[]>>;
|
|
495
499
|
queryTotalCompanies(config?: {
|
|
496
500
|
force?: boolean;
|
|
@@ -571,4 +575,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
|
|
|
571
575
|
clientId?: string;
|
|
572
576
|
}): void;
|
|
573
577
|
|
|
574
|
-
export { ApiClient, type ApiResponse, type BaseListResponse, type CabinUserInfo, type ChildOrganization, type CodeSourceType, DataHandler, EnumOrgBindType, EnumOrgQueryMode, EnumOrgQueryScope, EventEmitter, type MenuItem, type OpenIndicatorType, Permission as OpmsPermission, type OpmsUserInfo, type Option, type OrgDirectionType, type OrgRecord, type OrgTreeItem, type OrgType, type PermissionEventListener, type PermissionEventMap, type PermissionEventType, type QueryOrgCustomParams, type QueryUserInfoParams, RESOURCE_KEY, type Resource, type ResourceType, type ResultViewType, type SearchUserInfoPageParams, TOKEN_KEY, USER_INFO_KEY, USER_ORG_KEY, USER_ORG_NO_AUTH_KEY, USER_TOTAL_COMPANY_KEY, type UserInfo, type UserOrgTreeParams, type UserOrganization, type UserRole, jumpToSSOLogin, jumpToSSOLogout };
|
|
578
|
+
export { ApiClient, type ApiResponse, type BaseListResponse, type CabinUserInfo, type ChildOrganization, type CodeSourceType, type CrewStatus, DataHandler, EnumOrgBindType, EnumOrgQueryMode, EnumOrgQueryScope, EventEmitter, type MenuItem, type OpenIndicatorType, Permission as OpmsPermission, type OpmsUserInfo, type Option, type OrgDirectionType, type OrgRecord, type OrgTreeItem, type OrgType, type PermissionEventListener, type PermissionEventMap, type PermissionEventType, type QueryOrgCustomParams, type QueryUserInfoParams, RESOURCE_KEY, type Resource, type ResourceType, type ResultViewType, type SearchCabinUserInfoPageParams, type SearchUserInfoPageParams, TOKEN_KEY, USER_INFO_KEY, USER_ORG_KEY, USER_ORG_NO_AUTH_KEY, USER_TOTAL_COMPANY_KEY, type UserInfo, type UserOrgTreeParams, type UserOrganization, type UserRole, jumpToSSOLogin, jumpToSSOLogout };
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,7 @@ interface QueryOrgCustomParams {
|
|
|
217
217
|
orgTypes?: OrgType[];
|
|
218
218
|
orgCodes?: string[];
|
|
219
219
|
}
|
|
220
|
+
type CrewStatus = 'NORMAL' | 'STOP' | 'DIMISSION';
|
|
220
221
|
interface SearchUserInfoPageParams {
|
|
221
222
|
pageNum: number;
|
|
222
223
|
pageSize: number;
|
|
@@ -226,6 +227,9 @@ interface SearchUserInfoPageParams {
|
|
|
226
227
|
includeSub?: boolean;
|
|
227
228
|
onlyPrimary?: boolean;
|
|
228
229
|
}
|
|
230
|
+
interface SearchCabinUserInfoPageParams extends SearchUserInfoPageParams {
|
|
231
|
+
status?: CrewStatus[];
|
|
232
|
+
}
|
|
229
233
|
interface QueryUserInfoParams {
|
|
230
234
|
keys: string[];
|
|
231
235
|
queryField: string;
|
|
@@ -490,7 +494,7 @@ declare class Permission {
|
|
|
490
494
|
} | null>;
|
|
491
495
|
queryUserInfoByKeys(params: QueryUserInfoParams): Promise<ApiResponse<OpmsUserInfo[]>>;
|
|
492
496
|
searchUserInfoPage(params: SearchUserInfoPageParams): Promise<ApiResponse<BaseListResponse<OpmsUserInfo[]>>>;
|
|
493
|
-
searchCabinUserInfoPage(params:
|
|
497
|
+
searchCabinUserInfoPage(params: SearchCabinUserInfoPageParams): Promise<ApiResponse<BaseListResponse<CabinUserInfo[]>>>;
|
|
494
498
|
queryCabinUserInfo(params: QueryUserInfoParams): Promise<ApiResponse<CabinUserInfo[]>>;
|
|
495
499
|
queryTotalCompanies(config?: {
|
|
496
500
|
force?: boolean;
|
|
@@ -571,4 +575,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
|
|
|
571
575
|
clientId?: string;
|
|
572
576
|
}): void;
|
|
573
577
|
|
|
574
|
-
export { ApiClient, type ApiResponse, type BaseListResponse, type CabinUserInfo, type ChildOrganization, type CodeSourceType, DataHandler, EnumOrgBindType, EnumOrgQueryMode, EnumOrgQueryScope, EventEmitter, type MenuItem, type OpenIndicatorType, Permission as OpmsPermission, type OpmsUserInfo, type Option, type OrgDirectionType, type OrgRecord, type OrgTreeItem, type OrgType, type PermissionEventListener, type PermissionEventMap, type PermissionEventType, type QueryOrgCustomParams, type QueryUserInfoParams, RESOURCE_KEY, type Resource, type ResourceType, type ResultViewType, type SearchUserInfoPageParams, TOKEN_KEY, USER_INFO_KEY, USER_ORG_KEY, USER_ORG_NO_AUTH_KEY, USER_TOTAL_COMPANY_KEY, type UserInfo, type UserOrgTreeParams, type UserOrganization, type UserRole, jumpToSSOLogin, jumpToSSOLogout };
|
|
578
|
+
export { ApiClient, type ApiResponse, type BaseListResponse, type CabinUserInfo, type ChildOrganization, type CodeSourceType, type CrewStatus, DataHandler, EnumOrgBindType, EnumOrgQueryMode, EnumOrgQueryScope, EventEmitter, type MenuItem, type OpenIndicatorType, Permission as OpmsPermission, type OpmsUserInfo, type Option, type OrgDirectionType, type OrgRecord, type OrgTreeItem, type OrgType, type PermissionEventListener, type PermissionEventMap, type PermissionEventType, type QueryOrgCustomParams, type QueryUserInfoParams, RESOURCE_KEY, type Resource, type ResourceType, type ResultViewType, type SearchCabinUserInfoPageParams, type SearchUserInfoPageParams, TOKEN_KEY, USER_INFO_KEY, USER_ORG_KEY, USER_ORG_NO_AUTH_KEY, USER_TOTAL_COMPANY_KEY, type UserInfo, type UserOrgTreeParams, type UserOrganization, type UserRole, jumpToSSOLogin, jumpToSSOLogout };
|
package/dist/index.mjs
CHANGED
|
@@ -273,7 +273,11 @@ var filterTreeByOrgCodes = (tree, orgCodes) => {
|
|
|
273
273
|
const shouldDisableNode = (node) => {
|
|
274
274
|
const isTarget = orgCodes.includes(node.value);
|
|
275
275
|
if (!isTarget) return true;
|
|
276
|
-
|
|
276
|
+
const hasDescendants = hasTargetDescendants(node);
|
|
277
|
+
if (hasDescendants) {
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
return node.disabled;
|
|
277
281
|
};
|
|
278
282
|
const buildFilteredTree = (node) => {
|
|
279
283
|
const isTarget = orgCodes.includes(node.value);
|