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