@ximatai/muyun-web-app 0.26.9 → 0.26.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MetadataOrchestrationView-CzhAgEdX.js → MetadataOrchestrationView-BhtVwJII.js} +182 -182
- package/dist/{ModuleActionManagementView-CM2d8jPO.js → ModuleActionManagementView-DpZS-xAD.js} +70 -70
- package/dist/RoleAuthorizationView-8lilhtMB.js +646 -0
- package/dist/{RoleDetailWorkspaceView-CzaQ3Dz1.js → RoleDetailWorkspaceView-CFha6JHn.js} +1 -1
- package/dist/{RoleManagementView-nY7qu4GF.js → RoleManagementView-0_KDrzgh.js} +511 -514
- package/dist/index.css +1 -1
- package/dist/index.js +282 -302
- package/dist/{platform-components-CIi6GdC9.js → platform-components-oRIsIoxu.js} +2060 -1893
- package/dist/types/app/StaticRoutePageHost.vue.d.ts +2 -0
- package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +4 -2
- package/dist/types/consumer/index.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationInlineSurface.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/ManagedDetailRelationSurface.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/ModulePageListExpansionSurface.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansion.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansions.vue.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +7 -2
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +69 -15
- package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +3 -2
- package/dist/types/dynamic-page-runtime/index.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +35 -3
- package/dist/types/dynamic-page-runtime/navigatorEntrySelection.d.ts +18 -0
- package/dist/types/dynamic-page-runtime/pageContextRuntime.d.ts +8 -0
- package/dist/types/dynamic-page-runtime/pageNavigatorItemModel.d.ts +13 -0
- package/dist/types/dynamic-page-runtime/recordDetailController.d.ts +9 -8
- package/dist/types/platform-admin-runtime/platformModulePageEnhancement.d.ts +6 -0
- package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +4 -0
- package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +5 -3
- package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +2 -2
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordPanelButton.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordPicker.vue.d.ts +2 -0
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +7 -1
- package/dist/types/platform-components/RecordStatusSwitch.vue.d.ts +2 -0
- package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +4 -0
- package/dist/types/platform-components/index.d.ts +0 -2
- package/dist/types/platform-components/recordFormFieldModel.d.ts +16 -2
- package/dist/types/platform-components/recordPickerConstraints.d.ts +2 -0
- package/dist/types/platform-workbench/Workbench.vue.d.ts +4 -2
- package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +4 -2
- package/dist/types/vue-ui-antdv/components/UiSwitch.vue.d.ts +2 -0
- package/dist/types/web-contracts/index.d.ts +72 -2
- package/dist/types/web-core/http.d.ts +6 -0
- package/dist/types/web-core/module/index.d.ts +1 -1
- package/dist/types/web-core/module/moduleContext.d.ts +2 -1
- package/dist/types/web-core/module/staticModuleClient.d.ts +6 -0
- package/dist/types/web-core/realtime.d.ts +8 -0
- package/dist/{workspaceViews-CkERhK0K.js → workspaceViews-D-RiJ64o.js} +3341 -3011
- package/package.json +1 -1
- package/dist/DictionaryManagementView-CtIQpqVA.js +0 -1035
- package/dist/MenuManagementView-DJhkN2sG.js +0 -837
- package/dist/RoleAuthorizationView-jn_WUCeg.js +0 -599
- package/dist/SystemUserDetailWorkspaceView-CBvqmWvP.js +0 -17
- package/dist/SystemUserManagementView-AEomKvK7.js +0 -887
- package/dist/currentUserContext-B1lj1WgF.js +0 -11
- package/dist/types/platform-components/scopedResourceTreeModuleContext.d.ts +0 -6
- package/dist/types/views/DictionaryManagementView.vue.d.ts +0 -3
- package/dist/types/views/MenuManagementView.vue.d.ts +0 -3
- package/dist/types/views/SystemUserDetailWorkspaceView.vue.d.ts +0 -7
- package/dist/types/views/SystemUserManagementView.vue.d.ts +0 -7
- package/dist/types/views/dictionaryManagementState.d.ts +0 -215
- package/dist/types/views/menuManagementState.d.ts +0 -180
- package/dist/types/views/systemUserDetailWorkspaceSession.d.ts +0 -12
- package/dist/types/views/systemUserDetailWorkspaceView.d.ts +0 -5
- package/dist/workspaceViewSessions-B5g4M0rT.js +0 -51
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as _e, n as S, r as ve, t as ye } from "./workspaceViewSessions-B5g4M0rT.js";
|
|
6
|
-
import { Fragment as be, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createTextVNode as O, createVNode as k, defineComponent as A, normalizeClass as xe, onBeforeUnmount as Se, onMounted as Ce, openBlock as j, ref as M, renderList as N, toDisplayString as P, unref as F, watch as we, withCtx as I, withKeys as L, withModifiers as Te } from "vue";
|
|
1
|
+
import { D as e, H as t, It as n, L as r, Mt as i, R as a, Rt as o, T as s, V as ee, Wt as c, _ as l, _t as u, at as d, bt as f, c as p, dr as m, dt as h, ft as te, it as g, j as _, jt as ne, m as v, n as y, o as b, p as x, pt as re, r as ie, rt as ae, s as oe, st as se, ut as ce, v as le, vt as S, x as C } from "./platform-components-oRIsIoxu.js";
|
|
2
|
+
import { A as ue, V as de, y as w } from "./workspaceViews-D-RiJ64o.js";
|
|
3
|
+
import { a as T, i as E, o as fe, r as pe, s as me, t as he } from "./RoleAuthorizationView-8lilhtMB.js";
|
|
4
|
+
import { Fragment as ge, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createTextVNode as M, createVNode as N, defineComponent as P, normalizeClass as _e, onBeforeUnmount as ve, onMounted as ye, openBlock as F, ref as I, renderList as L, toDisplayString as R, unref as z, watch as be, withCtx as B, withKeys as V, withModifiers as xe } from "vue";
|
|
7
5
|
//#region src/views/RoleAccountGrantDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
6
|
+
var H = {
|
|
9
7
|
key: 1,
|
|
10
8
|
class: "role-account-grant-drawer-state"
|
|
11
|
-
},
|
|
9
|
+
}, U = {
|
|
12
10
|
key: 2,
|
|
13
11
|
class: "role-account-grant-drawer-body"
|
|
14
|
-
},
|
|
12
|
+
}, W = { class: "role-account-grant-search" }, G = { class: "role-account-grant-summary" }, K = { key: 0 }, q = { class: "role-account-grant-selected" }, J = { class: "role-account-grant-selected-title" }, Se = {
|
|
15
13
|
key: 0,
|
|
16
14
|
class: "role-account-grant-selected-list"
|
|
17
|
-
},
|
|
15
|
+
}, Ce = ["disabled", "onClick"], we = {
|
|
18
16
|
key: 1,
|
|
19
17
|
class: "role-account-grant-selected-empty"
|
|
20
|
-
},
|
|
18
|
+
}, Te = { class: "role-account-grant-pagination" }, Ee = 20, De = /*#__PURE__*/ o(/* @__PURE__ */ P({
|
|
21
19
|
name: "RoleAccountGrantDrawer",
|
|
22
20
|
__name: "RoleAccountGrantDrawer",
|
|
23
21
|
props: {
|
|
@@ -28,19 +26,19 @@ var R = {
|
|
|
28
26
|
},
|
|
29
27
|
emits: ["close", "saved"],
|
|
30
28
|
setup(e, { emit: t }) {
|
|
31
|
-
let
|
|
29
|
+
let r = e, i = t, a = I([]), o = I({}), s = I([]), c = I(/* @__PURE__ */ new Set()), l = I(/* @__PURE__ */ new Set()), u = I(""), f = I(""), p = I(0), m = I(0), _ = I(!1), v = I(!1), y = I(!1), b = I(!1), x = D(() => fe(r.context.http)), ie = D(() => r.role?.id), ae = D(() => r.role ? `绑定用户 - ${Z(r.role)}` : "绑定用户"), oe = D(() => r.role?.ownerScopeType === "platform" ? "platform" : r.role?.ownerScopeType === "organization" ? "organization" : "tenant"), se = D(() => oe.value === "platform" ? void 0 : r.role?.ownerScopeId), ce = D(() => {
|
|
32
30
|
let e = /* @__PURE__ */ new Map();
|
|
33
|
-
for (let t of
|
|
31
|
+
for (let t of a.value) t.userId && e.set(t.userId, t);
|
|
34
32
|
return e;
|
|
35
|
-
}),
|
|
33
|
+
}), le = D(() => s.value.filter((e) => e.id).map((e) => ({
|
|
36
34
|
id: e.id,
|
|
37
|
-
username:
|
|
35
|
+
username: Y(e),
|
|
38
36
|
employeeNo: e.employeeNo ?? "",
|
|
39
37
|
employeeTitle: e.employeeTitle ?? "",
|
|
40
38
|
organizationTitle: e.organizationTitle ?? e.organizationId ?? "",
|
|
41
39
|
departmentTitle: e.departmentTitle ?? e.departmentId ?? "",
|
|
42
|
-
boundTitle:
|
|
43
|
-
}))),
|
|
40
|
+
boundTitle: l.value.has(e.id) ? "已绑定" : "未绑定"
|
|
41
|
+
}))), S = D(() => [...c.value].map((e) => o.value[e] ?? Ae(e))), C = D(() => Math.max(1, Math.ceil(m.value / Ee))), ue = D(() => p.value > 0), de = D(() => p.value + 1 < C.value), w = D(() => [...c.value].filter((e) => !l.value.has(e))), T = D(() => [...l.value].filter((e) => !c.value.has(e))), E = D(() => w.value.length > 0 || T.value.length > 0), pe = {
|
|
44
42
|
rowKey: "id",
|
|
45
43
|
columns: [
|
|
46
44
|
{
|
|
@@ -74,26 +72,26 @@ var R = {
|
|
|
74
72
|
width: 90
|
|
75
73
|
}
|
|
76
74
|
]
|
|
77
|
-
},
|
|
78
|
-
selectedRowKeys: [...
|
|
75
|
+
}, me = D(() => ({
|
|
76
|
+
selectedRowKeys: [...c.value],
|
|
79
77
|
preserveSelectedRowKeys: !0,
|
|
80
|
-
disabledOf: () =>
|
|
78
|
+
disabledOf: () => y.value,
|
|
81
79
|
onChange: (e) => {
|
|
82
|
-
|
|
80
|
+
c.value = new Set(e.map((e) => String(e)));
|
|
83
81
|
}
|
|
84
82
|
}));
|
|
85
|
-
|
|
86
|
-
e ?
|
|
83
|
+
be(() => [r.open, r.role?.id], ([e]) => {
|
|
84
|
+
e ? he() : De();
|
|
87
85
|
}, { immediate: !0 });
|
|
88
|
-
async function
|
|
89
|
-
let e =
|
|
86
|
+
async function he() {
|
|
87
|
+
let e = ie.value;
|
|
90
88
|
if (!e) {
|
|
91
|
-
|
|
89
|
+
De();
|
|
92
90
|
return;
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
_.value = !0, b.value = !1;
|
|
95
93
|
try {
|
|
96
|
-
let [t, n] = await Promise.all([
|
|
94
|
+
let [t, n] = await Promise.all([x.value.accountRoleGrants(e), x.value.userSelector({
|
|
97
95
|
roleId: e,
|
|
98
96
|
enabledOnly: !1,
|
|
99
97
|
page: {
|
|
@@ -101,197 +99,197 @@ var R = {
|
|
|
101
99
|
pageSize: 500
|
|
102
100
|
}
|
|
103
101
|
})]);
|
|
104
|
-
|
|
102
|
+
a.value = t;
|
|
105
103
|
let r = new Set(t.map((e) => e.userId).filter((e) => !!e));
|
|
106
|
-
|
|
104
|
+
l.value = r, c.value = new Set(r), o.value = ke([...t.map((e) => Ae(e.userId)).filter((e) => !!e), ...n.records]), await P(0);
|
|
107
105
|
} catch (e) {
|
|
108
|
-
|
|
106
|
+
b.value = !0, d(e, {
|
|
109
107
|
source: "role-account-grants",
|
|
110
108
|
phase: "load"
|
|
111
109
|
});
|
|
112
110
|
} finally {
|
|
113
|
-
|
|
111
|
+
_.value = !1;
|
|
114
112
|
}
|
|
115
113
|
}
|
|
116
|
-
async function
|
|
117
|
-
|
|
114
|
+
async function P(e) {
|
|
115
|
+
v.value = !0;
|
|
118
116
|
try {
|
|
119
|
-
let t = await
|
|
120
|
-
keyword:
|
|
117
|
+
let t = await x.value.userSelector({
|
|
118
|
+
keyword: f.value,
|
|
121
119
|
enabledOnly: !0,
|
|
122
120
|
page: {
|
|
123
121
|
pageNum: Math.max(0, e),
|
|
124
|
-
pageSize:
|
|
122
|
+
pageSize: Ee
|
|
125
123
|
}
|
|
126
124
|
});
|
|
127
|
-
|
|
128
|
-
...
|
|
129
|
-
...
|
|
130
|
-
},
|
|
125
|
+
s.value = t.records, o.value = {
|
|
126
|
+
...o.value,
|
|
127
|
+
...ke(t.records)
|
|
128
|
+
}, p.value = t.pageNum, m.value = t.total;
|
|
131
129
|
} catch (e) {
|
|
132
|
-
|
|
130
|
+
d(e, {
|
|
133
131
|
source: "role-account-grants",
|
|
134
132
|
phase: "load"
|
|
135
133
|
});
|
|
136
134
|
} finally {
|
|
137
|
-
|
|
135
|
+
v.value = !1;
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
138
|
+
function _e() {
|
|
139
|
+
f.value = u.value.trim(), P(0);
|
|
142
140
|
}
|
|
143
|
-
function
|
|
144
|
-
let n = new Set(
|
|
145
|
-
t ? n.add(e) : n.delete(e),
|
|
141
|
+
function ve(e, t) {
|
|
142
|
+
let n = new Set(c.value);
|
|
143
|
+
t ? n.add(e) : n.delete(e), c.value = n;
|
|
146
144
|
}
|
|
147
|
-
async function
|
|
148
|
-
let e =
|
|
145
|
+
async function ye() {
|
|
146
|
+
let e = ie.value;
|
|
149
147
|
if (e) {
|
|
150
|
-
if (!
|
|
151
|
-
|
|
148
|
+
if (!E.value) {
|
|
149
|
+
i("close");
|
|
152
150
|
return;
|
|
153
151
|
}
|
|
154
|
-
|
|
152
|
+
y.value = !0;
|
|
155
153
|
try {
|
|
156
|
-
for (let t of
|
|
154
|
+
for (let t of w.value) await x.value.grantAccountRole(e, {
|
|
157
155
|
userId: t,
|
|
158
|
-
managementScopeType:
|
|
159
|
-
managementScopeId:
|
|
156
|
+
managementScopeType: oe.value,
|
|
157
|
+
managementScopeId: se.value
|
|
160
158
|
});
|
|
161
|
-
for (let t of
|
|
162
|
-
let n =
|
|
163
|
-
n && await
|
|
159
|
+
for (let t of T.value) {
|
|
160
|
+
let n = ce.value.get(t)?.id;
|
|
161
|
+
n && await x.value.deleteAccountRoleGrant(e, n);
|
|
164
162
|
}
|
|
165
|
-
await
|
|
163
|
+
await g({
|
|
166
164
|
success: !0,
|
|
167
165
|
message: "用户绑定已保存"
|
|
168
166
|
}, {
|
|
169
167
|
source: "role-account-grants",
|
|
170
168
|
phase: "action",
|
|
171
169
|
fallbackMessage: "用户绑定已保存"
|
|
172
|
-
}),
|
|
170
|
+
}), i("saved"), i("close");
|
|
173
171
|
} catch (e) {
|
|
174
|
-
|
|
172
|
+
d(e, {
|
|
175
173
|
source: "role-account-grants",
|
|
176
174
|
phase: "action"
|
|
177
175
|
});
|
|
178
176
|
} finally {
|
|
179
|
-
|
|
177
|
+
y.value = !1;
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
180
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
181
|
+
function xe() {
|
|
182
|
+
y.value || i("close");
|
|
185
183
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
184
|
+
function De() {
|
|
185
|
+
a.value = [], o.value = {}, s.value = [], c.value = /* @__PURE__ */ new Set(), l.value = /* @__PURE__ */ new Set(), u.value = "", f.value = "", p.value = 0, m.value = 0, _.value = !1, v.value = !1, y.value = !1, b.value = !1;
|
|
188
186
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
187
|
+
function Oe(e) {
|
|
188
|
+
ve(e, !1);
|
|
191
189
|
}
|
|
192
|
-
function
|
|
190
|
+
function ke(e) {
|
|
193
191
|
let t = {};
|
|
194
192
|
for (let n of e) n.id && (t[n.id] = n);
|
|
195
193
|
return t;
|
|
196
194
|
}
|
|
197
|
-
function
|
|
195
|
+
function Ae(e) {
|
|
198
196
|
return e ? {
|
|
199
197
|
id: e,
|
|
200
198
|
username: e
|
|
201
199
|
} : void 0;
|
|
202
200
|
}
|
|
203
|
-
function
|
|
201
|
+
function Y(e) {
|
|
204
202
|
return String(e?.username ?? e?.id ?? "未知用户");
|
|
205
203
|
}
|
|
206
|
-
function
|
|
204
|
+
function X(e) {
|
|
207
205
|
return e.employeeTitle && e.employeeNo ? `${e.employeeTitle} / ${e.employeeNo}` : e.employeeTitle ?? e.employeeNo ?? e.employeeId ?? e.id;
|
|
208
206
|
}
|
|
209
|
-
function
|
|
207
|
+
function Z(e) {
|
|
210
208
|
return String(e.title ?? e.id ?? "角色");
|
|
211
209
|
}
|
|
212
|
-
return (t,
|
|
210
|
+
return (t, r) => (F(), O(z(ee), {
|
|
213
211
|
open: e.open,
|
|
214
|
-
title:
|
|
215
|
-
|
|
212
|
+
title: ae.value,
|
|
213
|
+
"render-mode": e.container ? "inline" : "portal",
|
|
216
214
|
"close-title": "关闭",
|
|
217
|
-
onClose:
|
|
215
|
+
onClose: xe
|
|
218
216
|
}, {
|
|
219
|
-
operation:
|
|
220
|
-
disabled:
|
|
221
|
-
onClick:
|
|
217
|
+
operation: B(() => [N(z(n), {
|
|
218
|
+
disabled: y.value || _.value,
|
|
219
|
+
onClick: xe
|
|
222
220
|
}, {
|
|
223
|
-
default:
|
|
221
|
+
default: B(() => [...r[3] ||= [M("取消", -1)]]),
|
|
224
222
|
_: 1
|
|
225
|
-
}, 8, ["disabled"]),
|
|
223
|
+
}, 8, ["disabled"]), N(z(n), {
|
|
226
224
|
type: "primary",
|
|
227
|
-
loading:
|
|
228
|
-
disabled:
|
|
229
|
-
onClick:
|
|
225
|
+
loading: y.value,
|
|
226
|
+
disabled: _.value || !E.value,
|
|
227
|
+
onClick: ye
|
|
230
228
|
}, {
|
|
231
|
-
default:
|
|
229
|
+
default: B(() => [...r[4] ||= [M(" 确定 ", -1)]]),
|
|
232
230
|
_: 1
|
|
233
231
|
}, 8, ["loading", "disabled"])]),
|
|
234
|
-
default:
|
|
232
|
+
default: B(() => [_.value ? (F(), O(z(re), {
|
|
235
233
|
key: 0,
|
|
236
234
|
class: "role-account-grant-drawer-state",
|
|
237
235
|
tip: "加载用户"
|
|
238
|
-
})) :
|
|
236
|
+
})) : b.value ? (F(), A("div", H, [N(z(te), {
|
|
239
237
|
title: "用户加载失败",
|
|
240
238
|
message: "无法加载当前角色的用户绑定"
|
|
241
|
-
}),
|
|
239
|
+
}), N(z(n), {
|
|
242
240
|
type: "primary",
|
|
243
241
|
"icon-name": "reload",
|
|
244
|
-
onClick:
|
|
242
|
+
onClick: he
|
|
245
243
|
}, {
|
|
246
|
-
default:
|
|
244
|
+
default: B(() => [...r[5] ||= [M("重试", -1)]]),
|
|
247
245
|
_: 1
|
|
248
|
-
})])) : (
|
|
249
|
-
|
|
250
|
-
value:
|
|
246
|
+
})])) : (F(), A("section", U, [
|
|
247
|
+
j("div", W, [N(z(ne), {
|
|
248
|
+
value: u.value,
|
|
251
249
|
"allow-clear": "",
|
|
252
|
-
disabled:
|
|
250
|
+
disabled: y.value,
|
|
253
251
|
placeholder: "搜索用户账号",
|
|
254
|
-
"onUpdate:value":
|
|
255
|
-
onKeydown:
|
|
256
|
-
}, null, 8, ["value", "disabled"]),
|
|
252
|
+
"onUpdate:value": r[0] ||= (e) => u.value = e,
|
|
253
|
+
onKeydown: V(_e, ["enter"])
|
|
254
|
+
}, null, 8, ["value", "disabled"]), N(z(n), {
|
|
257
255
|
"icon-name": "search",
|
|
258
|
-
disabled:
|
|
259
|
-
onClick:
|
|
256
|
+
disabled: y.value,
|
|
257
|
+
onClick: _e
|
|
260
258
|
}, {
|
|
261
|
-
default:
|
|
259
|
+
default: B(() => [...r[6] ||= [M("查询", -1)]]),
|
|
262
260
|
_: 1
|
|
263
261
|
}, 8, ["disabled"])]),
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
j("div", G, [j("span", null, "已选 " + R(c.value.size) + " 个", 1), E.value ? (F(), A("span", K, "新增 " + R(w.value.length) + " 个,移除 " + R(T.value.length) + " 个", 1)) : k("v-if", !0)]),
|
|
263
|
+
j("section", q, [j("div", J, [r[7] ||= j("strong", null, "已选用户", -1), j("span", null, R(S.value.length) + " 个", 1)]), S.value.length > 0 ? (F(), A("div", Se, [(F(!0), A(ge, null, L(S.value, (e) => (F(), A("button", {
|
|
266
264
|
key: e.id,
|
|
267
265
|
type: "button",
|
|
268
|
-
disabled:
|
|
269
|
-
onClick: (t) =>
|
|
270
|
-
}, [
|
|
271
|
-
|
|
266
|
+
disabled: y.value,
|
|
267
|
+
onClick: (t) => Oe(e.id)
|
|
268
|
+
}, [j("span", null, R(Y(e)), 1), j("small", null, R(X(e)), 1)], 8, Ce))), 128))])) : (F(), A("span", we, "暂无已选用户"))]),
|
|
269
|
+
N(z(h), {
|
|
272
270
|
class: "role-account-grant-table",
|
|
273
271
|
size: "middle",
|
|
274
|
-
contract:
|
|
275
|
-
rows:
|
|
276
|
-
loading:
|
|
272
|
+
contract: pe,
|
|
273
|
+
rows: le.value,
|
|
274
|
+
loading: v.value,
|
|
277
275
|
pagination: !1,
|
|
278
|
-
selection:
|
|
276
|
+
selection: me.value
|
|
279
277
|
}, null, 8, [
|
|
280
278
|
"rows",
|
|
281
279
|
"loading",
|
|
282
280
|
"selection"
|
|
283
281
|
]),
|
|
284
|
-
|
|
285
|
-
disabled:
|
|
286
|
-
onClick:
|
|
282
|
+
j("div", Te, [j("span", null, "共 " + R(m.value) + " 个用户,第 " + R(p.value + 1) + " / " + R(C.value) + " 页", 1), j("div", null, [N(z(n), {
|
|
283
|
+
disabled: y.value || v.value || !ue.value,
|
|
284
|
+
onClick: r[1] ||= (e) => P(p.value - 1)
|
|
287
285
|
}, {
|
|
288
|
-
default:
|
|
286
|
+
default: B(() => [...r[8] ||= [M(" 上一页 ", -1)]]),
|
|
289
287
|
_: 1
|
|
290
|
-
}, 8, ["disabled"]),
|
|
291
|
-
disabled:
|
|
292
|
-
onClick:
|
|
288
|
+
}, 8, ["disabled"]), N(z(n), {
|
|
289
|
+
disabled: y.value || v.value || !de.value,
|
|
290
|
+
onClick: r[2] ||= (e) => P(p.value + 1)
|
|
293
291
|
}, {
|
|
294
|
-
default:
|
|
292
|
+
default: B(() => [...r[9] ||= [M(" 下一页 ", -1)]]),
|
|
295
293
|
_: 1
|
|
296
294
|
}, 8, ["disabled"])])])
|
|
297
295
|
]))]),
|
|
@@ -299,14 +297,14 @@ var R = {
|
|
|
299
297
|
}, 8, [
|
|
300
298
|
"open",
|
|
301
299
|
"title",
|
|
302
|
-
"
|
|
300
|
+
"render-mode"
|
|
303
301
|
]));
|
|
304
302
|
}
|
|
305
|
-
}), [["__scopeId", "data-v-
|
|
303
|
+
}), [["__scopeId", "data-v-859c5b4b"]]);
|
|
306
304
|
//#endregion
|
|
307
305
|
//#region src/views/roleDetailWorkspaceSession.ts
|
|
308
|
-
function
|
|
309
|
-
return
|
|
306
|
+
function Oe(e, t) {
|
|
307
|
+
return pe(w, e, {
|
|
310
308
|
...t,
|
|
311
309
|
selectedRole: { ...t.selectedRole },
|
|
312
310
|
draft: { ...t.draft },
|
|
@@ -317,15 +315,15 @@ function je(e, t) {
|
|
|
317
315
|
}
|
|
318
316
|
});
|
|
319
317
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
318
|
+
function ke(e, t) {
|
|
319
|
+
return E(w, e, t);
|
|
322
320
|
}
|
|
323
|
-
function
|
|
324
|
-
return
|
|
321
|
+
function Ae(e) {
|
|
322
|
+
return T(w, e);
|
|
325
323
|
}
|
|
326
324
|
//#endregion
|
|
327
325
|
//#region src/views/EmployeeEmploymentTable.vue
|
|
328
|
-
var
|
|
326
|
+
var Y = /*#__PURE__*/ o(/* @__PURE__ */ P({
|
|
329
327
|
name: "EmployeeEmploymentTable",
|
|
330
328
|
__name: "EmployeeEmploymentTable",
|
|
331
329
|
props: {
|
|
@@ -342,7 +340,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
342
340
|
},
|
|
343
341
|
emits: ["update:selectedIds"],
|
|
344
342
|
setup(e, { emit: t }) {
|
|
345
|
-
let n = e, r = t, i =
|
|
343
|
+
let n = e, r = t, i = I([]), a = [
|
|
346
344
|
{
|
|
347
345
|
key: "title",
|
|
348
346
|
title: "职员",
|
|
@@ -391,7 +389,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
391
389
|
title: "主岗位",
|
|
392
390
|
width: 88
|
|
393
391
|
}
|
|
394
|
-
], s =
|
|
392
|
+
], s = D(() => {
|
|
395
393
|
let e = /* @__PURE__ */ new Map();
|
|
396
394
|
for (let t of n.rows) {
|
|
397
395
|
let n = t.employeeId ?? t.id, r = e.get(n) ?? {
|
|
@@ -404,16 +402,16 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
404
402
|
r.positions.push(t), e.set(n, r);
|
|
405
403
|
}
|
|
406
404
|
return [...e.values()];
|
|
407
|
-
}),
|
|
408
|
-
function
|
|
405
|
+
}), ee = D(() => s.value);
|
|
406
|
+
function c(e, t) {
|
|
409
407
|
let n = t;
|
|
410
|
-
return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${
|
|
408
|
+
return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${d(n)} 项` : "";
|
|
411
409
|
}
|
|
412
|
-
function
|
|
410
|
+
function l(e, t) {
|
|
413
411
|
let n = t;
|
|
414
412
|
return e.key === "position" ? n.positionTitle ?? n.positionId : e.key === "organization" ? n.organizationTitle ?? n.organizationId : e.key === "department" ? n.departmentTitle ?? n.departmentId : e.key === "primaryPosition" ? n.primaryPosition ? "是" : "否" : "";
|
|
415
413
|
}
|
|
416
|
-
function
|
|
414
|
+
function d(e) {
|
|
417
415
|
return e.positions.filter((e) => n.selectedIds.has(e.id)).length;
|
|
418
416
|
}
|
|
419
417
|
function f(e) {
|
|
@@ -430,29 +428,29 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
430
428
|
for (let e of t) i.add(String(e));
|
|
431
429
|
r("update:selectedIds", i);
|
|
432
430
|
}
|
|
433
|
-
function
|
|
431
|
+
function m(e, t) {
|
|
434
432
|
let n = e.employeeId;
|
|
435
433
|
i.value = t ? Array.from(new Set([...i.value, n])) : i.value.filter((e) => e !== n);
|
|
436
434
|
}
|
|
437
|
-
function
|
|
435
|
+
function h(e) {
|
|
438
436
|
let t = e.employeeId;
|
|
439
|
-
|
|
437
|
+
m(e, !i.value.includes(t));
|
|
440
438
|
}
|
|
441
|
-
return (e, t) => (
|
|
439
|
+
return (e, t) => (F(), O(z(u), {
|
|
442
440
|
class: "employee-employment-table",
|
|
443
441
|
columns: a,
|
|
444
|
-
rows:
|
|
442
|
+
rows: ee.value,
|
|
445
443
|
"row-key": "employeeId",
|
|
446
444
|
pagination: !1,
|
|
447
445
|
"expanded-row-keys": i.value,
|
|
448
446
|
"clickable-rows": "",
|
|
449
447
|
"horizontal-scroll": "",
|
|
450
|
-
onRowExpand:
|
|
451
|
-
onRowDblclick:
|
|
448
|
+
onRowExpand: m,
|
|
449
|
+
onRowDblclick: h
|
|
452
450
|
}, {
|
|
453
|
-
cell:
|
|
454
|
-
expandedRow:
|
|
455
|
-
default:
|
|
451
|
+
cell: B(({ column: e, record: t }) => [M(R(c(e, t)), 1)]),
|
|
452
|
+
expandedRow: B(({ record: e }) => [N(z(C), { title: "任职信息" }, {
|
|
453
|
+
default: B(() => [N(z(u), {
|
|
456
454
|
columns: o,
|
|
457
455
|
rows: e.positions,
|
|
458
456
|
"row-key": "id",
|
|
@@ -461,7 +459,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
461
459
|
"horizontal-scroll": "",
|
|
462
460
|
"row-muted": (e) => e.enabled === !1
|
|
463
461
|
}, {
|
|
464
|
-
cell:
|
|
462
|
+
cell: B(({ column: e, record: t }) => [M(R(l(e, t)), 1)]),
|
|
465
463
|
_: 1
|
|
466
464
|
}, 8, [
|
|
467
465
|
"rows",
|
|
@@ -473,16 +471,16 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
473
471
|
_: 1
|
|
474
472
|
}, 8, ["rows", "expanded-row-keys"]));
|
|
475
473
|
}
|
|
476
|
-
}), [["__scopeId", "data-v-e5fcebfa"]]),
|
|
474
|
+
}), [["__scopeId", "data-v-e5fcebfa"]]), X = { key: 1 }, Z = {
|
|
477
475
|
key: 2,
|
|
478
476
|
class: "role-employment-grant-body"
|
|
479
|
-
},
|
|
477
|
+
}, je = { class: "role-employment-grant-selected" }, Q = { class: "role-employment-grant-selected-title" }, Me = {
|
|
480
478
|
key: 0,
|
|
481
479
|
class: "role-employment-grant-selected-list"
|
|
482
|
-
},
|
|
480
|
+
}, Ne = ["disabled", "onClick"], Pe = {
|
|
483
481
|
key: 1,
|
|
484
482
|
class: "role-employment-grant-selected-empty"
|
|
485
|
-
},
|
|
483
|
+
}, Fe = { class: "role-employment-grant-pagination" }, Ie = /*#__PURE__*/ o(/* @__PURE__ */ P({
|
|
486
484
|
name: "RoleEmploymentGrantDrawer",
|
|
487
485
|
__name: "RoleEmploymentGrantDrawer",
|
|
488
486
|
props: {
|
|
@@ -493,67 +491,67 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
493
491
|
},
|
|
494
492
|
emits: ["close", "saved"],
|
|
495
493
|
setup(e, { emit: t }) {
|
|
496
|
-
let
|
|
497
|
-
|
|
498
|
-
e ?
|
|
494
|
+
let r = e, i = t, a = I([]), o = I([]), s = I({}), c = I(/* @__PURE__ */ new Set()), l = I(/* @__PURE__ */ new Set()), u = I(!1), f = I(!1), p = I(!1), m = I(!1), h = I(0), _ = I(0), v = I(""), y = D(() => r.role?.id), b = D(() => fe(r.context.http)), x = D(() => `绑定任职 - ${r.role?.title ?? r.role?.id ?? ""}`), ie = D(() => [...c.value].filter((e) => !l.value.has(e))), ae = D(() => [...l.value].filter((e) => !c.value.has(e))), oe = D(() => new Map(a.value.map((e) => [e.employeePositionId, e]))), se = D(() => o.value.filter((e) => !v.value.trim() || de(e).includes(v.value.trim()))), ce = D(() => new Set(se.value.filter((e) => c.value.has(e.id)).map((e) => e.employeeId)).size), le = D(() => [...c.value].map((e) => s.value[e] ?? E(e)));
|
|
495
|
+
be(() => [r.open, r.role?.id], ([e]) => {
|
|
496
|
+
e ? S() : ue();
|
|
499
497
|
}, { immediate: !0 });
|
|
500
|
-
async function
|
|
501
|
-
let t =
|
|
498
|
+
async function S(e = 0) {
|
|
499
|
+
let t = y.value;
|
|
502
500
|
if (t) {
|
|
503
|
-
|
|
501
|
+
f.value = !0, m.value = !1;
|
|
504
502
|
try {
|
|
505
|
-
let [n, r] = await Promise.all([
|
|
503
|
+
let [n, r] = await Promise.all([b.value.employmentRoleGrants(t), b.value.employmentSelector(t, {
|
|
506
504
|
enabledOnly: !0,
|
|
507
505
|
page: {
|
|
508
506
|
pageNum: e,
|
|
509
507
|
pageSize: 50
|
|
510
508
|
}
|
|
511
509
|
})]);
|
|
512
|
-
|
|
513
|
-
...
|
|
514
|
-
...
|
|
515
|
-
},
|
|
510
|
+
a.value = n, l.value = new Set(n.map((e) => e.employeePositionId).filter((e) => !!e)), s.value = {
|
|
511
|
+
...s.value,
|
|
512
|
+
...T(r.records)
|
|
513
|
+
}, u.value ||= (c.value = new Set(l.value), !0), o.value = r.records, h.value = r.pageNum, _.value = r.total;
|
|
516
514
|
} catch (e) {
|
|
517
|
-
|
|
515
|
+
m.value = !0, d(e, {
|
|
518
516
|
source: "role-employment-grants",
|
|
519
517
|
phase: "load"
|
|
520
518
|
});
|
|
521
519
|
} finally {
|
|
522
|
-
|
|
520
|
+
f.value = !1;
|
|
523
521
|
}
|
|
524
522
|
}
|
|
525
523
|
}
|
|
526
|
-
async function
|
|
527
|
-
let e =
|
|
524
|
+
async function C() {
|
|
525
|
+
let e = y.value;
|
|
528
526
|
if (e) {
|
|
529
|
-
|
|
527
|
+
p.value = !0;
|
|
530
528
|
try {
|
|
531
|
-
for (let t of
|
|
532
|
-
for (let t of
|
|
529
|
+
for (let t of ie.value) await b.value.grantEmploymentRole(e, t);
|
|
530
|
+
for (let t of ae.value) {
|
|
533
531
|
let n = oe.value.get(t)?.id;
|
|
534
|
-
n && await
|
|
532
|
+
n && await b.value.deleteEmploymentRoleGrant(e, n);
|
|
535
533
|
}
|
|
536
|
-
await
|
|
534
|
+
await g({
|
|
537
535
|
success: !0,
|
|
538
536
|
message: "任职角色授权已保存"
|
|
539
537
|
}, {
|
|
540
538
|
source: "role-employment-grants",
|
|
541
539
|
phase: "action"
|
|
542
|
-
}),
|
|
540
|
+
}), i("saved"), i("close");
|
|
543
541
|
} catch (e) {
|
|
544
|
-
|
|
542
|
+
d(e, {
|
|
545
543
|
source: "role-employment-grants",
|
|
546
544
|
phase: "action"
|
|
547
545
|
});
|
|
548
546
|
} finally {
|
|
549
|
-
|
|
547
|
+
p.value = !1;
|
|
550
548
|
}
|
|
551
549
|
}
|
|
552
550
|
}
|
|
553
|
-
function
|
|
554
|
-
|
|
551
|
+
function ue() {
|
|
552
|
+
a.value = [], o.value = [], s.value = {}, c.value = /* @__PURE__ */ new Set(), l.value = /* @__PURE__ */ new Set(), u.value = !1, v.value = "", h.value = 0, _.value = 0, m.value = !1;
|
|
555
553
|
}
|
|
556
|
-
function
|
|
554
|
+
function de(e) {
|
|
557
555
|
return [
|
|
558
556
|
e.employeeTitle,
|
|
559
557
|
e.employeeNo,
|
|
@@ -562,103 +560,103 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
562
560
|
e.positionTitle
|
|
563
561
|
].filter(Boolean).join(" ");
|
|
564
562
|
}
|
|
565
|
-
function
|
|
566
|
-
let t = new Set(
|
|
567
|
-
t.delete(e),
|
|
563
|
+
function w(e) {
|
|
564
|
+
let t = new Set(c.value);
|
|
565
|
+
t.delete(e), c.value = t;
|
|
568
566
|
}
|
|
569
|
-
function
|
|
567
|
+
function T(e) {
|
|
570
568
|
let t = {};
|
|
571
569
|
for (let n of e) n.id && (t[n.id] = n);
|
|
572
570
|
return t;
|
|
573
571
|
}
|
|
574
|
-
function
|
|
572
|
+
function E(e) {
|
|
575
573
|
return {
|
|
576
574
|
id: e,
|
|
577
575
|
positionId: e
|
|
578
576
|
};
|
|
579
577
|
}
|
|
580
|
-
function
|
|
578
|
+
function pe(e) {
|
|
581
579
|
let t = e.positionTitle ?? e.positionId ?? e.id;
|
|
582
580
|
return e.employeeTitle ? `${e.employeeTitle} · ${t}` : t;
|
|
583
581
|
}
|
|
584
|
-
function
|
|
582
|
+
function me(e) {
|
|
585
583
|
return [
|
|
586
584
|
e.employeeNo,
|
|
587
585
|
e.organizationTitle ?? e.organizationId,
|
|
588
586
|
e.departmentTitle ?? e.departmentId
|
|
589
587
|
].filter(Boolean).join(" / ") || e.id;
|
|
590
588
|
}
|
|
591
|
-
return (t,
|
|
589
|
+
return (t, r) => (F(), O(z(ee), {
|
|
592
590
|
open: e.open,
|
|
593
|
-
title:
|
|
594
|
-
|
|
591
|
+
title: x.value,
|
|
592
|
+
"render-mode": e.container ? "inline" : "portal",
|
|
595
593
|
"close-title": "关闭",
|
|
596
|
-
onClose:
|
|
594
|
+
onClose: r[6] ||= (e) => !p.value && i("close")
|
|
597
595
|
}, {
|
|
598
|
-
operation:
|
|
599
|
-
disabled:
|
|
600
|
-
onClick:
|
|
596
|
+
operation: B(() => [N(z(n), {
|
|
597
|
+
disabled: p.value,
|
|
598
|
+
onClick: r[0] ||= (e) => i("close")
|
|
601
599
|
}, {
|
|
602
|
-
default:
|
|
600
|
+
default: B(() => [...r[7] ||= [M("取消", -1)]]),
|
|
603
601
|
_: 1
|
|
604
|
-
}, 8, ["disabled"]),
|
|
602
|
+
}, 8, ["disabled"]), N(z(n), {
|
|
605
603
|
type: "primary",
|
|
606
|
-
loading:
|
|
607
|
-
disabled:
|
|
608
|
-
onClick:
|
|
604
|
+
loading: p.value,
|
|
605
|
+
disabled: f.value || ie.value.length === 0 && ae.value.length === 0,
|
|
606
|
+
onClick: C
|
|
609
607
|
}, {
|
|
610
|
-
default:
|
|
608
|
+
default: B(() => [...r[8] ||= [M(" 确定 ", -1)]]),
|
|
611
609
|
_: 1
|
|
612
610
|
}, 8, ["loading", "disabled"])]),
|
|
613
|
-
default:
|
|
611
|
+
default: B(() => [f.value ? (F(), O(z(re), {
|
|
614
612
|
key: 0,
|
|
615
613
|
tip: "加载任职"
|
|
616
|
-
})) :
|
|
614
|
+
})) : m.value ? (F(), A("div", X, [N(z(te), {
|
|
617
615
|
title: "任职加载失败",
|
|
618
616
|
message: "无法加载任职授权"
|
|
619
|
-
}),
|
|
620
|
-
default:
|
|
617
|
+
}), N(z(n), { onClick: r[1] ||= (e) => S() }, {
|
|
618
|
+
default: B(() => [...r[9] ||= [M("重试", -1)]]),
|
|
621
619
|
_: 1
|
|
622
|
-
})])) : (
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
value:
|
|
626
|
-
"onUpdate:value":
|
|
620
|
+
})])) : (F(), A("section", Z, [
|
|
621
|
+
r[13] ||= j("p", null, "角色将在所选任职的机构、部门和岗位上下文中生效。展开职员后选择其具体任职。", -1),
|
|
622
|
+
N(z(ne), {
|
|
623
|
+
value: v.value,
|
|
624
|
+
"onUpdate:value": r[2] ||= (e) => v.value = e,
|
|
627
625
|
"allow-clear": "",
|
|
628
626
|
placeholder: "筛选职员、工号、机构、部门或岗位"
|
|
629
627
|
}, null, 8, ["value"]),
|
|
630
|
-
|
|
631
|
-
|
|
628
|
+
j("div", null, " 已选 " + R(c.value.size) + " 个任职;当前页涉及 " + R(ce.value) + " 名职员;新增 " + R(ie.value.length) + " 个,移除 " + R(ae.value.length) + " 个 ", 1),
|
|
629
|
+
j("section", je, [j("div", Q, [r[10] ||= j("strong", null, "已选任职", -1), j("span", null, R(le.value.length) + " 个", 1)]), le.value.length > 0 ? (F(), A("div", Me, [(F(!0), A(ge, null, L(le.value, (e) => (F(), A("button", {
|
|
632
630
|
key: e.id,
|
|
633
631
|
type: "button",
|
|
634
|
-
disabled:
|
|
635
|
-
onClick: (t) =>
|
|
636
|
-
}, [
|
|
637
|
-
|
|
638
|
-
"selected-ids":
|
|
639
|
-
"onUpdate:selectedIds":
|
|
632
|
+
disabled: p.value,
|
|
633
|
+
onClick: (t) => w(e.id)
|
|
634
|
+
}, [j("span", null, R(pe(e)), 1), j("small", null, R(me(e)), 1)], 8, Ne))), 128))])) : (F(), A("span", Pe, "暂无已选任职"))]),
|
|
635
|
+
N(Y, {
|
|
636
|
+
"selected-ids": c.value,
|
|
637
|
+
"onUpdate:selectedIds": r[3] ||= (e) => c.value = e,
|
|
640
638
|
rows: se.value,
|
|
641
639
|
selectable: "",
|
|
642
|
-
disabled:
|
|
640
|
+
disabled: p.value
|
|
643
641
|
}, null, 8, [
|
|
644
642
|
"selected-ids",
|
|
645
643
|
"rows",
|
|
646
644
|
"disabled"
|
|
647
645
|
]),
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
disabled:
|
|
652
|
-
onClick:
|
|
646
|
+
j("div", Fe, [
|
|
647
|
+
j("span", null, "共 " + R(_.value) + " 个启用任职", 1),
|
|
648
|
+
N(z(n), {
|
|
649
|
+
disabled: f.value || h.value === 0,
|
|
650
|
+
onClick: r[4] ||= (e) => S(h.value - 1)
|
|
653
651
|
}, {
|
|
654
|
-
default:
|
|
652
|
+
default: B(() => [...r[11] ||= [M("上一页", -1)]]),
|
|
655
653
|
_: 1
|
|
656
654
|
}, 8, ["disabled"]),
|
|
657
|
-
|
|
658
|
-
disabled:
|
|
659
|
-
onClick:
|
|
655
|
+
N(z(n), {
|
|
656
|
+
disabled: f.value || (h.value + 1) * 50 >= _.value,
|
|
657
|
+
onClick: r[5] ||= (e) => S(h.value + 1)
|
|
660
658
|
}, {
|
|
661
|
-
default:
|
|
659
|
+
default: B(() => [...r[12] ||= [M(" 下一页 ", -1)]]),
|
|
662
660
|
_: 1
|
|
663
661
|
}, 8, ["disabled"])
|
|
664
662
|
])
|
|
@@ -667,10 +665,10 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
667
665
|
}, 8, [
|
|
668
666
|
"open",
|
|
669
667
|
"title",
|
|
670
|
-
"
|
|
668
|
+
"render-mode"
|
|
671
669
|
]));
|
|
672
670
|
}
|
|
673
|
-
}), [["__scopeId", "data-v-
|
|
671
|
+
}), [["__scopeId", "data-v-e56f551d"]]), Le = { class: "role-group-member-selector" }, Re = /*#__PURE__*/ o(/* @__PURE__ */ P({
|
|
674
672
|
name: "RoleGroupMemberSelector",
|
|
675
673
|
__name: "RoleGroupMemberSelector",
|
|
676
674
|
props: {
|
|
@@ -684,49 +682,49 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
684
682
|
},
|
|
685
683
|
emits: ["update:value"],
|
|
686
684
|
setup(e, { emit: t }) {
|
|
687
|
-
let
|
|
688
|
-
label: `${
|
|
685
|
+
let n = e, r = t, a = D(() => c(n.value)), o = D(() => new Set(n.candidates.filter((e) => e.roleKind === "dataGrant" && e.id && a.value.includes(e.id)).map((e) => e.id))), s = D(() => n.candidates.filter((e) => e.id && e.id !== n.currentRoleId).map((e) => ({
|
|
686
|
+
label: `${l(e)} / ${u(e.roleKind)}`,
|
|
689
687
|
value: e.id,
|
|
690
688
|
disabled: e.roleKind === "dataGrant" && o.value.size > 0 && !a.value.includes(e.id)
|
|
691
689
|
})));
|
|
692
|
-
function
|
|
690
|
+
function ee(e) {
|
|
693
691
|
if (!Array.isArray(e)) {
|
|
694
|
-
|
|
692
|
+
r("update:value", void 0);
|
|
695
693
|
return;
|
|
696
694
|
}
|
|
697
695
|
let t = e.map((e) => String(e).trim()).filter(Boolean);
|
|
698
|
-
|
|
696
|
+
r("update:value", t.length > 0 ? t.join(",") : void 0);
|
|
699
697
|
}
|
|
700
|
-
function
|
|
698
|
+
function c(e) {
|
|
701
699
|
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
702
700
|
}
|
|
703
|
-
function
|
|
701
|
+
function l(e) {
|
|
704
702
|
return String(e?.title ?? e?.id ?? "角色");
|
|
705
703
|
}
|
|
706
|
-
function
|
|
704
|
+
function u(e) {
|
|
707
705
|
return e === "dataGrant" ? "数据授权角色" : "标准角色";
|
|
708
706
|
}
|
|
709
|
-
return (t,
|
|
707
|
+
return (t, n) => (F(), A("label", Le, [n[0] ||= j("span", { class: "role-group-member-selector-label" }, "成员角色", -1), N(z(i), {
|
|
710
708
|
mode: "multiple",
|
|
711
709
|
value: a.value,
|
|
712
710
|
options: s.value,
|
|
713
711
|
placeholder: "请选择成员角色",
|
|
714
712
|
disabled: e.disabled,
|
|
715
713
|
"allow-clear": !0,
|
|
716
|
-
"onUpdate:value":
|
|
714
|
+
"onUpdate:value": ee
|
|
717
715
|
}, null, 8, [
|
|
718
716
|
"value",
|
|
719
717
|
"options",
|
|
720
718
|
"disabled"
|
|
721
719
|
])]));
|
|
722
720
|
}
|
|
723
|
-
}), [["__scopeId", "data-v-91d9ae10"]]),
|
|
721
|
+
}), [["__scopeId", "data-v-91d9ae10"]]), ze = {
|
|
724
722
|
key: 1,
|
|
725
723
|
class: "role-detail-state"
|
|
726
|
-
},
|
|
724
|
+
}, Be = {
|
|
727
725
|
key: 1,
|
|
728
726
|
class: "role-detail-state"
|
|
729
|
-
},
|
|
727
|
+
}, Ve = /*@__PURE__*/ P({
|
|
730
728
|
name: "RoleManagementView",
|
|
731
729
|
__name: "RoleManagementView",
|
|
732
730
|
props: {
|
|
@@ -734,20 +732,20 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
734
732
|
scopeKind: {},
|
|
735
733
|
scopeId: {}
|
|
736
734
|
},
|
|
737
|
-
setup(
|
|
738
|
-
let
|
|
739
|
-
let e =
|
|
740
|
-
if (!(
|
|
735
|
+
setup(i) {
|
|
736
|
+
let o = i, u = ue(), m = c({ moduleAlias: "iam.tenant" }), h = c({ moduleAlias: "iam.organization" }), g = c({ moduleAlias: "iam.role" }), C = de(), T = I(""), E = I(null), fe = I(""), pe = I(0), P = I(0), L = I(0), R = I(), V = I(), H = I(), U = I(), W = I(!1), G = I("view"), K = I(!1), q = I(!1), J = I(!1), Se = I(), Ce = I(!1), we = I(!1), Te = I(), Ee = I(!1), Y = I(0), X = I(Kt(void 0)), Z = I(a(void 0)), je = I([]), Q = D(() => !!(o.recordId && o.scopeKind)), Me = D(() => Q.value && u?.presentation === "drawer"), Ne = D(() => !Q.value || Me.value), Pe = D(() => m), Fe = D(() => R.value?.id), Le = D(() => C?.value?.system === !0), Ve = D(() => C?.value?.system === !0), He = D(() => {
|
|
737
|
+
let e = C?.value?.tenantId;
|
|
738
|
+
if (!(C?.value?.system === !0 || !e)) return {
|
|
741
739
|
id: e,
|
|
742
740
|
title: e,
|
|
743
741
|
alias: e,
|
|
744
742
|
enabled: !0
|
|
745
743
|
};
|
|
746
|
-
}), Ue =
|
|
744
|
+
}), Ue = D(() => b(h, {
|
|
747
745
|
scopeFieldName: "tenantId",
|
|
748
|
-
scopeValue:
|
|
746
|
+
scopeValue: Fe.value,
|
|
749
747
|
treePath: "/iam.organization/tree"
|
|
750
|
-
})), We =
|
|
748
|
+
})), We = D(() => V.value?.kind !== "platform"), Ge = D(() => dt(g, V.value)), Ke = D(() => [
|
|
751
749
|
{
|
|
752
750
|
key: "title",
|
|
753
751
|
title: "角色名称",
|
|
@@ -783,24 +781,24 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
783
781
|
type: "enabledStatus",
|
|
784
782
|
width: "10%"
|
|
785
783
|
}
|
|
786
|
-
]), qe =
|
|
787
|
-
let e =
|
|
788
|
-
return !!(e?.id && e.systemManaged !== !0 &&
|
|
789
|
-
}), $e =
|
|
784
|
+
]), qe = D(() => !!V.value), Je = D(() => G.value === "create" ? "新建角色" : vn(U.value ?? X.value)), Ye = D(() => V.value?.title ?? "角色详情"), Xe = D(() => J.value || K.value), Ze = D(() => K.value || !V.value ? !1 : G.value === "create" ? g.can("create") === !0 : !!U.value?.id && g.can("update") === !0 && !U.value?.systemManaged), Qe = D(() => {
|
|
785
|
+
let e = U.value;
|
|
786
|
+
return !!(e?.id && e.systemManaged !== !0 && g.can(gn(e)) === !0);
|
|
787
|
+
}), $e = D(() => G.value === "view" ? U.value?.id ? [
|
|
790
788
|
{
|
|
791
789
|
key: "edit",
|
|
792
790
|
actionCode: "update",
|
|
793
791
|
title: "编辑",
|
|
794
792
|
iconName: "edit",
|
|
795
|
-
disabled:
|
|
793
|
+
disabled: J.value || U.value.systemManaged === !0
|
|
796
794
|
},
|
|
797
795
|
{
|
|
798
796
|
key: "bind",
|
|
799
|
-
actionCode: mn(
|
|
800
|
-
title: hn(
|
|
797
|
+
actionCode: mn(U.value),
|
|
798
|
+
title: hn(U.value),
|
|
801
799
|
iconName: "lock",
|
|
802
|
-
visible: fn(
|
|
803
|
-
disabled:
|
|
800
|
+
visible: fn(U.value),
|
|
801
|
+
disabled: J.value || U.value.systemManaged === !0
|
|
804
802
|
},
|
|
805
803
|
{
|
|
806
804
|
key: "delete",
|
|
@@ -808,47 +806,47 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
808
806
|
title: "删除",
|
|
809
807
|
iconName: "delete",
|
|
810
808
|
danger: !0,
|
|
811
|
-
disabled:
|
|
809
|
+
disabled: J.value || U.value.systemManaged === !0
|
|
812
810
|
}
|
|
813
811
|
] : [] : [{
|
|
814
812
|
key: "cancel",
|
|
815
813
|
title: "取消",
|
|
816
814
|
iconName: "close",
|
|
817
|
-
disabled:
|
|
815
|
+
disabled: J.value
|
|
818
816
|
}, {
|
|
819
817
|
key: "save",
|
|
820
|
-
actionCode:
|
|
818
|
+
actionCode: G.value === "create" ? "create" : "update",
|
|
821
819
|
title: "保存",
|
|
822
820
|
iconName: "save",
|
|
823
821
|
primary: !0,
|
|
824
|
-
loading:
|
|
822
|
+
loading: J.value,
|
|
825
823
|
disabled: !Ze.value
|
|
826
|
-
}]), et =
|
|
827
|
-
view:
|
|
828
|
-
input:
|
|
829
|
-
let e =
|
|
824
|
+
}]), et = D(() => $e.value), tt = D(() => $e.value), nt = me({
|
|
825
|
+
view: w,
|
|
826
|
+
input: D(() => {
|
|
827
|
+
let e = U.value?.id, t = V.value, n = G.value;
|
|
830
828
|
if (!(!e || !t || n !== "view" && n !== "edit")) return {
|
|
831
829
|
recordId: e,
|
|
832
830
|
scopeKind: t.kind,
|
|
833
831
|
...t.kind === "platform" ? {} : { scopeId: t.id }
|
|
834
832
|
};
|
|
835
833
|
}),
|
|
836
|
-
title:
|
|
837
|
-
eligibility:
|
|
838
|
-
hasStableIdentity: !!(
|
|
839
|
-
busy:
|
|
834
|
+
title: D(() => vn(U.value)),
|
|
835
|
+
eligibility: D(() => ({
|
|
836
|
+
hasStableIdentity: !!(U.value?.id && V.value) && !K.value,
|
|
837
|
+
busy: J.value
|
|
840
838
|
})),
|
|
841
839
|
beforePromote: async (e) => {
|
|
842
|
-
let t =
|
|
843
|
-
if (!(!t || !n)) return await
|
|
840
|
+
let t = U.value, n = V.value;
|
|
841
|
+
if (!(!t || !n)) return await Oe(e, {
|
|
844
842
|
selectedRole: t,
|
|
845
|
-
draft:
|
|
843
|
+
draft: X.value,
|
|
846
844
|
scope: n,
|
|
847
|
-
mode:
|
|
845
|
+
mode: G.value === "edit" ? "edit" : "view"
|
|
848
846
|
}) === "accepted";
|
|
849
847
|
},
|
|
850
848
|
onPromoted: Mt
|
|
851
|
-
}), rt =
|
|
849
|
+
}), rt = D(() => ({
|
|
852
850
|
title: {
|
|
853
851
|
label: "角色名称",
|
|
854
852
|
required: !0,
|
|
@@ -860,18 +858,18 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
860
858
|
required: !0,
|
|
861
859
|
visible: !0,
|
|
862
860
|
controlType: "select",
|
|
863
|
-
options: en(
|
|
861
|
+
options: en(X.value.roleKind)
|
|
864
862
|
},
|
|
865
863
|
roleKind: {
|
|
866
864
|
label: "角色类型",
|
|
867
865
|
required: !0,
|
|
868
866
|
visible: !0,
|
|
869
867
|
controlType: "select",
|
|
870
|
-
options: tn(
|
|
868
|
+
options: tn(X.value.assignmentType)
|
|
871
869
|
},
|
|
872
870
|
memberRoleIds: {
|
|
873
871
|
label: "成员角色",
|
|
874
|
-
visible:
|
|
872
|
+
visible: X.value.roleKind === "group"
|
|
875
873
|
},
|
|
876
874
|
ownerScopeType: {
|
|
877
875
|
label: "归属范围",
|
|
@@ -904,7 +902,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
904
902
|
required: !0,
|
|
905
903
|
visible: !0,
|
|
906
904
|
controlType: "select",
|
|
907
|
-
options: on(
|
|
905
|
+
options: on(V.value?.kind ?? X.value.ownerScopeType)
|
|
908
906
|
},
|
|
909
907
|
description: {
|
|
910
908
|
label: "说明",
|
|
@@ -932,44 +930,44 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
932
930
|
"description",
|
|
933
931
|
"enabled",
|
|
934
932
|
"sortOrder"
|
|
935
|
-
], ot =
|
|
933
|
+
], ot = D(() => {
|
|
936
934
|
let e = [
|
|
937
935
|
"title",
|
|
938
936
|
"assignmentType",
|
|
939
937
|
"roleKind"
|
|
940
938
|
];
|
|
941
|
-
return
|
|
939
|
+
return X.value.roleKind === "group" && e.push("memberRoleIds"), e.push("ownerScopeType", "ownerScopeId", "sharePolicy", "description", "enabled", "sortOrder"), e;
|
|
942
940
|
}), st;
|
|
943
|
-
|
|
944
|
-
if (lt(), !
|
|
941
|
+
ye(() => {
|
|
942
|
+
if (lt(), !Q.value || !o.recordId || !o.scopeKind) return;
|
|
945
943
|
let e = Ht();
|
|
946
|
-
e && !
|
|
947
|
-
}),
|
|
944
|
+
e && !Me.value && (st = ke(e, ct)), Vt();
|
|
945
|
+
}), ve(() => st?.());
|
|
948
946
|
function ct(e) {
|
|
949
|
-
return
|
|
947
|
+
return G.value === "edit" ? !1 : (Gt(e), !0);
|
|
950
948
|
}
|
|
951
|
-
|
|
952
|
-
!
|
|
953
|
-
}, { immediate: !0 }),
|
|
954
|
-
|
|
949
|
+
be(U, (e) => {
|
|
950
|
+
!Q.value || !e || u?.setTitle(vn(e));
|
|
951
|
+
}, { immediate: !0 }), be(He, gt, { immediate: !0 }), be(V, () => {
|
|
952
|
+
Q.value || (H.value = void 0, U.value = void 0, X.value = Kt(V.value), Mt(), L.value += 1, ut());
|
|
955
953
|
});
|
|
956
954
|
async function lt() {
|
|
957
955
|
try {
|
|
958
|
-
|
|
956
|
+
Z.value = a((await g.runtime.ready).uiDescriptor);
|
|
959
957
|
} catch (e) {
|
|
960
|
-
|
|
958
|
+
d(e, {
|
|
961
959
|
source: "role-management",
|
|
962
960
|
phase: "load"
|
|
963
961
|
});
|
|
964
962
|
}
|
|
965
963
|
}
|
|
966
|
-
async function ut(e =
|
|
964
|
+
async function ut(e = V.value) {
|
|
967
965
|
if (!e) {
|
|
968
|
-
|
|
966
|
+
je.value = [];
|
|
969
967
|
return;
|
|
970
968
|
}
|
|
971
969
|
try {
|
|
972
|
-
|
|
970
|
+
je.value = (await g.crud.query(ft({
|
|
973
971
|
page: {
|
|
974
972
|
pageNum: 0,
|
|
975
973
|
pageSize: 500
|
|
@@ -994,7 +992,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
994
992
|
sorts: [{ field: "sortOrder" }, { field: "title" }]
|
|
995
993
|
}, e))).records;
|
|
996
994
|
} catch (e) {
|
|
997
|
-
|
|
995
|
+
je.value = [], d(e, {
|
|
998
996
|
source: "role-management",
|
|
999
997
|
phase: "load"
|
|
1000
998
|
});
|
|
@@ -1025,39 +1023,39 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1025
1023
|
};
|
|
1026
1024
|
}
|
|
1027
1025
|
function pt(e) {
|
|
1028
|
-
return e === "ownerScopeType" || e === "ownerScopeId" ||
|
|
1026
|
+
return e === "ownerScopeType" || e === "ownerScopeId" || G.value === "edit" && ["assignmentType", "roleKind"].includes(e) ? !0 : U.value?.systemManaged === !0;
|
|
1029
1027
|
}
|
|
1030
1028
|
function mt(e, t) {
|
|
1031
1029
|
let n = {
|
|
1032
|
-
...
|
|
1030
|
+
...X.value,
|
|
1033
1031
|
[e]: t
|
|
1034
1032
|
};
|
|
1035
|
-
e === "roleKind" && (t === "group" || t === "dataGrant") && (n.assignmentType = "employment"), e === "roleKind" && t !== "group" && (n.memberRoleIds = void 0), e === "assignmentType" && t === "account" && $t(n.roleKind) && (n.roleKind = "standard", n.memberRoleIds = void 0),
|
|
1033
|
+
e === "roleKind" && (t === "group" || t === "dataGrant") && (n.assignmentType = "employment"), e === "roleKind" && t !== "group" && (n.memberRoleIds = void 0), e === "assignmentType" && t === "account" && $t(n.roleKind) && (n.roleKind = "standard", n.memberRoleIds = void 0), X.value = n;
|
|
1036
1034
|
}
|
|
1037
1035
|
function ht(e) {
|
|
1038
|
-
if (
|
|
1039
|
-
if (!
|
|
1036
|
+
if (Ve.value) {
|
|
1037
|
+
if (!V.value && Le.value) {
|
|
1040
1038
|
_t();
|
|
1041
1039
|
return;
|
|
1042
1040
|
}
|
|
1043
|
-
!
|
|
1041
|
+
!R.value && e.length > 0 && vt(e[0]);
|
|
1044
1042
|
}
|
|
1045
1043
|
}
|
|
1046
|
-
function gt(e =
|
|
1047
|
-
!e ||
|
|
1044
|
+
function gt(e = He.value) {
|
|
1045
|
+
!e || Ve.value || R.value || V.value || (R.value = e, yt(e), P.value += 1);
|
|
1048
1046
|
}
|
|
1049
1047
|
function _t() {
|
|
1050
|
-
!$() || !
|
|
1048
|
+
!$() || !Le.value || (R.value = void 0, V.value = {
|
|
1051
1049
|
kind: "platform",
|
|
1052
1050
|
key: "platform",
|
|
1053
1051
|
title: "平台角色"
|
|
1054
1052
|
});
|
|
1055
1053
|
}
|
|
1056
1054
|
function vt(e) {
|
|
1057
|
-
$() && (
|
|
1055
|
+
$() && (R.value = e, yt(e), P.value += 1);
|
|
1058
1056
|
}
|
|
1059
|
-
function yt(e =
|
|
1060
|
-
!e?.id || !$() || (
|
|
1057
|
+
function yt(e = R.value) {
|
|
1058
|
+
!e?.id || !$() || (V.value = {
|
|
1061
1059
|
kind: "tenant",
|
|
1062
1060
|
id: e.id,
|
|
1063
1061
|
key: `tenant:${e.id}`,
|
|
@@ -1066,12 +1064,12 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1066
1064
|
});
|
|
1067
1065
|
}
|
|
1068
1066
|
function bt(e) {
|
|
1069
|
-
!e.id || !$() || (
|
|
1067
|
+
!e.id || !$() || (V.value = {
|
|
1070
1068
|
kind: "organization",
|
|
1071
1069
|
id: e.id,
|
|
1072
1070
|
key: `organization:${e.id}`,
|
|
1073
1071
|
title: bn(e),
|
|
1074
|
-
tenant:
|
|
1072
|
+
tenant: R.value,
|
|
1075
1073
|
organization: e
|
|
1076
1074
|
});
|
|
1077
1075
|
}
|
|
@@ -1136,10 +1134,10 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1136
1134
|
}
|
|
1137
1135
|
}
|
|
1138
1136
|
function Tt(e) {
|
|
1139
|
-
!String(e.id ?? "") || e.roleKind === "group" || (
|
|
1137
|
+
!String(e.id ?? "") || e.roleKind === "group" || (Te.value = qt(e), Ee.value = !0);
|
|
1140
1138
|
}
|
|
1141
1139
|
function Et() {
|
|
1142
|
-
|
|
1140
|
+
Ee.value = !1, Te.value = void 0;
|
|
1143
1141
|
}
|
|
1144
1142
|
function Dt(e) {
|
|
1145
1143
|
$() && jt(e, "view");
|
|
@@ -1148,11 +1146,11 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1148
1146
|
if (!$()) return;
|
|
1149
1147
|
let n = String(e.id ?? "");
|
|
1150
1148
|
if (n) {
|
|
1151
|
-
|
|
1149
|
+
Ce.value = !t, we.value = t, Se.value = qt(e);
|
|
1152
1150
|
try {
|
|
1153
|
-
|
|
1151
|
+
Se.value = await g.crud.view(n);
|
|
1154
1152
|
} catch (e) {
|
|
1155
|
-
|
|
1153
|
+
Ce.value = !1, we.value = !1, Se.value = void 0, d(e, {
|
|
1156
1154
|
source: "role-management",
|
|
1157
1155
|
phase: "load"
|
|
1158
1156
|
});
|
|
@@ -1160,29 +1158,29 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1160
1158
|
}
|
|
1161
1159
|
}
|
|
1162
1160
|
function kt() {
|
|
1163
|
-
|
|
1161
|
+
J.value || (Ce.value = !1, we.value = !1, Se.value = void 0);
|
|
1164
1162
|
}
|
|
1165
1163
|
function At() {
|
|
1166
1164
|
if ($()) {
|
|
1167
|
-
if (!
|
|
1168
|
-
|
|
1165
|
+
if (!V.value) {
|
|
1166
|
+
se("请先选择角色归属范围", { phase: "validation" });
|
|
1169
1167
|
return;
|
|
1170
1168
|
}
|
|
1171
|
-
|
|
1169
|
+
U.value = void 0, H.value = void 0, X.value = Kt(V.value), G.value = "create", K.value = !1, q.value = !1, Y.value += 1, W.value = !0;
|
|
1172
1170
|
}
|
|
1173
1171
|
}
|
|
1174
1172
|
async function jt(e, t) {
|
|
1175
1173
|
if (!$()) return;
|
|
1176
1174
|
let n = String(e.id ?? "");
|
|
1177
1175
|
if (!n) return;
|
|
1178
|
-
|
|
1179
|
-
let r =
|
|
1180
|
-
|
|
1176
|
+
H.value = n, W.value = !0, G.value = t, U.value = void 0, X.value = qt(e), K.value = !0, q.value = !1;
|
|
1177
|
+
let r = Y.value + 1;
|
|
1178
|
+
Y.value = r;
|
|
1181
1179
|
try {
|
|
1182
|
-
let e = await
|
|
1180
|
+
let e = await g.crud.view(n);
|
|
1183
1181
|
if (!zt(n, r)) return;
|
|
1184
1182
|
if (!Wt(e)) {
|
|
1185
|
-
|
|
1183
|
+
q.value = !0, se("角色不属于当前归属范围", {
|
|
1186
1184
|
source: "role-management",
|
|
1187
1185
|
phase: "load"
|
|
1188
1186
|
});
|
|
@@ -1190,24 +1188,24 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1190
1188
|
}
|
|
1191
1189
|
Bt(e, t);
|
|
1192
1190
|
} catch (e) {
|
|
1193
|
-
zt(n, r) && (
|
|
1191
|
+
zt(n, r) && (q.value = !0, d(e, {
|
|
1194
1192
|
source: "role-management",
|
|
1195
1193
|
phase: "load"
|
|
1196
1194
|
}));
|
|
1197
1195
|
} finally {
|
|
1198
|
-
zt(n, r) && (
|
|
1196
|
+
zt(n, r) && (K.value = !1);
|
|
1199
1197
|
}
|
|
1200
1198
|
}
|
|
1201
1199
|
function Mt() {
|
|
1202
|
-
|
|
1200
|
+
J.value || (Y.value += 1, K.value = !1, q.value = !1, W.value = !1, G.value = "view", X.value = U.value ? qt(U.value) : Kt(V.value), Me.value && u?.dismiss());
|
|
1203
1201
|
}
|
|
1204
1202
|
function Nt() {
|
|
1205
|
-
if (!
|
|
1206
|
-
if (!
|
|
1203
|
+
if (!J.value) {
|
|
1204
|
+
if (!U.value?.id || G.value === "create") {
|
|
1207
1205
|
Mt();
|
|
1208
1206
|
return;
|
|
1209
1207
|
}
|
|
1210
|
-
|
|
1208
|
+
X.value = qt(U.value), G.value = "view", K.value = !1, q.value = !1;
|
|
1211
1209
|
}
|
|
1212
1210
|
}
|
|
1213
1211
|
function Pt(e) {
|
|
@@ -1220,48 +1218,48 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1220
1218
|
return;
|
|
1221
1219
|
}
|
|
1222
1220
|
if ($()) {
|
|
1223
|
-
if (e.key === "edit" &&
|
|
1224
|
-
|
|
1221
|
+
if (e.key === "edit" && U.value && !U.value.systemManaged) {
|
|
1222
|
+
X.value = qt(U.value), G.value = "edit";
|
|
1225
1223
|
return;
|
|
1226
1224
|
}
|
|
1227
|
-
if (e.key === "bind" &&
|
|
1228
|
-
Ot(
|
|
1225
|
+
if (e.key === "bind" && U.value) {
|
|
1226
|
+
Ot(U.value, U.value.assignmentType === "employment");
|
|
1229
1227
|
return;
|
|
1230
1228
|
}
|
|
1231
|
-
e.key === "delete" && Lt(
|
|
1229
|
+
e.key === "delete" && Lt(U.value);
|
|
1232
1230
|
}
|
|
1233
1231
|
}
|
|
1234
1232
|
function Ft() {
|
|
1235
|
-
let e = String(
|
|
1233
|
+
let e = String(X.value.id ?? H.value ?? "");
|
|
1236
1234
|
if (!e) return;
|
|
1237
|
-
let t =
|
|
1235
|
+
let t = G.value === "create" ? "view" : G.value;
|
|
1238
1236
|
jt({
|
|
1239
|
-
...
|
|
1237
|
+
...X.value,
|
|
1240
1238
|
id: e
|
|
1241
1239
|
}, t);
|
|
1242
1240
|
}
|
|
1243
1241
|
async function It() {
|
|
1244
|
-
await
|
|
1245
|
-
loading:
|
|
1246
|
-
mode:
|
|
1242
|
+
await y({
|
|
1243
|
+
loading: J,
|
|
1244
|
+
mode: G.value === "edit" ? "edit" : "create",
|
|
1247
1245
|
source: "role-management",
|
|
1248
|
-
validateContext: () =>
|
|
1246
|
+
validateContext: () => V.value ? void 0 : "请先选择角色归属范围",
|
|
1249
1247
|
canSave: () => Ze.value,
|
|
1250
1248
|
deniedMessage: "当前用户无权保存角色",
|
|
1251
|
-
createRecord: () => Jt(
|
|
1249
|
+
createRecord: () => Jt(X.value, V.value),
|
|
1252
1250
|
validateRecord: Xt,
|
|
1253
|
-
save: (e, t) => t === "edit" &&
|
|
1251
|
+
save: (e, t) => t === "edit" && U.value?.id ? g.crud.update(U.value.id, e) : g.crud.insert(e),
|
|
1254
1252
|
onSaved: ({ record: e }) => {
|
|
1255
|
-
Bt(e),
|
|
1253
|
+
Bt(e), L.value += 1, ut();
|
|
1256
1254
|
}
|
|
1257
1255
|
});
|
|
1258
1256
|
}
|
|
1259
1257
|
async function Lt(e) {
|
|
1260
|
-
await
|
|
1261
|
-
loading:
|
|
1258
|
+
await ie({
|
|
1259
|
+
loading: J,
|
|
1262
1260
|
source: "role-management",
|
|
1263
1261
|
record: () => e?.id ? e : void 0,
|
|
1264
|
-
canExecute: (e) =>
|
|
1262
|
+
canExecute: (e) => g.can("delete") === !0 && e.systemManaged !== !0,
|
|
1265
1263
|
deniedMessage: "当前用户无权删除角色",
|
|
1266
1264
|
confirm: (e) => ce({
|
|
1267
1265
|
title: "删除角色",
|
|
@@ -1269,39 +1267,39 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1269
1267
|
okText: "删除",
|
|
1270
1268
|
danger: !0
|
|
1271
1269
|
}),
|
|
1272
|
-
execute: (e) =>
|
|
1270
|
+
execute: (e) => g.crud.delete(String(e.id), { version: e.version }),
|
|
1273
1271
|
onExecuted: (e, t) => {
|
|
1274
|
-
|
|
1272
|
+
H.value === String(t.id) && (H.value = void 0, U.value = void 0, X.value = Kt(V.value), W.value = !1, G.value = "view", K.value = !1, q.value = !1, Y.value += 1), L.value += 1, ut();
|
|
1275
1273
|
}
|
|
1276
1274
|
});
|
|
1277
1275
|
}
|
|
1278
1276
|
async function Rt(e) {
|
|
1279
|
-
await
|
|
1280
|
-
loading:
|
|
1277
|
+
await ie({
|
|
1278
|
+
loading: J,
|
|
1281
1279
|
source: "role-management",
|
|
1282
1280
|
record: () => e?.id ? e : void 0,
|
|
1283
|
-
canExecute: (e) =>
|
|
1281
|
+
canExecute: (e) => g.can(gn(e)) === !0 && e.systemManaged !== !0,
|
|
1284
1282
|
deniedMessage: "当前用户无权变更角色启停状态",
|
|
1285
|
-
execute: (e) => e.enabled === !1 ?
|
|
1283
|
+
execute: (e) => e.enabled === !1 ? g.crud.enable(String(e.id), { version: e.version }) : g.crud.disable(String(e.id), { version: e.version }),
|
|
1286
1284
|
onExecuted: async (e, t) => {
|
|
1287
|
-
|
|
1285
|
+
H.value === String(t.id) && Bt(await g.crud.view(String(t.id))), L.value += 1, ut();
|
|
1288
1286
|
}
|
|
1289
1287
|
});
|
|
1290
1288
|
}
|
|
1291
1289
|
function $() {
|
|
1292
|
-
return !
|
|
1290
|
+
return !J.value;
|
|
1293
1291
|
}
|
|
1294
1292
|
function zt(e, t) {
|
|
1295
|
-
return
|
|
1293
|
+
return Y.value === t && H.value === e;
|
|
1296
1294
|
}
|
|
1297
1295
|
function Bt(e, t = "view") {
|
|
1298
|
-
|
|
1296
|
+
U.value = e, H.value = e.id, X.value = qt(e), G.value = t === "edit" && e.systemManaged !== !0 ? "edit" : "view", W.value = !0, K.value = !1, q.value = !1, Y.value += 1;
|
|
1299
1297
|
}
|
|
1300
1298
|
async function Vt() {
|
|
1301
1299
|
let e = Ht();
|
|
1302
1300
|
if (!e) return;
|
|
1303
|
-
|
|
1304
|
-
let t =
|
|
1301
|
+
V.value = Ut(e);
|
|
1302
|
+
let t = Ae(e);
|
|
1305
1303
|
if (t) {
|
|
1306
1304
|
Gt(t);
|
|
1307
1305
|
return;
|
|
@@ -1309,11 +1307,11 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1309
1307
|
await jt({ id: e.recordId }, "view");
|
|
1310
1308
|
}
|
|
1311
1309
|
function Ht() {
|
|
1312
|
-
let e =
|
|
1313
|
-
if (!(!e || !t || t !== "platform" && !
|
|
1310
|
+
let e = o.recordId, t = o.scopeKind;
|
|
1311
|
+
if (!(!e || !t || t !== "platform" && !o.scopeId)) return {
|
|
1314
1312
|
recordId: e,
|
|
1315
1313
|
scopeKind: t,
|
|
1316
|
-
...t === "platform" ? {} : { scopeId:
|
|
1314
|
+
...t === "platform" ? {} : { scopeId: o.scopeId }
|
|
1317
1315
|
};
|
|
1318
1316
|
}
|
|
1319
1317
|
function Ut(e) {
|
|
@@ -1336,11 +1334,11 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1336
1334
|
};
|
|
1337
1335
|
}
|
|
1338
1336
|
function Wt(e) {
|
|
1339
|
-
let t =
|
|
1337
|
+
let t = V.value;
|
|
1340
1338
|
return !t || e.ownerScopeType !== t.kind ? !1 : t.kind === "platform" || e.ownerScopeId === t.id;
|
|
1341
1339
|
}
|
|
1342
1340
|
function Gt(e) {
|
|
1343
|
-
|
|
1341
|
+
V.value = e.scope, U.value = e.selectedRole, H.value = e.selectedRole.id, X.value = e.draft, G.value = e.mode, W.value = !0, K.value = !1, q.value = !1, Y.value += 1;
|
|
1344
1342
|
}
|
|
1345
1343
|
function Kt(e) {
|
|
1346
1344
|
return {
|
|
@@ -1358,7 +1356,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1358
1356
|
return { ...e };
|
|
1359
1357
|
}
|
|
1360
1358
|
function Jt(e, t) {
|
|
1361
|
-
let n = Qt(e.roleKind), r = nn(e.sharePolicy, t.kind), i =
|
|
1359
|
+
let n = Qt(e.roleKind), r = nn(e.sharePolicy, t.kind), i = oe(e, {
|
|
1362
1360
|
title: e.title?.trim(),
|
|
1363
1361
|
assignmentType: Zt(e.assignmentType, n),
|
|
1364
1362
|
roleKind: n,
|
|
@@ -1378,18 +1376,18 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1378
1376
|
return e?.kind === "platform" ? void 0 : e?.tenant?.id ?? e?.id;
|
|
1379
1377
|
}
|
|
1380
1378
|
function Xt(e) {
|
|
1381
|
-
for (let
|
|
1379
|
+
for (let t of [
|
|
1382
1380
|
"title",
|
|
1383
1381
|
"assignmentType",
|
|
1384
1382
|
"roleKind",
|
|
1385
1383
|
"ownerScopeType",
|
|
1386
1384
|
"sharePolicy"
|
|
1387
1385
|
]) {
|
|
1388
|
-
let
|
|
1389
|
-
fields:
|
|
1386
|
+
let n = r(t, {
|
|
1387
|
+
fields: Z.value,
|
|
1390
1388
|
fallback: rt.value
|
|
1391
1389
|
});
|
|
1392
|
-
if (
|
|
1390
|
+
if (n.visible && n.required && !e[t]) return `请填写${n.label}`;
|
|
1393
1391
|
}
|
|
1394
1392
|
if (e.ownerScopeType !== "platform" && !e.ownerScopeId) return "请选择归属对象";
|
|
1395
1393
|
if (!on(e.ownerScopeType).some((t) => t.value === e.sharePolicy)) return "请选择当前归属范围可用的公开策略";
|
|
@@ -1522,14 +1520,14 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1522
1520
|
return String(e?.title ?? e?.code ?? e?.id ?? "未命名机构");
|
|
1523
1521
|
}
|
|
1524
1522
|
function xn(e, t) {
|
|
1525
|
-
if (e === "ownerScopeType") return Cn(
|
|
1526
|
-
if (e === "ownerScopeId") return
|
|
1523
|
+
if (e === "ownerScopeType") return Cn(X.value.ownerScopeType);
|
|
1524
|
+
if (e === "ownerScopeId") return V.value?.title ?? String(t ?? "");
|
|
1527
1525
|
if (e === "memberRoleIds") return Sn(t);
|
|
1528
1526
|
}
|
|
1529
1527
|
function Sn(e) {
|
|
1530
1528
|
let t = En(e);
|
|
1531
1529
|
return t.length === 0 ? "-" : t.map((e) => {
|
|
1532
|
-
let t =
|
|
1530
|
+
let t = je.value.find((t) => t.id === e);
|
|
1533
1531
|
return t ? vn(t) : e;
|
|
1534
1532
|
}).join(",");
|
|
1535
1533
|
}
|
|
@@ -1553,57 +1551,57 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1553
1551
|
function En(e) {
|
|
1554
1552
|
return Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
1555
1553
|
}
|
|
1556
|
-
return (
|
|
1554
|
+
return (r, i) => (F(), A("section", {
|
|
1557
1555
|
ref_key: "pageRoot",
|
|
1558
|
-
ref:
|
|
1559
|
-
class:
|
|
1556
|
+
ref: E,
|
|
1557
|
+
class: _e(["role-management-page", {
|
|
1560
1558
|
"role-management-page-platform": !We.value,
|
|
1561
|
-
"role-management-page--task":
|
|
1559
|
+
"role-management-page--task": Q.value && !Me.value
|
|
1562
1560
|
}])
|
|
1563
1561
|
}, [
|
|
1564
|
-
!
|
|
1562
|
+
!Q.value || Me.value ? (F(), O(z(le), {
|
|
1565
1563
|
key: 0,
|
|
1566
1564
|
class: "role-scope-panel",
|
|
1567
1565
|
title: "租户",
|
|
1568
1566
|
"refresh-title": "刷新租户列表",
|
|
1569
|
-
"search-keyword":
|
|
1567
|
+
"search-keyword": T.value,
|
|
1570
1568
|
"search-placeholder": "搜索租户名称、alias 或 ID",
|
|
1571
|
-
searchable:
|
|
1572
|
-
onRefresh:
|
|
1573
|
-
"onUpdate:searchKeyword":
|
|
1569
|
+
searchable: Ve.value,
|
|
1570
|
+
onRefresh: i[2] ||= (e) => Ve.value ? pe.value += 1 : gt(),
|
|
1571
|
+
"onUpdate:searchKeyword": i[3] ||= (e) => T.value = e
|
|
1574
1572
|
}, {
|
|
1575
|
-
default:
|
|
1573
|
+
default: B(() => [Le.value ? (F(), A("button", {
|
|
1576
1574
|
key: 0,
|
|
1577
1575
|
class: "role-platform-scope",
|
|
1578
1576
|
type: "button",
|
|
1579
1577
|
onClick: _t
|
|
1580
|
-
}, [
|
|
1578
|
+
}, [N(z(f), {
|
|
1581
1579
|
title: "平台角色",
|
|
1582
1580
|
secondary: "全局范围",
|
|
1583
1581
|
clickable: "",
|
|
1584
|
-
selected:
|
|
1585
|
-
}, null, 8, ["selected"])])) :
|
|
1582
|
+
selected: V.value?.kind === "platform"
|
|
1583
|
+
}, null, 8, ["selected"])])) : k("v-if", !0), !Ve.value && He.value ? (F(), A("button", {
|
|
1586
1584
|
key: 1,
|
|
1587
1585
|
class: "role-tenant-root-scope",
|
|
1588
1586
|
type: "button",
|
|
1589
|
-
onClick:
|
|
1590
|
-
}, [
|
|
1591
|
-
title: yn(
|
|
1587
|
+
onClick: i[0] ||= (e) => vt(He.value)
|
|
1588
|
+
}, [N(z(f), {
|
|
1589
|
+
title: yn(He.value),
|
|
1592
1590
|
secondary: "当前租户",
|
|
1593
1591
|
clickable: "",
|
|
1594
|
-
selected:
|
|
1595
|
-
}, null, 8, ["title", "selected"])])) : (
|
|
1592
|
+
selected: R.value?.id === He.value.id
|
|
1593
|
+
}, null, 8, ["title", "selected"])])) : (F(), O(z(ae), {
|
|
1596
1594
|
key: 2,
|
|
1597
|
-
context:
|
|
1598
|
-
"selected-id":
|
|
1599
|
-
"reload-key":
|
|
1600
|
-
keyword:
|
|
1595
|
+
context: Pe.value,
|
|
1596
|
+
"selected-id": R.value?.id,
|
|
1597
|
+
"reload-key": pe.value,
|
|
1598
|
+
keyword: T.value,
|
|
1601
1599
|
"empty-description": "暂无租户",
|
|
1602
1600
|
"loading-tip": "加载租户列表",
|
|
1603
1601
|
"fallback-title": "未命名租户",
|
|
1604
1602
|
"item-of": wn,
|
|
1605
1603
|
onLoaded: ht,
|
|
1606
|
-
onSelect:
|
|
1604
|
+
onSelect: i[1] ||= (e) => vt(e)
|
|
1607
1605
|
}, null, 8, [
|
|
1608
1606
|
"context",
|
|
1609
1607
|
"selected-id",
|
|
@@ -1611,65 +1609,65 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1611
1609
|
"keyword"
|
|
1612
1610
|
]))]),
|
|
1613
1611
|
_: 1
|
|
1614
|
-
}, 8, ["search-keyword", "searchable"])) :
|
|
1615
|
-
(!
|
|
1612
|
+
}, 8, ["search-keyword", "searchable"])) : k("v-if", !0),
|
|
1613
|
+
(!Q.value || Me.value) && We.value ? (F(), O(z(le), {
|
|
1616
1614
|
key: 1,
|
|
1617
1615
|
class: "role-scope-panel",
|
|
1618
1616
|
title: "归属范围",
|
|
1619
1617
|
"refresh-title": "刷新机构树",
|
|
1620
|
-
"search-keyword":
|
|
1618
|
+
"search-keyword": fe.value,
|
|
1621
1619
|
"search-placeholder": "搜索机构名称、编码或 ID",
|
|
1622
|
-
searchable: !!
|
|
1623
|
-
onRefresh:
|
|
1624
|
-
"onUpdate:searchKeyword":
|
|
1620
|
+
searchable: !!R.value,
|
|
1621
|
+
onRefresh: i[6] ||= (e) => P.value += 1,
|
|
1622
|
+
"onUpdate:searchKeyword": i[7] ||= (e) => fe.value = e
|
|
1625
1623
|
}, {
|
|
1626
|
-
default:
|
|
1624
|
+
default: B(() => [V.value?.kind === "platform" ? (F(), O(z(S), {
|
|
1627
1625
|
key: 0,
|
|
1628
1626
|
description: "平台角色不需要选择租户内范围"
|
|
1629
|
-
})) :
|
|
1627
|
+
})) : R.value ? (F(), A(ge, { key: 2 }, [j("button", {
|
|
1630
1628
|
class: "role-tenant-root-scope",
|
|
1631
1629
|
type: "button",
|
|
1632
|
-
onClick:
|
|
1633
|
-
}, [
|
|
1634
|
-
title: yn(
|
|
1630
|
+
onClick: i[4] ||= (e) => yt()
|
|
1631
|
+
}, [N(z(f), {
|
|
1632
|
+
title: yn(R.value),
|
|
1635
1633
|
secondary: "租户本级角色",
|
|
1636
1634
|
clickable: "",
|
|
1637
|
-
selected:
|
|
1638
|
-
}, null, 8, ["title", "selected"])]),
|
|
1635
|
+
selected: V.value?.kind === "tenant" && V.value.id === R.value.id
|
|
1636
|
+
}, null, 8, ["title", "selected"])]), N(z(p), {
|
|
1639
1637
|
context: Ue.value,
|
|
1640
|
-
"selected-id":
|
|
1641
|
-
"reload-key":
|
|
1642
|
-
keyword:
|
|
1638
|
+
"selected-id": V.value?.kind === "organization" ? V.value.id : void 0,
|
|
1639
|
+
"reload-key": P.value,
|
|
1640
|
+
keyword: fe.value,
|
|
1643
1641
|
"search-mode": "none",
|
|
1644
1642
|
"search-trigger": "external",
|
|
1645
1643
|
"empty-description": "当前租户暂无机构",
|
|
1646
1644
|
"loading-tip": "加载机构树",
|
|
1647
1645
|
"fallback-title": "未命名机构",
|
|
1648
1646
|
"item-of": Tn,
|
|
1649
|
-
onSelect:
|
|
1647
|
+
onSelect: i[5] ||= (e) => bt(e)
|
|
1650
1648
|
}, null, 8, [
|
|
1651
1649
|
"context",
|
|
1652
1650
|
"selected-id",
|
|
1653
1651
|
"reload-key",
|
|
1654
1652
|
"keyword"
|
|
1655
|
-
])], 64)) : (
|
|
1653
|
+
])], 64)) : (F(), O(z(S), {
|
|
1656
1654
|
key: 1,
|
|
1657
1655
|
description: "请选择左侧租户"
|
|
1658
1656
|
}))]),
|
|
1659
1657
|
_: 1
|
|
1660
|
-
}, 8, ["search-keyword", "searchable"])) :
|
|
1661
|
-
!
|
|
1658
|
+
}, 8, ["search-keyword", "searchable"])) : k("v-if", !0),
|
|
1659
|
+
!Q.value || Me.value ? (F(), O(z(e), {
|
|
1662
1660
|
key: 2,
|
|
1663
1661
|
class: "role-list-panel",
|
|
1664
1662
|
context: Ge.value,
|
|
1665
|
-
title:
|
|
1663
|
+
title: V.value ? `角色列表 - ${V.value.title}` : "角色列表",
|
|
1666
1664
|
columns: Ke.value,
|
|
1667
1665
|
"standard-crud-actions": "",
|
|
1668
1666
|
"standard-crud-row-actions": "",
|
|
1669
1667
|
"extra-row-actions-of": St,
|
|
1670
1668
|
"row-action-state-of": Ct,
|
|
1671
|
-
"selected-key":
|
|
1672
|
-
"reload-key":
|
|
1669
|
+
"selected-key": H.value,
|
|
1670
|
+
"reload-key": L.value,
|
|
1673
1671
|
ready: qe.value,
|
|
1674
1672
|
"quick-search-placeholder": "搜索角色名称或说明",
|
|
1675
1673
|
"empty-description": "当前范围暂无角色",
|
|
@@ -1677,7 +1675,7 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1677
1675
|
onAction: xt,
|
|
1678
1676
|
onRowAction: wt,
|
|
1679
1677
|
onRowDblclick: Dt,
|
|
1680
|
-
onSelect:
|
|
1678
|
+
onSelect: i[8] ||= (e) => H.value = String(e.id ?? "")
|
|
1681
1679
|
}, null, 8, [
|
|
1682
1680
|
"context",
|
|
1683
1681
|
"title",
|
|
@@ -1685,53 +1683,53 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1685
1683
|
"selected-key",
|
|
1686
1684
|
"reload-key",
|
|
1687
1685
|
"ready"
|
|
1688
|
-
])) :
|
|
1689
|
-
|
|
1686
|
+
])) : k("v-if", !0),
|
|
1687
|
+
Ne.value ? (F(), O(z(ee), {
|
|
1690
1688
|
key: 3,
|
|
1691
|
-
open:
|
|
1689
|
+
open: W.value,
|
|
1692
1690
|
title: Je.value,
|
|
1693
|
-
|
|
1691
|
+
"render-mode": "inline",
|
|
1694
1692
|
subtitle: Ye.value,
|
|
1695
|
-
"close-on-outside":
|
|
1696
|
-
promotion:
|
|
1693
|
+
"close-on-outside": G.value === "view",
|
|
1694
|
+
promotion: z(nt),
|
|
1697
1695
|
onClose: Mt
|
|
1698
1696
|
}, {
|
|
1699
|
-
status:
|
|
1697
|
+
status: B(() => [G.value === "view" && U.value ? (F(), O(z(l), {
|
|
1700
1698
|
key: 0,
|
|
1701
|
-
enabled:
|
|
1702
|
-
disabled:
|
|
1703
|
-
loading:
|
|
1699
|
+
enabled: U.value.enabled !== !1,
|
|
1700
|
+
disabled: J.value || !Qe.value,
|
|
1701
|
+
loading: J.value,
|
|
1704
1702
|
"show-label": !1,
|
|
1705
|
-
onChange:
|
|
1703
|
+
onChange: i[9] ||= (e) => Rt(U.value)
|
|
1706
1704
|
}, null, 8, [
|
|
1707
1705
|
"enabled",
|
|
1708
1706
|
"disabled",
|
|
1709
1707
|
"loading"
|
|
1710
|
-
])) :
|
|
1711
|
-
operation:
|
|
1708
|
+
])) : k("v-if", !0)]),
|
|
1709
|
+
operation: B(() => [N(z(t), {
|
|
1712
1710
|
context: Ge.value,
|
|
1713
1711
|
actions: et.value,
|
|
1714
1712
|
onAction: Pt
|
|
1715
1713
|
}, null, 8, ["context", "actions"])]),
|
|
1716
|
-
default:
|
|
1714
|
+
default: B(() => [K.value ? (F(), O(z(re), {
|
|
1717
1715
|
key: 0,
|
|
1718
1716
|
class: "role-detail-state",
|
|
1719
1717
|
tip: "加载角色详情"
|
|
1720
|
-
})) :
|
|
1718
|
+
})) : q.value ? (F(), A("div", ze, [N(z(te), {
|
|
1721
1719
|
title: "详情加载失败",
|
|
1722
1720
|
message: "无法加载角色详情,请重试"
|
|
1723
|
-
}),
|
|
1721
|
+
}), N(z(n), {
|
|
1724
1722
|
type: "primary",
|
|
1725
1723
|
"icon-name": "reload",
|
|
1726
1724
|
onClick: Ft
|
|
1727
1725
|
}, {
|
|
1728
|
-
default:
|
|
1726
|
+
default: B(() => [...i[15] ||= [M("重试", -1)]]),
|
|
1729
1727
|
_: 1
|
|
1730
|
-
})])) :
|
|
1728
|
+
})])) : G.value === "view" || G.value === "create" || U.value ? (F(), A(ge, { key: 2 }, [G.value === "view" ? (F(), O(z(_), {
|
|
1731
1729
|
key: 0,
|
|
1732
|
-
record:
|
|
1730
|
+
record: X.value,
|
|
1733
1731
|
"field-names": ot.value,
|
|
1734
|
-
fields:
|
|
1732
|
+
fields: Z.value,
|
|
1735
1733
|
fallback: rt.value,
|
|
1736
1734
|
"display-of": xn
|
|
1737
1735
|
}, null, 8, [
|
|
@@ -1739,19 +1737,19 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1739
1737
|
"field-names",
|
|
1740
1738
|
"fields",
|
|
1741
1739
|
"fallback"
|
|
1742
|
-
])) : (
|
|
1740
|
+
])) : (F(), A("form", {
|
|
1743
1741
|
key: 1,
|
|
1744
1742
|
class: "role-form",
|
|
1745
|
-
onSubmit:
|
|
1743
|
+
onSubmit: xe(It, ["prevent"])
|
|
1746
1744
|
}, [
|
|
1747
|
-
|
|
1748
|
-
value:
|
|
1745
|
+
j("label", null, [i[16] ||= j("span", { class: "role-form-label" }, "当前范围", -1), N(z(ne), {
|
|
1746
|
+
value: V.value?.title ?? "-",
|
|
1749
1747
|
disabled: ""
|
|
1750
1748
|
}, null, 8, ["value"])]),
|
|
1751
|
-
|
|
1752
|
-
record:
|
|
1749
|
+
N(z(v), {
|
|
1750
|
+
record: X.value,
|
|
1753
1751
|
"field-names": it,
|
|
1754
|
-
fields:
|
|
1752
|
+
fields: Z.value,
|
|
1755
1753
|
fallback: rt.value,
|
|
1756
1754
|
disabled: Xe.value,
|
|
1757
1755
|
"disabled-of": pt,
|
|
@@ -1762,23 +1760,23 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1762
1760
|
"fallback",
|
|
1763
1761
|
"disabled"
|
|
1764
1762
|
]),
|
|
1765
|
-
|
|
1763
|
+
X.value.roleKind === "group" ? (F(), O(Re, {
|
|
1766
1764
|
key: 0,
|
|
1767
|
-
value:
|
|
1768
|
-
candidates:
|
|
1769
|
-
"current-role-id":
|
|
1770
|
-
disabled: Xe.value ||
|
|
1771
|
-
"onUpdate:value":
|
|
1765
|
+
value: X.value.memberRoleIds,
|
|
1766
|
+
candidates: je.value,
|
|
1767
|
+
"current-role-id": U.value?.id,
|
|
1768
|
+
disabled: Xe.value || U.value?.systemManaged === !0,
|
|
1769
|
+
"onUpdate:value": i[10] ||= (e) => mt("memberRoleIds", e)
|
|
1772
1770
|
}, null, 8, [
|
|
1773
1771
|
"value",
|
|
1774
1772
|
"candidates",
|
|
1775
1773
|
"current-role-id",
|
|
1776
1774
|
"disabled"
|
|
1777
|
-
])) :
|
|
1778
|
-
|
|
1779
|
-
record:
|
|
1775
|
+
])) : k("v-if", !0),
|
|
1776
|
+
N(z(v), {
|
|
1777
|
+
record: X.value,
|
|
1780
1778
|
"field-names": at,
|
|
1781
|
-
fields:
|
|
1779
|
+
fields: Z.value,
|
|
1782
1780
|
fallback: rt.value,
|
|
1783
1781
|
disabled: Xe.value,
|
|
1784
1782
|
"disabled-of": pt,
|
|
@@ -1789,65 +1787,64 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1789
1787
|
"fallback",
|
|
1790
1788
|
"disabled"
|
|
1791
1789
|
])
|
|
1792
|
-
], 32)),
|
|
1790
|
+
], 32)), G.value === "create" ? k("v-if", !0) : (F(), O(z(x), {
|
|
1793
1791
|
key: 2,
|
|
1794
|
-
record:
|
|
1792
|
+
record: X.value,
|
|
1795
1793
|
"show-sort-order": ""
|
|
1796
|
-
}, null, 8, ["record"]))], 64)) :
|
|
1794
|
+
}, null, 8, ["record"]))], 64)) : k("v-if", !0)]),
|
|
1797
1795
|
_: 1
|
|
1798
1796
|
}, 8, [
|
|
1799
1797
|
"open",
|
|
1800
1798
|
"title",
|
|
1801
|
-
"container",
|
|
1802
1799
|
"subtitle",
|
|
1803
1800
|
"close-on-outside",
|
|
1804
1801
|
"promotion"
|
|
1805
|
-
])) : (
|
|
1802
|
+
])) : (F(), O(z(s), {
|
|
1806
1803
|
key: 4,
|
|
1807
1804
|
title: Je.value,
|
|
1808
1805
|
subtitle: Ye.value
|
|
1809
1806
|
}, {
|
|
1810
|
-
status:
|
|
1807
|
+
status: B(() => [G.value === "view" && U.value ? (F(), O(z(l), {
|
|
1811
1808
|
key: 0,
|
|
1812
|
-
enabled:
|
|
1813
|
-
disabled:
|
|
1814
|
-
loading:
|
|
1809
|
+
enabled: U.value.enabled !== !1,
|
|
1810
|
+
disabled: J.value || !Qe.value,
|
|
1811
|
+
loading: J.value,
|
|
1815
1812
|
"show-label": !1,
|
|
1816
|
-
onChange:
|
|
1813
|
+
onChange: i[11] ||= (e) => Rt(U.value)
|
|
1817
1814
|
}, null, 8, [
|
|
1818
1815
|
"enabled",
|
|
1819
1816
|
"disabled",
|
|
1820
1817
|
"loading"
|
|
1821
|
-
])) :
|
|
1822
|
-
operation:
|
|
1823
|
-
context:
|
|
1818
|
+
])) : k("v-if", !0)]),
|
|
1819
|
+
operation: B(() => [N(z(t), {
|
|
1820
|
+
context: z(g),
|
|
1824
1821
|
actions: tt.value,
|
|
1825
|
-
"record-id":
|
|
1822
|
+
"record-id": U.value?.id,
|
|
1826
1823
|
onAction: Pt
|
|
1827
1824
|
}, null, 8, [
|
|
1828
1825
|
"context",
|
|
1829
1826
|
"actions",
|
|
1830
1827
|
"record-id"
|
|
1831
1828
|
])]),
|
|
1832
|
-
default:
|
|
1829
|
+
default: B(() => [K.value ? (F(), O(z(re), {
|
|
1833
1830
|
key: 0,
|
|
1834
1831
|
class: "role-detail-state",
|
|
1835
1832
|
tip: "加载角色详情"
|
|
1836
|
-
})) :
|
|
1833
|
+
})) : q.value ? (F(), A("div", Be, [N(z(te), {
|
|
1837
1834
|
title: "详情加载失败",
|
|
1838
1835
|
message: "无法加载角色详情,请重试"
|
|
1839
|
-
}),
|
|
1836
|
+
}), N(z(n), {
|
|
1840
1837
|
type: "primary",
|
|
1841
1838
|
"icon-name": "reload",
|
|
1842
1839
|
onClick: Ft
|
|
1843
1840
|
}, {
|
|
1844
|
-
default:
|
|
1841
|
+
default: B(() => [...i[17] ||= [M("重试", -1)]]),
|
|
1845
1842
|
_: 1
|
|
1846
|
-
})])) :
|
|
1843
|
+
})])) : G.value === "view" || U.value ? (F(), A(ge, { key: 2 }, [G.value === "view" ? (F(), O(z(_), {
|
|
1847
1844
|
key: 0,
|
|
1848
|
-
record:
|
|
1845
|
+
record: X.value,
|
|
1849
1846
|
"field-names": ot.value,
|
|
1850
|
-
fields:
|
|
1847
|
+
fields: Z.value,
|
|
1851
1848
|
fallback: rt.value,
|
|
1852
1849
|
"display-of": xn
|
|
1853
1850
|
}, null, 8, [
|
|
@@ -1855,19 +1852,19 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1855
1852
|
"field-names",
|
|
1856
1853
|
"fields",
|
|
1857
1854
|
"fallback"
|
|
1858
|
-
])) : (
|
|
1855
|
+
])) : (F(), A("form", {
|
|
1859
1856
|
key: 1,
|
|
1860
1857
|
class: "role-form",
|
|
1861
|
-
onSubmit:
|
|
1858
|
+
onSubmit: xe(It, ["prevent"])
|
|
1862
1859
|
}, [
|
|
1863
|
-
|
|
1864
|
-
value:
|
|
1860
|
+
j("label", null, [i[18] ||= j("span", { class: "role-form-label" }, "当前范围", -1), N(z(ne), {
|
|
1861
|
+
value: V.value?.title ?? "-",
|
|
1865
1862
|
disabled: ""
|
|
1866
1863
|
}, null, 8, ["value"])]),
|
|
1867
|
-
|
|
1868
|
-
record:
|
|
1864
|
+
N(z(v), {
|
|
1865
|
+
record: X.value,
|
|
1869
1866
|
"field-names": it,
|
|
1870
|
-
fields:
|
|
1867
|
+
fields: Z.value,
|
|
1871
1868
|
fallback: rt.value,
|
|
1872
1869
|
disabled: Xe.value,
|
|
1873
1870
|
"disabled-of": pt,
|
|
@@ -1878,23 +1875,23 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1878
1875
|
"fallback",
|
|
1879
1876
|
"disabled"
|
|
1880
1877
|
]),
|
|
1881
|
-
|
|
1878
|
+
X.value.roleKind === "group" ? (F(), O(Re, {
|
|
1882
1879
|
key: 0,
|
|
1883
|
-
value:
|
|
1884
|
-
candidates:
|
|
1885
|
-
"current-role-id":
|
|
1886
|
-
disabled: Xe.value ||
|
|
1887
|
-
"onUpdate:value":
|
|
1880
|
+
value: X.value.memberRoleIds,
|
|
1881
|
+
candidates: je.value,
|
|
1882
|
+
"current-role-id": U.value?.id,
|
|
1883
|
+
disabled: Xe.value || U.value?.systemManaged === !0,
|
|
1884
|
+
"onUpdate:value": i[12] ||= (e) => mt("memberRoleIds", e)
|
|
1888
1885
|
}, null, 8, [
|
|
1889
1886
|
"value",
|
|
1890
1887
|
"candidates",
|
|
1891
1888
|
"current-role-id",
|
|
1892
1889
|
"disabled"
|
|
1893
|
-
])) :
|
|
1894
|
-
|
|
1895
|
-
record:
|
|
1890
|
+
])) : k("v-if", !0),
|
|
1891
|
+
N(z(v), {
|
|
1892
|
+
record: X.value,
|
|
1896
1893
|
"field-names": at,
|
|
1897
|
-
fields:
|
|
1894
|
+
fields: Z.value,
|
|
1898
1895
|
fallback: rt.value,
|
|
1899
1896
|
disabled: Xe.value,
|
|
1900
1897
|
"disabled-of": pt,
|
|
@@ -1905,47 +1902,47 @@ var K = /*#__PURE__*/ a(/* @__PURE__ */ A({
|
|
|
1905
1902
|
"fallback",
|
|
1906
1903
|
"disabled"
|
|
1907
1904
|
])
|
|
1908
|
-
], 32)),
|
|
1909
|
-
record:
|
|
1905
|
+
], 32)), N(z(x), {
|
|
1906
|
+
record: X.value,
|
|
1910
1907
|
"show-sort-order": ""
|
|
1911
|
-
}, null, 8, ["record"])], 64)) :
|
|
1908
|
+
}, null, 8, ["record"])], 64)) : k("v-if", !0)]),
|
|
1912
1909
|
_: 1
|
|
1913
1910
|
}, 8, ["title", "subtitle"])),
|
|
1914
|
-
|
|
1915
|
-
open:
|
|
1916
|
-
context:
|
|
1917
|
-
role:
|
|
1918
|
-
container:
|
|
1911
|
+
N(De, {
|
|
1912
|
+
open: Ce.value,
|
|
1913
|
+
context: z(g),
|
|
1914
|
+
role: Se.value,
|
|
1915
|
+
container: E.value,
|
|
1919
1916
|
onClose: kt,
|
|
1920
|
-
onSaved:
|
|
1917
|
+
onSaved: i[13] ||= (e) => L.value += 1
|
|
1921
1918
|
}, null, 8, [
|
|
1922
1919
|
"open",
|
|
1923
1920
|
"context",
|
|
1924
1921
|
"role",
|
|
1925
1922
|
"container"
|
|
1926
1923
|
]),
|
|
1927
|
-
|
|
1928
|
-
open:
|
|
1929
|
-
context:
|
|
1930
|
-
role:
|
|
1931
|
-
container:
|
|
1924
|
+
N(Ie, {
|
|
1925
|
+
open: we.value,
|
|
1926
|
+
context: z(g),
|
|
1927
|
+
role: Se.value,
|
|
1928
|
+
container: E.value,
|
|
1932
1929
|
onClose: kt,
|
|
1933
|
-
onSaved:
|
|
1930
|
+
onSaved: i[14] ||= (e) => L.value += 1
|
|
1934
1931
|
}, null, 8, [
|
|
1935
1932
|
"open",
|
|
1936
1933
|
"context",
|
|
1937
1934
|
"role",
|
|
1938
1935
|
"container"
|
|
1939
1936
|
]),
|
|
1940
|
-
|
|
1937
|
+
Ee.value && Te.value?.id ? (F(), O(he, {
|
|
1941
1938
|
key: 5,
|
|
1942
|
-
"role-id":
|
|
1943
|
-
container:
|
|
1939
|
+
"role-id": Te.value.id,
|
|
1940
|
+
container: E.value,
|
|
1944
1941
|
drawer: "",
|
|
1945
1942
|
onClose: Et
|
|
1946
|
-
}, null, 8, ["role-id", "container"])) :
|
|
1943
|
+
}, null, 8, ["role-id", "container"])) : k("v-if", !0)
|
|
1947
1944
|
], 2));
|
|
1948
1945
|
}
|
|
1949
|
-
}),
|
|
1946
|
+
}), He = /* @__PURE__ */ m({ default: () => Ue }), Ue = /*#__PURE__*/ o(Ve, [["__scopeId", "data-v-9d3ace62"]]);
|
|
1950
1947
|
//#endregion
|
|
1951
|
-
export {
|
|
1948
|
+
export { He as n, Ue as t };
|