com-angel-authorization 1.0.27 → 1.0.29
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/README.md +2 -0
- package/dist/index.cjs +24 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +56 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +8 -1
- package/dist/react/index.d.ts +8 -1
- package/dist/react/index.js +57 -5
- package/dist/react/index.js.map +1 -1
- package/dist/vue/index.cjs +57 -5
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +8 -1
- package/dist/vue/index.d.ts +8 -1
- package/dist/vue/index.js +57 -5
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/vue/index.d.cts
CHANGED
|
@@ -233,6 +233,11 @@ type AuthorizationResourceListResult = {
|
|
|
233
233
|
hasPreviousPage: boolean;
|
|
234
234
|
hasNextPage: boolean;
|
|
235
235
|
};
|
|
236
|
+
type MenuPermissionPoint = {
|
|
237
|
+
resourceId?: string;
|
|
238
|
+
name: string;
|
|
239
|
+
identification?: string;
|
|
240
|
+
};
|
|
236
241
|
type MenuResource = {
|
|
237
242
|
resourceId: string;
|
|
238
243
|
/** 上级菜单 ID;无上级时为 null */
|
|
@@ -249,6 +254,8 @@ type MenuResource = {
|
|
|
249
254
|
name: string;
|
|
250
255
|
identification: string;
|
|
251
256
|
permissionPointIds: string[];
|
|
257
|
+
/** 关联权限点对象(列表展示优先取其中 name) */
|
|
258
|
+
permissionPoints?: MenuPermissionPoint[];
|
|
252
259
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
253
260
|
permissionPointNames?: string[];
|
|
254
261
|
status: ResourceStatus;
|
|
@@ -803,4 +810,4 @@ declare const snowyflake: ConfigurableSnowflake;
|
|
|
803
810
|
declare function getAppClientId(): string;
|
|
804
811
|
declare function getDeviceWorkerId(): string;
|
|
805
812
|
|
|
806
|
-
export { type ApiResourceType, type AuthorizationResource, type AuthorizationResourceApi, type AuthorizationResourceFormValues, type AuthorizationResourceListResult, Can, type CheckOptions, type CreateAuthorizationResourceBody, type CreateDefaultResourceRequestOptions, type CreateMenuResourceBody, type CreateSystemRoleBody, type CreateSystemUserBody, type FetchAuthorizationResourcesParams, type FetchMenuResourcesParams, type FetchSystemGroupsParams, type FetchSystemRoleOptionsParams, type FetchSystemRolesParams, type FetchSystemUsersParams, type HttpMethod, type ListPaginationParams, type ListPaginationResult, MENU_LEAF_NO, MENU_LEAF_YES, MENU_LIST_TYPE_PARAM, MENU_TYPE_BUTTON, MENU_TYPE_LABEL, MENU_TYPE_MENU, MENU_TYPE_OPTIONS, MENU_TYPE_PAGE, MENU_VISIBILITY_OPTIONS, type MatchMode, MenuManager, type MenuResource, type MenuResourceApi, type MenuResourceFormValues, type MenuResourceListResult, type MenuResourceType, PERMISSION_STORE_KEY, type PageDirection, type PermissionChecker, type PermissionCode, type PermissionDirectiveValue, type PermissionListener, type PermissionPluginOptions, type PermissionState, PermissionStore, type PermissionStoreAPI, RESOURCE_PRIVATE_OPTIONS, RESOURCE_STATUS_DISABLED, RESOURCE_STATUS_ENABLED, RESOURCE_STATUS_OPTIONS, RESOURCE_TYPE_API, ROOT_MENU_DEPTH, ROOT_PARENT_ID, type ResourceHttpRequest, ResourceManager, type ResourceRequestOptions, type ResourceStatus, type ResourceType, type RoleCode, RoleManager, type RolePermissionTreeNode, type RolePermissionsResult, SYSTEM_ADMIN_DEFAULT_KEY, SYSTEM_ADMIN_MENU, type SaveRolePermissionsBody, SystemAdmin, type SystemAdminMenuGroup, type SystemAdminMenuKey, type SystemAdminSubMenu, type SystemGroupOption, type SystemRole, type SystemRoleApi, type SystemRoleFormValues, type SystemRoleListResult, type SystemRoleOption, type SystemUser, type SystemUserApi, type SystemUserFormValues, type SystemUserListResult, type UpdateAuthorizationResourceBody, type UpdateMenuResourceBody, type UpdateSystemRoleBody, type UpdateSystemUserBody, type UsePermissionResult, UserManager, appendQueryParam, buildCreateBody, buildCreateMenuBody, buildCreateRoleBody, buildCreateUserBody, buildPermissionTreeIndex, buildSavePermissionsBody, buildUpdateBody, buildUpdateMenuBody, buildUpdateRoleBody, buildUpdateUserBody, collectTreeResourceIds, countCheckedDescendants, createAuthorizationResourceApi, createDefaultResourceRequest, createMenuResourceApi, createPermissionPlugin, createPermissionStore, createSystemRoleApi, createSystemUserApi, createVPermission, extractPagination, extractRecords, getAppClientId, getDeviceWorkerId, hasCheckedDescendant, isMenuLeaf, isPermissionNodeIndeterminate, mapAuthorizationResource, mapMenuResource, mapPermissionTreeNode, mapRolePermissions, mapSystemGroupOption, mapSystemRole, mapSystemRoleOption, mapSystemUser, resolveMenuDepth, snowyflake, togglePermissionCheck, useHasPermission, useHasRole, usePermission, validateUsername };
|
|
813
|
+
export { type ApiResourceType, type AuthorizationResource, type AuthorizationResourceApi, type AuthorizationResourceFormValues, type AuthorizationResourceListResult, Can, type CheckOptions, type CreateAuthorizationResourceBody, type CreateDefaultResourceRequestOptions, type CreateMenuResourceBody, type CreateSystemRoleBody, type CreateSystemUserBody, type FetchAuthorizationResourcesParams, type FetchMenuResourcesParams, type FetchSystemGroupsParams, type FetchSystemRoleOptionsParams, type FetchSystemRolesParams, type FetchSystemUsersParams, type HttpMethod, type ListPaginationParams, type ListPaginationResult, MENU_LEAF_NO, MENU_LEAF_YES, MENU_LIST_TYPE_PARAM, MENU_TYPE_BUTTON, MENU_TYPE_LABEL, MENU_TYPE_MENU, MENU_TYPE_OPTIONS, MENU_TYPE_PAGE, MENU_VISIBILITY_OPTIONS, type MatchMode, MenuManager, type MenuPermissionPoint, type MenuResource, type MenuResourceApi, type MenuResourceFormValues, type MenuResourceListResult, type MenuResourceType, PERMISSION_STORE_KEY, type PageDirection, type PermissionChecker, type PermissionCode, type PermissionDirectiveValue, type PermissionListener, type PermissionPluginOptions, type PermissionState, PermissionStore, type PermissionStoreAPI, RESOURCE_PRIVATE_OPTIONS, RESOURCE_STATUS_DISABLED, RESOURCE_STATUS_ENABLED, RESOURCE_STATUS_OPTIONS, RESOURCE_TYPE_API, ROOT_MENU_DEPTH, ROOT_PARENT_ID, type ResourceHttpRequest, ResourceManager, type ResourceRequestOptions, type ResourceStatus, type ResourceType, type RoleCode, RoleManager, type RolePermissionTreeNode, type RolePermissionsResult, SYSTEM_ADMIN_DEFAULT_KEY, SYSTEM_ADMIN_MENU, type SaveRolePermissionsBody, SystemAdmin, type SystemAdminMenuGroup, type SystemAdminMenuKey, type SystemAdminSubMenu, type SystemGroupOption, type SystemRole, type SystemRoleApi, type SystemRoleFormValues, type SystemRoleListResult, type SystemRoleOption, type SystemUser, type SystemUserApi, type SystemUserFormValues, type SystemUserListResult, type UpdateAuthorizationResourceBody, type UpdateMenuResourceBody, type UpdateSystemRoleBody, type UpdateSystemUserBody, type UsePermissionResult, UserManager, appendQueryParam, buildCreateBody, buildCreateMenuBody, buildCreateRoleBody, buildCreateUserBody, buildPermissionTreeIndex, buildSavePermissionsBody, buildUpdateBody, buildUpdateMenuBody, buildUpdateRoleBody, buildUpdateUserBody, collectTreeResourceIds, countCheckedDescendants, createAuthorizationResourceApi, createDefaultResourceRequest, createMenuResourceApi, createPermissionPlugin, createPermissionStore, createSystemRoleApi, createSystemUserApi, createVPermission, extractPagination, extractRecords, getAppClientId, getDeviceWorkerId, hasCheckedDescendant, isMenuLeaf, isPermissionNodeIndeterminate, mapAuthorizationResource, mapMenuResource, mapPermissionTreeNode, mapRolePermissions, mapSystemGroupOption, mapSystemRole, mapSystemRoleOption, mapSystemUser, resolveMenuDepth, snowyflake, togglePermissionCheck, useHasPermission, useHasRole, usePermission, validateUsername };
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -233,6 +233,11 @@ type AuthorizationResourceListResult = {
|
|
|
233
233
|
hasPreviousPage: boolean;
|
|
234
234
|
hasNextPage: boolean;
|
|
235
235
|
};
|
|
236
|
+
type MenuPermissionPoint = {
|
|
237
|
+
resourceId?: string;
|
|
238
|
+
name: string;
|
|
239
|
+
identification?: string;
|
|
240
|
+
};
|
|
236
241
|
type MenuResource = {
|
|
237
242
|
resourceId: string;
|
|
238
243
|
/** 上级菜单 ID;无上级时为 null */
|
|
@@ -249,6 +254,8 @@ type MenuResource = {
|
|
|
249
254
|
name: string;
|
|
250
255
|
identification: string;
|
|
251
256
|
permissionPointIds: string[];
|
|
257
|
+
/** 关联权限点对象(列表展示优先取其中 name) */
|
|
258
|
+
permissionPoints?: MenuPermissionPoint[];
|
|
252
259
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
253
260
|
permissionPointNames?: string[];
|
|
254
261
|
status: ResourceStatus;
|
|
@@ -803,4 +810,4 @@ declare const snowyflake: ConfigurableSnowflake;
|
|
|
803
810
|
declare function getAppClientId(): string;
|
|
804
811
|
declare function getDeviceWorkerId(): string;
|
|
805
812
|
|
|
806
|
-
export { type ApiResourceType, type AuthorizationResource, type AuthorizationResourceApi, type AuthorizationResourceFormValues, type AuthorizationResourceListResult, Can, type CheckOptions, type CreateAuthorizationResourceBody, type CreateDefaultResourceRequestOptions, type CreateMenuResourceBody, type CreateSystemRoleBody, type CreateSystemUserBody, type FetchAuthorizationResourcesParams, type FetchMenuResourcesParams, type FetchSystemGroupsParams, type FetchSystemRoleOptionsParams, type FetchSystemRolesParams, type FetchSystemUsersParams, type HttpMethod, type ListPaginationParams, type ListPaginationResult, MENU_LEAF_NO, MENU_LEAF_YES, MENU_LIST_TYPE_PARAM, MENU_TYPE_BUTTON, MENU_TYPE_LABEL, MENU_TYPE_MENU, MENU_TYPE_OPTIONS, MENU_TYPE_PAGE, MENU_VISIBILITY_OPTIONS, type MatchMode, MenuManager, type MenuResource, type MenuResourceApi, type MenuResourceFormValues, type MenuResourceListResult, type MenuResourceType, PERMISSION_STORE_KEY, type PageDirection, type PermissionChecker, type PermissionCode, type PermissionDirectiveValue, type PermissionListener, type PermissionPluginOptions, type PermissionState, PermissionStore, type PermissionStoreAPI, RESOURCE_PRIVATE_OPTIONS, RESOURCE_STATUS_DISABLED, RESOURCE_STATUS_ENABLED, RESOURCE_STATUS_OPTIONS, RESOURCE_TYPE_API, ROOT_MENU_DEPTH, ROOT_PARENT_ID, type ResourceHttpRequest, ResourceManager, type ResourceRequestOptions, type ResourceStatus, type ResourceType, type RoleCode, RoleManager, type RolePermissionTreeNode, type RolePermissionsResult, SYSTEM_ADMIN_DEFAULT_KEY, SYSTEM_ADMIN_MENU, type SaveRolePermissionsBody, SystemAdmin, type SystemAdminMenuGroup, type SystemAdminMenuKey, type SystemAdminSubMenu, type SystemGroupOption, type SystemRole, type SystemRoleApi, type SystemRoleFormValues, type SystemRoleListResult, type SystemRoleOption, type SystemUser, type SystemUserApi, type SystemUserFormValues, type SystemUserListResult, type UpdateAuthorizationResourceBody, type UpdateMenuResourceBody, type UpdateSystemRoleBody, type UpdateSystemUserBody, type UsePermissionResult, UserManager, appendQueryParam, buildCreateBody, buildCreateMenuBody, buildCreateRoleBody, buildCreateUserBody, buildPermissionTreeIndex, buildSavePermissionsBody, buildUpdateBody, buildUpdateMenuBody, buildUpdateRoleBody, buildUpdateUserBody, collectTreeResourceIds, countCheckedDescendants, createAuthorizationResourceApi, createDefaultResourceRequest, createMenuResourceApi, createPermissionPlugin, createPermissionStore, createSystemRoleApi, createSystemUserApi, createVPermission, extractPagination, extractRecords, getAppClientId, getDeviceWorkerId, hasCheckedDescendant, isMenuLeaf, isPermissionNodeIndeterminate, mapAuthorizationResource, mapMenuResource, mapPermissionTreeNode, mapRolePermissions, mapSystemGroupOption, mapSystemRole, mapSystemRoleOption, mapSystemUser, resolveMenuDepth, snowyflake, togglePermissionCheck, useHasPermission, useHasRole, usePermission, validateUsername };
|
|
813
|
+
export { type ApiResourceType, type AuthorizationResource, type AuthorizationResourceApi, type AuthorizationResourceFormValues, type AuthorizationResourceListResult, Can, type CheckOptions, type CreateAuthorizationResourceBody, type CreateDefaultResourceRequestOptions, type CreateMenuResourceBody, type CreateSystemRoleBody, type CreateSystemUserBody, type FetchAuthorizationResourcesParams, type FetchMenuResourcesParams, type FetchSystemGroupsParams, type FetchSystemRoleOptionsParams, type FetchSystemRolesParams, type FetchSystemUsersParams, type HttpMethod, type ListPaginationParams, type ListPaginationResult, MENU_LEAF_NO, MENU_LEAF_YES, MENU_LIST_TYPE_PARAM, MENU_TYPE_BUTTON, MENU_TYPE_LABEL, MENU_TYPE_MENU, MENU_TYPE_OPTIONS, MENU_TYPE_PAGE, MENU_VISIBILITY_OPTIONS, type MatchMode, MenuManager, type MenuPermissionPoint, type MenuResource, type MenuResourceApi, type MenuResourceFormValues, type MenuResourceListResult, type MenuResourceType, PERMISSION_STORE_KEY, type PageDirection, type PermissionChecker, type PermissionCode, type PermissionDirectiveValue, type PermissionListener, type PermissionPluginOptions, type PermissionState, PermissionStore, type PermissionStoreAPI, RESOURCE_PRIVATE_OPTIONS, RESOURCE_STATUS_DISABLED, RESOURCE_STATUS_ENABLED, RESOURCE_STATUS_OPTIONS, RESOURCE_TYPE_API, ROOT_MENU_DEPTH, ROOT_PARENT_ID, type ResourceHttpRequest, ResourceManager, type ResourceRequestOptions, type ResourceStatus, type ResourceType, type RoleCode, RoleManager, type RolePermissionTreeNode, type RolePermissionsResult, SYSTEM_ADMIN_DEFAULT_KEY, SYSTEM_ADMIN_MENU, type SaveRolePermissionsBody, SystemAdmin, type SystemAdminMenuGroup, type SystemAdminMenuKey, type SystemAdminSubMenu, type SystemGroupOption, type SystemRole, type SystemRoleApi, type SystemRoleFormValues, type SystemRoleListResult, type SystemRoleOption, type SystemUser, type SystemUserApi, type SystemUserFormValues, type SystemUserListResult, type UpdateAuthorizationResourceBody, type UpdateMenuResourceBody, type UpdateSystemRoleBody, type UpdateSystemUserBody, type UsePermissionResult, UserManager, appendQueryParam, buildCreateBody, buildCreateMenuBody, buildCreateRoleBody, buildCreateUserBody, buildPermissionTreeIndex, buildSavePermissionsBody, buildUpdateBody, buildUpdateMenuBody, buildUpdateRoleBody, buildUpdateUserBody, collectTreeResourceIds, countCheckedDescendants, createAuthorizationResourceApi, createDefaultResourceRequest, createMenuResourceApi, createPermissionPlugin, createPermissionStore, createSystemRoleApi, createSystemUserApi, createVPermission, extractPagination, extractRecords, getAppClientId, getDeviceWorkerId, hasCheckedDescendant, isMenuLeaf, isPermissionNodeIndeterminate, mapAuthorizationResource, mapMenuResource, mapPermissionTreeNode, mapRolePermissions, mapSystemGroupOption, mapSystemRole, mapSystemRoleOption, mapSystemUser, resolveMenuDepth, snowyflake, togglePermissionCheck, useHasPermission, useHasRole, usePermission, validateUsername };
|
package/dist/vue/index.js
CHANGED
|
@@ -502,6 +502,23 @@ function toStringArray(value) {
|
|
|
502
502
|
}
|
|
503
503
|
return [];
|
|
504
504
|
}
|
|
505
|
+
function mapMenuPermissionPoints(value) {
|
|
506
|
+
if (!Array.isArray(value)) return void 0;
|
|
507
|
+
const points = value.map((item) => {
|
|
508
|
+
if (!item || typeof item !== "object") return null;
|
|
509
|
+
const row = item;
|
|
510
|
+
const name = String(row.name ?? "").trim();
|
|
511
|
+
if (!name) return null;
|
|
512
|
+
const resourceId = row.resourceId ?? row.resource_id ?? row.id;
|
|
513
|
+
const identification = row.identification ?? row.identity;
|
|
514
|
+
return {
|
|
515
|
+
...resourceId !== void 0 && resourceId !== null && resourceId !== "" ? { resourceId: String(resourceId) } : {},
|
|
516
|
+
name,
|
|
517
|
+
...identification !== void 0 && identification !== null && identification !== "" ? { identification: String(identification) } : {}
|
|
518
|
+
};
|
|
519
|
+
}).filter((item) => item !== null);
|
|
520
|
+
return points.length ? points : void 0;
|
|
521
|
+
}
|
|
505
522
|
function toMenuType(value) {
|
|
506
523
|
const v = String(value ?? "").toLowerCase();
|
|
507
524
|
if (v === MENU_TYPE_PAGE || v === MENU_TYPE_MENU || v === MENU_TYPE_BUTTON) {
|
|
@@ -529,11 +546,14 @@ function mapMenuResource(item) {
|
|
|
529
546
|
const row = item;
|
|
530
547
|
const resourceId = row.resourceId ?? row.resource_id ?? row.id;
|
|
531
548
|
if (resourceId === void 0 || resourceId === null || resourceId === "") return null;
|
|
549
|
+
const permissionPoints = mapMenuPermissionPoints(
|
|
550
|
+
row.permissionPoints ?? row.permission_points
|
|
551
|
+
);
|
|
532
552
|
const permissionPointIds = toStringArray(
|
|
533
|
-
row.permissionPointIds ?? row.permission_point_ids ??
|
|
553
|
+
row.permissionPointIds ?? row.permission_point_ids ?? (permissionPoints?.length ? permissionPoints.map((p) => p.resourceId).filter(Boolean) : void 0) ?? row.permissions
|
|
534
554
|
);
|
|
535
555
|
const permissionNamesRaw = row.permissionPointNames ?? row.permission_point_names ?? row.permissionNames;
|
|
536
|
-
const permissionPointNames = Array.isArray(permissionNamesRaw) ? permissionNamesRaw.map((n) => String(n ?? "")).filter(Boolean) :
|
|
556
|
+
const permissionPointNames = Array.isArray(permissionNamesRaw) ? permissionNamesRaw.map((n) => String(n ?? "")).filter(Boolean) : permissionPoints?.map((p) => p.name).filter(Boolean);
|
|
537
557
|
const rawParentId = row.parentId ?? row.parent_id ?? (row.parent && typeof row.parent === "object" ? row.parent.resourceId ?? row.parent.resource_id ?? row.parent.id : void 0);
|
|
538
558
|
const parentId = rawParentId === void 0 || rawParentId === null || rawParentId === "" || String(rawParentId) === "0" ? null : String(rawParentId);
|
|
539
559
|
const rawDepth = row.depth;
|
|
@@ -553,7 +573,8 @@ function mapMenuResource(item) {
|
|
|
553
573
|
name: String(row.name ?? ""),
|
|
554
574
|
identification: String(row.identification ?? row.identity ?? row.path ?? ""),
|
|
555
575
|
permissionPointIds,
|
|
556
|
-
|
|
576
|
+
permissionPoints,
|
|
577
|
+
permissionPointNames: permissionPointNames && permissionPointNames.length ? permissionPointNames : void 0,
|
|
557
578
|
status: toResourceStatus(row.status),
|
|
558
579
|
sort
|
|
559
580
|
};
|
|
@@ -1761,6 +1782,7 @@ var MenuManager = defineComponent3({
|
|
|
1761
1782
|
const saving = ref2(false);
|
|
1762
1783
|
const deletingRow = ref2(null);
|
|
1763
1784
|
const deleting = ref2(false);
|
|
1785
|
+
const permissionKeyword = ref2("");
|
|
1764
1786
|
const permissionNameMap = computed3(() => {
|
|
1765
1787
|
const map = /* @__PURE__ */ new Map();
|
|
1766
1788
|
permissionPoints.value.forEach(
|
|
@@ -1768,6 +1790,13 @@ var MenuManager = defineComponent3({
|
|
|
1768
1790
|
);
|
|
1769
1791
|
return map;
|
|
1770
1792
|
});
|
|
1793
|
+
const filteredPermissionPoints = computed3(() => {
|
|
1794
|
+
const kw = permissionKeyword.value.trim().toLowerCase();
|
|
1795
|
+
if (!kw) return permissionPoints.value;
|
|
1796
|
+
return permissionPoints.value.filter(
|
|
1797
|
+
(p) => p.name.toLowerCase().includes(kw) || p.identification.toLowerCase().includes(kw)
|
|
1798
|
+
);
|
|
1799
|
+
});
|
|
1771
1800
|
const allKnownMenus = computed3(() => {
|
|
1772
1801
|
const map = /* @__PURE__ */ new Map();
|
|
1773
1802
|
records.value.forEach((row) => map.set(row.resourceId, row));
|
|
@@ -1873,6 +1902,7 @@ var MenuManager = defineComponent3({
|
|
|
1873
1902
|
}
|
|
1874
1903
|
function openCreate(parent) {
|
|
1875
1904
|
editing.value = null;
|
|
1905
|
+
permissionKeyword.value = "";
|
|
1876
1906
|
if (parent) {
|
|
1877
1907
|
Object.assign(form, {
|
|
1878
1908
|
...emptyForm2(),
|
|
@@ -1888,6 +1918,7 @@ var MenuManager = defineComponent3({
|
|
|
1888
1918
|
function openEdit(row) {
|
|
1889
1919
|
const parentId = resolveRowParentId(row);
|
|
1890
1920
|
editing.value = row;
|
|
1921
|
+
permissionKeyword.value = "";
|
|
1891
1922
|
Object.assign(form, {
|
|
1892
1923
|
parentId,
|
|
1893
1924
|
depth: row.depth > 0 ? row.depth : resolveMenuDepth(parentId, allKnownMenus.value),
|
|
@@ -1902,7 +1933,10 @@ var MenuManager = defineComponent3({
|
|
|
1902
1933
|
void loadPermissionPoints();
|
|
1903
1934
|
}
|
|
1904
1935
|
function closeDialog() {
|
|
1905
|
-
if (!saving.value)
|
|
1936
|
+
if (!saving.value) {
|
|
1937
|
+
dialogOpen.value = false;
|
|
1938
|
+
permissionKeyword.value = "";
|
|
1939
|
+
}
|
|
1906
1940
|
}
|
|
1907
1941
|
async function handleSubmit(event) {
|
|
1908
1942
|
event.preventDefault();
|
|
@@ -1951,6 +1985,9 @@ var MenuManager = defineComponent3({
|
|
|
1951
1985
|
form.permissionPointIds = exists ? form.permissionPointIds.filter((x) => x !== id) : [...form.permissionPointIds, id];
|
|
1952
1986
|
}
|
|
1953
1987
|
function renderPermissionLabels(row) {
|
|
1988
|
+
if (row.permissionPoints?.length) {
|
|
1989
|
+
return row.permissionPoints.map((p) => p.name).filter(Boolean).join("\u3001") || "\u2014";
|
|
1990
|
+
}
|
|
1954
1991
|
if (row.permissionPointNames?.length) {
|
|
1955
1992
|
return row.permissionPointNames.join("\u3001");
|
|
1956
1993
|
}
|
|
@@ -2250,6 +2287,21 @@ var MenuManager = defineComponent3({
|
|
|
2250
2287
|
]),
|
|
2251
2288
|
h2("fieldset", { style: s2.fieldset }, [
|
|
2252
2289
|
h2("legend", { style: s2.label }, "\u6743\u9650\u6807\u8BC6"),
|
|
2290
|
+
permissionPoints.value.length > 0 ? [
|
|
2291
|
+
h2("input", {
|
|
2292
|
+
style: { ...s2.input, marginBottom: "8px" },
|
|
2293
|
+
value: permissionKeyword.value,
|
|
2294
|
+
placeholder: "\u641C\u7D22\u6743\u9650\u540D\u79F0 / \u6807\u8BC6",
|
|
2295
|
+
onInput: (e) => {
|
|
2296
|
+
permissionKeyword.value = e.target.value;
|
|
2297
|
+
}
|
|
2298
|
+
}),
|
|
2299
|
+
h2(
|
|
2300
|
+
"div",
|
|
2301
|
+
{ style: s2.hint },
|
|
2302
|
+
permissionKeyword.value.trim() ? `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u5339\u914D ${filteredPermissionPoints.value.length} / ${permissionPoints.value.length}` : `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u5171 ${permissionPoints.value.length} \u9879`
|
|
2303
|
+
)
|
|
2304
|
+
] : null,
|
|
2253
2305
|
h2(
|
|
2254
2306
|
"div",
|
|
2255
2307
|
{ style: s2.multiSelect },
|
|
@@ -2259,7 +2311,7 @@ var MenuManager = defineComponent3({
|
|
|
2259
2311
|
{ style: s2.hint },
|
|
2260
2312
|
"\u6682\u65E0\u6743\u9650\u70B9\uFF0C\u8BF7\u5148\u5728\u6743\u9650\u70B9\u7BA1\u7406\u4E2D\u65B0\u589E"
|
|
2261
2313
|
)
|
|
2262
|
-
] :
|
|
2314
|
+
] : filteredPermissionPoints.value.length === 0 ? [h2("div", { style: s2.hint }, "\u65E0\u5339\u914D\u6743\u9650\u70B9")] : filteredPermissionPoints.value.map(
|
|
2263
2315
|
(p) => h2(
|
|
2264
2316
|
"label",
|
|
2265
2317
|
{ key: p.resourceId, style: s2.checkItem },
|