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