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