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