@ximatai/muyun-web-app 0.26.9 → 0.26.11
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/{MetadataOrchestrationView-CzhAgEdX.js → MetadataOrchestrationView-F_Bmfn9K.js} +188 -188
- package/dist/{ModuleActionManagementView-CM2d8jPO.js → ModuleActionManagementView-Db_3Twom.js} +70 -70
- package/dist/RoleDetailWorkspaceView-UOm1ejGH.js +1369 -0
- package/dist/index.css +1 -1
- package/dist/index.js +274 -299
- package/dist/{platform-components-CIi6GdC9.js → platform-components-59b4qzUL.js} +2738 -2453
- package/dist/types/app/StaticRoutePageHost.vue.d.ts +2 -0
- package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +4 -2
- package/dist/types/consumer/index.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationInlineSurface.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationSurface.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/ModulePageListExpansionSurface.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansion.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansions.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +7 -2
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +5 -1
- package/dist/types/dynamic-page-runtime/composables/useModulePageFormContributionRuntime.d.ts +5 -3
- package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +95 -41
- package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +3 -2
- package/dist/types/dynamic-page-runtime/index.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +103 -3
- package/dist/types/dynamic-page-runtime/navigatorEntrySelection.d.ts +18 -0
- package/dist/types/dynamic-page-runtime/pageContextRuntime.d.ts +8 -0
- package/dist/types/dynamic-page-runtime/pageNavigatorItemModel.d.ts +13 -0
- package/dist/types/dynamic-page-runtime/recordDetailController.d.ts +9 -8
- package/dist/types/formula/FormulaRuntime.d.ts +3 -0
- package/dist/types/platform-admin-runtime/platformModulePageEnhancement.d.ts +6 -0
- package/dist/types/{views/SystemUserManagementView.vue.d.ts → platform-admin-runtime/role/RoleAccountGrantDrawerSurface.vue.d.ts} +2 -2
- package/dist/types/{views/UserDetailRouteView.vue.d.ts → platform-admin-runtime/role/RoleAuthorizationDrawerSurface.vue.d.ts} +2 -3
- package/dist/types/{views/SystemUserDetailWorkspaceView.vue.d.ts → platform-admin-runtime/role/RoleEmploymentGrantDrawerSurface.vue.d.ts} +2 -2
- package/dist/types/platform-admin-runtime/role/RoleEnumTitleCell.vue.d.ts +8 -0
- package/dist/types/{dynamic-page-runtime/DynamicModuleHost.vue.d.ts → platform-admin-runtime/role/RoleGroupMemberFormField.vue.d.ts} +2 -2
- 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/CrudRecordListExplorer.vue.d.ts +5 -1
- package/dist/types/platform-components/DrawerOperationBar.vue.d.ts +4 -2
- package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +6 -3
- package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +4 -2
- package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +2 -2
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordPanelButton.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordPicker.vue.d.ts +3 -1
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +13 -4
- package/dist/types/platform-components/RecordStatusSwitch.vue.d.ts +2 -0
- package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +5 -1
- package/dist/types/platform-components/index.d.ts +1 -3
- package/dist/types/platform-components/recordFormFieldModel.d.ts +16 -2
- package/dist/types/platform-components/recordPickerConstraints.d.ts +2 -0
- package/dist/types/platform-components/scopedTreeModuleContext.d.ts +2 -2
- package/dist/types/platform-components/staticTreeResourceModuleContext.d.ts +3 -3
- package/dist/types/platform-workbench/Workbench.vue.d.ts +4 -2
- package/dist/types/views/EmployeeEmploymentTable.vue.d.ts +5 -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/roleGrantClient.d.ts +8 -5
- package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +4 -2
- package/dist/types/vue-ui-antdv/components/UiSwitch.vue.d.ts +2 -0
- package/dist/types/vue-ui-antdv/components/UiTable.vue.d.ts +1 -0
- package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +20 -1
- package/dist/types/vue-ui-antdv/types.d.ts +6 -0
- package/dist/types/web-contracts/index.d.ts +81 -4
- package/dist/types/web-core/http.d.ts +6 -0
- package/dist/types/web-core/module/index.d.ts +1 -1
- package/dist/types/web-core/module/moduleContext.d.ts +2 -1
- package/dist/types/web-core/module/staticModuleClient.d.ts +10 -4
- package/dist/types/web-core/realtime.d.ts +8 -0
- package/dist/workspaceViews-BvV8mpML.js +11149 -0
- package/package.json +1 -1
- package/dist/DictionaryManagementView-CtIQpqVA.js +0 -1035
- package/dist/MenuManagementView-DJhkN2sG.js +0 -837
- package/dist/RoleAuthorizationView-jn_WUCeg.js +0 -599
- package/dist/RoleDetailWorkspaceView-CzaQ3Dz1.js +0 -26
- package/dist/RoleManagementView-nY7qu4GF.js +0 -1951
- package/dist/SystemUserDetailWorkspaceView-CBvqmWvP.js +0 -17
- package/dist/SystemUserManagementView-AEomKvK7.js +0 -887
- package/dist/currentUserContext-B1lj1WgF.js +0 -11
- 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/platform-components/scopedResourceTreeModuleContext.d.ts +0 -6
- package/dist/types/views/DictionaryManagementView.vue.d.ts +0 -3
- package/dist/types/views/MenuManagementView.vue.d.ts +0 -3
- 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/dictionaryManagementState.d.ts +0 -215
- package/dist/types/views/menuManagementState.d.ts +0 -180
- package/dist/types/views/systemUserDetailWorkspaceSession.d.ts +0 -12
- package/dist/types/views/systemUserDetailWorkspaceView.d.ts +0 -5
- 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/workspaceViewSessions-B5g4M0rT.js +0 -51
- package/dist/workspaceViews-CkERhK0K.js +0 -8748
|
@@ -0,0 +1,1369 @@
|
|
|
1
|
+
import { E as e, Gt as t, H as n, Lt as r, M as i, Mt as a, Nt as o, O as ee, R as te, U as ne, ft as re, ht as s, lt as ie, m as ae, mt as oe, n as se, o as ce, p as le, r as ue, s as de, st as c, v as fe, xt as pe, y as me, z as he, zt as l } from "./platform-components-59b4qzUL.js";
|
|
2
|
+
import { E as ge, J as _e, L as ve, a as ye, c as be, i as xe, o as Se, r as Ce, s as we, t as Te } from "./workspaceViews-BvV8mpML.js";
|
|
3
|
+
import { Fragment as Ee, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as De, createVNode as h, defineComponent as g, normalizeClass as Oe, onBeforeUnmount as ke, onMounted as Ae, openBlock as _, ref as v, unref as y, watch as je, withCtx as b, withModifiers as Me } from "vue";
|
|
4
|
+
//#region src/views/roleDetailWorkspaceSession.ts
|
|
5
|
+
function Ne(e, t) {
|
|
6
|
+
return Ce(ge, e, {
|
|
7
|
+
...t,
|
|
8
|
+
selectedRole: { ...t.selectedRole },
|
|
9
|
+
draft: { ...t.draft },
|
|
10
|
+
scope: {
|
|
11
|
+
...t.scope,
|
|
12
|
+
tenant: t.scope.tenant ? { ...t.scope.tenant } : void 0,
|
|
13
|
+
organization: t.scope.organization ? { ...t.scope.organization } : void 0
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function Pe(e, t) {
|
|
18
|
+
return xe(ge, e, t);
|
|
19
|
+
}
|
|
20
|
+
function Fe(e) {
|
|
21
|
+
return ye(ge, e);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/views/RoleGroupMemberSelector.vue?vue&type=script&setup=true&lang.ts
|
|
25
|
+
var x = { class: "role-group-member-selector" }, Ie = /*#__PURE__*/ l(/* @__PURE__ */ g({
|
|
26
|
+
name: "RoleGroupMemberSelector",
|
|
27
|
+
__name: "RoleGroupMemberSelector",
|
|
28
|
+
props: {
|
|
29
|
+
value: { default: void 0 },
|
|
30
|
+
candidates: {},
|
|
31
|
+
currentRoleId: { default: void 0 },
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
emits: ["update:value"],
|
|
38
|
+
setup(e, { emit: t }) {
|
|
39
|
+
let n = e, r = t, i = u(() => ne(n.value)), a = u(() => new Set(n.candidates.filter((e) => e.roleKind === "dataGrant" && e.id && i.value.includes(e.id)).map((e) => e.id))), ee = u(() => n.candidates.filter((e) => e.id && e.id !== n.currentRoleId).map((e) => ({
|
|
40
|
+
label: `${re(e)} / ${s(e.roleKind)}`,
|
|
41
|
+
value: e.id,
|
|
42
|
+
disabled: e.roleKind === "dataGrant" && a.value.size > 0 && !i.value.includes(e.id)
|
|
43
|
+
})));
|
|
44
|
+
function te(e) {
|
|
45
|
+
if (!Array.isArray(e)) {
|
|
46
|
+
r("update:value", void 0);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let t = e.map((e) => String(e).trim()).filter(Boolean);
|
|
50
|
+
r("update:value", t.length > 0 ? t.join(",") : void 0);
|
|
51
|
+
}
|
|
52
|
+
function ne(e) {
|
|
53
|
+
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
54
|
+
}
|
|
55
|
+
function re(e) {
|
|
56
|
+
return String(e?.title ?? e?.id ?? "角色");
|
|
57
|
+
}
|
|
58
|
+
function s(e) {
|
|
59
|
+
return e === "dataGrant" ? "数据授权角色" : "标准角色";
|
|
60
|
+
}
|
|
61
|
+
return (t, n) => (_(), p("label", x, [n[0] ||= m("span", { class: "role-group-member-selector-label" }, "成员角色", -1), h(y(o), {
|
|
62
|
+
mode: "multiple",
|
|
63
|
+
value: i.value,
|
|
64
|
+
options: ee.value,
|
|
65
|
+
placeholder: "请选择成员角色",
|
|
66
|
+
disabled: e.disabled,
|
|
67
|
+
"allow-clear": !0,
|
|
68
|
+
"onUpdate:value": te
|
|
69
|
+
}, null, 8, [
|
|
70
|
+
"value",
|
|
71
|
+
"options",
|
|
72
|
+
"disabled"
|
|
73
|
+
])]));
|
|
74
|
+
}
|
|
75
|
+
}), [["__scopeId", "data-v-91d9ae10"]]), Le = {
|
|
76
|
+
key: 1,
|
|
77
|
+
class: "role-detail-state"
|
|
78
|
+
}, Re = {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "role-detail-state"
|
|
81
|
+
}, S = /*#__PURE__*/ l(/* @__PURE__ */ g({
|
|
82
|
+
name: "RoleManagementView",
|
|
83
|
+
__name: "RoleManagementView",
|
|
84
|
+
props: {
|
|
85
|
+
recordId: {},
|
|
86
|
+
scopeKind: {},
|
|
87
|
+
scopeId: {}
|
|
88
|
+
},
|
|
89
|
+
setup(o) {
|
|
90
|
+
let l = o, ye = ve(), xe = t({ moduleAlias: "iam.tenant" }), Ce = t({ moduleAlias: "iam.organization" }), g = t({ moduleAlias: "iam.role" }), x = _e(), S = v(""), C = v(null), w = v(0), T = v(), E = v(), D = v(), O = v(), k = v(!1), A = v("view"), j = v(!1), M = v(!1), N = v(!1), P = v(), F = v(!1), I = v(!1), L = v(), ze = v(!1), R = v(0), z = v(Z(void 0)), B = v(he(void 0)), V = v([]), H = u(() => !!(l.recordId && l.scopeKind)), U = u(() => H.value && ye?.presentation === "drawer"), Be = u(() => !H.value || U.value), W = v([]), Ve = v([]), He = v(!1), G = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = u(() => Pn(W.value, S.value)), Ke = u(() => x?.value?.system === !0), qe = u(() => x?.value?.system === !0), Je = u(() => {
|
|
91
|
+
let e = x?.value?.tenantId;
|
|
92
|
+
if (!(x?.value?.system === !0 || !e)) return {
|
|
93
|
+
id: e,
|
|
94
|
+
title: e,
|
|
95
|
+
alias: e,
|
|
96
|
+
enabled: !0
|
|
97
|
+
};
|
|
98
|
+
}), Ye = u(() => pt(g, E.value)), Xe = u(() => [
|
|
99
|
+
{
|
|
100
|
+
key: "title",
|
|
101
|
+
title: "角色名称",
|
|
102
|
+
width: "22%"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: "assignmentType",
|
|
106
|
+
title: "授权层级",
|
|
107
|
+
width: "13%",
|
|
108
|
+
render: (e) => Sn(e, "assignmentType", vn(e.assignmentType))
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "roleKind",
|
|
112
|
+
title: "角色类型",
|
|
113
|
+
width: "13%",
|
|
114
|
+
render: (e) => Sn(e, "roleKind", yn(e.roleKind))
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "sharePolicy",
|
|
118
|
+
title: "公开策略",
|
|
119
|
+
width: "15%",
|
|
120
|
+
render: (e) => Sn(e, "sharePolicy", bn(e.sharePolicy))
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: "systemManaged",
|
|
124
|
+
title: "系统托管",
|
|
125
|
+
width: "12%",
|
|
126
|
+
render: (e) => xn(e.systemManaged)
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: "enabled",
|
|
130
|
+
title: "状态",
|
|
131
|
+
type: "enabledStatus",
|
|
132
|
+
width: "10%"
|
|
133
|
+
}
|
|
134
|
+
]), Ze = u(() => !!E.value), Qe = u(() => A.value === "create" ? "新建角色" : $(O.value ?? z.value)), $e = u(() => E.value?.title ?? "角色详情"), K = u(() => N.value || j.value), et = u(() => j.value || !E.value ? !1 : A.value === "create" ? g.can("create") === !0 : !!O.value?.id && g.can("update") === !0 && !O.value?.systemManaged), tt = u(() => {
|
|
135
|
+
let e = O.value;
|
|
136
|
+
return !!(e?.id && e.systemManaged !== !0 && g.can(Dn(e)) === !0);
|
|
137
|
+
}), nt = u(() => A.value === "view" ? O.value?.id ? [
|
|
138
|
+
{
|
|
139
|
+
key: "edit",
|
|
140
|
+
actionCode: "update",
|
|
141
|
+
title: "编辑",
|
|
142
|
+
iconName: "edit",
|
|
143
|
+
disabled: N.value || O.value.systemManaged === !0
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: "bind",
|
|
147
|
+
actionCode: Tn(O.value),
|
|
148
|
+
title: En(O.value),
|
|
149
|
+
iconName: "lock",
|
|
150
|
+
visible: Cn(O.value),
|
|
151
|
+
disabled: N.value || O.value.systemManaged === !0
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "delete",
|
|
155
|
+
actionCode: "delete",
|
|
156
|
+
title: "删除",
|
|
157
|
+
iconName: "delete",
|
|
158
|
+
danger: !0,
|
|
159
|
+
disabled: N.value || O.value.systemManaged === !0
|
|
160
|
+
}
|
|
161
|
+
] : [] : [{
|
|
162
|
+
key: "cancel",
|
|
163
|
+
title: "取消",
|
|
164
|
+
iconName: "close",
|
|
165
|
+
disabled: N.value
|
|
166
|
+
}, {
|
|
167
|
+
key: "save",
|
|
168
|
+
actionCode: A.value === "create" ? "create" : "update",
|
|
169
|
+
title: "保存",
|
|
170
|
+
iconName: "save",
|
|
171
|
+
primary: !0,
|
|
172
|
+
loading: N.value,
|
|
173
|
+
disabled: !et.value
|
|
174
|
+
}]), rt = u(() => nt.value), it = u(() => nt.value), at = Se({
|
|
175
|
+
view: ge,
|
|
176
|
+
input: u(() => {
|
|
177
|
+
let e = O.value?.id, t = E.value, n = A.value;
|
|
178
|
+
if (!(!e || !t || n !== "view" && n !== "edit")) return {
|
|
179
|
+
recordId: e,
|
|
180
|
+
scopeKind: t.kind,
|
|
181
|
+
...t.kind === "platform" ? {} : { scopeId: t.id }
|
|
182
|
+
};
|
|
183
|
+
}),
|
|
184
|
+
title: u(() => $(O.value)),
|
|
185
|
+
eligibility: u(() => ({
|
|
186
|
+
hasStableIdentity: !!(O.value?.id && E.value) && !j.value,
|
|
187
|
+
busy: N.value
|
|
188
|
+
})),
|
|
189
|
+
beforePromote: async (e) => {
|
|
190
|
+
let t = O.value, n = E.value;
|
|
191
|
+
if (!(!t || !n)) return await Ne(e, {
|
|
192
|
+
selectedRole: t,
|
|
193
|
+
draft: z.value,
|
|
194
|
+
scope: n,
|
|
195
|
+
mode: A.value === "edit" ? "edit" : "view"
|
|
196
|
+
}) === "accepted";
|
|
197
|
+
},
|
|
198
|
+
onPromoted: Gt
|
|
199
|
+
}), q = u(() => ({
|
|
200
|
+
title: {
|
|
201
|
+
label: "角色名称",
|
|
202
|
+
required: !0,
|
|
203
|
+
visible: !0,
|
|
204
|
+
placeholder: "请输入角色名称"
|
|
205
|
+
},
|
|
206
|
+
assignmentType: {
|
|
207
|
+
label: "授权层级",
|
|
208
|
+
required: !0,
|
|
209
|
+
visible: !0,
|
|
210
|
+
controlType: "select",
|
|
211
|
+
options: fn(z.value.roleKind)
|
|
212
|
+
},
|
|
213
|
+
roleKind: {
|
|
214
|
+
label: "角色类型",
|
|
215
|
+
required: !0,
|
|
216
|
+
visible: !0,
|
|
217
|
+
controlType: "select",
|
|
218
|
+
options: pn(z.value.assignmentType)
|
|
219
|
+
},
|
|
220
|
+
memberRoleIds: {
|
|
221
|
+
label: "成员角色",
|
|
222
|
+
visible: z.value.roleKind === "group"
|
|
223
|
+
},
|
|
224
|
+
ownerScopeType: {
|
|
225
|
+
label: "归属范围",
|
|
226
|
+
required: !0,
|
|
227
|
+
visible: !0,
|
|
228
|
+
readOnly: !0,
|
|
229
|
+
controlType: "select",
|
|
230
|
+
options: [
|
|
231
|
+
{
|
|
232
|
+
label: "平台",
|
|
233
|
+
value: "platform"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
label: "租户",
|
|
237
|
+
value: "tenant"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
label: "机构",
|
|
241
|
+
value: "organization"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
ownerScopeId: {
|
|
246
|
+
label: "归属对象",
|
|
247
|
+
visible: !0,
|
|
248
|
+
readOnly: !0
|
|
249
|
+
},
|
|
250
|
+
sharePolicy: {
|
|
251
|
+
label: "公开策略",
|
|
252
|
+
required: !0,
|
|
253
|
+
visible: !0,
|
|
254
|
+
controlType: "select",
|
|
255
|
+
options: _n(E.value?.kind ?? z.value.ownerScopeType)
|
|
256
|
+
},
|
|
257
|
+
description: {
|
|
258
|
+
label: "说明",
|
|
259
|
+
visible: !0,
|
|
260
|
+
placeholder: "请输入角色说明"
|
|
261
|
+
},
|
|
262
|
+
enabled: {
|
|
263
|
+
label: "启用状态",
|
|
264
|
+
visible: !0,
|
|
265
|
+
controlType: "enabledStatus"
|
|
266
|
+
},
|
|
267
|
+
sortOrder: {
|
|
268
|
+
label: "排序号",
|
|
269
|
+
visible: !0,
|
|
270
|
+
placeholder: "请输入排序号"
|
|
271
|
+
}
|
|
272
|
+
})), ot = [
|
|
273
|
+
"title",
|
|
274
|
+
"assignmentType",
|
|
275
|
+
"roleKind"
|
|
276
|
+
], st = [
|
|
277
|
+
"ownerScopeType",
|
|
278
|
+
"ownerScopeId",
|
|
279
|
+
"sharePolicy",
|
|
280
|
+
"description",
|
|
281
|
+
"enabled",
|
|
282
|
+
"sortOrder"
|
|
283
|
+
], ct = u(() => {
|
|
284
|
+
let e = [
|
|
285
|
+
"title",
|
|
286
|
+
"assignmentType",
|
|
287
|
+
"roleKind"
|
|
288
|
+
];
|
|
289
|
+
return z.value.roleKind === "group" && e.push("memberRoleIds"), e.push("ownerScopeType", "ownerScopeId", "sharePolicy", "description", "enabled", "sortOrder"), e;
|
|
290
|
+
}), lt;
|
|
291
|
+
Ae(() => {
|
|
292
|
+
if (dt(), (!H.value || U.value) && gt(), !H.value || !l.recordId || !l.scopeKind) return;
|
|
293
|
+
let e = tn();
|
|
294
|
+
e && !U.value && (lt = Pe(e, ut)), en();
|
|
295
|
+
}), ke(() => lt?.());
|
|
296
|
+
function ut(e) {
|
|
297
|
+
return A.value === "edit" ? !1 : (an(e), !0);
|
|
298
|
+
}
|
|
299
|
+
je(O, (e) => {
|
|
300
|
+
!H.value || !e || ye?.setTitle($(e));
|
|
301
|
+
}, { immediate: !0 }), je(Je, kt, { immediate: !0 }), je(E, () => {
|
|
302
|
+
H.value || (D.value = void 0, O.value = void 0, z.value = Z(E.value), Gt(), w.value += 1, ft());
|
|
303
|
+
});
|
|
304
|
+
async function dt() {
|
|
305
|
+
try {
|
|
306
|
+
B.value = he((await g.runtime.ready).uiDescriptor);
|
|
307
|
+
} catch (e) {
|
|
308
|
+
c(e, {
|
|
309
|
+
source: "role-management",
|
|
310
|
+
phase: "load"
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async function ft(e = E.value) {
|
|
315
|
+
if (!e) {
|
|
316
|
+
V.value = [];
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
V.value = (await g.crud.query(mt({
|
|
321
|
+
page: {
|
|
322
|
+
pageNum: 0,
|
|
323
|
+
pageSize: 500
|
|
324
|
+
},
|
|
325
|
+
conditions: [
|
|
326
|
+
{
|
|
327
|
+
fieldName: "assignmentType",
|
|
328
|
+
operator: "EQ",
|
|
329
|
+
values: ["employment"]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
fieldName: "roleKind",
|
|
333
|
+
operator: "IN",
|
|
334
|
+
values: ["standard", "dataGrant"]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
fieldName: "enabled",
|
|
338
|
+
operator: "EQ",
|
|
339
|
+
values: [!0]
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
sorts: [{ field: "sortOrder" }, { field: "title" }]
|
|
343
|
+
}, e))).records;
|
|
344
|
+
} catch (e) {
|
|
345
|
+
V.value = [], c(e, {
|
|
346
|
+
source: "role-management",
|
|
347
|
+
phase: "load"
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function pt(e, t) {
|
|
352
|
+
return {
|
|
353
|
+
...e,
|
|
354
|
+
crud: {
|
|
355
|
+
...e.crud,
|
|
356
|
+
query: (n) => t ? e.crud.query(mt(n, t)) : e.crud.query(n)
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function mt(e, t) {
|
|
361
|
+
let n = [...e?.conditions ?? [], {
|
|
362
|
+
fieldName: "ownerScopeType",
|
|
363
|
+
operator: "EQ",
|
|
364
|
+
values: [t.kind]
|
|
365
|
+
}];
|
|
366
|
+
return t.kind !== "platform" && t.id && n.push({
|
|
367
|
+
fieldName: "ownerScopeId",
|
|
368
|
+
operator: "EQ",
|
|
369
|
+
values: [t.id]
|
|
370
|
+
}), {
|
|
371
|
+
...e,
|
|
372
|
+
conditions: n
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function ht(e) {
|
|
376
|
+
return e === "ownerScopeType" || e === "ownerScopeId" || A.value === "edit" && ["assignmentType", "roleKind"].includes(e) ? !0 : O.value?.systemManaged === !0;
|
|
377
|
+
}
|
|
378
|
+
function J(e, t) {
|
|
379
|
+
let n = {
|
|
380
|
+
...z.value,
|
|
381
|
+
[e]: t
|
|
382
|
+
};
|
|
383
|
+
e === "roleKind" && (t === "group" || t === "dataGrant") && (n.assignmentType = "employment"), e === "roleKind" && t !== "group" && (n.memberRoleIds = void 0), e === "assignmentType" && t === "account" && dn(n.roleKind) && (n.roleKind = "standard", n.memberRoleIds = void 0), z.value = n;
|
|
384
|
+
}
|
|
385
|
+
async function gt() {
|
|
386
|
+
if (!(H.value && !U.value)) {
|
|
387
|
+
if (!qe.value) {
|
|
388
|
+
let e = Je.value;
|
|
389
|
+
if (!e?.id) return;
|
|
390
|
+
G.set(e.id, e), W.value = [_t(e)], kt(e);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
He.value = !0;
|
|
394
|
+
try {
|
|
395
|
+
await xe.runtime.ready;
|
|
396
|
+
let e = await xe.abilities.crud().query({ page: {
|
|
397
|
+
pageNum: 1,
|
|
398
|
+
pageSize: 200
|
|
399
|
+
} });
|
|
400
|
+
G.clear(), e.records.forEach((e) => {
|
|
401
|
+
e.id && G.set(e.id, e);
|
|
402
|
+
}), W.value = e.records.map(_t), !E.value && Ke.value && At();
|
|
403
|
+
} catch (e) {
|
|
404
|
+
W.value = [], c(e, {
|
|
405
|
+
source: "role-management",
|
|
406
|
+
phase: "load"
|
|
407
|
+
});
|
|
408
|
+
} finally {
|
|
409
|
+
He.value = !1;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function _t(e) {
|
|
414
|
+
return {
|
|
415
|
+
key: Ct(e.id),
|
|
416
|
+
title: kn(e),
|
|
417
|
+
secondary: e.alias ?? e.id,
|
|
418
|
+
muted: e.enabled === !1,
|
|
419
|
+
isLeaf: !1
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
async function vt(e) {
|
|
423
|
+
let t = Et(e.key);
|
|
424
|
+
if (!t || e.children !== void 0) return;
|
|
425
|
+
let n = G.get(t);
|
|
426
|
+
if (n) try {
|
|
427
|
+
let r = ce(Ce, {
|
|
428
|
+
scopeFieldName: "tenantId",
|
|
429
|
+
scopeValue: t,
|
|
430
|
+
treePath: "/iam.organization/tree"
|
|
431
|
+
});
|
|
432
|
+
await r.runtime.ready;
|
|
433
|
+
let i = await r.abilities.tree().tree(), a = [yt(n), ...i.records.map((e) => bt(e, t))];
|
|
434
|
+
St(e.key, {
|
|
435
|
+
...e,
|
|
436
|
+
children: a
|
|
437
|
+
});
|
|
438
|
+
} catch (e) {
|
|
439
|
+
throw c(e, {
|
|
440
|
+
source: "role-management",
|
|
441
|
+
phase: "load"
|
|
442
|
+
}), e;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function yt(e) {
|
|
446
|
+
return {
|
|
447
|
+
key: wt(e.id),
|
|
448
|
+
title: kn(e),
|
|
449
|
+
secondary: "租户本级角色",
|
|
450
|
+
isLeaf: !0
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function bt(e, t) {
|
|
454
|
+
let n = e.record;
|
|
455
|
+
return n.id && (Ue.set(n.id, n), We.set(n.id, t)), {
|
|
456
|
+
key: Tt(n.id),
|
|
457
|
+
title: An(n),
|
|
458
|
+
secondary: n.code ?? n.id,
|
|
459
|
+
muted: n.enabled === !1,
|
|
460
|
+
isLeaf: e.children.length === 0,
|
|
461
|
+
children: e.children.map((e) => bt(e, t))
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
function xt(e) {
|
|
465
|
+
let t = Et(e.key);
|
|
466
|
+
if (t) {
|
|
467
|
+
let e = G.get(t);
|
|
468
|
+
e && Mt(e);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
let n = Dt(e.key);
|
|
472
|
+
if (n) {
|
|
473
|
+
let e = G.get(n);
|
|
474
|
+
e && Mt(e);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
let r = Ot(e.key);
|
|
478
|
+
if (!r) return;
|
|
479
|
+
let i = Ue.get(r), a = We.get(r);
|
|
480
|
+
i && a && (T.value = G.get(a), Pt(i));
|
|
481
|
+
}
|
|
482
|
+
function St(e, t) {
|
|
483
|
+
let n = (r) => r.map((r) => r.key === e ? t : r.children ? {
|
|
484
|
+
...r,
|
|
485
|
+
children: n(r.children)
|
|
486
|
+
} : r);
|
|
487
|
+
W.value = n(W.value);
|
|
488
|
+
}
|
|
489
|
+
function Ct(e) {
|
|
490
|
+
return `tenant:${e ?? ""}`;
|
|
491
|
+
}
|
|
492
|
+
function wt(e) {
|
|
493
|
+
return `tenant-root:${e ?? ""}`;
|
|
494
|
+
}
|
|
495
|
+
function Tt(e) {
|
|
496
|
+
return `organization:${e ?? ""}`;
|
|
497
|
+
}
|
|
498
|
+
function Et(e) {
|
|
499
|
+
return e.startsWith("tenant:") ? e.slice(7) : void 0;
|
|
500
|
+
}
|
|
501
|
+
function Dt(e) {
|
|
502
|
+
return e.startsWith("tenant-root:") ? e.slice(12) : void 0;
|
|
503
|
+
}
|
|
504
|
+
function Ot(e) {
|
|
505
|
+
return e.startsWith("organization:") ? e.slice(13) : void 0;
|
|
506
|
+
}
|
|
507
|
+
function kt(e = Je.value) {
|
|
508
|
+
!e || qe.value || T.value || E.value || (T.value = e, Nt(e));
|
|
509
|
+
}
|
|
510
|
+
function At() {
|
|
511
|
+
!X() || !Ke.value || (T.value = void 0, E.value = {
|
|
512
|
+
kind: "platform",
|
|
513
|
+
key: "platform",
|
|
514
|
+
title: "平台角色"
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
function jt() {
|
|
518
|
+
if (X()) {
|
|
519
|
+
if (!Ke.value) {
|
|
520
|
+
Nt();
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
At();
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
function Mt(e) {
|
|
527
|
+
X() && (T.value = e, Nt(e));
|
|
528
|
+
}
|
|
529
|
+
function Nt(e = T.value) {
|
|
530
|
+
!e?.id || !X() || (E.value = {
|
|
531
|
+
kind: "tenant",
|
|
532
|
+
id: e.id,
|
|
533
|
+
key: `tenant:${e.id}`,
|
|
534
|
+
title: `${kn(e)} / 租户本级`,
|
|
535
|
+
tenant: e
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function Pt(e) {
|
|
539
|
+
!e.id || !X() || (E.value = {
|
|
540
|
+
kind: "organization",
|
|
541
|
+
id: e.id,
|
|
542
|
+
key: `organization:${e.id}`,
|
|
543
|
+
title: An(e),
|
|
544
|
+
tenant: T.value,
|
|
545
|
+
organization: e
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function Ft(e) {
|
|
549
|
+
e.key === "create" && Wt();
|
|
550
|
+
}
|
|
551
|
+
function It(e) {
|
|
552
|
+
return [
|
|
553
|
+
{
|
|
554
|
+
key: "bind",
|
|
555
|
+
actionCode: Tn(e),
|
|
556
|
+
title: "绑定",
|
|
557
|
+
after: "edit",
|
|
558
|
+
pinned: !0,
|
|
559
|
+
visible: Cn(e)
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
key: "authorize",
|
|
563
|
+
actionCode: "rolePermissions",
|
|
564
|
+
title: "授权",
|
|
565
|
+
after: "bind",
|
|
566
|
+
pinned: !0,
|
|
567
|
+
visible: wn(e)
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
key: "toggle",
|
|
571
|
+
actionCode: Dn(e),
|
|
572
|
+
title: On(e),
|
|
573
|
+
iconName: "power",
|
|
574
|
+
before: "delete"
|
|
575
|
+
}
|
|
576
|
+
];
|
|
577
|
+
}
|
|
578
|
+
function Lt(e, t) {
|
|
579
|
+
if (e.systemManaged !== !0) return;
|
|
580
|
+
let n = t.key ?? t.actionCode;
|
|
581
|
+
return n === "edit" || n === "update" || n === "bind" || n === "authorize" || n === "toggle" || n === "delete" ? { disabled: !0 } : void 0;
|
|
582
|
+
}
|
|
583
|
+
function Rt(e, t) {
|
|
584
|
+
if (X()) {
|
|
585
|
+
if (e.key === "view") {
|
|
586
|
+
Y(t, "view");
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (e.key === "edit") {
|
|
590
|
+
Y(t, "edit");
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
if (e.key === "bind") {
|
|
594
|
+
Ht(t, t.assignmentType === "employment");
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (e.key === "authorize") {
|
|
598
|
+
zt(t);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
if (e.key === "toggle") {
|
|
602
|
+
Zt(t);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
e.key === "delete" && Xt(t);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function zt(e) {
|
|
609
|
+
!String(e.id ?? "") || e.roleKind === "group" || (L.value = Q(e), ze.value = !0);
|
|
610
|
+
}
|
|
611
|
+
function Bt() {
|
|
612
|
+
ze.value = !1, L.value = void 0;
|
|
613
|
+
}
|
|
614
|
+
function Vt(e) {
|
|
615
|
+
X() && Y(e, "view");
|
|
616
|
+
}
|
|
617
|
+
async function Ht(e, t = !1) {
|
|
618
|
+
if (!X()) return;
|
|
619
|
+
let n = String(e.id ?? "");
|
|
620
|
+
if (n) {
|
|
621
|
+
F.value = !t, I.value = t, P.value = Q(e);
|
|
622
|
+
try {
|
|
623
|
+
P.value = await g.crud.view(n);
|
|
624
|
+
} catch (e) {
|
|
625
|
+
F.value = !1, I.value = !1, P.value = void 0, c(e, {
|
|
626
|
+
source: "role-management",
|
|
627
|
+
phase: "load"
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function Ut() {
|
|
633
|
+
N.value || (F.value = !1, I.value = !1, P.value = void 0);
|
|
634
|
+
}
|
|
635
|
+
function Wt() {
|
|
636
|
+
if (X()) {
|
|
637
|
+
if (!E.value) {
|
|
638
|
+
ie("请先选择角色归属范围", { phase: "validation" });
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
O.value = void 0, D.value = void 0, z.value = Z(E.value), A.value = "create", j.value = !1, M.value = !1, R.value += 1, k.value = !0;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
async function Y(e, t) {
|
|
645
|
+
if (!X()) return;
|
|
646
|
+
let n = String(e.id ?? "");
|
|
647
|
+
if (!n) return;
|
|
648
|
+
D.value = n, k.value = !0, A.value = t, O.value = void 0, z.value = Q(e), j.value = !0, M.value = !1;
|
|
649
|
+
let r = R.value + 1;
|
|
650
|
+
R.value = r;
|
|
651
|
+
try {
|
|
652
|
+
let e = await g.crud.view(n);
|
|
653
|
+
if (!Qt(n, r)) return;
|
|
654
|
+
if (!rn(e)) {
|
|
655
|
+
M.value = !0, ie("角色不属于当前归属范围", {
|
|
656
|
+
source: "role-management",
|
|
657
|
+
phase: "load"
|
|
658
|
+
});
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
$t(e, t);
|
|
662
|
+
} catch (e) {
|
|
663
|
+
Qt(n, r) && (M.value = !0, c(e, {
|
|
664
|
+
source: "role-management",
|
|
665
|
+
phase: "load"
|
|
666
|
+
}));
|
|
667
|
+
} finally {
|
|
668
|
+
Qt(n, r) && (j.value = !1);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function Gt() {
|
|
672
|
+
N.value || (R.value += 1, j.value = !1, M.value = !1, k.value = !1, A.value = "view", z.value = O.value ? Q(O.value) : Z(E.value), U.value && ye?.dismiss());
|
|
673
|
+
}
|
|
674
|
+
function Kt() {
|
|
675
|
+
if (!N.value) {
|
|
676
|
+
if (!O.value?.id || A.value === "create") {
|
|
677
|
+
Gt();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
z.value = Q(O.value), A.value = "view", j.value = !1, M.value = !1;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function qt(e) {
|
|
684
|
+
if (e.key === "cancel") {
|
|
685
|
+
Kt();
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
if (e.key === "save") {
|
|
689
|
+
Yt();
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
if (X()) {
|
|
693
|
+
if (e.key === "edit" && O.value && !O.value.systemManaged) {
|
|
694
|
+
z.value = Q(O.value), A.value = "edit";
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
if (e.key === "bind" && O.value) {
|
|
698
|
+
Ht(O.value, O.value.assignmentType === "employment");
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
e.key === "delete" && Xt(O.value);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function Jt() {
|
|
705
|
+
let e = String(z.value.id ?? D.value ?? "");
|
|
706
|
+
if (!e) return;
|
|
707
|
+
let t = A.value === "create" ? "view" : A.value;
|
|
708
|
+
Y({
|
|
709
|
+
...z.value,
|
|
710
|
+
id: e
|
|
711
|
+
}, t);
|
|
712
|
+
}
|
|
713
|
+
async function Yt() {
|
|
714
|
+
await se({
|
|
715
|
+
loading: N,
|
|
716
|
+
mode: A.value === "edit" ? "edit" : "create",
|
|
717
|
+
source: "role-management",
|
|
718
|
+
validateContext: () => E.value ? void 0 : "请先选择角色归属范围",
|
|
719
|
+
canSave: () => et.value,
|
|
720
|
+
deniedMessage: "当前用户无权保存角色",
|
|
721
|
+
createRecord: () => on(z.value, E.value),
|
|
722
|
+
validateRecord: cn,
|
|
723
|
+
save: (e, t) => t === "edit" && O.value?.id ? g.crud.update(O.value.id, e) : g.crud.insert(e),
|
|
724
|
+
onSaved: ({ record: e }) => {
|
|
725
|
+
$t(e), w.value += 1, ft();
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
async function Xt(e) {
|
|
730
|
+
await ue({
|
|
731
|
+
loading: N,
|
|
732
|
+
source: "role-management",
|
|
733
|
+
record: () => e?.id ? e : void 0,
|
|
734
|
+
canExecute: (e) => g.can("delete") === !0 && e.systemManaged !== !0,
|
|
735
|
+
deniedMessage: "当前用户无权删除角色",
|
|
736
|
+
confirm: (e) => re({
|
|
737
|
+
title: "删除角色",
|
|
738
|
+
content: `确认删除角色「${$(e)}」?`,
|
|
739
|
+
okText: "删除",
|
|
740
|
+
danger: !0
|
|
741
|
+
}),
|
|
742
|
+
execute: (e) => g.crud.delete(String(e.id), { version: e.version }),
|
|
743
|
+
onExecuted: (e, t) => {
|
|
744
|
+
D.value === String(t.id) && (D.value = void 0, O.value = void 0, z.value = Z(E.value), k.value = !1, A.value = "view", j.value = !1, M.value = !1, R.value += 1), w.value += 1, ft();
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
async function Zt(e) {
|
|
749
|
+
await ue({
|
|
750
|
+
loading: N,
|
|
751
|
+
source: "role-management",
|
|
752
|
+
record: () => e?.id ? e : void 0,
|
|
753
|
+
canExecute: (e) => g.can(Dn(e)) === !0 && e.systemManaged !== !0,
|
|
754
|
+
deniedMessage: "当前用户无权变更角色启停状态",
|
|
755
|
+
execute: (e) => e.enabled === !1 ? g.crud.enable(String(e.id), { version: e.version }) : g.crud.disable(String(e.id), { version: e.version }),
|
|
756
|
+
onExecuted: async (e, t) => {
|
|
757
|
+
D.value === String(t.id) && $t(await g.crud.view(String(t.id))), w.value += 1, ft();
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
function X() {
|
|
762
|
+
return !N.value;
|
|
763
|
+
}
|
|
764
|
+
function Qt(e, t) {
|
|
765
|
+
return R.value === t && D.value === e;
|
|
766
|
+
}
|
|
767
|
+
function $t(e, t = "view") {
|
|
768
|
+
O.value = e, D.value = e.id, z.value = Q(e), A.value = t === "edit" && e.systemManaged !== !0 ? "edit" : "view", k.value = !0, j.value = !1, M.value = !1, R.value += 1;
|
|
769
|
+
}
|
|
770
|
+
async function en() {
|
|
771
|
+
let e = tn();
|
|
772
|
+
if (!e) return;
|
|
773
|
+
E.value = nn(e);
|
|
774
|
+
let t = Fe(e);
|
|
775
|
+
if (t) {
|
|
776
|
+
an(t);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
await Y({ id: e.recordId }, "view");
|
|
780
|
+
}
|
|
781
|
+
function tn() {
|
|
782
|
+
let e = l.recordId, t = l.scopeKind;
|
|
783
|
+
if (!(!e || !t || t !== "platform" && !l.scopeId)) return {
|
|
784
|
+
recordId: e,
|
|
785
|
+
scopeKind: t,
|
|
786
|
+
...t === "platform" ? {} : { scopeId: l.scopeId }
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
function nn(e) {
|
|
790
|
+
if (e.scopeKind === "platform") return {
|
|
791
|
+
kind: "platform",
|
|
792
|
+
key: "platform",
|
|
793
|
+
title: "平台角色"
|
|
794
|
+
};
|
|
795
|
+
let t = e.scopeId, n = e.scopeKind === "organization" ? `机构:${t}` : `租户:${t}`;
|
|
796
|
+
return {
|
|
797
|
+
kind: e.scopeKind,
|
|
798
|
+
id: t,
|
|
799
|
+
key: `${e.scopeKind}:${t}`,
|
|
800
|
+
title: n,
|
|
801
|
+
...e.scopeKind === "tenant" ? { tenant: {
|
|
802
|
+
id: t,
|
|
803
|
+
title: t,
|
|
804
|
+
alias: t
|
|
805
|
+
} } : {}
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function rn(e) {
|
|
809
|
+
let t = E.value;
|
|
810
|
+
return !t || e.ownerScopeType !== t.kind ? !1 : t.kind === "platform" || e.ownerScopeId === t.id;
|
|
811
|
+
}
|
|
812
|
+
function an(e) {
|
|
813
|
+
E.value = e.scope, O.value = e.selectedRole, D.value = e.selectedRole.id, z.value = e.draft, A.value = e.mode, k.value = !0, j.value = !1, M.value = !1, R.value += 1;
|
|
814
|
+
}
|
|
815
|
+
function Z(e) {
|
|
816
|
+
return {
|
|
817
|
+
tenantId: sn(e),
|
|
818
|
+
ownerScopeType: e?.kind,
|
|
819
|
+
ownerScopeId: e?.kind === "platform" ? void 0 : e?.id,
|
|
820
|
+
assignmentType: "employment",
|
|
821
|
+
roleKind: "standard",
|
|
822
|
+
sharePolicy: hn(),
|
|
823
|
+
enabled: !0,
|
|
824
|
+
sortOrder: 100
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
function Q(e) {
|
|
828
|
+
return { ...e };
|
|
829
|
+
}
|
|
830
|
+
function on(e, t) {
|
|
831
|
+
let n = un(e.roleKind), r = mn(e.sharePolicy, t.kind), i = de(e, {
|
|
832
|
+
title: e.title?.trim(),
|
|
833
|
+
assignmentType: ln(e.assignmentType, n),
|
|
834
|
+
roleKind: n,
|
|
835
|
+
memberRoleIds: e.memberRoleIds?.trim() || void 0,
|
|
836
|
+
tenantId: sn(t),
|
|
837
|
+
ownerScopeType: t.kind,
|
|
838
|
+
ownerScopeId: t.kind === "platform" ? void 0 : t.id,
|
|
839
|
+
ownerScopeKey: void 0,
|
|
840
|
+
sharePolicy: r,
|
|
841
|
+
description: e.description?.trim() || void 0,
|
|
842
|
+
enabled: e.enabled !== !1,
|
|
843
|
+
sortOrder: gn(e.sortOrder)
|
|
844
|
+
});
|
|
845
|
+
return n !== "group" && (i.memberRoleIds = void 0), i;
|
|
846
|
+
}
|
|
847
|
+
function sn(e) {
|
|
848
|
+
return e?.kind === "platform" ? void 0 : e?.tenant?.id ?? e?.id;
|
|
849
|
+
}
|
|
850
|
+
function cn(e) {
|
|
851
|
+
for (let t of [
|
|
852
|
+
"title",
|
|
853
|
+
"assignmentType",
|
|
854
|
+
"roleKind",
|
|
855
|
+
"ownerScopeType",
|
|
856
|
+
"sharePolicy"
|
|
857
|
+
]) {
|
|
858
|
+
let n = te(t, {
|
|
859
|
+
fields: B.value,
|
|
860
|
+
fallback: q.value
|
|
861
|
+
});
|
|
862
|
+
if (n.visible && n.required && !e[t]) return `请填写${n.label}`;
|
|
863
|
+
}
|
|
864
|
+
if (e.ownerScopeType !== "platform" && !e.ownerScopeId) return "请选择归属对象";
|
|
865
|
+
if (!_n(e.ownerScopeType).some((t) => t.value === e.sharePolicy)) return "请选择当前归属范围可用的公开策略";
|
|
866
|
+
}
|
|
867
|
+
function ln(e, t) {
|
|
868
|
+
return t === "group" || t === "dataGrant" ? "employment" : e === "account" ? "account" : "employment";
|
|
869
|
+
}
|
|
870
|
+
function un(e) {
|
|
871
|
+
return e === "group" || e === "dataGrant" || e === "system" ? e : "standard";
|
|
872
|
+
}
|
|
873
|
+
function dn(e) {
|
|
874
|
+
return e === "group" || e === "dataGrant";
|
|
875
|
+
}
|
|
876
|
+
function fn(e) {
|
|
877
|
+
return dn(e) ? [{
|
|
878
|
+
label: "任职角色",
|
|
879
|
+
value: "employment"
|
|
880
|
+
}] : [{
|
|
881
|
+
label: "账号角色",
|
|
882
|
+
value: "account"
|
|
883
|
+
}, {
|
|
884
|
+
label: "任职角色",
|
|
885
|
+
value: "employment"
|
|
886
|
+
}];
|
|
887
|
+
}
|
|
888
|
+
function pn(e) {
|
|
889
|
+
let t = [{
|
|
890
|
+
label: "标准角色",
|
|
891
|
+
value: "standard"
|
|
892
|
+
}, {
|
|
893
|
+
label: "系统角色",
|
|
894
|
+
value: "system"
|
|
895
|
+
}];
|
|
896
|
+
return e === "account" ? t : [
|
|
897
|
+
t[0],
|
|
898
|
+
{
|
|
899
|
+
label: "角色组",
|
|
900
|
+
value: "group"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
label: "数据授权角色",
|
|
904
|
+
value: "dataGrant"
|
|
905
|
+
},
|
|
906
|
+
t[1]
|
|
907
|
+
];
|
|
908
|
+
}
|
|
909
|
+
function mn(e, t) {
|
|
910
|
+
return _n(t).map((e) => e.value).includes(e ?? "") ? e : hn();
|
|
911
|
+
}
|
|
912
|
+
function hn() {
|
|
913
|
+
return "private";
|
|
914
|
+
}
|
|
915
|
+
function gn(e) {
|
|
916
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : 100;
|
|
917
|
+
let t = Number(String(e ?? "").trim());
|
|
918
|
+
return Number.isFinite(t) ? t : 100;
|
|
919
|
+
}
|
|
920
|
+
function _n(e) {
|
|
921
|
+
return e === "platform" ? [{
|
|
922
|
+
label: "私有",
|
|
923
|
+
value: "private"
|
|
924
|
+
}, {
|
|
925
|
+
label: "全局公开",
|
|
926
|
+
value: "platform"
|
|
927
|
+
}] : e === "organization" ? [{
|
|
928
|
+
label: "私有",
|
|
929
|
+
value: "private"
|
|
930
|
+
}, {
|
|
931
|
+
label: "本级及下级",
|
|
932
|
+
value: "ownerAndChildren"
|
|
933
|
+
}] : [{
|
|
934
|
+
label: "私有",
|
|
935
|
+
value: "private"
|
|
936
|
+
}, {
|
|
937
|
+
label: "租户公开",
|
|
938
|
+
value: "tenant"
|
|
939
|
+
}];
|
|
940
|
+
}
|
|
941
|
+
function vn(e) {
|
|
942
|
+
return e === "account" ? "账号角色" : "任职角色";
|
|
943
|
+
}
|
|
944
|
+
function yn(e) {
|
|
945
|
+
return {
|
|
946
|
+
standard: "标准角色",
|
|
947
|
+
group: "角色组",
|
|
948
|
+
dataGrant: "数据授权角色",
|
|
949
|
+
system: "系统角色"
|
|
950
|
+
}[e ?? "standard"];
|
|
951
|
+
}
|
|
952
|
+
function bn(e) {
|
|
953
|
+
return {
|
|
954
|
+
private: "私有",
|
|
955
|
+
ownerAndChildren: "本级及下级",
|
|
956
|
+
tenant: "租户公开",
|
|
957
|
+
platform: "全局公开"
|
|
958
|
+
}[e ?? "private"];
|
|
959
|
+
}
|
|
960
|
+
function xn(e) {
|
|
961
|
+
return e === !0 ? "是" : "否";
|
|
962
|
+
}
|
|
963
|
+
function Sn(e, t, n) {
|
|
964
|
+
let r = e[`${t}Title`];
|
|
965
|
+
return typeof r == "string" && r.trim() ? r : n;
|
|
966
|
+
}
|
|
967
|
+
function Cn(e) {
|
|
968
|
+
return !!e?.id && (e?.assignmentType === "account" || e?.assignmentType === "employment");
|
|
969
|
+
}
|
|
970
|
+
function wn(e) {
|
|
971
|
+
return !!e?.id && e?.roleKind !== "group";
|
|
972
|
+
}
|
|
973
|
+
function Tn(e) {
|
|
974
|
+
return e?.assignmentType === "employment" ? "employmentRoleGrants" : "accountRoleGrants";
|
|
975
|
+
}
|
|
976
|
+
function En(e) {
|
|
977
|
+
return e?.assignmentType === "employment" ? "绑定任职" : "绑定用户";
|
|
978
|
+
}
|
|
979
|
+
function Dn(e) {
|
|
980
|
+
return e?.enabled === !1 ? "enable" : "disable";
|
|
981
|
+
}
|
|
982
|
+
function On(e) {
|
|
983
|
+
return e?.enabled === !1 ? "启用" : "停用";
|
|
984
|
+
}
|
|
985
|
+
function $(e) {
|
|
986
|
+
return String(e?.title ?? e?.id ?? "角色");
|
|
987
|
+
}
|
|
988
|
+
function kn(e) {
|
|
989
|
+
return String(e?.title ?? e?.alias ?? e?.id ?? "未命名租户");
|
|
990
|
+
}
|
|
991
|
+
function An(e) {
|
|
992
|
+
return String(e?.title ?? e?.code ?? e?.id ?? "未命名机构");
|
|
993
|
+
}
|
|
994
|
+
function jn(e, t) {
|
|
995
|
+
if (e === "ownerScopeType") return Nn(z.value.ownerScopeType);
|
|
996
|
+
if (e === "ownerScopeId") return E.value?.title ?? String(t ?? "");
|
|
997
|
+
if (e === "memberRoleIds") return Mn(t);
|
|
998
|
+
}
|
|
999
|
+
function Mn(e) {
|
|
1000
|
+
let t = Fn(e);
|
|
1001
|
+
return t.length === 0 ? "-" : t.map((e) => {
|
|
1002
|
+
let t = V.value.find((t) => t.id === e);
|
|
1003
|
+
return t ? $(t) : e;
|
|
1004
|
+
}).join(",");
|
|
1005
|
+
}
|
|
1006
|
+
function Nn(e) {
|
|
1007
|
+
return e === "platform" ? "平台" : e === "organization" ? "机构" : "租户";
|
|
1008
|
+
}
|
|
1009
|
+
function Pn(e, t) {
|
|
1010
|
+
let n = t.trim().toLowerCase();
|
|
1011
|
+
return n ? e.flatMap((e) => {
|
|
1012
|
+
let r = e.children ? Pn(e.children, t) : void 0;
|
|
1013
|
+
return [
|
|
1014
|
+
e.title,
|
|
1015
|
+
e.secondary,
|
|
1016
|
+
e.key
|
|
1017
|
+
].some((e) => e?.toLowerCase().includes(n)) || (r?.length ?? 0) > 0 ? [{
|
|
1018
|
+
...e,
|
|
1019
|
+
...r ? { children: r } : {}
|
|
1020
|
+
}] : [];
|
|
1021
|
+
}) : e;
|
|
1022
|
+
}
|
|
1023
|
+
function Fn(e) {
|
|
1024
|
+
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
1025
|
+
}
|
|
1026
|
+
return (t, o) => (_(), p("section", {
|
|
1027
|
+
ref_key: "pageRoot",
|
|
1028
|
+
ref: C,
|
|
1029
|
+
class: Oe(["role-management-page", { "role-management-page--task": H.value && !U.value }])
|
|
1030
|
+
}, [
|
|
1031
|
+
!H.value || U.value ? (_(), d(y(me), {
|
|
1032
|
+
key: 0,
|
|
1033
|
+
class: "role-scope-panel",
|
|
1034
|
+
title: "租户",
|
|
1035
|
+
"refresh-title": "刷新租户列表",
|
|
1036
|
+
"search-keyword": S.value,
|
|
1037
|
+
"search-placeholder": "搜索租户名称、alias 或 ID",
|
|
1038
|
+
searchable: qe.value,
|
|
1039
|
+
onRefresh: gt,
|
|
1040
|
+
"onUpdate:searchKeyword": o[1] ||= (e) => S.value = e
|
|
1041
|
+
}, {
|
|
1042
|
+
default: b(() => [He.value ? (_(), d(y(s), {
|
|
1043
|
+
key: 0,
|
|
1044
|
+
tip: "加载租户"
|
|
1045
|
+
})) : (_(), d(y(pe), {
|
|
1046
|
+
key: 1,
|
|
1047
|
+
"expanded-keys": Ve.value,
|
|
1048
|
+
"onUpdate:expandedKeys": o[0] ||= (e) => Ve.value = e,
|
|
1049
|
+
nodes: Ge.value,
|
|
1050
|
+
"selected-key": E.value?.kind === "tenant" ? wt(E.value.id) : E.value?.kind === "organization" ? Tt(E.value.id) : void 0,
|
|
1051
|
+
"load-children": vt,
|
|
1052
|
+
onSelect: xt,
|
|
1053
|
+
onDeselect: jt
|
|
1054
|
+
}, null, 8, [
|
|
1055
|
+
"expanded-keys",
|
|
1056
|
+
"nodes",
|
|
1057
|
+
"selected-key"
|
|
1058
|
+
]))]),
|
|
1059
|
+
_: 1
|
|
1060
|
+
}, 8, ["search-keyword", "searchable"])) : f("v-if", !0),
|
|
1061
|
+
!H.value || U.value ? (_(), d(y(ee), {
|
|
1062
|
+
key: 1,
|
|
1063
|
+
class: "role-list-panel",
|
|
1064
|
+
context: Ye.value,
|
|
1065
|
+
title: E.value ? `角色列表 - ${E.value.title}` : "角色列表",
|
|
1066
|
+
columns: Xe.value,
|
|
1067
|
+
"standard-crud-actions": "",
|
|
1068
|
+
"standard-crud-row-actions": "",
|
|
1069
|
+
"extra-row-actions-of": It,
|
|
1070
|
+
"row-action-state-of": Lt,
|
|
1071
|
+
"selected-key": D.value,
|
|
1072
|
+
"reload-key": w.value,
|
|
1073
|
+
ready: Ze.value,
|
|
1074
|
+
"quick-search-placeholder": "搜索角色名称或说明",
|
|
1075
|
+
"empty-description": "当前范围暂无角色",
|
|
1076
|
+
"waiting-description": "请选择角色归属范围",
|
|
1077
|
+
onAction: Ft,
|
|
1078
|
+
onRowAction: Rt,
|
|
1079
|
+
onRowDblclick: Vt,
|
|
1080
|
+
onSelect: o[2] ||= (e) => D.value = String(e.id ?? "")
|
|
1081
|
+
}, null, 8, [
|
|
1082
|
+
"context",
|
|
1083
|
+
"title",
|
|
1084
|
+
"columns",
|
|
1085
|
+
"selected-key",
|
|
1086
|
+
"reload-key",
|
|
1087
|
+
"ready"
|
|
1088
|
+
])) : f("v-if", !0),
|
|
1089
|
+
Be.value ? (_(), d(y(n), {
|
|
1090
|
+
key: 2,
|
|
1091
|
+
open: k.value,
|
|
1092
|
+
title: Qe.value,
|
|
1093
|
+
"render-mode": "inline",
|
|
1094
|
+
subtitle: $e.value,
|
|
1095
|
+
"close-on-outside": A.value === "view",
|
|
1096
|
+
promotion: y(at),
|
|
1097
|
+
onClose: Gt
|
|
1098
|
+
}, {
|
|
1099
|
+
status: b(() => [A.value === "view" && O.value ? (_(), d(y(fe), {
|
|
1100
|
+
key: 0,
|
|
1101
|
+
enabled: O.value.enabled !== !1,
|
|
1102
|
+
disabled: N.value || !tt.value,
|
|
1103
|
+
loading: N.value,
|
|
1104
|
+
"show-label": !1,
|
|
1105
|
+
onChange: o[3] ||= (e) => Zt(O.value)
|
|
1106
|
+
}, null, 8, [
|
|
1107
|
+
"enabled",
|
|
1108
|
+
"disabled",
|
|
1109
|
+
"loading"
|
|
1110
|
+
])) : f("v-if", !0)]),
|
|
1111
|
+
operation: b(() => [h(y(ne), {
|
|
1112
|
+
context: Ye.value,
|
|
1113
|
+
actions: rt.value,
|
|
1114
|
+
onAction: qt
|
|
1115
|
+
}, null, 8, ["context", "actions"])]),
|
|
1116
|
+
default: b(() => [j.value ? (_(), d(y(s), {
|
|
1117
|
+
key: 0,
|
|
1118
|
+
class: "role-detail-state",
|
|
1119
|
+
tip: "加载角色详情"
|
|
1120
|
+
})) : M.value ? (_(), p("div", Le, [h(y(oe), {
|
|
1121
|
+
title: "详情加载失败",
|
|
1122
|
+
message: "无法加载角色详情,请重试"
|
|
1123
|
+
}), h(y(r), {
|
|
1124
|
+
type: "primary",
|
|
1125
|
+
"icon-name": "reload",
|
|
1126
|
+
onClick: Jt
|
|
1127
|
+
}, {
|
|
1128
|
+
default: b(() => [...o[9] ||= [De("重试", -1)]]),
|
|
1129
|
+
_: 1
|
|
1130
|
+
})])) : A.value === "view" || A.value === "create" || O.value ? (_(), p(Ee, { key: 2 }, [A.value === "view" ? (_(), d(y(i), {
|
|
1131
|
+
key: 0,
|
|
1132
|
+
record: z.value,
|
|
1133
|
+
"field-names": ct.value,
|
|
1134
|
+
fields: B.value,
|
|
1135
|
+
fallback: q.value,
|
|
1136
|
+
"display-of": jn
|
|
1137
|
+
}, null, 8, [
|
|
1138
|
+
"record",
|
|
1139
|
+
"field-names",
|
|
1140
|
+
"fields",
|
|
1141
|
+
"fallback"
|
|
1142
|
+
])) : (_(), p("form", {
|
|
1143
|
+
key: 1,
|
|
1144
|
+
class: "role-form",
|
|
1145
|
+
onSubmit: Me(Yt, ["prevent"])
|
|
1146
|
+
}, [
|
|
1147
|
+
m("label", null, [o[10] ||= m("span", { class: "role-form-label" }, "当前范围", -1), h(y(a), {
|
|
1148
|
+
value: E.value?.title ?? "-",
|
|
1149
|
+
disabled: ""
|
|
1150
|
+
}, null, 8, ["value"])]),
|
|
1151
|
+
h(y(ae), {
|
|
1152
|
+
record: z.value,
|
|
1153
|
+
"field-names": ot,
|
|
1154
|
+
fields: B.value,
|
|
1155
|
+
fallback: q.value,
|
|
1156
|
+
disabled: K.value,
|
|
1157
|
+
"disabled-of": ht,
|
|
1158
|
+
"onUpdate:field": J
|
|
1159
|
+
}, null, 8, [
|
|
1160
|
+
"record",
|
|
1161
|
+
"fields",
|
|
1162
|
+
"fallback",
|
|
1163
|
+
"disabled"
|
|
1164
|
+
]),
|
|
1165
|
+
z.value.roleKind === "group" ? (_(), d(Ie, {
|
|
1166
|
+
key: 0,
|
|
1167
|
+
value: z.value.memberRoleIds,
|
|
1168
|
+
candidates: V.value,
|
|
1169
|
+
"current-role-id": O.value?.id,
|
|
1170
|
+
disabled: K.value || O.value?.systemManaged === !0,
|
|
1171
|
+
"onUpdate:value": o[4] ||= (e) => J("memberRoleIds", e)
|
|
1172
|
+
}, null, 8, [
|
|
1173
|
+
"value",
|
|
1174
|
+
"candidates",
|
|
1175
|
+
"current-role-id",
|
|
1176
|
+
"disabled"
|
|
1177
|
+
])) : f("v-if", !0),
|
|
1178
|
+
h(y(ae), {
|
|
1179
|
+
record: z.value,
|
|
1180
|
+
"field-names": st,
|
|
1181
|
+
fields: B.value,
|
|
1182
|
+
fallback: q.value,
|
|
1183
|
+
disabled: K.value,
|
|
1184
|
+
"disabled-of": ht,
|
|
1185
|
+
"onUpdate:field": J
|
|
1186
|
+
}, null, 8, [
|
|
1187
|
+
"record",
|
|
1188
|
+
"fields",
|
|
1189
|
+
"fallback",
|
|
1190
|
+
"disabled"
|
|
1191
|
+
])
|
|
1192
|
+
], 32)), A.value === "create" ? f("v-if", !0) : (_(), d(y(le), {
|
|
1193
|
+
key: 2,
|
|
1194
|
+
record: z.value,
|
|
1195
|
+
"show-sort-order": ""
|
|
1196
|
+
}, null, 8, ["record"]))], 64)) : f("v-if", !0)]),
|
|
1197
|
+
_: 1
|
|
1198
|
+
}, 8, [
|
|
1199
|
+
"open",
|
|
1200
|
+
"title",
|
|
1201
|
+
"subtitle",
|
|
1202
|
+
"close-on-outside",
|
|
1203
|
+
"promotion"
|
|
1204
|
+
])) : (_(), d(y(e), {
|
|
1205
|
+
key: 3,
|
|
1206
|
+
title: Qe.value,
|
|
1207
|
+
subtitle: $e.value
|
|
1208
|
+
}, {
|
|
1209
|
+
status: b(() => [A.value === "view" && O.value ? (_(), d(y(fe), {
|
|
1210
|
+
key: 0,
|
|
1211
|
+
enabled: O.value.enabled !== !1,
|
|
1212
|
+
disabled: N.value || !tt.value,
|
|
1213
|
+
loading: N.value,
|
|
1214
|
+
"show-label": !1,
|
|
1215
|
+
onChange: o[5] ||= (e) => Zt(O.value)
|
|
1216
|
+
}, null, 8, [
|
|
1217
|
+
"enabled",
|
|
1218
|
+
"disabled",
|
|
1219
|
+
"loading"
|
|
1220
|
+
])) : f("v-if", !0)]),
|
|
1221
|
+
operation: b(() => [h(y(ne), {
|
|
1222
|
+
context: y(g),
|
|
1223
|
+
actions: it.value,
|
|
1224
|
+
"record-id": O.value?.id,
|
|
1225
|
+
onAction: qt
|
|
1226
|
+
}, null, 8, [
|
|
1227
|
+
"context",
|
|
1228
|
+
"actions",
|
|
1229
|
+
"record-id"
|
|
1230
|
+
])]),
|
|
1231
|
+
default: b(() => [j.value ? (_(), d(y(s), {
|
|
1232
|
+
key: 0,
|
|
1233
|
+
class: "role-detail-state",
|
|
1234
|
+
tip: "加载角色详情"
|
|
1235
|
+
})) : M.value ? (_(), p("div", Re, [h(y(oe), {
|
|
1236
|
+
title: "详情加载失败",
|
|
1237
|
+
message: "无法加载角色详情,请重试"
|
|
1238
|
+
}), h(y(r), {
|
|
1239
|
+
type: "primary",
|
|
1240
|
+
"icon-name": "reload",
|
|
1241
|
+
onClick: Jt
|
|
1242
|
+
}, {
|
|
1243
|
+
default: b(() => [...o[11] ||= [De("重试", -1)]]),
|
|
1244
|
+
_: 1
|
|
1245
|
+
})])) : A.value === "view" || O.value ? (_(), p(Ee, { key: 2 }, [A.value === "view" ? (_(), d(y(i), {
|
|
1246
|
+
key: 0,
|
|
1247
|
+
record: z.value,
|
|
1248
|
+
"field-names": ct.value,
|
|
1249
|
+
fields: B.value,
|
|
1250
|
+
fallback: q.value,
|
|
1251
|
+
"display-of": jn
|
|
1252
|
+
}, null, 8, [
|
|
1253
|
+
"record",
|
|
1254
|
+
"field-names",
|
|
1255
|
+
"fields",
|
|
1256
|
+
"fallback"
|
|
1257
|
+
])) : (_(), p("form", {
|
|
1258
|
+
key: 1,
|
|
1259
|
+
class: "role-form",
|
|
1260
|
+
onSubmit: Me(Yt, ["prevent"])
|
|
1261
|
+
}, [
|
|
1262
|
+
m("label", null, [o[12] ||= m("span", { class: "role-form-label" }, "当前范围", -1), h(y(a), {
|
|
1263
|
+
value: E.value?.title ?? "-",
|
|
1264
|
+
disabled: ""
|
|
1265
|
+
}, null, 8, ["value"])]),
|
|
1266
|
+
h(y(ae), {
|
|
1267
|
+
record: z.value,
|
|
1268
|
+
"field-names": ot,
|
|
1269
|
+
fields: B.value,
|
|
1270
|
+
fallback: q.value,
|
|
1271
|
+
disabled: K.value,
|
|
1272
|
+
"disabled-of": ht,
|
|
1273
|
+
"onUpdate:field": J
|
|
1274
|
+
}, null, 8, [
|
|
1275
|
+
"record",
|
|
1276
|
+
"fields",
|
|
1277
|
+
"fallback",
|
|
1278
|
+
"disabled"
|
|
1279
|
+
]),
|
|
1280
|
+
z.value.roleKind === "group" ? (_(), d(Ie, {
|
|
1281
|
+
key: 0,
|
|
1282
|
+
value: z.value.memberRoleIds,
|
|
1283
|
+
candidates: V.value,
|
|
1284
|
+
"current-role-id": O.value?.id,
|
|
1285
|
+
disabled: K.value || O.value?.systemManaged === !0,
|
|
1286
|
+
"onUpdate:value": o[6] ||= (e) => J("memberRoleIds", e)
|
|
1287
|
+
}, null, 8, [
|
|
1288
|
+
"value",
|
|
1289
|
+
"candidates",
|
|
1290
|
+
"current-role-id",
|
|
1291
|
+
"disabled"
|
|
1292
|
+
])) : f("v-if", !0),
|
|
1293
|
+
h(y(ae), {
|
|
1294
|
+
record: z.value,
|
|
1295
|
+
"field-names": st,
|
|
1296
|
+
fields: B.value,
|
|
1297
|
+
fallback: q.value,
|
|
1298
|
+
disabled: K.value,
|
|
1299
|
+
"disabled-of": ht,
|
|
1300
|
+
"onUpdate:field": J
|
|
1301
|
+
}, null, 8, [
|
|
1302
|
+
"record",
|
|
1303
|
+
"fields",
|
|
1304
|
+
"fallback",
|
|
1305
|
+
"disabled"
|
|
1306
|
+
])
|
|
1307
|
+
], 32)), h(y(le), {
|
|
1308
|
+
record: z.value,
|
|
1309
|
+
"show-sort-order": ""
|
|
1310
|
+
}, null, 8, ["record"])], 64)) : f("v-if", !0)]),
|
|
1311
|
+
_: 1
|
|
1312
|
+
}, 8, ["title", "subtitle"])),
|
|
1313
|
+
h(be, {
|
|
1314
|
+
open: F.value,
|
|
1315
|
+
context: y(g),
|
|
1316
|
+
role: P.value,
|
|
1317
|
+
container: C.value,
|
|
1318
|
+
onClose: Ut,
|
|
1319
|
+
onSaved: o[7] ||= (e) => w.value += 1
|
|
1320
|
+
}, null, 8, [
|
|
1321
|
+
"open",
|
|
1322
|
+
"context",
|
|
1323
|
+
"role",
|
|
1324
|
+
"container"
|
|
1325
|
+
]),
|
|
1326
|
+
h(we, {
|
|
1327
|
+
open: I.value,
|
|
1328
|
+
context: y(g),
|
|
1329
|
+
role: P.value,
|
|
1330
|
+
container: C.value,
|
|
1331
|
+
onClose: Ut,
|
|
1332
|
+
onSaved: o[8] ||= (e) => w.value += 1
|
|
1333
|
+
}, null, 8, [
|
|
1334
|
+
"open",
|
|
1335
|
+
"context",
|
|
1336
|
+
"role",
|
|
1337
|
+
"container"
|
|
1338
|
+
]),
|
|
1339
|
+
ze.value && L.value?.id ? (_(), d(Te, {
|
|
1340
|
+
key: 4,
|
|
1341
|
+
"role-id": L.value.id,
|
|
1342
|
+
container: C.value,
|
|
1343
|
+
drawer: "",
|
|
1344
|
+
onClose: Bt
|
|
1345
|
+
}, null, 8, ["role-id", "container"])) : f("v-if", !0)
|
|
1346
|
+
], 2));
|
|
1347
|
+
}
|
|
1348
|
+
}), [["__scopeId", "data-v-0af66625"]]), C = /* @__PURE__ */ g({
|
|
1349
|
+
name: "RoleDetailWorkspaceView",
|
|
1350
|
+
__name: "RoleDetailWorkspaceView",
|
|
1351
|
+
props: {
|
|
1352
|
+
recordId: {},
|
|
1353
|
+
scopeKind: {},
|
|
1354
|
+
scopeId: {}
|
|
1355
|
+
},
|
|
1356
|
+
setup(e) {
|
|
1357
|
+
return (t, n) => (_(), d(S, {
|
|
1358
|
+
"record-id": e.recordId,
|
|
1359
|
+
"scope-kind": e.scopeKind,
|
|
1360
|
+
"scope-id": e.scopeId
|
|
1361
|
+
}, null, 8, [
|
|
1362
|
+
"record-id",
|
|
1363
|
+
"scope-kind",
|
|
1364
|
+
"scope-id"
|
|
1365
|
+
]));
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
//#endregion
|
|
1369
|
+
export { C as default };
|