@ximatai/muyun-web-app 0.26.8 → 0.26.9
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/DictionaryManagementView-CtIQpqVA.js +1035 -0
- package/dist/MenuManagementView-DJhkN2sG.js +837 -0
- package/dist/{MetadataOrchestrationView-DKYVGMzy.js → MetadataOrchestrationView-CzhAgEdX.js} +211 -205
- package/dist/{ModuleActionManagementView-DiVzuPdu.js → ModuleActionManagementView-CM2d8jPO.js} +72 -72
- package/dist/{RoleAuthorizationView-C0s4Bog7.js → RoleAuthorizationView-jn_WUCeg.js} +228 -221
- package/dist/{RoleDetailWorkspaceView-dqHxKVfd.js → RoleDetailWorkspaceView-CzaQ3Dz1.js} +1 -1
- package/dist/RoleManagementView-nY7qu4GF.js +1951 -0
- package/dist/{SystemUserDetailWorkspaceView-CQ9WeLrR.js → SystemUserDetailWorkspaceView-CBvqmWvP.js} +1 -1
- package/dist/SystemUserManagementView-AEomKvK7.js +887 -0
- package/dist/currentUserContext-B1lj1WgF.js +11 -0
- package/dist/index.css +1 -1
- package/dist/index.js +531 -4402
- package/dist/{platform-components-CFU_zR7-.js → platform-components-CIi6GdC9.js} +4832 -3453
- package/dist/types/App.vue.d.ts +1 -0
- package/dist/types/app/StaticRoutePageHost.vue.d.ts +11 -0
- package/dist/types/app/loginTenant.d.ts +1 -1
- package/dist/types/app/menuRouteCompiler.d.ts +45 -0
- package/dist/types/app/menuRouteRuntime.d.ts +24 -0
- package/dist/types/app/pageRouteContext.d.ts +24 -0
- package/dist/types/app/routeDiagnosticsStore.d.ts +10 -0
- package/dist/types/app/router.d.ts +15 -0
- package/dist/types/app/staticRouteDefinitions.d.ts +25 -0
- package/dist/types/app/workbenchRouteSync.d.ts +1 -1
- package/dist/types/app/workbenchStartup.d.ts +3 -3
- package/dist/types/consumer/index.d.ts +5 -3
- package/dist/types/dynamic-page-runtime/DynamicModuleHost.vue.d.ts +3 -10
- package/dist/types/dynamic-page-runtime/DynamicRecordDetailActions.vue.d.ts +4 -3
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationInlineSurface.vue.d.ts +40 -0
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationSurface.vue.d.ts +14 -0
- package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +26 -0
- package/dist/types/dynamic-page-runtime/ModulePageFormContributionRenderer.vue.d.ts +12 -0
- package/dist/types/dynamic-page-runtime/ModulePageHost.vue.d.ts +14 -0
- package/dist/types/dynamic-page-runtime/ModulePageListExpansionSurface.vue.d.ts +19 -0
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansion.vue.d.ts +13 -0
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansions.vue.d.ts +16 -0
- package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +42 -0
- package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +41 -0
- package/dist/types/dynamic-page-runtime/NavigatorManagementEditor.vue.d.ts +20 -1
- package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +12 -5
- package/dist/types/dynamic-page-runtime/RecordFormSurface.vue.d.ts +31 -0
- package/dist/types/dynamic-page-runtime/composables/useManagedDetailRelationRuntime.d.ts +30 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageActions.d.ts +13 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageBootstrap.d.ts +17 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailActionRuntime.d.ts +48 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +26 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageFormContributionRuntime.d.ts +22 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageListSession.d.ts +41 -0
- package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +1324 -0
- package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +22 -0
- package/dist/types/dynamic-page-runtime/dynamicModuleDetailStateModel.d.ts +5 -12
- package/dist/types/dynamic-page-runtime/formComputeCoordinator.d.ts +18 -0
- package/dist/types/dynamic-page-runtime/index.d.ts +3 -2
- package/dist/types/dynamic-page-runtime/listPageSizePreference.d.ts +10 -0
- package/dist/types/dynamic-page-runtime/moduleDetailStateModel.d.ts +12 -0
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +181 -7
- package/dist/types/dynamic-page-runtime/navigatorVisibility.d.ts +6 -0
- package/dist/types/dynamic-page-runtime/pageContextRuntime.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/recordDetailController.d.ts +9 -1
- package/dist/types/dynamic-page-runtime/relationFormComputeCoordinator.d.ts +9 -0
- package/dist/types/formula/FormulaRuntime.d.ts +29 -0
- package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +1 -0
- package/dist/types/{views/UserDetailWorkspaceView.vue.d.ts → platform-admin-runtime/employee/EmployeeAccountDrawer.vue.d.ts} +2 -2
- package/dist/types/platform-admin-runtime/employeeModulePageEnhancement.d.ts +3 -0
- package/dist/types/platform-admin-runtime/index.d.ts +1 -1
- package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +2 -0
- package/dist/types/platform-admin-runtime/passwordPolicyPageEnhancement.d.ts +6 -0
- package/dist/types/platform-admin-runtime/platformAdminRoutes.d.ts +1 -6
- package/dist/types/platform-admin-runtime/platformModulePageEnhancement.d.ts +9 -0
- package/dist/types/platform-admin-runtime/tenant/TenantApplicationConfigurationDrawer.vue.d.ts +7 -0
- package/dist/types/platform-admin-runtime/tenant/TenantApplicationsDetailSection.vue.d.ts +7 -0
- package/dist/types/platform-admin-runtime/tenantModulePageEnhancement.d.ts +7 -0
- package/dist/types/platform-admin-runtime/user/UserOnlineStatusCell.vue.d.ts +8 -0
- package/dist/types/platform-admin-runtime/user/UserPasswordDrawer.vue.d.ts +7 -0
- package/dist/types/platform-admin-runtime/user/UserSessionListExpansion.vue.d.ts +7 -0
- package/dist/types/platform-admin-runtime/user/useUserSessionRows.d.ts +23 -0
- package/dist/types/platform-admin-runtime/user/userOnlineStatusStore.d.ts +11 -0
- package/dist/types/platform-admin-runtime/userModulePageEnhancement.d.ts +7 -0
- package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +4 -2
- package/dist/types/platform-components/DetailRelationListPanel.vue.d.ts +13 -0
- package/dist/types/{views/EmployeeDetailWorkspaceView.vue.d.ts → platform-components/DrawerTitleActions.vue.d.ts} +2 -1
- package/dist/types/platform-components/FileTransferUploader.vue.d.ts +7 -0
- package/dist/types/platform-components/ModuleActionButton.vue.d.ts +5 -2
- package/dist/types/platform-components/RecordContentSectionHeading.vue.d.ts +17 -0
- package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +3 -0
- package/dist/types/platform-components/RecordDetailExtensionSection.vue.d.ts +8 -3
- package/dist/types/platform-components/RecordDetailFields.vue.d.ts +5 -0
- package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +11 -3
- package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +14 -6
- package/dist/types/platform-components/RecordExpandedSubtable.vue.d.ts +3 -0
- package/dist/types/platform-components/RecordFileReferenceTransfer.vue.d.ts +4 -0
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +29 -1
- package/dist/types/platform-components/RecordImageFileReferencePreview.vue.d.ts +11 -0
- package/dist/types/platform-components/RecordListExpansionSurface.vue.d.ts +13 -0
- package/dist/types/platform-components/RecordListExplorer.vue.d.ts +4 -2
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +2 -1
- package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +12 -2
- package/dist/types/platform-components/RecordPicker.vue.d.ts +10 -2
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +33 -5
- package/dist/types/{views/EmployeeEmploymentDrawer.vue.d.ts → platform-components/RecordRelationTabs.vue.d.ts} +7 -7
- package/dist/types/platform-components/RecordSelectionCheckbox.vue.d.ts +13 -0
- package/dist/types/platform-components/StaticManagementLayout.vue.d.ts +12 -4
- package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +4 -2
- package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +2 -0
- package/dist/types/platform-components/drawerTitleActions.d.ts +11 -0
- package/dist/types/platform-components/index.d.ts +11 -3
- package/dist/types/platform-components/optionFieldOptionCache.d.ts +3 -0
- package/dist/types/platform-components/recordDetailFieldModel.d.ts +2 -0
- package/dist/types/platform-components/recordFormFieldModel.d.ts +67 -4
- package/dist/types/platform-components/recordPickerConstraints.d.ts +2 -0
- package/dist/types/platform-components/recordPickerModel.d.ts +6 -2
- package/dist/types/platform-workbench/Workbench.vue.d.ts +2 -2
- package/dist/types/platform-workbench/index.d.ts +3 -2
- package/dist/types/platform-workbench/legacyPageHostTypeCompatibility.d.ts +6 -0
- package/dist/types/platform-workbench/menuNavigation.d.ts +24 -2
- package/dist/types/platform-workbench/pageCacheKey.d.ts +2 -0
- package/dist/types/platform-workbench/pageHostRegistry.d.ts +1 -1
- package/dist/types/platform-workbench/workbenchNavigation.d.ts +14 -1
- package/dist/types/views/PasswordPolicyPreview.vue.d.ts +7 -0
- package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +1 -0
- package/dist/types/views/RoleAuthorizationView.vue.d.ts +2 -0
- package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +1 -0
- package/dist/types/views/{EmployeeManagementView.vue.d.ts → UserDetailRouteView.vue.d.ts} +3 -2
- package/dist/types/views/UserManagementListView.vue.d.ts +3 -0
- package/dist/types/views/UserManagementView.vue.d.ts +1 -6
- package/dist/types/views/WorkspaceRouteView.vue.d.ts +3 -0
- package/dist/types/views/menuManagementState.d.ts +2 -0
- package/dist/types/views/userDetailStateModel.d.ts +1 -3
- package/dist/types/views/userManagementRouteState.d.ts +11 -0
- package/dist/types/vue-ui-antdv/components/UiButton.vue.d.ts +3 -0
- package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiInput.vue.d.ts +2 -1
- package/dist/types/vue-ui-antdv/components/UiRadioGroup.vue.d.ts +18 -0
- package/dist/types/vue-ui-antdv/components/UiRecordExplorerItem.vue.d.ts +2 -2
- package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +4 -2
- package/dist/types/vue-ui-antdv/index.d.ts +4 -2
- package/dist/types/web-contracts/index.d.ts +303 -12
- package/dist/types/web-core/businessNotifications.d.ts +3 -2
- package/dist/types/web-core/index.d.ts +1 -0
- package/dist/types/web-core/module/abilities.d.ts +7 -7
- package/dist/types/web-core/module/moduleContext.d.ts +5 -3
- package/dist/types/web-core/module/runtimeContext.d.ts +2 -0
- package/dist/types/web-core/module/staticModuleClient.d.ts +36 -10
- package/dist/types/web-core/referenceResolveClient.d.ts +11 -0
- package/dist/workspaceViewSessions-B5g4M0rT.js +51 -0
- package/dist/workspaceViews-CkERhK0K.js +8748 -0
- package/package.json +1 -1
- package/dist/EmployeeDetailWorkspaceView-DswEDSxH.js +0 -14
- package/dist/EmployeeManagementView-C9STtw08.js +0 -1777
- package/dist/RoleManagementView-D43pUCxi.js +0 -1926
- package/dist/SystemUserManagementView-D75_ylYk.js +0 -758
- package/dist/UserDetailWorkspaceView-BCST01d2.js +0 -17
- package/dist/UserManagementView-CcdvDo_y.js +0 -964
- package/dist/pageRealtime-EAiGWKEo.js +0 -227
- package/dist/types/views/EmployeeDetailContent.vue.d.ts +0 -64
- package/dist/types/views/employeeDetailStateModel.d.ts +0 -39
- package/dist/types/views/employeeDetailWorkspaceSession.d.ts +0 -16
- package/dist/types/views/employeeDetailWorkspaceView.d.ts +0 -4
- package/dist/types/views/fieldUiControlManagementState.d.ts +0 -76
- package/dist/types/views/moduleManagementState.d.ts +0 -76
- package/dist/types/views/positionManagementState.d.ts +0 -218
- package/dist/types/views/tenantManagementState.d.ts +0 -74
- package/dist/types/views/useEmployeeEmploymentRows.d.ts +0 -20
- package/dist/types/views/userDetailWorkspaceSession.d.ts +0 -14
- package/dist/types/views/userDetailWorkspaceView.d.ts +0 -4
- package/dist/useUserSessionRows-DCpUZCzN.js +0 -128
- package/dist/workspaceViewSessions-Dj1LjdG1.js +0 -4984
- /package/dist/types/views/{FieldUiControlManagementView.vue.d.ts → DynamicModuleRouteView.vue.d.ts} +0 -0
- /package/dist/types/views/{ModuleManagementView.vue.d.ts → ExternalRouteView.vue.d.ts} +0 -0
- /package/dist/types/views/{PasswordManagementView.vue.d.ts → ModuleOpenApiRouteView.vue.d.ts} +0 -0
- /package/dist/types/views/{PositionManagementView.vue.d.ts → OpenApiCatalogRouteView.vue.d.ts} +0 -0
- /package/dist/types/views/{TenantManagementView.vue.d.ts → RouteDiagnosticsView.vue.d.ts} +0 -0
|
@@ -1,1926 +0,0 @@
|
|
|
1
|
-
import { At as e, C as t, E as n, F as r, Ft as i, I as a, M as o, N as s, Nt as c, Vt as l, X as u, Z as ee, _t as d, c as f, ct as p, dt as te, gt as m, h, i as g, it as _, j as v, k as y, kt as ne, l as re, lt as b, nt as x, r as ie, u as ae, ut as oe, v as se, w as ce, y as S, yt as C } from "./platform-components-CFU_zR7-.js";
|
|
2
|
-
import { S as le, i as ue, j as de, l as w, n as T, r as E, t as fe } from "./workspaceViewSessions-Dj1LjdG1.js";
|
|
3
|
-
import { r as pe, t as me } from "./RoleAuthorizationView-C0s4Bog7.js";
|
|
4
|
-
import { Fragment as he, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createTextVNode as M, createVNode as N, defineComponent as P, normalizeClass as ge, onBeforeUnmount as _e, onMounted as ve, openBlock as F, ref as I, renderList as L, toDisplayString as R, unref as z, watch as ye, withCtx as B, withKeys as V, withModifiers as be } from "vue";
|
|
5
|
-
//#region src/views/RoleAccountGrantDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var H = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "role-account-grant-drawer-state"
|
|
9
|
-
}, U = {
|
|
10
|
-
key: 2,
|
|
11
|
-
class: "role-account-grant-drawer-body"
|
|
12
|
-
}, W = { class: "role-account-grant-search" }, G = { class: "role-account-grant-summary" }, K = { key: 0 }, q = { class: "role-account-grant-selected" }, J = { class: "role-account-grant-selected-title" }, xe = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "role-account-grant-selected-list"
|
|
15
|
-
}, Se = ["disabled", "onClick"], Ce = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "role-account-grant-selected-empty"
|
|
18
|
-
}, we = { class: "role-account-grant-pagination" }, Te = 20, Ee = /*#__PURE__*/ i(/* @__PURE__ */ P({
|
|
19
|
-
name: "RoleAccountGrantDrawer",
|
|
20
|
-
__name: "RoleAccountGrantDrawer",
|
|
21
|
-
props: {
|
|
22
|
-
open: { type: Boolean },
|
|
23
|
-
context: {},
|
|
24
|
-
role: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["close", "saved"],
|
|
27
|
-
setup(e, { emit: t }) {
|
|
28
|
-
let n = e, i = t, a = I([]), o = I({}), s = I([]), l = I(/* @__PURE__ */ new Set()), u = I(/* @__PURE__ */ new Set()), d = I(""), f = I(""), p = I(0), m = I(0), h = I(!1), g = I(!1), _ = I(!1), v = I(!1), y = D(() => pe(n.context.http)), re = D(() => n.role?.id), ie = D(() => n.role ? `绑定用户 - ${Ae(n.role)}` : "绑定用户"), ae = D(() => n.role?.ownerScopeType === "platform" ? "platform" : n.role?.ownerScopeType === "organization" ? "organization" : "tenant"), se = D(() => ae.value === "platform" ? void 0 : n.role?.ownerScopeId), ce = D(() => {
|
|
29
|
-
let e = /* @__PURE__ */ new Map();
|
|
30
|
-
for (let t of a.value) t.userId && e.set(t.userId, t);
|
|
31
|
-
return e;
|
|
32
|
-
}), S = D(() => s.value.filter((e) => e.id).map((e) => ({
|
|
33
|
-
id: e.id,
|
|
34
|
-
username: X(e),
|
|
35
|
-
employeeNo: e.employeeNo ?? "",
|
|
36
|
-
employeeTitle: e.employeeTitle ?? "",
|
|
37
|
-
organizationTitle: e.organizationTitle ?? e.organizationId ?? "",
|
|
38
|
-
departmentTitle: e.departmentTitle ?? e.departmentId ?? "",
|
|
39
|
-
boundTitle: u.value.has(e.id) ? "已绑定" : "未绑定"
|
|
40
|
-
}))), C = D(() => [...l.value].map((e) => o.value[e] ?? Y(e))), le = D(() => Math.max(1, Math.ceil(m.value / Te))), ue = D(() => p.value > 0), de = D(() => p.value + 1 < le.value), w = D(() => [...l.value].filter((e) => !u.value.has(e))), T = D(() => [...u.value].filter((e) => !l.value.has(e))), E = D(() => w.value.length > 0 || T.value.length > 0), fe = {
|
|
41
|
-
rowKey: "id",
|
|
42
|
-
columns: [
|
|
43
|
-
{
|
|
44
|
-
title: "用户账号",
|
|
45
|
-
key: "username",
|
|
46
|
-
width: 140
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: "职员姓名",
|
|
50
|
-
key: "employeeTitle",
|
|
51
|
-
width: 120
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: "职员工号",
|
|
55
|
-
key: "employeeNo",
|
|
56
|
-
width: 120
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
title: "所属机构",
|
|
60
|
-
key: "organizationTitle",
|
|
61
|
-
width: 140
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
title: "所属部门",
|
|
65
|
-
key: "departmentTitle",
|
|
66
|
-
width: 140
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
title: "状态",
|
|
70
|
-
key: "boundTitle",
|
|
71
|
-
width: 90
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}, me = D(() => ({
|
|
75
|
-
selectedRowKeys: [...l.value],
|
|
76
|
-
preserveSelectedRowKeys: !0,
|
|
77
|
-
disabledOf: () => _.value,
|
|
78
|
-
onChange: (e) => {
|
|
79
|
-
l.value = new Set(e.map((e) => String(e)));
|
|
80
|
-
}
|
|
81
|
-
}));
|
|
82
|
-
ye(() => [n.open, n.role?.id], ([e]) => {
|
|
83
|
-
e ? P() : De();
|
|
84
|
-
}, { immediate: !0 });
|
|
85
|
-
async function P() {
|
|
86
|
-
let e = re.value;
|
|
87
|
-
if (!e) {
|
|
88
|
-
De();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
h.value = !0, v.value = !1;
|
|
92
|
-
try {
|
|
93
|
-
let [t, n] = await Promise.all([y.value.accountRoleGrants(e), y.value.userSelector({
|
|
94
|
-
roleId: e,
|
|
95
|
-
enabledOnly: !1,
|
|
96
|
-
page: {
|
|
97
|
-
pageNum: 0,
|
|
98
|
-
pageSize: 500
|
|
99
|
-
}
|
|
100
|
-
})]);
|
|
101
|
-
a.value = t;
|
|
102
|
-
let r = new Set(t.map((e) => e.userId).filter((e) => !!e));
|
|
103
|
-
u.value = r, l.value = new Set(r), o.value = ke([...t.map((e) => Y(e.userId)).filter((e) => !!e), ...n.records]), await ge(0);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
v.value = !0, x(e, {
|
|
106
|
-
source: "role-account-grants",
|
|
107
|
-
phase: "load"
|
|
108
|
-
});
|
|
109
|
-
} finally {
|
|
110
|
-
h.value = !1;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async function ge(e) {
|
|
114
|
-
g.value = !0;
|
|
115
|
-
try {
|
|
116
|
-
let t = await y.value.userSelector({
|
|
117
|
-
keyword: f.value,
|
|
118
|
-
enabledOnly: !0,
|
|
119
|
-
page: {
|
|
120
|
-
pageNum: Math.max(0, e),
|
|
121
|
-
pageSize: Te
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
s.value = t.records, o.value = {
|
|
125
|
-
...o.value,
|
|
126
|
-
...ke(t.records)
|
|
127
|
-
}, p.value = t.pageNum, m.value = t.total;
|
|
128
|
-
} catch (e) {
|
|
129
|
-
x(e, {
|
|
130
|
-
source: "role-account-grants",
|
|
131
|
-
phase: "load"
|
|
132
|
-
});
|
|
133
|
-
} finally {
|
|
134
|
-
g.value = !1;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function _e() {
|
|
138
|
-
f.value = d.value.trim(), ge(0);
|
|
139
|
-
}
|
|
140
|
-
function ve(e, t) {
|
|
141
|
-
let n = new Set(l.value);
|
|
142
|
-
t ? n.add(e) : n.delete(e), l.value = n;
|
|
143
|
-
}
|
|
144
|
-
async function be() {
|
|
145
|
-
let e = re.value;
|
|
146
|
-
if (e) {
|
|
147
|
-
if (!E.value) {
|
|
148
|
-
i("close");
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
_.value = !0;
|
|
152
|
-
try {
|
|
153
|
-
for (let t of w.value) await y.value.grantAccountRole(e, {
|
|
154
|
-
userId: t,
|
|
155
|
-
managementScopeType: ae.value,
|
|
156
|
-
managementScopeId: se.value
|
|
157
|
-
});
|
|
158
|
-
for (let t of T.value) {
|
|
159
|
-
let n = ce.value.get(t)?.id;
|
|
160
|
-
n && await y.value.deleteAccountRoleGrant(e, n);
|
|
161
|
-
}
|
|
162
|
-
await ee({
|
|
163
|
-
success: !0,
|
|
164
|
-
message: "用户绑定已保存"
|
|
165
|
-
}, {
|
|
166
|
-
source: "role-account-grants",
|
|
167
|
-
phase: "action",
|
|
168
|
-
fallbackMessage: "用户绑定已保存"
|
|
169
|
-
}), i("saved"), i("close");
|
|
170
|
-
} catch (e) {
|
|
171
|
-
x(e, {
|
|
172
|
-
source: "role-account-grants",
|
|
173
|
-
phase: "action"
|
|
174
|
-
});
|
|
175
|
-
} finally {
|
|
176
|
-
_.value = !1;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function Ee() {
|
|
181
|
-
_.value || i("close");
|
|
182
|
-
}
|
|
183
|
-
function De() {
|
|
184
|
-
a.value = [], o.value = {}, s.value = [], l.value = /* @__PURE__ */ new Set(), u.value = /* @__PURE__ */ new Set(), d.value = "", f.value = "", p.value = 0, m.value = 0, h.value = !1, g.value = !1, _.value = !1, v.value = !1;
|
|
185
|
-
}
|
|
186
|
-
function Oe(e) {
|
|
187
|
-
ve(e, !1);
|
|
188
|
-
}
|
|
189
|
-
function ke(e) {
|
|
190
|
-
let t = {};
|
|
191
|
-
for (let n of e) n.id && (t[n.id] = n);
|
|
192
|
-
return t;
|
|
193
|
-
}
|
|
194
|
-
function Y(e) {
|
|
195
|
-
return e ? {
|
|
196
|
-
id: e,
|
|
197
|
-
username: e
|
|
198
|
-
} : void 0;
|
|
199
|
-
}
|
|
200
|
-
function X(e) {
|
|
201
|
-
return String(e?.username ?? e?.id ?? "未知用户");
|
|
202
|
-
}
|
|
203
|
-
function Z(e) {
|
|
204
|
-
return e.employeeTitle && e.employeeNo ? `${e.employeeTitle} / ${e.employeeNo}` : e.employeeTitle ?? e.employeeNo ?? e.employeeId ?? e.id;
|
|
205
|
-
}
|
|
206
|
-
function Ae(e) {
|
|
207
|
-
return String(e.title ?? e.id ?? "角色");
|
|
208
|
-
}
|
|
209
|
-
return (t, n) => (F(), O(z(r), {
|
|
210
|
-
open: e.open,
|
|
211
|
-
title: ie.value,
|
|
212
|
-
"close-title": "关闭",
|
|
213
|
-
onClose: Ee
|
|
214
|
-
}, {
|
|
215
|
-
operation: B(() => [N(z(c), {
|
|
216
|
-
disabled: _.value || h.value,
|
|
217
|
-
onClick: Ee
|
|
218
|
-
}, {
|
|
219
|
-
default: B(() => [...n[3] ||= [M("取消", -1)]]),
|
|
220
|
-
_: 1
|
|
221
|
-
}, 8, ["disabled"]), N(z(c), {
|
|
222
|
-
type: "primary",
|
|
223
|
-
loading: _.value,
|
|
224
|
-
disabled: h.value || !E.value,
|
|
225
|
-
onClick: be
|
|
226
|
-
}, {
|
|
227
|
-
default: B(() => [...n[4] ||= [M(" 确定 ", -1)]]),
|
|
228
|
-
_: 1
|
|
229
|
-
}, 8, ["loading", "disabled"])]),
|
|
230
|
-
default: B(() => [h.value ? (F(), O(z(te), {
|
|
231
|
-
key: 0,
|
|
232
|
-
class: "role-account-grant-drawer-state",
|
|
233
|
-
tip: "加载用户"
|
|
234
|
-
})) : v.value ? (F(), A("div", H, [N(z(oe), {
|
|
235
|
-
title: "用户加载失败",
|
|
236
|
-
message: "无法加载当前角色的用户绑定"
|
|
237
|
-
}), N(z(c), {
|
|
238
|
-
type: "primary",
|
|
239
|
-
"icon-name": "reload",
|
|
240
|
-
onClick: P
|
|
241
|
-
}, {
|
|
242
|
-
default: B(() => [...n[5] ||= [M("重试", -1)]]),
|
|
243
|
-
_: 1
|
|
244
|
-
})])) : (F(), A("section", U, [
|
|
245
|
-
j("div", W, [N(z(ne), {
|
|
246
|
-
value: d.value,
|
|
247
|
-
"allow-clear": "",
|
|
248
|
-
disabled: _.value,
|
|
249
|
-
placeholder: "搜索用户账号",
|
|
250
|
-
"onUpdate:value": n[0] ||= (e) => d.value = e,
|
|
251
|
-
onKeydown: V(_e, ["enter"])
|
|
252
|
-
}, null, 8, ["value", "disabled"]), N(z(c), {
|
|
253
|
-
"icon-name": "search",
|
|
254
|
-
disabled: _.value,
|
|
255
|
-
onClick: _e
|
|
256
|
-
}, {
|
|
257
|
-
default: B(() => [...n[6] ||= [M("查询", -1)]]),
|
|
258
|
-
_: 1
|
|
259
|
-
}, 8, ["disabled"])]),
|
|
260
|
-
j("div", G, [j("span", null, "已选 " + R(l.value.size) + " 个", 1), E.value ? (F(), A("span", K, "新增 " + R(w.value.length) + " 个,移除 " + R(T.value.length) + " 个", 1)) : k("v-if", !0)]),
|
|
261
|
-
j("section", q, [j("div", J, [n[7] ||= j("strong", null, "已选用户", -1), j("span", null, R(C.value.length) + " 个", 1)]), C.value.length > 0 ? (F(), A("div", xe, [(F(!0), A(he, null, L(C.value, (e) => (F(), A("button", {
|
|
262
|
-
key: e.id,
|
|
263
|
-
type: "button",
|
|
264
|
-
disabled: _.value,
|
|
265
|
-
onClick: (t) => Oe(e.id)
|
|
266
|
-
}, [j("span", null, R(X(e)), 1), j("small", null, R(Z(e)), 1)], 8, Se))), 128))])) : (F(), A("span", Ce, "暂无已选用户"))]),
|
|
267
|
-
N(z(b), {
|
|
268
|
-
class: "role-account-grant-table",
|
|
269
|
-
size: "middle",
|
|
270
|
-
contract: fe,
|
|
271
|
-
rows: S.value,
|
|
272
|
-
loading: g.value,
|
|
273
|
-
pagination: !1,
|
|
274
|
-
selection: me.value
|
|
275
|
-
}, null, 8, [
|
|
276
|
-
"rows",
|
|
277
|
-
"loading",
|
|
278
|
-
"selection"
|
|
279
|
-
]),
|
|
280
|
-
j("div", we, [j("span", null, "共 " + R(m.value) + " 个用户,第 " + R(p.value + 1) + " / " + R(le.value) + " 页", 1), j("div", null, [N(z(c), {
|
|
281
|
-
disabled: _.value || g.value || !ue.value,
|
|
282
|
-
onClick: n[1] ||= (e) => ge(p.value - 1)
|
|
283
|
-
}, {
|
|
284
|
-
default: B(() => [...n[8] ||= [M(" 上一页 ", -1)]]),
|
|
285
|
-
_: 1
|
|
286
|
-
}, 8, ["disabled"]), N(z(c), {
|
|
287
|
-
disabled: _.value || g.value || !de.value,
|
|
288
|
-
onClick: n[2] ||= (e) => ge(p.value + 1)
|
|
289
|
-
}, {
|
|
290
|
-
default: B(() => [...n[9] ||= [M(" 下一页 ", -1)]]),
|
|
291
|
-
_: 1
|
|
292
|
-
}, 8, ["disabled"])])])
|
|
293
|
-
]))]),
|
|
294
|
-
_: 1
|
|
295
|
-
}, 8, ["open", "title"]));
|
|
296
|
-
}
|
|
297
|
-
}), [["__scopeId", "data-v-edc71fb0"]]);
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region src/views/roleDetailWorkspaceSession.ts
|
|
300
|
-
function De(e, t) {
|
|
301
|
-
return fe(w, e, {
|
|
302
|
-
...t,
|
|
303
|
-
selectedRole: { ...t.selectedRole },
|
|
304
|
-
draft: { ...t.draft },
|
|
305
|
-
scope: {
|
|
306
|
-
...t.scope,
|
|
307
|
-
tenant: t.scope.tenant ? { ...t.scope.tenant } : void 0,
|
|
308
|
-
organization: t.scope.organization ? { ...t.scope.organization } : void 0
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
function Oe(e, t) {
|
|
313
|
-
return T(w, e, t);
|
|
314
|
-
}
|
|
315
|
-
function ke(e) {
|
|
316
|
-
return E(w, e);
|
|
317
|
-
}
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region src/views/EmployeeEmploymentTable.vue
|
|
320
|
-
var Y = /*#__PURE__*/ i(/* @__PURE__ */ P({
|
|
321
|
-
name: "EmployeeEmploymentTable",
|
|
322
|
-
__name: "EmployeeEmploymentTable",
|
|
323
|
-
props: {
|
|
324
|
-
rows: {},
|
|
325
|
-
selectedIds: { default: () => /* @__PURE__ */ new Set() },
|
|
326
|
-
selectable: {
|
|
327
|
-
type: Boolean,
|
|
328
|
-
default: !1
|
|
329
|
-
},
|
|
330
|
-
disabled: {
|
|
331
|
-
type: Boolean,
|
|
332
|
-
default: !1
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
emits: ["update:selectedIds"],
|
|
336
|
-
setup(e, { emit: t }) {
|
|
337
|
-
let r = e, i = t, a = I([]), o = [
|
|
338
|
-
{
|
|
339
|
-
key: "title",
|
|
340
|
-
title: "职员",
|
|
341
|
-
width: 160
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
key: "employeeNo",
|
|
345
|
-
title: "工号",
|
|
346
|
-
width: 140
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
key: "organizationTitle",
|
|
350
|
-
title: "所属机构",
|
|
351
|
-
width: 180
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
key: "employmentCount",
|
|
355
|
-
title: "任职",
|
|
356
|
-
width: 88,
|
|
357
|
-
align: "right"
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
key: "selectedCount",
|
|
361
|
-
title: "已选",
|
|
362
|
-
width: 88,
|
|
363
|
-
align: "right"
|
|
364
|
-
}
|
|
365
|
-
], s = [
|
|
366
|
-
{
|
|
367
|
-
key: "position",
|
|
368
|
-
title: "岗位",
|
|
369
|
-
width: 160
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
key: "organization",
|
|
373
|
-
title: "机构",
|
|
374
|
-
width: 160
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
key: "department",
|
|
378
|
-
title: "部门",
|
|
379
|
-
width: 160
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
key: "primaryPosition",
|
|
383
|
-
title: "主岗位",
|
|
384
|
-
width: 88
|
|
385
|
-
}
|
|
386
|
-
], c = D(() => {
|
|
387
|
-
let e = /* @__PURE__ */ new Map();
|
|
388
|
-
for (let t of r.rows) {
|
|
389
|
-
let n = t.employeeId ?? t.id, r = e.get(n) ?? {
|
|
390
|
-
employeeId: n,
|
|
391
|
-
title: t.employeeTitle ?? n,
|
|
392
|
-
employeeNo: t.employeeNo,
|
|
393
|
-
organizationTitle: t.organizationTitle,
|
|
394
|
-
positions: []
|
|
395
|
-
};
|
|
396
|
-
r.positions.push(t), e.set(n, r);
|
|
397
|
-
}
|
|
398
|
-
return [...e.values()];
|
|
399
|
-
}), l = D(() => c.value);
|
|
400
|
-
function u(e, t) {
|
|
401
|
-
let n = t;
|
|
402
|
-
return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${d(n)} 项` : "";
|
|
403
|
-
}
|
|
404
|
-
function ee(e, t) {
|
|
405
|
-
let n = t;
|
|
406
|
-
return e.key === "position" ? n.positionTitle ?? n.positionId : e.key === "organization" ? n.organizationTitle ?? n.organizationId : e.key === "department" ? n.departmentTitle ?? n.departmentId : e.key === "primaryPosition" ? n.primaryPosition ? "是" : "否" : "";
|
|
407
|
-
}
|
|
408
|
-
function d(e) {
|
|
409
|
-
return e.positions.filter((e) => r.selectedIds.has(e.id)).length;
|
|
410
|
-
}
|
|
411
|
-
function f(e) {
|
|
412
|
-
if (r.selectable) return {
|
|
413
|
-
selectedRowKeys: e.positions.filter((e) => r.selectedIds.has(e.id)).map((e) => e.id),
|
|
414
|
-
preserveSelectedRowKeys: !0,
|
|
415
|
-
disabledOf: () => r.disabled,
|
|
416
|
-
onChange: (t) => p(e, t)
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
function p(e, t) {
|
|
420
|
-
let n = new Set(r.selectedIds);
|
|
421
|
-
for (let t of e.positions) n.delete(t.id);
|
|
422
|
-
for (let e of t) n.add(String(e));
|
|
423
|
-
i("update:selectedIds", n);
|
|
424
|
-
}
|
|
425
|
-
function te(e, t) {
|
|
426
|
-
let n = e.employeeId;
|
|
427
|
-
a.value = t ? Array.from(new Set([...a.value, n])) : a.value.filter((e) => e !== n);
|
|
428
|
-
}
|
|
429
|
-
function h(e) {
|
|
430
|
-
let t = e.employeeId;
|
|
431
|
-
te(e, !a.value.includes(t));
|
|
432
|
-
}
|
|
433
|
-
return (e, t) => (F(), O(z(m), {
|
|
434
|
-
class: "employee-employment-table",
|
|
435
|
-
columns: o,
|
|
436
|
-
rows: l.value,
|
|
437
|
-
"row-key": "employeeId",
|
|
438
|
-
pagination: !1,
|
|
439
|
-
"expanded-row-keys": a.value,
|
|
440
|
-
"clickable-rows": "",
|
|
441
|
-
"horizontal-scroll": "",
|
|
442
|
-
onRowExpand: te,
|
|
443
|
-
onRowDblclick: h
|
|
444
|
-
}, {
|
|
445
|
-
cell: B(({ column: e, record: t }) => [M(R(u(e, t)), 1)]),
|
|
446
|
-
expandedRow: B(({ record: e }) => [N(z(n), { title: "任职信息" }, {
|
|
447
|
-
default: B(() => [N(z(m), {
|
|
448
|
-
columns: s,
|
|
449
|
-
rows: e.positions,
|
|
450
|
-
"row-key": "id",
|
|
451
|
-
pagination: !1,
|
|
452
|
-
selection: f(e),
|
|
453
|
-
"horizontal-scroll": "",
|
|
454
|
-
"row-muted": (e) => e.enabled === !1
|
|
455
|
-
}, {
|
|
456
|
-
cell: B(({ column: e, record: t }) => [M(R(ee(e, t)), 1)]),
|
|
457
|
-
_: 1
|
|
458
|
-
}, 8, [
|
|
459
|
-
"rows",
|
|
460
|
-
"selection",
|
|
461
|
-
"row-muted"
|
|
462
|
-
])]),
|
|
463
|
-
_: 2
|
|
464
|
-
}, 1024)]),
|
|
465
|
-
_: 1
|
|
466
|
-
}, 8, ["rows", "expanded-row-keys"]));
|
|
467
|
-
}
|
|
468
|
-
}), [["__scopeId", "data-v-e5fcebfa"]]), X = { key: 1 }, Z = {
|
|
469
|
-
key: 2,
|
|
470
|
-
class: "role-employment-grant-body"
|
|
471
|
-
}, Ae = { class: "role-employment-grant-selected" }, Q = { class: "role-employment-grant-selected-title" }, je = {
|
|
472
|
-
key: 0,
|
|
473
|
-
class: "role-employment-grant-selected-list"
|
|
474
|
-
}, Me = ["disabled", "onClick"], Ne = {
|
|
475
|
-
key: 1,
|
|
476
|
-
class: "role-employment-grant-selected-empty"
|
|
477
|
-
}, Pe = { class: "role-employment-grant-pagination" }, Fe = /*#__PURE__*/ i(/* @__PURE__ */ P({
|
|
478
|
-
name: "RoleEmploymentGrantDrawer",
|
|
479
|
-
__name: "RoleEmploymentGrantDrawer",
|
|
480
|
-
props: {
|
|
481
|
-
open: { type: Boolean },
|
|
482
|
-
context: {},
|
|
483
|
-
role: {}
|
|
484
|
-
},
|
|
485
|
-
emits: ["close", "saved"],
|
|
486
|
-
setup(e, { emit: t }) {
|
|
487
|
-
let n = e, i = t, a = I([]), o = I([]), s = I({}), l = I(/* @__PURE__ */ new Set()), u = I(/* @__PURE__ */ new Set()), d = I(!1), f = I(!1), p = I(!1), m = I(!1), h = I(0), g = I(0), _ = I(""), v = D(() => n.role?.id), y = D(() => pe(n.context.http)), re = D(() => `绑定任职 - ${n.role?.title ?? n.role?.id ?? ""}`), b = D(() => [...l.value].filter((e) => !u.value.has(e))), ie = D(() => [...u.value].filter((e) => !l.value.has(e))), ae = D(() => new Map(a.value.map((e) => [e.employeePositionId, e]))), se = D(() => o.value.filter((e) => !_.value.trim() || de(e).includes(_.value.trim()))), ce = D(() => new Set(se.value.filter((e) => l.value.has(e.id)).map((e) => e.employeeId)).size), S = D(() => [...l.value].map((e) => s.value[e] ?? E(e)));
|
|
488
|
-
ye(() => [n.open, n.role?.id], ([e]) => {
|
|
489
|
-
e ? C() : ue();
|
|
490
|
-
}, { immediate: !0 });
|
|
491
|
-
async function C(e = 0) {
|
|
492
|
-
let t = v.value;
|
|
493
|
-
if (t) {
|
|
494
|
-
f.value = !0, m.value = !1;
|
|
495
|
-
try {
|
|
496
|
-
let [n, r] = await Promise.all([y.value.employmentRoleGrants(t), y.value.employmentSelector(t, {
|
|
497
|
-
enabledOnly: !0,
|
|
498
|
-
page: {
|
|
499
|
-
pageNum: e,
|
|
500
|
-
pageSize: 50
|
|
501
|
-
}
|
|
502
|
-
})]);
|
|
503
|
-
a.value = n, u.value = new Set(n.map((e) => e.employeePositionId).filter((e) => !!e)), s.value = {
|
|
504
|
-
...s.value,
|
|
505
|
-
...T(r.records)
|
|
506
|
-
}, d.value ||= (l.value = new Set(u.value), !0), o.value = r.records, h.value = r.pageNum, g.value = r.total;
|
|
507
|
-
} catch (e) {
|
|
508
|
-
m.value = !0, x(e, {
|
|
509
|
-
source: "role-employment-grants",
|
|
510
|
-
phase: "load"
|
|
511
|
-
});
|
|
512
|
-
} finally {
|
|
513
|
-
f.value = !1;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
async function le() {
|
|
518
|
-
let e = v.value;
|
|
519
|
-
if (e) {
|
|
520
|
-
p.value = !0;
|
|
521
|
-
try {
|
|
522
|
-
for (let t of b.value) await y.value.grantEmploymentRole(e, t);
|
|
523
|
-
for (let t of ie.value) {
|
|
524
|
-
let n = ae.value.get(t)?.id;
|
|
525
|
-
n && await y.value.deleteEmploymentRoleGrant(e, n);
|
|
526
|
-
}
|
|
527
|
-
await ee({
|
|
528
|
-
success: !0,
|
|
529
|
-
message: "任职角色授权已保存"
|
|
530
|
-
}, {
|
|
531
|
-
source: "role-employment-grants",
|
|
532
|
-
phase: "action"
|
|
533
|
-
}), i("saved"), i("close");
|
|
534
|
-
} catch (e) {
|
|
535
|
-
x(e, {
|
|
536
|
-
source: "role-employment-grants",
|
|
537
|
-
phase: "action"
|
|
538
|
-
});
|
|
539
|
-
} finally {
|
|
540
|
-
p.value = !1;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
function ue() {
|
|
545
|
-
a.value = [], o.value = [], s.value = {}, l.value = /* @__PURE__ */ new Set(), u.value = /* @__PURE__ */ new Set(), d.value = !1, _.value = "", h.value = 0, g.value = 0, m.value = !1;
|
|
546
|
-
}
|
|
547
|
-
function de(e) {
|
|
548
|
-
return [
|
|
549
|
-
e.employeeTitle,
|
|
550
|
-
e.employeeNo,
|
|
551
|
-
e.organizationTitle,
|
|
552
|
-
e.departmentTitle,
|
|
553
|
-
e.positionTitle
|
|
554
|
-
].filter(Boolean).join(" ");
|
|
555
|
-
}
|
|
556
|
-
function w(e) {
|
|
557
|
-
let t = new Set(l.value);
|
|
558
|
-
t.delete(e), l.value = t;
|
|
559
|
-
}
|
|
560
|
-
function T(e) {
|
|
561
|
-
let t = {};
|
|
562
|
-
for (let n of e) n.id && (t[n.id] = n);
|
|
563
|
-
return t;
|
|
564
|
-
}
|
|
565
|
-
function E(e) {
|
|
566
|
-
return {
|
|
567
|
-
id: e,
|
|
568
|
-
positionId: e
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
function fe(e) {
|
|
572
|
-
let t = e.positionTitle ?? e.positionId ?? e.id;
|
|
573
|
-
return e.employeeTitle ? `${e.employeeTitle} · ${t}` : t;
|
|
574
|
-
}
|
|
575
|
-
function me(e) {
|
|
576
|
-
return [
|
|
577
|
-
e.employeeNo,
|
|
578
|
-
e.organizationTitle ?? e.organizationId,
|
|
579
|
-
e.departmentTitle ?? e.departmentId
|
|
580
|
-
].filter(Boolean).join(" / ") || e.id;
|
|
581
|
-
}
|
|
582
|
-
return (t, n) => (F(), O(z(r), {
|
|
583
|
-
open: e.open,
|
|
584
|
-
title: re.value,
|
|
585
|
-
"close-title": "关闭",
|
|
586
|
-
onClose: n[6] ||= (e) => !p.value && i("close")
|
|
587
|
-
}, {
|
|
588
|
-
operation: B(() => [N(z(c), {
|
|
589
|
-
disabled: p.value,
|
|
590
|
-
onClick: n[0] ||= (e) => i("close")
|
|
591
|
-
}, {
|
|
592
|
-
default: B(() => [...n[7] ||= [M("取消", -1)]]),
|
|
593
|
-
_: 1
|
|
594
|
-
}, 8, ["disabled"]), N(z(c), {
|
|
595
|
-
type: "primary",
|
|
596
|
-
loading: p.value,
|
|
597
|
-
disabled: f.value || b.value.length === 0 && ie.value.length === 0,
|
|
598
|
-
onClick: le
|
|
599
|
-
}, {
|
|
600
|
-
default: B(() => [...n[8] ||= [M(" 确定 ", -1)]]),
|
|
601
|
-
_: 1
|
|
602
|
-
}, 8, ["loading", "disabled"])]),
|
|
603
|
-
default: B(() => [f.value ? (F(), O(z(te), {
|
|
604
|
-
key: 0,
|
|
605
|
-
tip: "加载任职"
|
|
606
|
-
})) : m.value ? (F(), A("div", X, [N(z(oe), {
|
|
607
|
-
title: "任职加载失败",
|
|
608
|
-
message: "无法加载任职授权"
|
|
609
|
-
}), N(z(c), { onClick: n[1] ||= (e) => C() }, {
|
|
610
|
-
default: B(() => [...n[9] ||= [M("重试", -1)]]),
|
|
611
|
-
_: 1
|
|
612
|
-
})])) : (F(), A("section", Z, [
|
|
613
|
-
n[13] ||= j("p", null, "角色将在所选任职的机构、部门和岗位上下文中生效。展开职员后选择其具体任职。", -1),
|
|
614
|
-
N(z(ne), {
|
|
615
|
-
value: _.value,
|
|
616
|
-
"onUpdate:value": n[2] ||= (e) => _.value = e,
|
|
617
|
-
"allow-clear": "",
|
|
618
|
-
placeholder: "筛选职员、工号、机构、部门或岗位"
|
|
619
|
-
}, null, 8, ["value"]),
|
|
620
|
-
j("div", null, " 已选 " + R(l.value.size) + " 个任职;当前页涉及 " + R(ce.value) + " 名职员;新增 " + R(b.value.length) + " 个,移除 " + R(ie.value.length) + " 个 ", 1),
|
|
621
|
-
j("section", Ae, [j("div", Q, [n[10] ||= j("strong", null, "已选任职", -1), j("span", null, R(S.value.length) + " 个", 1)]), S.value.length > 0 ? (F(), A("div", je, [(F(!0), A(he, null, L(S.value, (e) => (F(), A("button", {
|
|
622
|
-
key: e.id,
|
|
623
|
-
type: "button",
|
|
624
|
-
disabled: p.value,
|
|
625
|
-
onClick: (t) => w(e.id)
|
|
626
|
-
}, [j("span", null, R(fe(e)), 1), j("small", null, R(me(e)), 1)], 8, Me))), 128))])) : (F(), A("span", Ne, "暂无已选任职"))]),
|
|
627
|
-
N(Y, {
|
|
628
|
-
"selected-ids": l.value,
|
|
629
|
-
"onUpdate:selectedIds": n[3] ||= (e) => l.value = e,
|
|
630
|
-
rows: se.value,
|
|
631
|
-
selectable: "",
|
|
632
|
-
disabled: p.value
|
|
633
|
-
}, null, 8, [
|
|
634
|
-
"selected-ids",
|
|
635
|
-
"rows",
|
|
636
|
-
"disabled"
|
|
637
|
-
]),
|
|
638
|
-
j("div", Pe, [
|
|
639
|
-
j("span", null, "共 " + R(g.value) + " 个启用任职", 1),
|
|
640
|
-
N(z(c), {
|
|
641
|
-
disabled: f.value || h.value === 0,
|
|
642
|
-
onClick: n[4] ||= (e) => C(h.value - 1)
|
|
643
|
-
}, {
|
|
644
|
-
default: B(() => [...n[11] ||= [M("上一页", -1)]]),
|
|
645
|
-
_: 1
|
|
646
|
-
}, 8, ["disabled"]),
|
|
647
|
-
N(z(c), {
|
|
648
|
-
disabled: f.value || (h.value + 1) * 50 >= g.value,
|
|
649
|
-
onClick: n[5] ||= (e) => C(h.value + 1)
|
|
650
|
-
}, {
|
|
651
|
-
default: B(() => [...n[12] ||= [M(" 下一页 ", -1)]]),
|
|
652
|
-
_: 1
|
|
653
|
-
}, 8, ["disabled"])
|
|
654
|
-
])
|
|
655
|
-
]))]),
|
|
656
|
-
_: 1
|
|
657
|
-
}, 8, ["open", "title"]));
|
|
658
|
-
}
|
|
659
|
-
}), [["__scopeId", "data-v-06d7cca7"]]), Ie = { class: "role-group-member-selector" }, Le = /*#__PURE__*/ i(/* @__PURE__ */ P({
|
|
660
|
-
name: "RoleGroupMemberSelector",
|
|
661
|
-
__name: "RoleGroupMemberSelector",
|
|
662
|
-
props: {
|
|
663
|
-
value: { default: void 0 },
|
|
664
|
-
candidates: {},
|
|
665
|
-
currentRoleId: { default: void 0 },
|
|
666
|
-
disabled: {
|
|
667
|
-
type: Boolean,
|
|
668
|
-
default: !1
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
emits: ["update:value"],
|
|
672
|
-
setup(t, { emit: n }) {
|
|
673
|
-
let r = t, i = n, a = D(() => l(r.value)), o = D(() => new Set(r.candidates.filter((e) => e.roleKind === "dataGrant" && e.id && a.value.includes(e.id)).map((e) => e.id))), s = D(() => r.candidates.filter((e) => e.id && e.id !== r.currentRoleId).map((e) => ({
|
|
674
|
-
label: `${u(e)} / ${ee(e.roleKind)}`,
|
|
675
|
-
value: e.id,
|
|
676
|
-
disabled: e.roleKind === "dataGrant" && o.value.size > 0 && !a.value.includes(e.id)
|
|
677
|
-
})));
|
|
678
|
-
function c(e) {
|
|
679
|
-
if (!Array.isArray(e)) {
|
|
680
|
-
i("update:value", void 0);
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
let t = e.map((e) => String(e).trim()).filter(Boolean);
|
|
684
|
-
i("update:value", t.length > 0 ? t.join(",") : void 0);
|
|
685
|
-
}
|
|
686
|
-
function l(e) {
|
|
687
|
-
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
688
|
-
}
|
|
689
|
-
function u(e) {
|
|
690
|
-
return String(e?.title ?? e?.id ?? "角色");
|
|
691
|
-
}
|
|
692
|
-
function ee(e) {
|
|
693
|
-
return e === "dataGrant" ? "数据授权角色" : "标准角色";
|
|
694
|
-
}
|
|
695
|
-
return (n, r) => (F(), A("label", Ie, [r[0] ||= j("span", { class: "role-group-member-selector-label" }, "成员角色", -1), N(z(e), {
|
|
696
|
-
mode: "multiple",
|
|
697
|
-
value: a.value,
|
|
698
|
-
options: s.value,
|
|
699
|
-
placeholder: "请选择成员角色",
|
|
700
|
-
disabled: t.disabled,
|
|
701
|
-
"allow-clear": !0,
|
|
702
|
-
"onUpdate:value": c
|
|
703
|
-
}, null, 8, [
|
|
704
|
-
"value",
|
|
705
|
-
"options",
|
|
706
|
-
"disabled"
|
|
707
|
-
])]));
|
|
708
|
-
}
|
|
709
|
-
}), [["__scopeId", "data-v-91d9ae10"]]), Re = {
|
|
710
|
-
key: 1,
|
|
711
|
-
class: "role-detail-state"
|
|
712
|
-
}, ze = {
|
|
713
|
-
key: 1,
|
|
714
|
-
class: "role-detail-state"
|
|
715
|
-
}, Be = /*#__PURE__*/ i(/* @__PURE__ */ P({
|
|
716
|
-
name: "RoleManagementView",
|
|
717
|
-
__name: "RoleManagementView",
|
|
718
|
-
props: {
|
|
719
|
-
recordId: {},
|
|
720
|
-
scopeKind: {},
|
|
721
|
-
scopeId: {}
|
|
722
|
-
},
|
|
723
|
-
setup(e) {
|
|
724
|
-
let n = e, i = le(), ee = l({ moduleAlias: "iam.tenant" }), m = l({ moduleAlias: "iam.organization" }), b = l({ moduleAlias: "iam.role" }), T = de(), E = I(""), fe = I(""), pe = I(0), P = I(0), L = I(0), R = I(), V = I(), H = I(), U = I(), W = I(!1), G = I("view"), K = I(!1), q = I(!1), J = I(!1), xe = I(), Se = I(!1), Ce = I(!1), we = I(), Te = I(!1), Y = I(0), X = I(Gt(void 0)), Z = I(s(void 0)), Ae = I([]), Q = D(() => !!(n.recordId && n.scopeKind)), je = D(() => Q.value && i?.presentation === "drawer"), Me = D(() => !Q.value || je.value), Ne = D(() => ee), Pe = D(() => R.value?.id), Ie = D(() => T?.value?.system === !0), Be = D(() => T?.value?.system === !0), Ve = D(() => {
|
|
725
|
-
let e = T?.value?.tenantId;
|
|
726
|
-
if (!(T?.value?.system === !0 || !e)) return {
|
|
727
|
-
id: e,
|
|
728
|
-
title: e,
|
|
729
|
-
alias: e,
|
|
730
|
-
enabled: !0
|
|
731
|
-
};
|
|
732
|
-
}), He = D(() => f(m, {
|
|
733
|
-
scopeFieldName: "tenantId",
|
|
734
|
-
scopeValue: Pe.value,
|
|
735
|
-
treePath: "/iam.organization/tree"
|
|
736
|
-
})), Ue = D(() => V.value?.kind !== "platform"), We = D(() => ut(b, V.value)), Ge = D(() => [
|
|
737
|
-
{
|
|
738
|
-
key: "title",
|
|
739
|
-
title: "角色名称",
|
|
740
|
-
width: "22%"
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
key: "assignmentType",
|
|
744
|
-
title: "授权层级",
|
|
745
|
-
width: "13%",
|
|
746
|
-
render: (e) => un(e, "assignmentType", on(e.assignmentType))
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
key: "roleKind",
|
|
750
|
-
title: "角色类型",
|
|
751
|
-
width: "13%",
|
|
752
|
-
render: (e) => un(e, "roleKind", sn(e.roleKind))
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
key: "sharePolicy",
|
|
756
|
-
title: "公开策略",
|
|
757
|
-
width: "15%",
|
|
758
|
-
render: (e) => un(e, "sharePolicy", cn(e.sharePolicy))
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
key: "systemManaged",
|
|
762
|
-
title: "系统托管",
|
|
763
|
-
width: "12%",
|
|
764
|
-
render: (e) => ln(e.systemManaged)
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
key: "enabled",
|
|
768
|
-
title: "状态",
|
|
769
|
-
type: "enabledStatus",
|
|
770
|
-
width: "10%"
|
|
771
|
-
}
|
|
772
|
-
]), Ke = D(() => !!V.value), qe = D(() => G.value === "create" ? "新建角色" : _n(U.value ?? X.value)), Je = D(() => V.value?.title ?? "角色详情"), Ye = D(() => J.value || K.value), Xe = D(() => K.value || !V.value ? !1 : G.value === "create" ? b.can("create") === !0 : !!U.value?.id && b.can("update") === !0 && !U.value?.systemManaged), Ze = D(() => {
|
|
773
|
-
let e = U.value;
|
|
774
|
-
return !!(e?.id && e.systemManaged !== !0 && b.can(hn(e)) === !0);
|
|
775
|
-
}), Qe = D(() => G.value === "view" ? U.value?.id ? [
|
|
776
|
-
{
|
|
777
|
-
key: "edit",
|
|
778
|
-
actionCode: "update",
|
|
779
|
-
title: "编辑",
|
|
780
|
-
iconName: "edit",
|
|
781
|
-
disabled: J.value || U.value.systemManaged === !0
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
key: "bind",
|
|
785
|
-
actionCode: pn(U.value),
|
|
786
|
-
title: mn(U.value),
|
|
787
|
-
iconName: "lock",
|
|
788
|
-
visible: dn(U.value),
|
|
789
|
-
disabled: J.value || U.value.systemManaged === !0
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
key: "delete",
|
|
793
|
-
actionCode: "delete",
|
|
794
|
-
title: "删除",
|
|
795
|
-
iconName: "delete",
|
|
796
|
-
danger: !0,
|
|
797
|
-
disabled: J.value || U.value.systemManaged === !0
|
|
798
|
-
}
|
|
799
|
-
] : [] : [{
|
|
800
|
-
key: "cancel",
|
|
801
|
-
title: "取消",
|
|
802
|
-
iconName: "close",
|
|
803
|
-
disabled: J.value
|
|
804
|
-
}, {
|
|
805
|
-
key: "save",
|
|
806
|
-
actionCode: G.value === "create" ? "create" : "update",
|
|
807
|
-
title: "保存",
|
|
808
|
-
iconName: "save",
|
|
809
|
-
primary: !0,
|
|
810
|
-
loading: J.value,
|
|
811
|
-
disabled: !Xe.value
|
|
812
|
-
}]), $e = D(() => Qe.value), et = D(() => Qe.value), tt = ue({
|
|
813
|
-
view: w,
|
|
814
|
-
input: D(() => {
|
|
815
|
-
let e = U.value?.id, t = V.value, n = G.value;
|
|
816
|
-
if (!(!e || !t || n !== "view" && n !== "edit")) return {
|
|
817
|
-
recordId: e,
|
|
818
|
-
scopeKind: t.kind,
|
|
819
|
-
...t.kind === "platform" ? {} : { scopeId: t.id }
|
|
820
|
-
};
|
|
821
|
-
}),
|
|
822
|
-
title: D(() => _n(U.value)),
|
|
823
|
-
eligibility: D(() => ({
|
|
824
|
-
hasStableIdentity: !!(U.value?.id && V.value) && !K.value,
|
|
825
|
-
busy: J.value
|
|
826
|
-
})),
|
|
827
|
-
beforePromote: async (e) => {
|
|
828
|
-
let t = U.value, n = V.value;
|
|
829
|
-
if (!(!t || !n)) return await De(e, {
|
|
830
|
-
selectedRole: t,
|
|
831
|
-
draft: X.value,
|
|
832
|
-
scope: n,
|
|
833
|
-
mode: G.value === "edit" ? "edit" : "view"
|
|
834
|
-
}) === "accepted";
|
|
835
|
-
},
|
|
836
|
-
onPromoted: jt
|
|
837
|
-
}), nt = D(() => ({
|
|
838
|
-
title: {
|
|
839
|
-
label: "角色名称",
|
|
840
|
-
required: !0,
|
|
841
|
-
visible: !0,
|
|
842
|
-
placeholder: "请输入角色名称"
|
|
843
|
-
},
|
|
844
|
-
assignmentType: {
|
|
845
|
-
label: "授权层级",
|
|
846
|
-
required: !0,
|
|
847
|
-
visible: !0,
|
|
848
|
-
controlType: "select",
|
|
849
|
-
options: $t(X.value.roleKind)
|
|
850
|
-
},
|
|
851
|
-
roleKind: {
|
|
852
|
-
label: "角色类型",
|
|
853
|
-
required: !0,
|
|
854
|
-
visible: !0,
|
|
855
|
-
controlType: "select",
|
|
856
|
-
options: en(X.value.assignmentType)
|
|
857
|
-
},
|
|
858
|
-
memberRoleIds: {
|
|
859
|
-
label: "成员角色",
|
|
860
|
-
visible: X.value.roleKind === "group"
|
|
861
|
-
},
|
|
862
|
-
ownerScopeType: {
|
|
863
|
-
label: "归属范围",
|
|
864
|
-
required: !0,
|
|
865
|
-
visible: !0,
|
|
866
|
-
readOnly: !0,
|
|
867
|
-
controlType: "select",
|
|
868
|
-
options: [
|
|
869
|
-
{
|
|
870
|
-
label: "平台",
|
|
871
|
-
value: "platform"
|
|
872
|
-
},
|
|
873
|
-
{
|
|
874
|
-
label: "租户",
|
|
875
|
-
value: "tenant"
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
label: "机构",
|
|
879
|
-
value: "organization"
|
|
880
|
-
}
|
|
881
|
-
]
|
|
882
|
-
},
|
|
883
|
-
ownerScopeId: {
|
|
884
|
-
label: "归属对象",
|
|
885
|
-
visible: !0,
|
|
886
|
-
readOnly: !0
|
|
887
|
-
},
|
|
888
|
-
sharePolicy: {
|
|
889
|
-
label: "公开策略",
|
|
890
|
-
required: !0,
|
|
891
|
-
visible: !0,
|
|
892
|
-
controlType: "select",
|
|
893
|
-
options: an(V.value?.kind ?? X.value.ownerScopeType)
|
|
894
|
-
},
|
|
895
|
-
description: {
|
|
896
|
-
label: "说明",
|
|
897
|
-
visible: !0,
|
|
898
|
-
placeholder: "请输入角色说明"
|
|
899
|
-
},
|
|
900
|
-
enabled: {
|
|
901
|
-
label: "启用状态",
|
|
902
|
-
visible: !0,
|
|
903
|
-
controlType: "enabledStatus"
|
|
904
|
-
},
|
|
905
|
-
sortOrder: {
|
|
906
|
-
label: "排序号",
|
|
907
|
-
visible: !0,
|
|
908
|
-
placeholder: "请输入排序号"
|
|
909
|
-
}
|
|
910
|
-
})), rt = [
|
|
911
|
-
"title",
|
|
912
|
-
"assignmentType",
|
|
913
|
-
"roleKind"
|
|
914
|
-
], it = [
|
|
915
|
-
"ownerScopeType",
|
|
916
|
-
"ownerScopeId",
|
|
917
|
-
"sharePolicy",
|
|
918
|
-
"description",
|
|
919
|
-
"enabled",
|
|
920
|
-
"sortOrder"
|
|
921
|
-
], at = D(() => {
|
|
922
|
-
let e = [
|
|
923
|
-
"title",
|
|
924
|
-
"assignmentType",
|
|
925
|
-
"roleKind"
|
|
926
|
-
];
|
|
927
|
-
return X.value.roleKind === "group" && e.push("memberRoleIds"), e.push("ownerScopeType", "ownerScopeId", "sharePolicy", "description", "enabled", "sortOrder"), e;
|
|
928
|
-
}), ot;
|
|
929
|
-
ve(() => {
|
|
930
|
-
if (ct(), !Q.value || !n.recordId || !n.scopeKind) return;
|
|
931
|
-
let e = Vt();
|
|
932
|
-
e && !je.value && (ot = Oe(e, st)), Bt();
|
|
933
|
-
}), _e(() => ot?.());
|
|
934
|
-
function st(e) {
|
|
935
|
-
return G.value === "edit" ? !1 : (Wt(e), !0);
|
|
936
|
-
}
|
|
937
|
-
ye(U, (e) => {
|
|
938
|
-
!Q.value || !e || i?.setTitle(_n(e));
|
|
939
|
-
}, { immediate: !0 }), ye(Ve, ht, { immediate: !0 }), ye(V, () => {
|
|
940
|
-
Q.value || (H.value = void 0, U.value = void 0, X.value = Gt(V.value), jt(), L.value += 1, lt());
|
|
941
|
-
});
|
|
942
|
-
async function ct() {
|
|
943
|
-
try {
|
|
944
|
-
Z.value = s((await b.runtime.ready).uiDescriptor);
|
|
945
|
-
} catch (e) {
|
|
946
|
-
x(e, {
|
|
947
|
-
source: "role-management",
|
|
948
|
-
phase: "load"
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
async function lt(e = V.value) {
|
|
953
|
-
if (!e) {
|
|
954
|
-
Ae.value = [];
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
957
|
-
try {
|
|
958
|
-
Ae.value = (await b.crud.query(dt({
|
|
959
|
-
page: {
|
|
960
|
-
pageNum: 0,
|
|
961
|
-
pageSize: 500
|
|
962
|
-
},
|
|
963
|
-
conditions: [
|
|
964
|
-
{
|
|
965
|
-
fieldName: "assignmentType",
|
|
966
|
-
operator: "EQ",
|
|
967
|
-
values: ["employment"]
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
fieldName: "roleKind",
|
|
971
|
-
operator: "IN",
|
|
972
|
-
values: ["standard", "dataGrant"]
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
fieldName: "enabled",
|
|
976
|
-
operator: "EQ",
|
|
977
|
-
values: [!0]
|
|
978
|
-
}
|
|
979
|
-
],
|
|
980
|
-
sorts: [{ field: "sortOrder" }, { field: "title" }]
|
|
981
|
-
}, e))).records;
|
|
982
|
-
} catch (e) {
|
|
983
|
-
Ae.value = [], x(e, {
|
|
984
|
-
source: "role-management",
|
|
985
|
-
phase: "load"
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
function ut(e, t) {
|
|
990
|
-
return {
|
|
991
|
-
...e,
|
|
992
|
-
crud: {
|
|
993
|
-
...e.crud,
|
|
994
|
-
query: (n) => t ? e.crud.query(dt(n, t)) : e.crud.query(n)
|
|
995
|
-
}
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
function dt(e, t) {
|
|
999
|
-
let n = [...e?.conditions ?? [], {
|
|
1000
|
-
fieldName: "ownerScopeType",
|
|
1001
|
-
operator: "EQ",
|
|
1002
|
-
values: [t.kind]
|
|
1003
|
-
}];
|
|
1004
|
-
return t.kind !== "platform" && t.id && n.push({
|
|
1005
|
-
fieldName: "ownerScopeId",
|
|
1006
|
-
operator: "EQ",
|
|
1007
|
-
values: [t.id]
|
|
1008
|
-
}), {
|
|
1009
|
-
...e,
|
|
1010
|
-
conditions: n
|
|
1011
|
-
};
|
|
1012
|
-
}
|
|
1013
|
-
function ft(e) {
|
|
1014
|
-
return e === "ownerScopeType" || e === "ownerScopeId" || G.value === "edit" && ["assignmentType", "roleKind"].includes(e) ? !0 : U.value?.systemManaged === !0;
|
|
1015
|
-
}
|
|
1016
|
-
function pt(e, t) {
|
|
1017
|
-
let n = {
|
|
1018
|
-
...X.value,
|
|
1019
|
-
[e]: t
|
|
1020
|
-
};
|
|
1021
|
-
e === "roleKind" && (t === "group" || t === "dataGrant") && (n.assignmentType = "employment"), e === "roleKind" && t !== "group" && (n.memberRoleIds = void 0), e === "assignmentType" && t === "account" && Qt(n.roleKind) && (n.roleKind = "standard", n.memberRoleIds = void 0), X.value = n;
|
|
1022
|
-
}
|
|
1023
|
-
function mt(e) {
|
|
1024
|
-
if (Be.value) {
|
|
1025
|
-
if (!V.value && Ie.value) {
|
|
1026
|
-
gt();
|
|
1027
|
-
return;
|
|
1028
|
-
}
|
|
1029
|
-
!R.value && e.length > 0 && _t(e[0]);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
function ht(e = Ve.value) {
|
|
1033
|
-
!e || Be.value || R.value || V.value || (R.value = e, vt(e), P.value += 1);
|
|
1034
|
-
}
|
|
1035
|
-
function gt() {
|
|
1036
|
-
!$() || !Ie.value || (R.value = void 0, V.value = {
|
|
1037
|
-
kind: "platform",
|
|
1038
|
-
key: "platform",
|
|
1039
|
-
title: "平台角色"
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
function _t(e) {
|
|
1043
|
-
$() && (R.value = e, vt(e), P.value += 1);
|
|
1044
|
-
}
|
|
1045
|
-
function vt(e = R.value) {
|
|
1046
|
-
!e?.id || !$() || (V.value = {
|
|
1047
|
-
kind: "tenant",
|
|
1048
|
-
id: e.id,
|
|
1049
|
-
key: `tenant:${e.id}`,
|
|
1050
|
-
title: `${vn(e)} / 租户本级`,
|
|
1051
|
-
tenant: e
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
function yt(e) {
|
|
1055
|
-
!e.id || !$() || (V.value = {
|
|
1056
|
-
kind: "organization",
|
|
1057
|
-
id: e.id,
|
|
1058
|
-
key: `organization:${e.id}`,
|
|
1059
|
-
title: yn(e),
|
|
1060
|
-
tenant: R.value,
|
|
1061
|
-
organization: e
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
function bt(e) {
|
|
1065
|
-
e.key === "create" && kt();
|
|
1066
|
-
}
|
|
1067
|
-
function xt(e) {
|
|
1068
|
-
return [
|
|
1069
|
-
{
|
|
1070
|
-
key: "bind",
|
|
1071
|
-
actionCode: pn(e),
|
|
1072
|
-
title: "绑定",
|
|
1073
|
-
after: "edit",
|
|
1074
|
-
pinned: !0,
|
|
1075
|
-
visible: dn(e)
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
key: "authorize",
|
|
1079
|
-
actionCode: "rolePermissions",
|
|
1080
|
-
title: "授权",
|
|
1081
|
-
after: "bind",
|
|
1082
|
-
pinned: !0,
|
|
1083
|
-
visible: fn(e)
|
|
1084
|
-
},
|
|
1085
|
-
{
|
|
1086
|
-
key: "toggle",
|
|
1087
|
-
actionCode: hn(e),
|
|
1088
|
-
title: gn(e),
|
|
1089
|
-
iconName: "power",
|
|
1090
|
-
before: "delete"
|
|
1091
|
-
}
|
|
1092
|
-
];
|
|
1093
|
-
}
|
|
1094
|
-
function St(e, t) {
|
|
1095
|
-
if (e.systemManaged !== !0) return;
|
|
1096
|
-
let n = t.key ?? t.actionCode;
|
|
1097
|
-
return n === "edit" || n === "update" || n === "bind" || n === "authorize" || n === "toggle" || n === "delete" ? { disabled: !0 } : void 0;
|
|
1098
|
-
}
|
|
1099
|
-
function Ct(e, t) {
|
|
1100
|
-
if ($()) {
|
|
1101
|
-
if (e.key === "view") {
|
|
1102
|
-
At(t, "view");
|
|
1103
|
-
return;
|
|
1104
|
-
}
|
|
1105
|
-
if (e.key === "edit") {
|
|
1106
|
-
At(t, "edit");
|
|
1107
|
-
return;
|
|
1108
|
-
}
|
|
1109
|
-
if (e.key === "bind") {
|
|
1110
|
-
Dt(t, t.assignmentType === "employment");
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
if (e.key === "authorize") {
|
|
1114
|
-
wt(t);
|
|
1115
|
-
return;
|
|
1116
|
-
}
|
|
1117
|
-
if (e.key === "toggle") {
|
|
1118
|
-
Lt(t);
|
|
1119
|
-
return;
|
|
1120
|
-
}
|
|
1121
|
-
e.key === "delete" && It(t);
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
function wt(e) {
|
|
1125
|
-
!String(e.id ?? "") || e.roleKind === "group" || (we.value = Kt(e), Te.value = !0);
|
|
1126
|
-
}
|
|
1127
|
-
function Tt() {
|
|
1128
|
-
Te.value = !1, we.value = void 0;
|
|
1129
|
-
}
|
|
1130
|
-
function Et(e) {
|
|
1131
|
-
$() && At(e, "view");
|
|
1132
|
-
}
|
|
1133
|
-
async function Dt(e, t = !1) {
|
|
1134
|
-
if (!$()) return;
|
|
1135
|
-
let n = String(e.id ?? "");
|
|
1136
|
-
if (n) {
|
|
1137
|
-
Se.value = !t, Ce.value = t, xe.value = Kt(e);
|
|
1138
|
-
try {
|
|
1139
|
-
xe.value = await b.crud.view(n);
|
|
1140
|
-
} catch (e) {
|
|
1141
|
-
Se.value = !1, Ce.value = !1, xe.value = void 0, x(e, {
|
|
1142
|
-
source: "role-management",
|
|
1143
|
-
phase: "load"
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
function Ot() {
|
|
1149
|
-
J.value || (Se.value = !1, Ce.value = !1, xe.value = void 0);
|
|
1150
|
-
}
|
|
1151
|
-
function kt() {
|
|
1152
|
-
if ($()) {
|
|
1153
|
-
if (!V.value) {
|
|
1154
|
-
_("请先选择角色归属范围", { phase: "validation" });
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
U.value = void 0, H.value = void 0, X.value = Gt(V.value), G.value = "create", K.value = !1, q.value = !1, Y.value += 1, W.value = !0;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
async function At(e, t) {
|
|
1161
|
-
if (!$()) return;
|
|
1162
|
-
let n = String(e.id ?? "");
|
|
1163
|
-
if (!n) return;
|
|
1164
|
-
H.value = n, W.value = !0, G.value = t, U.value = void 0, X.value = Kt(e), K.value = !0, q.value = !1;
|
|
1165
|
-
let r = Y.value + 1;
|
|
1166
|
-
Y.value = r;
|
|
1167
|
-
try {
|
|
1168
|
-
let e = await b.crud.view(n);
|
|
1169
|
-
if (!Rt(n, r)) return;
|
|
1170
|
-
if (!Ut(e)) {
|
|
1171
|
-
q.value = !0, _("角色不属于当前归属范围", {
|
|
1172
|
-
source: "role-management",
|
|
1173
|
-
phase: "load"
|
|
1174
|
-
});
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
zt(e, t);
|
|
1178
|
-
} catch (e) {
|
|
1179
|
-
Rt(n, r) && (q.value = !0, x(e, {
|
|
1180
|
-
source: "role-management",
|
|
1181
|
-
phase: "load"
|
|
1182
|
-
}));
|
|
1183
|
-
} finally {
|
|
1184
|
-
Rt(n, r) && (K.value = !1);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
function jt() {
|
|
1188
|
-
J.value || (Y.value += 1, K.value = !1, q.value = !1, W.value = !1, G.value = "view", X.value = U.value ? Kt(U.value) : Gt(V.value), je.value && i?.dismiss());
|
|
1189
|
-
}
|
|
1190
|
-
function Mt() {
|
|
1191
|
-
if (!J.value) {
|
|
1192
|
-
if (!U.value?.id || G.value === "create") {
|
|
1193
|
-
jt();
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
X.value = Kt(U.value), G.value = "view", K.value = !1, q.value = !1;
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
function Nt(e) {
|
|
1200
|
-
if (e.key === "cancel") {
|
|
1201
|
-
Mt();
|
|
1202
|
-
return;
|
|
1203
|
-
}
|
|
1204
|
-
if (e.key === "save") {
|
|
1205
|
-
Ft();
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1208
|
-
if ($()) {
|
|
1209
|
-
if (e.key === "edit" && U.value && !U.value.systemManaged) {
|
|
1210
|
-
X.value = Kt(U.value), G.value = "edit";
|
|
1211
|
-
return;
|
|
1212
|
-
}
|
|
1213
|
-
if (e.key === "bind" && U.value) {
|
|
1214
|
-
Dt(U.value, U.value.assignmentType === "employment");
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
|
-
e.key === "delete" && It(U.value);
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
function Pt() {
|
|
1221
|
-
let e = String(X.value.id ?? H.value ?? "");
|
|
1222
|
-
if (!e) return;
|
|
1223
|
-
let t = G.value === "create" ? "view" : G.value;
|
|
1224
|
-
At({
|
|
1225
|
-
...X.value,
|
|
1226
|
-
id: e
|
|
1227
|
-
}, t);
|
|
1228
|
-
}
|
|
1229
|
-
async function Ft() {
|
|
1230
|
-
await ie({
|
|
1231
|
-
loading: J,
|
|
1232
|
-
mode: G.value === "edit" ? "edit" : "create",
|
|
1233
|
-
source: "role-management",
|
|
1234
|
-
validateContext: () => V.value ? void 0 : "请先选择角色归属范围",
|
|
1235
|
-
canSave: () => Xe.value,
|
|
1236
|
-
deniedMessage: "当前用户无权保存角色",
|
|
1237
|
-
createRecord: () => qt(X.value, V.value),
|
|
1238
|
-
validateRecord: Yt,
|
|
1239
|
-
save: (e, t) => t === "edit" && U.value?.id ? b.crud.update(U.value.id, e) : b.crud.insert(e),
|
|
1240
|
-
onSaved: ({ record: e }) => {
|
|
1241
|
-
zt(e), L.value += 1, lt();
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
}
|
|
1245
|
-
async function It(e) {
|
|
1246
|
-
await g({
|
|
1247
|
-
loading: J,
|
|
1248
|
-
source: "role-management",
|
|
1249
|
-
record: () => e?.id ? e : void 0,
|
|
1250
|
-
canExecute: (e) => b.can("delete") === !0 && e.systemManaged !== !0,
|
|
1251
|
-
deniedMessage: "当前用户无权删除角色",
|
|
1252
|
-
confirm: (e) => p({
|
|
1253
|
-
title: "删除角色",
|
|
1254
|
-
content: `确认删除角色「${_n(e)}」?`,
|
|
1255
|
-
okText: "删除",
|
|
1256
|
-
danger: !0
|
|
1257
|
-
}),
|
|
1258
|
-
execute: (e) => b.crud.delete(String(e.id), { version: e.version }),
|
|
1259
|
-
onExecuted: (e, t) => {
|
|
1260
|
-
H.value === String(t.id) && (H.value = void 0, U.value = void 0, X.value = Gt(V.value), W.value = !1, G.value = "view", K.value = !1, q.value = !1, Y.value += 1), L.value += 1, lt();
|
|
1261
|
-
}
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
async function Lt(e) {
|
|
1265
|
-
await g({
|
|
1266
|
-
loading: J,
|
|
1267
|
-
source: "role-management",
|
|
1268
|
-
record: () => e?.id ? e : void 0,
|
|
1269
|
-
canExecute: (e) => b.can(hn(e)) === !0 && e.systemManaged !== !0,
|
|
1270
|
-
deniedMessage: "当前用户无权变更角色启停状态",
|
|
1271
|
-
execute: (e) => e.enabled === !1 ? b.crud.enable(String(e.id), { version: e.version }) : b.crud.disable(String(e.id), { version: e.version }),
|
|
1272
|
-
onExecuted: async (e, t) => {
|
|
1273
|
-
H.value === String(t.id) && zt(await b.crud.view(String(t.id))), L.value += 1, lt();
|
|
1274
|
-
}
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
function $() {
|
|
1278
|
-
return !J.value;
|
|
1279
|
-
}
|
|
1280
|
-
function Rt(e, t) {
|
|
1281
|
-
return Y.value === t && H.value === e;
|
|
1282
|
-
}
|
|
1283
|
-
function zt(e, t = "view") {
|
|
1284
|
-
U.value = e, H.value = e.id, X.value = Kt(e), G.value = t === "edit" && e.systemManaged !== !0 ? "edit" : "view", W.value = !0, K.value = !1, q.value = !1, Y.value += 1;
|
|
1285
|
-
}
|
|
1286
|
-
async function Bt() {
|
|
1287
|
-
let e = Vt();
|
|
1288
|
-
if (!e) return;
|
|
1289
|
-
V.value = Ht(e);
|
|
1290
|
-
let t = ke(e);
|
|
1291
|
-
if (t) {
|
|
1292
|
-
Wt(t);
|
|
1293
|
-
return;
|
|
1294
|
-
}
|
|
1295
|
-
await At({ id: e.recordId }, "view");
|
|
1296
|
-
}
|
|
1297
|
-
function Vt() {
|
|
1298
|
-
let e = n.recordId, t = n.scopeKind;
|
|
1299
|
-
if (!(!e || !t || t !== "platform" && !n.scopeId)) return {
|
|
1300
|
-
recordId: e,
|
|
1301
|
-
scopeKind: t,
|
|
1302
|
-
...t === "platform" ? {} : { scopeId: n.scopeId }
|
|
1303
|
-
};
|
|
1304
|
-
}
|
|
1305
|
-
function Ht(e) {
|
|
1306
|
-
if (e.scopeKind === "platform") return {
|
|
1307
|
-
kind: "platform",
|
|
1308
|
-
key: "platform",
|
|
1309
|
-
title: "平台角色"
|
|
1310
|
-
};
|
|
1311
|
-
let t = e.scopeId, n = e.scopeKind === "organization" ? `机构:${t}` : `租户:${t}`;
|
|
1312
|
-
return {
|
|
1313
|
-
kind: e.scopeKind,
|
|
1314
|
-
id: t,
|
|
1315
|
-
key: `${e.scopeKind}:${t}`,
|
|
1316
|
-
title: n,
|
|
1317
|
-
...e.scopeKind === "tenant" ? { tenant: {
|
|
1318
|
-
id: t,
|
|
1319
|
-
title: t,
|
|
1320
|
-
alias: t
|
|
1321
|
-
} } : {}
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
function Ut(e) {
|
|
1325
|
-
let t = V.value;
|
|
1326
|
-
return !t || e.ownerScopeType !== t.kind ? !1 : t.kind === "platform" || e.ownerScopeId === t.id;
|
|
1327
|
-
}
|
|
1328
|
-
function Wt(e) {
|
|
1329
|
-
V.value = e.scope, U.value = e.selectedRole, H.value = e.selectedRole.id, X.value = e.draft, G.value = e.mode, W.value = !0, K.value = !1, q.value = !1, Y.value += 1;
|
|
1330
|
-
}
|
|
1331
|
-
function Gt(e) {
|
|
1332
|
-
return {
|
|
1333
|
-
tenantId: Jt(e),
|
|
1334
|
-
ownerScopeType: e?.kind,
|
|
1335
|
-
ownerScopeId: e?.kind === "platform" ? void 0 : e?.id,
|
|
1336
|
-
assignmentType: "employment",
|
|
1337
|
-
roleKind: "standard",
|
|
1338
|
-
sharePolicy: nn(),
|
|
1339
|
-
enabled: !0,
|
|
1340
|
-
sortOrder: 100
|
|
1341
|
-
};
|
|
1342
|
-
}
|
|
1343
|
-
function Kt(e) {
|
|
1344
|
-
return { ...e };
|
|
1345
|
-
}
|
|
1346
|
-
function qt(e, t) {
|
|
1347
|
-
let n = Zt(e.roleKind), r = tn(e.sharePolicy, t.kind), i = re(e, {
|
|
1348
|
-
title: e.title?.trim(),
|
|
1349
|
-
assignmentType: Xt(e.assignmentType, n),
|
|
1350
|
-
roleKind: n,
|
|
1351
|
-
memberRoleIds: e.memberRoleIds?.trim() || void 0,
|
|
1352
|
-
tenantId: Jt(t),
|
|
1353
|
-
ownerScopeType: t.kind,
|
|
1354
|
-
ownerScopeId: t.kind === "platform" ? void 0 : t.id,
|
|
1355
|
-
ownerScopeKey: void 0,
|
|
1356
|
-
sharePolicy: r,
|
|
1357
|
-
description: e.description?.trim() || void 0,
|
|
1358
|
-
enabled: e.enabled !== !1,
|
|
1359
|
-
sortOrder: rn(e.sortOrder)
|
|
1360
|
-
});
|
|
1361
|
-
return n !== "group" && (i.memberRoleIds = void 0), i;
|
|
1362
|
-
}
|
|
1363
|
-
function Jt(e) {
|
|
1364
|
-
return e?.kind === "platform" ? void 0 : e?.tenant?.id ?? e?.id;
|
|
1365
|
-
}
|
|
1366
|
-
function Yt(e) {
|
|
1367
|
-
for (let t of [
|
|
1368
|
-
"title",
|
|
1369
|
-
"assignmentType",
|
|
1370
|
-
"roleKind",
|
|
1371
|
-
"ownerScopeType",
|
|
1372
|
-
"sharePolicy"
|
|
1373
|
-
]) {
|
|
1374
|
-
let n = o(t, {
|
|
1375
|
-
fields: Z.value,
|
|
1376
|
-
fallback: nt.value
|
|
1377
|
-
});
|
|
1378
|
-
if (n.visible && n.required && !e[t]) return `请填写${n.label}`;
|
|
1379
|
-
}
|
|
1380
|
-
if (e.ownerScopeType !== "platform" && !e.ownerScopeId) return "请选择归属对象";
|
|
1381
|
-
if (!an(e.ownerScopeType).some((t) => t.value === e.sharePolicy)) return "请选择当前归属范围可用的公开策略";
|
|
1382
|
-
}
|
|
1383
|
-
function Xt(e, t) {
|
|
1384
|
-
return t === "group" || t === "dataGrant" ? "employment" : e === "account" ? "account" : "employment";
|
|
1385
|
-
}
|
|
1386
|
-
function Zt(e) {
|
|
1387
|
-
return e === "group" || e === "dataGrant" || e === "system" ? e : "standard";
|
|
1388
|
-
}
|
|
1389
|
-
function Qt(e) {
|
|
1390
|
-
return e === "group" || e === "dataGrant";
|
|
1391
|
-
}
|
|
1392
|
-
function $t(e) {
|
|
1393
|
-
return Qt(e) ? [{
|
|
1394
|
-
label: "任职角色",
|
|
1395
|
-
value: "employment"
|
|
1396
|
-
}] : [{
|
|
1397
|
-
label: "账号角色",
|
|
1398
|
-
value: "account"
|
|
1399
|
-
}, {
|
|
1400
|
-
label: "任职角色",
|
|
1401
|
-
value: "employment"
|
|
1402
|
-
}];
|
|
1403
|
-
}
|
|
1404
|
-
function en(e) {
|
|
1405
|
-
let t = [{
|
|
1406
|
-
label: "标准角色",
|
|
1407
|
-
value: "standard"
|
|
1408
|
-
}, {
|
|
1409
|
-
label: "系统角色",
|
|
1410
|
-
value: "system"
|
|
1411
|
-
}];
|
|
1412
|
-
return e === "account" ? t : [
|
|
1413
|
-
t[0],
|
|
1414
|
-
{
|
|
1415
|
-
label: "角色组",
|
|
1416
|
-
value: "group"
|
|
1417
|
-
},
|
|
1418
|
-
{
|
|
1419
|
-
label: "数据授权角色",
|
|
1420
|
-
value: "dataGrant"
|
|
1421
|
-
},
|
|
1422
|
-
t[1]
|
|
1423
|
-
];
|
|
1424
|
-
}
|
|
1425
|
-
function tn(e, t) {
|
|
1426
|
-
return an(t).map((e) => e.value).includes(e ?? "") ? e : nn();
|
|
1427
|
-
}
|
|
1428
|
-
function nn() {
|
|
1429
|
-
return "private";
|
|
1430
|
-
}
|
|
1431
|
-
function rn(e) {
|
|
1432
|
-
if (typeof e == "number") return Number.isFinite(e) ? e : 100;
|
|
1433
|
-
let t = Number(String(e ?? "").trim());
|
|
1434
|
-
return Number.isFinite(t) ? t : 100;
|
|
1435
|
-
}
|
|
1436
|
-
function an(e) {
|
|
1437
|
-
return e === "platform" ? [{
|
|
1438
|
-
label: "私有",
|
|
1439
|
-
value: "private"
|
|
1440
|
-
}, {
|
|
1441
|
-
label: "全局公开",
|
|
1442
|
-
value: "platform"
|
|
1443
|
-
}] : e === "organization" ? [{
|
|
1444
|
-
label: "私有",
|
|
1445
|
-
value: "private"
|
|
1446
|
-
}, {
|
|
1447
|
-
label: "本级及下级",
|
|
1448
|
-
value: "ownerAndChildren"
|
|
1449
|
-
}] : [{
|
|
1450
|
-
label: "私有",
|
|
1451
|
-
value: "private"
|
|
1452
|
-
}, {
|
|
1453
|
-
label: "租户公开",
|
|
1454
|
-
value: "tenant"
|
|
1455
|
-
}];
|
|
1456
|
-
}
|
|
1457
|
-
function on(e) {
|
|
1458
|
-
return e === "account" ? "账号角色" : "任职角色";
|
|
1459
|
-
}
|
|
1460
|
-
function sn(e) {
|
|
1461
|
-
return {
|
|
1462
|
-
standard: "标准角色",
|
|
1463
|
-
group: "角色组",
|
|
1464
|
-
dataGrant: "数据授权角色",
|
|
1465
|
-
system: "系统角色"
|
|
1466
|
-
}[e ?? "standard"];
|
|
1467
|
-
}
|
|
1468
|
-
function cn(e) {
|
|
1469
|
-
return {
|
|
1470
|
-
private: "私有",
|
|
1471
|
-
ownerAndChildren: "本级及下级",
|
|
1472
|
-
tenant: "租户公开",
|
|
1473
|
-
platform: "全局公开"
|
|
1474
|
-
}[e ?? "private"];
|
|
1475
|
-
}
|
|
1476
|
-
function ln(e) {
|
|
1477
|
-
return e === !0 ? "是" : "否";
|
|
1478
|
-
}
|
|
1479
|
-
function un(e, t, n) {
|
|
1480
|
-
let r = e[`${t}Title`];
|
|
1481
|
-
return typeof r == "string" && r.trim() ? r : n;
|
|
1482
|
-
}
|
|
1483
|
-
function dn(e) {
|
|
1484
|
-
return !!e?.id && (e?.assignmentType === "account" || e?.assignmentType === "employment");
|
|
1485
|
-
}
|
|
1486
|
-
function fn(e) {
|
|
1487
|
-
return !!e?.id && e?.roleKind !== "group";
|
|
1488
|
-
}
|
|
1489
|
-
function pn(e) {
|
|
1490
|
-
return e?.assignmentType === "employment" ? "employmentRoleGrants" : "accountRoleGrants";
|
|
1491
|
-
}
|
|
1492
|
-
function mn(e) {
|
|
1493
|
-
return e?.assignmentType === "employment" ? "绑定任职" : "绑定用户";
|
|
1494
|
-
}
|
|
1495
|
-
function hn(e) {
|
|
1496
|
-
return e?.enabled === !1 ? "enable" : "disable";
|
|
1497
|
-
}
|
|
1498
|
-
function gn(e) {
|
|
1499
|
-
return e?.enabled === !1 ? "启用" : "停用";
|
|
1500
|
-
}
|
|
1501
|
-
function _n(e) {
|
|
1502
|
-
return String(e?.title ?? e?.id ?? "角色");
|
|
1503
|
-
}
|
|
1504
|
-
function vn(e) {
|
|
1505
|
-
return String(e?.title ?? e?.alias ?? e?.id ?? "未命名租户");
|
|
1506
|
-
}
|
|
1507
|
-
function yn(e) {
|
|
1508
|
-
return String(e?.title ?? e?.code ?? e?.id ?? "未命名机构");
|
|
1509
|
-
}
|
|
1510
|
-
function bn(e, t) {
|
|
1511
|
-
if (e === "ownerScopeType") return Sn(X.value.ownerScopeType);
|
|
1512
|
-
if (e === "ownerScopeId") return V.value?.title ?? String(t ?? "");
|
|
1513
|
-
if (e === "memberRoleIds") return xn(t);
|
|
1514
|
-
}
|
|
1515
|
-
function xn(e) {
|
|
1516
|
-
let t = Tn(e);
|
|
1517
|
-
return t.length === 0 ? "-" : t.map((e) => {
|
|
1518
|
-
let t = Ae.value.find((t) => t.id === e);
|
|
1519
|
-
return t ? _n(t) : e;
|
|
1520
|
-
}).join(",");
|
|
1521
|
-
}
|
|
1522
|
-
function Sn(e) {
|
|
1523
|
-
return e === "platform" ? "平台" : e === "organization" ? "机构" : "租户";
|
|
1524
|
-
}
|
|
1525
|
-
function Cn(e) {
|
|
1526
|
-
return {
|
|
1527
|
-
title: vn(e),
|
|
1528
|
-
secondary: e.alias ?? e.id,
|
|
1529
|
-
muted: e.enabled === !1
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
|
-
function wn(e) {
|
|
1533
|
-
return {
|
|
1534
|
-
title: e.title ?? e.code ?? e.id ?? "未命名机构",
|
|
1535
|
-
secondary: e.code ?? e.id,
|
|
1536
|
-
muted: e.enabled === !1
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
function Tn(e) {
|
|
1540
|
-
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
1541
|
-
}
|
|
1542
|
-
return (e, n) => (F(), A("section", { class: ge(["role-management-page", {
|
|
1543
|
-
"role-management-page-platform": !Ue.value,
|
|
1544
|
-
"role-management-page--task": Q.value && !je.value
|
|
1545
|
-
}]) }, [
|
|
1546
|
-
!Q.value || je.value ? (F(), O(z(ce), {
|
|
1547
|
-
key: 0,
|
|
1548
|
-
class: "role-scope-panel",
|
|
1549
|
-
title: "租户",
|
|
1550
|
-
"refresh-title": "刷新租户列表",
|
|
1551
|
-
"search-keyword": E.value,
|
|
1552
|
-
"search-placeholder": "搜索租户名称、alias 或 ID",
|
|
1553
|
-
searchable: Be.value,
|
|
1554
|
-
onRefresh: n[2] ||= (e) => Be.value ? pe.value += 1 : ht(),
|
|
1555
|
-
"onUpdate:searchKeyword": n[3] ||= (e) => E.value = e
|
|
1556
|
-
}, {
|
|
1557
|
-
default: B(() => [Ie.value ? (F(), A("button", {
|
|
1558
|
-
key: 0,
|
|
1559
|
-
class: "role-platform-scope",
|
|
1560
|
-
type: "button",
|
|
1561
|
-
onClick: gt
|
|
1562
|
-
}, [N(z(C), {
|
|
1563
|
-
title: "平台角色",
|
|
1564
|
-
secondary: "全局范围",
|
|
1565
|
-
clickable: "",
|
|
1566
|
-
selected: V.value?.kind === "platform"
|
|
1567
|
-
}, null, 8, ["selected"])])) : k("v-if", !0), !Be.value && Ve.value ? (F(), A("button", {
|
|
1568
|
-
key: 1,
|
|
1569
|
-
class: "role-tenant-root-scope",
|
|
1570
|
-
type: "button",
|
|
1571
|
-
onClick: n[0] ||= (e) => _t(Ve.value)
|
|
1572
|
-
}, [N(z(C), {
|
|
1573
|
-
title: vn(Ve.value),
|
|
1574
|
-
secondary: "当前租户",
|
|
1575
|
-
clickable: "",
|
|
1576
|
-
selected: R.value?.id === Ve.value.id
|
|
1577
|
-
}, null, 8, ["title", "selected"])])) : (F(), O(z(u), {
|
|
1578
|
-
key: 2,
|
|
1579
|
-
context: Ne.value,
|
|
1580
|
-
"selected-id": R.value?.id,
|
|
1581
|
-
"reload-key": pe.value,
|
|
1582
|
-
keyword: E.value,
|
|
1583
|
-
"empty-description": "暂无租户",
|
|
1584
|
-
"loading-tip": "加载租户列表",
|
|
1585
|
-
"fallback-title": "未命名租户",
|
|
1586
|
-
"item-of": Cn,
|
|
1587
|
-
onLoaded: mt,
|
|
1588
|
-
onSelect: n[1] ||= (e) => _t(e)
|
|
1589
|
-
}, null, 8, [
|
|
1590
|
-
"context",
|
|
1591
|
-
"selected-id",
|
|
1592
|
-
"reload-key",
|
|
1593
|
-
"keyword"
|
|
1594
|
-
]))]),
|
|
1595
|
-
_: 1
|
|
1596
|
-
}, 8, ["search-keyword", "searchable"])) : k("v-if", !0),
|
|
1597
|
-
(!Q.value || je.value) && Ue.value ? (F(), O(z(ce), {
|
|
1598
|
-
key: 1,
|
|
1599
|
-
class: "role-scope-panel",
|
|
1600
|
-
title: "归属范围",
|
|
1601
|
-
"refresh-title": "刷新机构树",
|
|
1602
|
-
"search-keyword": fe.value,
|
|
1603
|
-
"search-placeholder": "搜索机构名称、编码或 ID",
|
|
1604
|
-
searchable: !!R.value,
|
|
1605
|
-
onRefresh: n[6] ||= (e) => P.value += 1,
|
|
1606
|
-
"onUpdate:searchKeyword": n[7] ||= (e) => fe.value = e
|
|
1607
|
-
}, {
|
|
1608
|
-
default: B(() => [V.value?.kind === "platform" ? (F(), O(z(d), {
|
|
1609
|
-
key: 0,
|
|
1610
|
-
description: "平台角色不需要选择租户内范围"
|
|
1611
|
-
})) : R.value ? (F(), A(he, { key: 2 }, [j("button", {
|
|
1612
|
-
class: "role-tenant-root-scope",
|
|
1613
|
-
type: "button",
|
|
1614
|
-
onClick: n[4] ||= (e) => vt()
|
|
1615
|
-
}, [N(z(C), {
|
|
1616
|
-
title: vn(R.value),
|
|
1617
|
-
secondary: "租户本级角色",
|
|
1618
|
-
clickable: "",
|
|
1619
|
-
selected: V.value?.kind === "tenant" && V.value.id === R.value.id
|
|
1620
|
-
}, null, 8, ["title", "selected"])]), N(z(ae), {
|
|
1621
|
-
context: He.value,
|
|
1622
|
-
"selected-id": V.value?.kind === "organization" ? V.value.id : void 0,
|
|
1623
|
-
"reload-key": P.value,
|
|
1624
|
-
keyword: fe.value,
|
|
1625
|
-
"search-mode": "none",
|
|
1626
|
-
"search-trigger": "external",
|
|
1627
|
-
"empty-description": "当前租户暂无机构",
|
|
1628
|
-
"loading-tip": "加载机构树",
|
|
1629
|
-
"fallback-title": "未命名机构",
|
|
1630
|
-
"item-of": wn,
|
|
1631
|
-
onSelect: n[5] ||= (e) => yt(e)
|
|
1632
|
-
}, null, 8, [
|
|
1633
|
-
"context",
|
|
1634
|
-
"selected-id",
|
|
1635
|
-
"reload-key",
|
|
1636
|
-
"keyword"
|
|
1637
|
-
])], 64)) : (F(), O(z(d), {
|
|
1638
|
-
key: 1,
|
|
1639
|
-
description: "请选择左侧租户"
|
|
1640
|
-
}))]),
|
|
1641
|
-
_: 1
|
|
1642
|
-
}, 8, ["search-keyword", "searchable"])) : k("v-if", !0),
|
|
1643
|
-
!Q.value || je.value ? (F(), O(z(h), {
|
|
1644
|
-
key: 2,
|
|
1645
|
-
class: "role-list-panel",
|
|
1646
|
-
context: We.value,
|
|
1647
|
-
title: V.value ? `角色列表 - ${V.value.title}` : "角色列表",
|
|
1648
|
-
columns: Ge.value,
|
|
1649
|
-
"standard-crud-actions": "",
|
|
1650
|
-
"standard-crud-row-actions": "",
|
|
1651
|
-
"extra-row-actions-of": xt,
|
|
1652
|
-
"row-action-state-of": St,
|
|
1653
|
-
"selected-key": H.value,
|
|
1654
|
-
"reload-key": L.value,
|
|
1655
|
-
ready: Ke.value,
|
|
1656
|
-
"quick-search-placeholder": "搜索角色名称或说明",
|
|
1657
|
-
"empty-description": "当前范围暂无角色",
|
|
1658
|
-
"waiting-description": "请选择角色归属范围",
|
|
1659
|
-
onAction: bt,
|
|
1660
|
-
onRowAction: Ct,
|
|
1661
|
-
onRowDblclick: Et,
|
|
1662
|
-
onSelect: n[8] ||= (e) => H.value = String(e.id ?? "")
|
|
1663
|
-
}, null, 8, [
|
|
1664
|
-
"context",
|
|
1665
|
-
"title",
|
|
1666
|
-
"columns",
|
|
1667
|
-
"selected-key",
|
|
1668
|
-
"reload-key",
|
|
1669
|
-
"ready"
|
|
1670
|
-
])) : k("v-if", !0),
|
|
1671
|
-
Me.value ? (F(), O(z(r), {
|
|
1672
|
-
key: 3,
|
|
1673
|
-
open: W.value,
|
|
1674
|
-
title: qe.value,
|
|
1675
|
-
subtitle: Je.value,
|
|
1676
|
-
"close-on-outside": G.value === "view",
|
|
1677
|
-
promotion: z(tt),
|
|
1678
|
-
onClose: jt
|
|
1679
|
-
}, {
|
|
1680
|
-
status: B(() => [G.value === "view" && U.value ? (F(), O(z(t), {
|
|
1681
|
-
key: 0,
|
|
1682
|
-
enabled: U.value.enabled !== !1,
|
|
1683
|
-
disabled: J.value || !Ze.value,
|
|
1684
|
-
loading: J.value,
|
|
1685
|
-
"show-label": !1,
|
|
1686
|
-
onChange: n[9] ||= (e) => Lt(U.value)
|
|
1687
|
-
}, null, 8, [
|
|
1688
|
-
"enabled",
|
|
1689
|
-
"disabled",
|
|
1690
|
-
"loading"
|
|
1691
|
-
])) : k("v-if", !0)]),
|
|
1692
|
-
operation: B(() => [N(z(a), {
|
|
1693
|
-
context: We.value,
|
|
1694
|
-
actions: $e.value,
|
|
1695
|
-
onAction: Nt
|
|
1696
|
-
}, null, 8, ["context", "actions"])]),
|
|
1697
|
-
default: B(() => [K.value ? (F(), O(z(te), {
|
|
1698
|
-
key: 0,
|
|
1699
|
-
class: "role-detail-state",
|
|
1700
|
-
tip: "加载角色详情"
|
|
1701
|
-
})) : q.value ? (F(), A("div", Re, [N(z(oe), {
|
|
1702
|
-
title: "详情加载失败",
|
|
1703
|
-
message: "无法加载角色详情,请重试"
|
|
1704
|
-
}), N(z(c), {
|
|
1705
|
-
type: "primary",
|
|
1706
|
-
"icon-name": "reload",
|
|
1707
|
-
onClick: Pt
|
|
1708
|
-
}, {
|
|
1709
|
-
default: B(() => [...n[15] ||= [M("重试", -1)]]),
|
|
1710
|
-
_: 1
|
|
1711
|
-
})])) : G.value === "view" || G.value === "create" || U.value ? (F(), A(he, { key: 2 }, [G.value === "view" ? (F(), O(z(v), {
|
|
1712
|
-
key: 0,
|
|
1713
|
-
record: X.value,
|
|
1714
|
-
"field-names": at.value,
|
|
1715
|
-
fields: Z.value,
|
|
1716
|
-
fallback: nt.value,
|
|
1717
|
-
"display-of": bn
|
|
1718
|
-
}, null, 8, [
|
|
1719
|
-
"record",
|
|
1720
|
-
"field-names",
|
|
1721
|
-
"fields",
|
|
1722
|
-
"fallback"
|
|
1723
|
-
])) : (F(), A("form", {
|
|
1724
|
-
key: 1,
|
|
1725
|
-
class: "role-form",
|
|
1726
|
-
onSubmit: be(Ft, ["prevent"])
|
|
1727
|
-
}, [
|
|
1728
|
-
j("label", null, [n[16] ||= j("span", { class: "role-form-label" }, "当前范围", -1), N(z(ne), {
|
|
1729
|
-
value: V.value?.title ?? "-",
|
|
1730
|
-
disabled: ""
|
|
1731
|
-
}, null, 8, ["value"])]),
|
|
1732
|
-
N(z(S), {
|
|
1733
|
-
record: X.value,
|
|
1734
|
-
"field-names": rt,
|
|
1735
|
-
fields: Z.value,
|
|
1736
|
-
fallback: nt.value,
|
|
1737
|
-
disabled: Ye.value,
|
|
1738
|
-
"disabled-of": ft,
|
|
1739
|
-
"onUpdate:field": pt
|
|
1740
|
-
}, null, 8, [
|
|
1741
|
-
"record",
|
|
1742
|
-
"fields",
|
|
1743
|
-
"fallback",
|
|
1744
|
-
"disabled"
|
|
1745
|
-
]),
|
|
1746
|
-
X.value.roleKind === "group" ? (F(), O(Le, {
|
|
1747
|
-
key: 0,
|
|
1748
|
-
value: X.value.memberRoleIds,
|
|
1749
|
-
candidates: Ae.value,
|
|
1750
|
-
"current-role-id": U.value?.id,
|
|
1751
|
-
disabled: Ye.value || U.value?.systemManaged === !0,
|
|
1752
|
-
"onUpdate:value": n[10] ||= (e) => pt("memberRoleIds", e)
|
|
1753
|
-
}, null, 8, [
|
|
1754
|
-
"value",
|
|
1755
|
-
"candidates",
|
|
1756
|
-
"current-role-id",
|
|
1757
|
-
"disabled"
|
|
1758
|
-
])) : k("v-if", !0),
|
|
1759
|
-
N(z(S), {
|
|
1760
|
-
record: X.value,
|
|
1761
|
-
"field-names": it,
|
|
1762
|
-
fields: Z.value,
|
|
1763
|
-
fallback: nt.value,
|
|
1764
|
-
disabled: Ye.value,
|
|
1765
|
-
"disabled-of": ft,
|
|
1766
|
-
"onUpdate:field": pt
|
|
1767
|
-
}, null, 8, [
|
|
1768
|
-
"record",
|
|
1769
|
-
"fields",
|
|
1770
|
-
"fallback",
|
|
1771
|
-
"disabled"
|
|
1772
|
-
])
|
|
1773
|
-
], 32)), G.value === "create" ? k("v-if", !0) : (F(), O(z(se), {
|
|
1774
|
-
key: 2,
|
|
1775
|
-
record: X.value,
|
|
1776
|
-
"show-sort-order": ""
|
|
1777
|
-
}, null, 8, ["record"]))], 64)) : k("v-if", !0)]),
|
|
1778
|
-
_: 1
|
|
1779
|
-
}, 8, [
|
|
1780
|
-
"open",
|
|
1781
|
-
"title",
|
|
1782
|
-
"subtitle",
|
|
1783
|
-
"close-on-outside",
|
|
1784
|
-
"promotion"
|
|
1785
|
-
])) : (F(), O(z(y), {
|
|
1786
|
-
key: 4,
|
|
1787
|
-
title: qe.value,
|
|
1788
|
-
subtitle: Je.value
|
|
1789
|
-
}, {
|
|
1790
|
-
status: B(() => [G.value === "view" && U.value ? (F(), O(z(t), {
|
|
1791
|
-
key: 0,
|
|
1792
|
-
enabled: U.value.enabled !== !1,
|
|
1793
|
-
disabled: J.value || !Ze.value,
|
|
1794
|
-
loading: J.value,
|
|
1795
|
-
"show-label": !1,
|
|
1796
|
-
onChange: n[11] ||= (e) => Lt(U.value)
|
|
1797
|
-
}, null, 8, [
|
|
1798
|
-
"enabled",
|
|
1799
|
-
"disabled",
|
|
1800
|
-
"loading"
|
|
1801
|
-
])) : k("v-if", !0)]),
|
|
1802
|
-
operation: B(() => [N(z(a), {
|
|
1803
|
-
context: z(b),
|
|
1804
|
-
actions: et.value,
|
|
1805
|
-
"record-id": U.value?.id,
|
|
1806
|
-
onAction: Nt
|
|
1807
|
-
}, null, 8, [
|
|
1808
|
-
"context",
|
|
1809
|
-
"actions",
|
|
1810
|
-
"record-id"
|
|
1811
|
-
])]),
|
|
1812
|
-
default: B(() => [K.value ? (F(), O(z(te), {
|
|
1813
|
-
key: 0,
|
|
1814
|
-
class: "role-detail-state",
|
|
1815
|
-
tip: "加载角色详情"
|
|
1816
|
-
})) : q.value ? (F(), A("div", ze, [N(z(oe), {
|
|
1817
|
-
title: "详情加载失败",
|
|
1818
|
-
message: "无法加载角色详情,请重试"
|
|
1819
|
-
}), N(z(c), {
|
|
1820
|
-
type: "primary",
|
|
1821
|
-
"icon-name": "reload",
|
|
1822
|
-
onClick: Pt
|
|
1823
|
-
}, {
|
|
1824
|
-
default: B(() => [...n[17] ||= [M("重试", -1)]]),
|
|
1825
|
-
_: 1
|
|
1826
|
-
})])) : G.value === "view" || U.value ? (F(), A(he, { key: 2 }, [G.value === "view" ? (F(), O(z(v), {
|
|
1827
|
-
key: 0,
|
|
1828
|
-
record: X.value,
|
|
1829
|
-
"field-names": at.value,
|
|
1830
|
-
fields: Z.value,
|
|
1831
|
-
fallback: nt.value,
|
|
1832
|
-
"display-of": bn
|
|
1833
|
-
}, null, 8, [
|
|
1834
|
-
"record",
|
|
1835
|
-
"field-names",
|
|
1836
|
-
"fields",
|
|
1837
|
-
"fallback"
|
|
1838
|
-
])) : (F(), A("form", {
|
|
1839
|
-
key: 1,
|
|
1840
|
-
class: "role-form",
|
|
1841
|
-
onSubmit: be(Ft, ["prevent"])
|
|
1842
|
-
}, [
|
|
1843
|
-
j("label", null, [n[18] ||= j("span", { class: "role-form-label" }, "当前范围", -1), N(z(ne), {
|
|
1844
|
-
value: V.value?.title ?? "-",
|
|
1845
|
-
disabled: ""
|
|
1846
|
-
}, null, 8, ["value"])]),
|
|
1847
|
-
N(z(S), {
|
|
1848
|
-
record: X.value,
|
|
1849
|
-
"field-names": rt,
|
|
1850
|
-
fields: Z.value,
|
|
1851
|
-
fallback: nt.value,
|
|
1852
|
-
disabled: Ye.value,
|
|
1853
|
-
"disabled-of": ft,
|
|
1854
|
-
"onUpdate:field": pt
|
|
1855
|
-
}, null, 8, [
|
|
1856
|
-
"record",
|
|
1857
|
-
"fields",
|
|
1858
|
-
"fallback",
|
|
1859
|
-
"disabled"
|
|
1860
|
-
]),
|
|
1861
|
-
X.value.roleKind === "group" ? (F(), O(Le, {
|
|
1862
|
-
key: 0,
|
|
1863
|
-
value: X.value.memberRoleIds,
|
|
1864
|
-
candidates: Ae.value,
|
|
1865
|
-
"current-role-id": U.value?.id,
|
|
1866
|
-
disabled: Ye.value || U.value?.systemManaged === !0,
|
|
1867
|
-
"onUpdate:value": n[12] ||= (e) => pt("memberRoleIds", e)
|
|
1868
|
-
}, null, 8, [
|
|
1869
|
-
"value",
|
|
1870
|
-
"candidates",
|
|
1871
|
-
"current-role-id",
|
|
1872
|
-
"disabled"
|
|
1873
|
-
])) : k("v-if", !0),
|
|
1874
|
-
N(z(S), {
|
|
1875
|
-
record: X.value,
|
|
1876
|
-
"field-names": it,
|
|
1877
|
-
fields: Z.value,
|
|
1878
|
-
fallback: nt.value,
|
|
1879
|
-
disabled: Ye.value,
|
|
1880
|
-
"disabled-of": ft,
|
|
1881
|
-
"onUpdate:field": pt
|
|
1882
|
-
}, null, 8, [
|
|
1883
|
-
"record",
|
|
1884
|
-
"fields",
|
|
1885
|
-
"fallback",
|
|
1886
|
-
"disabled"
|
|
1887
|
-
])
|
|
1888
|
-
], 32)), N(z(se), {
|
|
1889
|
-
record: X.value,
|
|
1890
|
-
"show-sort-order": ""
|
|
1891
|
-
}, null, 8, ["record"])], 64)) : k("v-if", !0)]),
|
|
1892
|
-
_: 1
|
|
1893
|
-
}, 8, ["title", "subtitle"])),
|
|
1894
|
-
N(Ee, {
|
|
1895
|
-
open: Se.value,
|
|
1896
|
-
context: z(b),
|
|
1897
|
-
role: xe.value,
|
|
1898
|
-
onClose: Ot,
|
|
1899
|
-
onSaved: n[13] ||= (e) => L.value += 1
|
|
1900
|
-
}, null, 8, [
|
|
1901
|
-
"open",
|
|
1902
|
-
"context",
|
|
1903
|
-
"role"
|
|
1904
|
-
]),
|
|
1905
|
-
N(Fe, {
|
|
1906
|
-
open: Ce.value,
|
|
1907
|
-
context: z(b),
|
|
1908
|
-
role: xe.value,
|
|
1909
|
-
onClose: Ot,
|
|
1910
|
-
onSaved: n[14] ||= (e) => L.value += 1
|
|
1911
|
-
}, null, 8, [
|
|
1912
|
-
"open",
|
|
1913
|
-
"context",
|
|
1914
|
-
"role"
|
|
1915
|
-
]),
|
|
1916
|
-
Te.value && we.value?.id ? (F(), O(me, {
|
|
1917
|
-
key: 5,
|
|
1918
|
-
"role-id": we.value.id,
|
|
1919
|
-
drawer: "",
|
|
1920
|
-
onClose: Tt
|
|
1921
|
-
}, null, 8, ["role-id"])) : k("v-if", !0)
|
|
1922
|
-
], 2));
|
|
1923
|
-
}
|
|
1924
|
-
}), [["__scopeId", "data-v-47bf49a4"]]);
|
|
1925
|
-
//#endregion
|
|
1926
|
-
export { Be as t };
|