@ximatai/muyun-web-app 0.26.4 → 0.26.5
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/{EmployeeDetailWorkspaceView-BySbWjCV.js → EmployeeDetailWorkspaceView-rm9ujeiQ.js} +1 -1
- package/dist/{EmployeeManagementView-DvmDPxzN.js → EmployeeManagementView-DyYMWQ64.js} +486 -486
- package/dist/{MetadataOrchestrationView-2JxJkFEC.js → MetadataOrchestrationView-DaPNQML7.js} +203 -203
- package/dist/ModuleActionManagementView-BFoPGqzC.js +597 -0
- package/dist/{RoleAuthorizationView-CK6Vfdup.js → RoleAuthorizationView-qQvn7M75.js} +68 -68
- package/dist/{RoleDetailWorkspaceView-BPZcZy-r.js → RoleDetailWorkspaceView-C-vaKeZM.js} +1 -1
- package/dist/{RoleManagementView-B7TzzVOm.js → RoleManagementView-C3nxfub2.js} +486 -486
- package/dist/{SystemUserDetailWorkspaceView-BtEDyU-k.js → SystemUserDetailWorkspaceView-FIbfff00.js} +1 -1
- package/dist/SystemUserManagementView-m6vwJDxI.js +761 -0
- package/dist/{UserDetailWorkspaceView-B6fGrnQ7.js → UserDetailWorkspaceView-M--ndn6x.js} +1 -1
- package/dist/{UserManagementView-4IJeDSQS.js → UserManagementView-MSXf4fno.js} +302 -302
- package/dist/index.css +1 -1
- package/dist/index.js +2237 -2237
- package/dist/{pageRealtime-CJriNmzP.js → pageRealtime-4LXXvVW7.js} +14 -14
- package/dist/{platform-components-CgMBopmF.js → platform-components-_3KlZZf5.js} +1166 -1168
- package/dist/types/consumer/index.d.ts +1 -2
- package/dist/types/dynamic-page-runtime/dynamicModuleDetailStateModel.d.ts +12 -0
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +14 -0
- package/dist/types/platform-components/recordFormFieldModel.d.ts +1 -1
- package/dist/{useUserSessionRows-DHsyr2Vy.js → useUserSessionRows-iAqK_cUy.js} +2 -2
- package/dist/workspaceViewSessions-DW0wbyQ_.js +1448 -0
- package/package.json +1 -1
- package/dist/ModuleActionManagementView-DRtYMXOK.js +0 -597
- package/dist/SystemUserManagementView-TKqj92zG.js +0 -761
- package/dist/workspaceViewSessions-BMbyO9O4.js +0 -1571
|
@@ -0,0 +1,761 @@
|
|
|
1
|
+
import { A as e, D as t, E as n, K as r, N as i, S as ee, Sn as te, St as a, X as o, _ as s, c as ne, g as re, ht as ie, i as c, k as ae, m as oe, mt as se, q as l, r as ce, ut as u, v as le, w as ue } from "./platform-components-_3KlZZf5.js";
|
|
2
|
+
import { d, g as de, i as fe, n as f, r as p, t as m } from "./workspaceViewSessions-DW0wbyQ_.js";
|
|
3
|
+
import { i as pe, n as me } from "./pageRealtime-4LXXvVW7.js";
|
|
4
|
+
import { t as he } from "./useUserSessionRows-iAqK_cUy.js";
|
|
5
|
+
import { Fragment as ge, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as b, createVNode as x, defineComponent as S, onBeforeUnmount as _e, onMounted as ve, openBlock as C, ref as w, resolveComponent as T, unref as E, watch as ye, withCtx as D, withModifiers as be } from "vue";
|
|
6
|
+
//#region src/views/systemUserDetailWorkspaceSession.ts
|
|
7
|
+
function xe(e, t) {
|
|
8
|
+
return m(d, e, {
|
|
9
|
+
...t,
|
|
10
|
+
selectedUser: { ...t.selectedUser },
|
|
11
|
+
draft: { ...t.draft }
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function Se(e, t) {
|
|
15
|
+
return f(d, e, t);
|
|
16
|
+
}
|
|
17
|
+
function Ce(e) {
|
|
18
|
+
return p(d, e);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/views/SystemUserManagementView.vue?vue&type=script&setup=true&lang.ts
|
|
22
|
+
var we = { class: "system-user-management-page" }, Te = { class: "system-user-detail-state" }, Ee = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "system-user-password-reset-result"
|
|
25
|
+
}, De = { key: 0 }, Oe = { key: 1 }, ke = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "system-user-detail-state"
|
|
28
|
+
}, Ae = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "system-user-password-reset-result"
|
|
31
|
+
}, je = { key: 0 }, Me = { key: 1 }, O = /*#__PURE__*/ ie(/* @__PURE__ */ S({
|
|
32
|
+
name: "SystemUserManagementView",
|
|
33
|
+
__name: "SystemUserManagementView",
|
|
34
|
+
props: {
|
|
35
|
+
recordId: {},
|
|
36
|
+
mode: {}
|
|
37
|
+
},
|
|
38
|
+
setup(ie) {
|
|
39
|
+
let f = ie, p = a({ moduleAlias: "iam.user" }), m = de(), S = w(), O = w(), k = w(!1), A = w("view"), j = w(!1), M = w(!1), N = w(!1), P = w(0), F = w(0), I = w(Z()), L = w(""), R = w(), z = w(e(void 0)), B = h(() => !!f.recordId), V = h(() => B.value && m?.presentation === "drawer"), Ne = h(() => !B.value || V.value), { expandedUserKeys: Pe, handleUserListLoaded: Fe, handleUserRowExpand: Ie, handleUserSessionBusinessEvent: Le, loadUserSessions: H, userOnlineStatusTitle: Re, userSessionState: U } = he({
|
|
40
|
+
context: p,
|
|
41
|
+
source: "system-user-management"
|
|
42
|
+
}), W = pe({
|
|
43
|
+
moduleAlias: "iam.user",
|
|
44
|
+
recordId: () => O.value?.id,
|
|
45
|
+
editing: () => A.value === "edit",
|
|
46
|
+
saving: () => N.value
|
|
47
|
+
}), G = h(() => Ze(p)), ze = h(() => [
|
|
48
|
+
{
|
|
49
|
+
key: "username",
|
|
50
|
+
title: "账号",
|
|
51
|
+
width: "24%"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: "onlineStatus",
|
|
55
|
+
title: "在线状态",
|
|
56
|
+
width: "14%",
|
|
57
|
+
align: "center"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "passwordStatusTitle",
|
|
61
|
+
title: "密码状态",
|
|
62
|
+
width: "18%"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "lastLoginAt",
|
|
66
|
+
title: "最后登录",
|
|
67
|
+
type: "datetime",
|
|
68
|
+
width: "24%"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "enabled",
|
|
72
|
+
title: "登录状态",
|
|
73
|
+
type: "enabledStatus",
|
|
74
|
+
width: "14%"
|
|
75
|
+
}
|
|
76
|
+
]), Be = h(() => $(O.value ?? I.value)), Ve = h(() => A.value === "resetPassword" ? "修改密码" : "系统账号"), K = h(() => N.value || j.value), He = h(() => {
|
|
77
|
+
if (j.value) return !1;
|
|
78
|
+
if (A.value === "edit") return !!O.value?.id && p.can("update") === !0;
|
|
79
|
+
if (A.value === "resetPassword") {
|
|
80
|
+
let e = O.value?.id;
|
|
81
|
+
return !!e && p.can("changePassword", e) === !0;
|
|
82
|
+
}
|
|
83
|
+
return !1;
|
|
84
|
+
}), Ue = h(() => !O.value?.id || j.value ? !1 : p.can(St(O.value)) === !0), We = h(() => A.value === "view" ? O.value?.id ? [
|
|
85
|
+
{
|
|
86
|
+
key: "edit",
|
|
87
|
+
actionCode: "update",
|
|
88
|
+
title: "编辑",
|
|
89
|
+
iconName: "edit",
|
|
90
|
+
disabled: N.value
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "resetPassword",
|
|
94
|
+
actionCode: "changePassword",
|
|
95
|
+
title: "修改密码",
|
|
96
|
+
iconName: "lock",
|
|
97
|
+
disabled: N.value
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "resetGeneratedPassword",
|
|
101
|
+
actionCode: "resetPassword",
|
|
102
|
+
title: "重置密码",
|
|
103
|
+
iconName: "reload",
|
|
104
|
+
disabled: N.value
|
|
105
|
+
}
|
|
106
|
+
] : [] : [{
|
|
107
|
+
key: "cancel",
|
|
108
|
+
title: "取消",
|
|
109
|
+
iconName: "close",
|
|
110
|
+
disabled: N.value
|
|
111
|
+
}, {
|
|
112
|
+
key: "save",
|
|
113
|
+
actionCode: A.value === "resetPassword" ? "changePassword" : "update",
|
|
114
|
+
title: "保存",
|
|
115
|
+
iconName: "save",
|
|
116
|
+
primary: !0,
|
|
117
|
+
loading: N.value,
|
|
118
|
+
disabled: !He.value
|
|
119
|
+
}]), Ge = h(() => We.value), Ke = fe({
|
|
120
|
+
view: d,
|
|
121
|
+
input: h(() => {
|
|
122
|
+
let e = O.value?.id;
|
|
123
|
+
return e && (A.value === "view" || A.value === "edit") ? { recordId: e } : void 0;
|
|
124
|
+
}),
|
|
125
|
+
title: h(() => $(O.value)),
|
|
126
|
+
eligibility: h(() => ({
|
|
127
|
+
hasStableIdentity: !!O.value?.id && !j.value,
|
|
128
|
+
busy: N.value
|
|
129
|
+
})),
|
|
130
|
+
beforePromote: async (e) => {
|
|
131
|
+
let t = O.value;
|
|
132
|
+
if (t) return await xe(e, {
|
|
133
|
+
selectedUser: t,
|
|
134
|
+
draft: I.value,
|
|
135
|
+
mode: A.value === "edit" ? "edit" : "view",
|
|
136
|
+
password: L.value,
|
|
137
|
+
resetPasswordResult: R.value
|
|
138
|
+
}) === "accepted";
|
|
139
|
+
},
|
|
140
|
+
onPromoted: nt
|
|
141
|
+
});
|
|
142
|
+
ye(O, (e) => {
|
|
143
|
+
!B.value || !e || m?.setTitle($(e));
|
|
144
|
+
}, { immediate: !0 });
|
|
145
|
+
let q = h(() => ({
|
|
146
|
+
username: {
|
|
147
|
+
label: "账号",
|
|
148
|
+
required: !0,
|
|
149
|
+
visible: !0,
|
|
150
|
+
placeholder: "请输入登录账号"
|
|
151
|
+
},
|
|
152
|
+
enabled: {
|
|
153
|
+
label: "允许登录",
|
|
154
|
+
visible: !0,
|
|
155
|
+
controlType: "enabledStatus"
|
|
156
|
+
}
|
|
157
|
+
})), qe = h(() => ["username", "enabled"]), Je;
|
|
158
|
+
ve(() => {
|
|
159
|
+
if (Xe(), f.recordId) {
|
|
160
|
+
let e = { recordId: f.recordId };
|
|
161
|
+
V.value || (Je = Se(e, Ye));
|
|
162
|
+
let t = Ce(e);
|
|
163
|
+
if (t) {
|
|
164
|
+
ht(t);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
J({ id: f.recordId }, f.mode ?? "view");
|
|
168
|
+
}
|
|
169
|
+
}), _e(() => Je?.());
|
|
170
|
+
function Ye(e) {
|
|
171
|
+
return A.value === "view" ? (ht(e), !0) : !1;
|
|
172
|
+
}
|
|
173
|
+
me(Le);
|
|
174
|
+
async function Xe() {
|
|
175
|
+
try {
|
|
176
|
+
z.value = e((await p.runtime.ready).uiDescriptor);
|
|
177
|
+
} catch (e) {
|
|
178
|
+
r(e, {
|
|
179
|
+
source: "system-user-management",
|
|
180
|
+
phase: "load"
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function Ze(e) {
|
|
185
|
+
return {
|
|
186
|
+
...e,
|
|
187
|
+
crud: {
|
|
188
|
+
...e.crud,
|
|
189
|
+
query: (t) => e.crud.query(Qe(t))
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function Qe(e) {
|
|
194
|
+
return {
|
|
195
|
+
...e,
|
|
196
|
+
conditions: [...e?.conditions ?? [], {
|
|
197
|
+
fieldName: "tenantId",
|
|
198
|
+
operator: "NULL",
|
|
199
|
+
values: []
|
|
200
|
+
}]
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function $e() {
|
|
204
|
+
return [{
|
|
205
|
+
key: "view",
|
|
206
|
+
actionCode: "view",
|
|
207
|
+
title: "查看"
|
|
208
|
+
}, {
|
|
209
|
+
key: "edit",
|
|
210
|
+
actionCode: "update",
|
|
211
|
+
title: "编辑",
|
|
212
|
+
iconName: "edit"
|
|
213
|
+
}];
|
|
214
|
+
}
|
|
215
|
+
function et(e, t) {
|
|
216
|
+
if (Y()) {
|
|
217
|
+
if (e.key === "view") {
|
|
218
|
+
J(t, "view");
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
e.key === "edit" && J(t, "edit");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function tt(e) {
|
|
225
|
+
Y() && J(e, "view");
|
|
226
|
+
}
|
|
227
|
+
async function J(e, t) {
|
|
228
|
+
if (!Y()) return;
|
|
229
|
+
let n = String(e.id ?? "");
|
|
230
|
+
if (!n) return;
|
|
231
|
+
S.value = n, W.clearExternalChanged(), k.value = !0, A.value = t, O.value = void 0, I.value = Q(e), L.value = "", R.value = void 0, j.value = !0, M.value = !1;
|
|
232
|
+
let i = P.value + 1;
|
|
233
|
+
P.value = i;
|
|
234
|
+
try {
|
|
235
|
+
let e = await p.crud.view(n);
|
|
236
|
+
if (!mt(n, i)) return;
|
|
237
|
+
if (!e?.id) {
|
|
238
|
+
M.value = !0, l("未找到指定系统账号", {
|
|
239
|
+
source: "system-user-management",
|
|
240
|
+
phase: "load"
|
|
241
|
+
});
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (e.tenantId) {
|
|
245
|
+
rt();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
X(e, t);
|
|
249
|
+
} catch (e) {
|
|
250
|
+
mt(n, i) && (M.value = !0, r(e, {
|
|
251
|
+
source: "system-user-management",
|
|
252
|
+
phase: "load"
|
|
253
|
+
}));
|
|
254
|
+
} finally {
|
|
255
|
+
mt(n, i) && (j.value = !1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function nt() {
|
|
259
|
+
N.value || (P.value += 1, j.value = !1, M.value = !1, k.value = !1, A.value = "view", L.value = "", R.value = void 0, W.clearExternalChanged(), I.value = O.value ? Q(O.value) : Z(), V.value && m?.dismiss());
|
|
260
|
+
}
|
|
261
|
+
function rt() {
|
|
262
|
+
P.value += 1, j.value = !1, M.value = !1, k.value = !1, O.value = void 0, S.value = void 0, I.value = Z(), l("指定账号不属于系统账号管理范围", {
|
|
263
|
+
source: "system-user-management",
|
|
264
|
+
phase: "validation"
|
|
265
|
+
}), B.value && m?.dismiss();
|
|
266
|
+
}
|
|
267
|
+
function it() {
|
|
268
|
+
if (!N.value) {
|
|
269
|
+
if (!O.value?.id) {
|
|
270
|
+
nt();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
I.value = Q(O.value), L.value = "", R.value = void 0, W.clearExternalChanged(), A.value = "view", j.value = !1, M.value = !1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function at(e) {
|
|
277
|
+
if (e.key === "cancel") {
|
|
278
|
+
it();
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (e.key === "save") {
|
|
282
|
+
ct();
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (Y()) {
|
|
286
|
+
if (e.key === "edit" && O.value) {
|
|
287
|
+
I.value = Q(O.value), W.clearExternalChanged(), A.value = "edit";
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (e.key === "resetPassword" && O.value) {
|
|
291
|
+
L.value = "", R.value = void 0, W.clearExternalChanged(), A.value = "resetPassword";
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
e.key === "resetGeneratedPassword" && O.value && ut();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function ot() {
|
|
298
|
+
let e = String(I.value.id ?? S.value ?? "");
|
|
299
|
+
e && J({
|
|
300
|
+
...I.value,
|
|
301
|
+
id: e
|
|
302
|
+
}, A.value);
|
|
303
|
+
}
|
|
304
|
+
function st() {
|
|
305
|
+
let e = String(W.externalChangedRecordId.value ?? I.value.id ?? S.value ?? "");
|
|
306
|
+
e && (W.clearExternalChanged(), J({
|
|
307
|
+
...I.value,
|
|
308
|
+
id: e
|
|
309
|
+
}, "edit"));
|
|
310
|
+
}
|
|
311
|
+
async function ct() {
|
|
312
|
+
if (A.value === "resetPassword") {
|
|
313
|
+
await lt();
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
await ce({
|
|
317
|
+
loading: N,
|
|
318
|
+
mode: "edit",
|
|
319
|
+
source: "system-user-management",
|
|
320
|
+
canSave: () => He.value,
|
|
321
|
+
deniedMessage: "当前用户无权保存系统账号",
|
|
322
|
+
createRecord: () => vt(I.value),
|
|
323
|
+
validateRecord: yt,
|
|
324
|
+
save: (e) => p.crud.update(O.value.id, e),
|
|
325
|
+
actionErrorHandlers: [{
|
|
326
|
+
code: te.conflictVersion,
|
|
327
|
+
handle: (e, { mode: t, record: n }) => t === "edit" && W.markExternalRecordChanged(n.id)
|
|
328
|
+
}],
|
|
329
|
+
onSaved: ({ record: e }) => {
|
|
330
|
+
X(e), F.value += 1;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
async function lt() {
|
|
335
|
+
if (!L.value.trim()) {
|
|
336
|
+
l("请填写新密码", {
|
|
337
|
+
source: "system-user-management",
|
|
338
|
+
phase: "validation"
|
|
339
|
+
});
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
await c({
|
|
343
|
+
loading: N,
|
|
344
|
+
source: "system-user-management",
|
|
345
|
+
record: () => O.value?.id ? O.value : void 0,
|
|
346
|
+
canExecute: () => He.value,
|
|
347
|
+
deniedMessage: "当前用户无权重置系统账号密码",
|
|
348
|
+
execute: (e) => p.http.request({
|
|
349
|
+
method: "POST",
|
|
350
|
+
path: `/iam.user/changePassword/${encodeURIComponent(e.id)}`,
|
|
351
|
+
body: { password: L.value }
|
|
352
|
+
}),
|
|
353
|
+
onExecuted: async (e, t) => {
|
|
354
|
+
X(await p.crud.view(t.id)), F.value += 1;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
async function ut() {
|
|
359
|
+
await c({
|
|
360
|
+
loading: N,
|
|
361
|
+
source: "system-user-management",
|
|
362
|
+
record: () => O.value?.id ? O.value : void 0,
|
|
363
|
+
canExecute: (e) => p.can("resetPassword", e.id) === !0,
|
|
364
|
+
deniedMessage: "当前用户无权重置系统账号密码",
|
|
365
|
+
execute: (e) => p.http.request({
|
|
366
|
+
method: "POST",
|
|
367
|
+
path: `/iam.user/resetPassword/${encodeURIComponent(e.id)}`
|
|
368
|
+
}),
|
|
369
|
+
onExecuted: async (e, t) => {
|
|
370
|
+
X(await p.crud.view(t.id)), R.value = e, F.value += 1;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
async function dt(e, t) {
|
|
375
|
+
await c({
|
|
376
|
+
loading: N,
|
|
377
|
+
source: "system-user-management",
|
|
378
|
+
record: () => e?.id ? e : void 0,
|
|
379
|
+
canExecute: (e) => p.can("revokeSession", e.id) === !0 && !t.current,
|
|
380
|
+
deniedMessage: "当前用户无权下线该登录会话",
|
|
381
|
+
confirm: (e) => o({
|
|
382
|
+
title: "下线登录会话",
|
|
383
|
+
content: `确认下线系统账号「${$(e)}」的该登录会话?`,
|
|
384
|
+
okText: "下线",
|
|
385
|
+
danger: !0
|
|
386
|
+
}),
|
|
387
|
+
execute: (e) => p.http.request({
|
|
388
|
+
method: "POST",
|
|
389
|
+
path: `/iam.user/${encodeURIComponent(e.id)}/sessions/${encodeURIComponent(t.id)}/revoke`
|
|
390
|
+
}),
|
|
391
|
+
onExecuted: (e, t) => {
|
|
392
|
+
H(t.id), F.value += 1;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
async function ft(e) {
|
|
397
|
+
let t = gt(String(e.id ?? "")).map((e) => e.id);
|
|
398
|
+
if (t.length === 0) {
|
|
399
|
+
l("当前没有可下线的登录会话", {
|
|
400
|
+
source: "system-user-management",
|
|
401
|
+
phase: "validation"
|
|
402
|
+
});
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
await c({
|
|
406
|
+
loading: N,
|
|
407
|
+
source: "system-user-management",
|
|
408
|
+
record: () => e?.id ? e : void 0,
|
|
409
|
+
canExecute: (e) => p.can("revokeSessions", e.id) === !0,
|
|
410
|
+
deniedMessage: "当前用户无权批量下线登录会话",
|
|
411
|
+
confirm: (e) => o({
|
|
412
|
+
title: "批量下线登录会话",
|
|
413
|
+
content: `确认下线系统账号「${$(e)}」的 ${t.length} 个登录会话?`,
|
|
414
|
+
okText: "全部下线",
|
|
415
|
+
danger: !0
|
|
416
|
+
}),
|
|
417
|
+
execute: (e) => p.http.request({
|
|
418
|
+
method: "POST",
|
|
419
|
+
path: `/iam.user/${encodeURIComponent(e.id)}/sessions/revoke`,
|
|
420
|
+
body: { sessionIds: t }
|
|
421
|
+
}),
|
|
422
|
+
onExecuted: (e, t) => {
|
|
423
|
+
H(t.id), F.value += 1;
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
async function pt() {
|
|
428
|
+
await c({
|
|
429
|
+
loading: N,
|
|
430
|
+
source: "system-user-management",
|
|
431
|
+
record: () => O.value?.id ? O.value : void 0,
|
|
432
|
+
canExecute: () => Ue.value,
|
|
433
|
+
deniedMessage: "当前用户无权变更系统账号启停状态",
|
|
434
|
+
execute: (e) => e.enabled === !1 ? p.crud.enable(e.id, { version: e.version }) : p.crud.disable(e.id, { version: e.version }),
|
|
435
|
+
onExecuted: async (e, t) => {
|
|
436
|
+
X(await p.crud.view(t.id)), F.value += 1;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function Y() {
|
|
441
|
+
return !N.value;
|
|
442
|
+
}
|
|
443
|
+
function mt(e, t) {
|
|
444
|
+
return P.value === t && S.value === e;
|
|
445
|
+
}
|
|
446
|
+
function X(e, t = "view") {
|
|
447
|
+
O.value = e, S.value = e.id, I.value = Q(e), L.value = "", A.value = t === "edit" ? "edit" : "view", W.clearExternalChanged(), k.value = !0, j.value = !1, M.value = !1, P.value += 1;
|
|
448
|
+
}
|
|
449
|
+
function ht(e) {
|
|
450
|
+
S.value = e.selectedUser.id, O.value = { ...e.selectedUser }, I.value = Q(e.draft), A.value = e.mode, L.value = e.password, R.value = e.resetPasswordResult, k.value = !0, j.value = !1, M.value = !1;
|
|
451
|
+
}
|
|
452
|
+
function gt(e) {
|
|
453
|
+
return !e || p.can("revokeSession", e) !== !0 ? [] : U(e).records.filter((e) => !e.current);
|
|
454
|
+
}
|
|
455
|
+
function _t(e, t) {
|
|
456
|
+
return !!e && !t.current && p.can("revokeSession", e) === !0;
|
|
457
|
+
}
|
|
458
|
+
function Z() {
|
|
459
|
+
return { enabled: !0 };
|
|
460
|
+
}
|
|
461
|
+
function Q(e) {
|
|
462
|
+
return {
|
|
463
|
+
...e,
|
|
464
|
+
password: void 0
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function vt(e) {
|
|
468
|
+
return ne(e, {
|
|
469
|
+
tenantId: void 0,
|
|
470
|
+
username: e.username?.trim(),
|
|
471
|
+
enabled: e.enabled !== !1,
|
|
472
|
+
password: void 0
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
function yt(e) {
|
|
476
|
+
let t = ae("username", {
|
|
477
|
+
fields: z.value,
|
|
478
|
+
fallback: q.value
|
|
479
|
+
});
|
|
480
|
+
if (t.visible && t.required && !e.username) return `请填写${t.label}`;
|
|
481
|
+
if (A.value === "resetPassword" && !L.value.trim()) return "请填写新密码";
|
|
482
|
+
}
|
|
483
|
+
function bt(e) {
|
|
484
|
+
return e === "username";
|
|
485
|
+
}
|
|
486
|
+
function xt(e, t) {
|
|
487
|
+
I.value = {
|
|
488
|
+
...I.value,
|
|
489
|
+
[e]: t
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function St(e) {
|
|
493
|
+
return e.enabled === !1 ? "enable" : "disable";
|
|
494
|
+
}
|
|
495
|
+
function $(e) {
|
|
496
|
+
return String(e?.username ?? e?.id ?? "系统账号");
|
|
497
|
+
}
|
|
498
|
+
return (e, r) => {
|
|
499
|
+
let te = T("UiSpin"), a = T("UiError"), o = T("DateTimeText");
|
|
500
|
+
return C(), v("section", we, [!B.value || V.value ? (C(), g(E(oe), {
|
|
501
|
+
key: 0,
|
|
502
|
+
class: "system-user-list-panel",
|
|
503
|
+
context: G.value,
|
|
504
|
+
title: "系统账号",
|
|
505
|
+
columns: ze.value,
|
|
506
|
+
"cell-renderers": { onlineStatus: E(Re) },
|
|
507
|
+
"row-actions-of": $e,
|
|
508
|
+
"selected-key": S.value,
|
|
509
|
+
"expanded-row-keys": E(Pe),
|
|
510
|
+
"reload-key": F.value,
|
|
511
|
+
ready: !0,
|
|
512
|
+
"quick-search-placeholder": "搜索账号、姓名、手机号或邮箱",
|
|
513
|
+
"empty-description": "暂无系统账号",
|
|
514
|
+
onRowAction: et,
|
|
515
|
+
onRowDblclick: tt,
|
|
516
|
+
onRowExpand: E(Ie),
|
|
517
|
+
onLoaded: E(Fe),
|
|
518
|
+
onSelect: r[0] ||= (e) => S.value = String(e.id ?? "")
|
|
519
|
+
}, {
|
|
520
|
+
expandedRow: D(({ record: e }) => [x(E(ue), {
|
|
521
|
+
sessions: E(U)(String(e.id ?? "")).records,
|
|
522
|
+
loading: E(U)(String(e.id ?? "")).loading,
|
|
523
|
+
error: E(U)(String(e.id ?? "")).error,
|
|
524
|
+
"actions-disabled": N.value,
|
|
525
|
+
"can-revoke": (t) => _t(String(e.id ?? ""), t),
|
|
526
|
+
"can-revoke-all": gt(String(e.id ?? "")).length > 1,
|
|
527
|
+
onRefresh: (t) => E(H)(String(e.id ?? "")),
|
|
528
|
+
onRevoke: (t) => dt(e, t),
|
|
529
|
+
onRevokeAll: (t) => ft(e)
|
|
530
|
+
}, null, 8, [
|
|
531
|
+
"sessions",
|
|
532
|
+
"loading",
|
|
533
|
+
"error",
|
|
534
|
+
"actions-disabled",
|
|
535
|
+
"can-revoke",
|
|
536
|
+
"can-revoke-all",
|
|
537
|
+
"onRefresh",
|
|
538
|
+
"onRevoke",
|
|
539
|
+
"onRevokeAll"
|
|
540
|
+
])]),
|
|
541
|
+
_: 1
|
|
542
|
+
}, 8, [
|
|
543
|
+
"context",
|
|
544
|
+
"columns",
|
|
545
|
+
"cell-renderers",
|
|
546
|
+
"selected-key",
|
|
547
|
+
"expanded-row-keys",
|
|
548
|
+
"reload-key",
|
|
549
|
+
"onRowExpand",
|
|
550
|
+
"onLoaded"
|
|
551
|
+
])) : _("v-if", !0), Ne.value ? (C(), g(E(re), {
|
|
552
|
+
key: 1,
|
|
553
|
+
open: k.value,
|
|
554
|
+
title: Be.value,
|
|
555
|
+
subtitle: Ve.value,
|
|
556
|
+
mode: A.value,
|
|
557
|
+
"form-modes": ["edit", "resetPassword"],
|
|
558
|
+
loading: j.value,
|
|
559
|
+
"load-failed": M.value,
|
|
560
|
+
"externally-changed": E(W).externallyChanged.value,
|
|
561
|
+
promotion: E(Ke),
|
|
562
|
+
"error-title": "详情加载失败",
|
|
563
|
+
"error-message": "无法加载系统账号详情,请重试",
|
|
564
|
+
onClose: nt,
|
|
565
|
+
onRetry: ot,
|
|
566
|
+
onReloadExternalChange: st,
|
|
567
|
+
onDismissExternalChange: E(W).clearExternalChanged
|
|
568
|
+
}, {
|
|
569
|
+
status: D(() => [A.value === "view" && O.value ? (C(), g(E(ee), {
|
|
570
|
+
key: 0,
|
|
571
|
+
enabled: O.value.enabled !== !1,
|
|
572
|
+
disabled: N.value || !Ue.value,
|
|
573
|
+
loading: N.value,
|
|
574
|
+
"show-label": !1,
|
|
575
|
+
onChange: pt
|
|
576
|
+
}, null, 8, [
|
|
577
|
+
"enabled",
|
|
578
|
+
"disabled",
|
|
579
|
+
"loading"
|
|
580
|
+
])) : _("v-if", !0)]),
|
|
581
|
+
operation: D(() => [x(E(i), {
|
|
582
|
+
context: G.value,
|
|
583
|
+
actions: Ge.value,
|
|
584
|
+
"record-id": O.value?.id,
|
|
585
|
+
onAction: at
|
|
586
|
+
}, null, 8, [
|
|
587
|
+
"context",
|
|
588
|
+
"actions",
|
|
589
|
+
"record-id"
|
|
590
|
+
])]),
|
|
591
|
+
loading: D(() => [x(te, {
|
|
592
|
+
class: "system-user-detail-state",
|
|
593
|
+
tip: "加载系统账号详情"
|
|
594
|
+
})]),
|
|
595
|
+
error: D(() => [y("div", Te, [x(a, {
|
|
596
|
+
title: "详情加载失败",
|
|
597
|
+
message: "无法加载系统账号详情,请重试"
|
|
598
|
+
}), x(E(se), {
|
|
599
|
+
type: "primary",
|
|
600
|
+
"icon-name": "reload",
|
|
601
|
+
onClick: ot
|
|
602
|
+
}, {
|
|
603
|
+
default: D(() => [...r[3] ||= [b("重试", -1)]]),
|
|
604
|
+
_: 1
|
|
605
|
+
})])]),
|
|
606
|
+
view: D(() => [
|
|
607
|
+
x(E(t), {
|
|
608
|
+
record: I.value,
|
|
609
|
+
fields: z.value,
|
|
610
|
+
fallback: q.value
|
|
611
|
+
}, null, 8, [
|
|
612
|
+
"record",
|
|
613
|
+
"fields",
|
|
614
|
+
"fallback"
|
|
615
|
+
]),
|
|
616
|
+
A.value === "view" && R.value?.temporaryPassword ? (C(), v("div", Ee, [
|
|
617
|
+
r[5] ||= y("span", null, "临时密码", -1),
|
|
618
|
+
x(E(u), {
|
|
619
|
+
value: R.value.temporaryPassword,
|
|
620
|
+
disabled: ""
|
|
621
|
+
}, null, 8, ["value"]),
|
|
622
|
+
R.value.expiresAt ? (C(), v("small", De, [r[4] ||= b(" 有效期至 ", -1), x(o, { value: R.value.expiresAt }, null, 8, ["value"])])) : _("v-if", !0)
|
|
623
|
+
])) : _("v-if", !0),
|
|
624
|
+
x(E(s), { record: I.value }, null, 8, ["record"])
|
|
625
|
+
]),
|
|
626
|
+
form: D(() => [y("form", {
|
|
627
|
+
class: "system-user-form",
|
|
628
|
+
onSubmit: be(ct, ["prevent"])
|
|
629
|
+
}, [A.value === "resetPassword" ? (C(), v("label", Oe, [r[6] ||= y("span", { class: "system-user-form-label" }, "新密码", -1), x(E(u), {
|
|
630
|
+
value: L.value,
|
|
631
|
+
type: "password",
|
|
632
|
+
disabled: K.value,
|
|
633
|
+
placeholder: "请输入密码",
|
|
634
|
+
"allow-clear": "",
|
|
635
|
+
"onUpdate:value": r[1] ||= (e) => L.value = e
|
|
636
|
+
}, null, 8, ["value", "disabled"])])) : (C(), g(E(le), {
|
|
637
|
+
key: 0,
|
|
638
|
+
record: I.value,
|
|
639
|
+
"field-names": qe.value,
|
|
640
|
+
fields: z.value,
|
|
641
|
+
fallback: q.value,
|
|
642
|
+
disabled: K.value,
|
|
643
|
+
"disabled-of": bt,
|
|
644
|
+
"onUpdate:field": xt
|
|
645
|
+
}, null, 8, [
|
|
646
|
+
"record",
|
|
647
|
+
"field-names",
|
|
648
|
+
"fields",
|
|
649
|
+
"fallback",
|
|
650
|
+
"disabled"
|
|
651
|
+
]))], 32), A.value === "resetPassword" ? _("v-if", !0) : (C(), g(E(s), {
|
|
652
|
+
key: 0,
|
|
653
|
+
record: I.value
|
|
654
|
+
}, null, 8, ["record"]))]),
|
|
655
|
+
_: 1
|
|
656
|
+
}, 8, [
|
|
657
|
+
"open",
|
|
658
|
+
"title",
|
|
659
|
+
"subtitle",
|
|
660
|
+
"mode",
|
|
661
|
+
"loading",
|
|
662
|
+
"load-failed",
|
|
663
|
+
"externally-changed",
|
|
664
|
+
"promotion",
|
|
665
|
+
"onDismissExternalChange"
|
|
666
|
+
])) : (C(), g(E(n), {
|
|
667
|
+
key: 2,
|
|
668
|
+
title: Be.value,
|
|
669
|
+
subtitle: Ve.value
|
|
670
|
+
}, {
|
|
671
|
+
status: D(() => [A.value === "view" && O.value ? (C(), g(E(ee), {
|
|
672
|
+
key: 0,
|
|
673
|
+
enabled: O.value.enabled !== !1,
|
|
674
|
+
disabled: N.value || !Ue.value,
|
|
675
|
+
loading: N.value,
|
|
676
|
+
"show-label": !1,
|
|
677
|
+
onChange: pt
|
|
678
|
+
}, null, 8, [
|
|
679
|
+
"enabled",
|
|
680
|
+
"disabled",
|
|
681
|
+
"loading"
|
|
682
|
+
])) : _("v-if", !0)]),
|
|
683
|
+
operation: D(() => [x(E(i), {
|
|
684
|
+
context: G.value,
|
|
685
|
+
actions: Ge.value,
|
|
686
|
+
"record-id": O.value?.id,
|
|
687
|
+
onAction: at
|
|
688
|
+
}, null, 8, [
|
|
689
|
+
"context",
|
|
690
|
+
"actions",
|
|
691
|
+
"record-id"
|
|
692
|
+
])]),
|
|
693
|
+
default: D(() => [j.value ? (C(), g(te, {
|
|
694
|
+
key: 0,
|
|
695
|
+
class: "system-user-detail-state",
|
|
696
|
+
tip: "加载系统账号详情"
|
|
697
|
+
})) : M.value ? (C(), v("div", ke, [x(a, {
|
|
698
|
+
title: "详情加载失败",
|
|
699
|
+
message: "无法加载系统账号详情,请重试"
|
|
700
|
+
}), x(E(se), {
|
|
701
|
+
type: "primary",
|
|
702
|
+
"icon-name": "reload",
|
|
703
|
+
onClick: ot
|
|
704
|
+
}, {
|
|
705
|
+
default: D(() => [...r[7] ||= [b("重试", -1)]]),
|
|
706
|
+
_: 1
|
|
707
|
+
})])) : A.value === "view" ? (C(), v(ge, { key: 2 }, [
|
|
708
|
+
x(E(t), {
|
|
709
|
+
record: I.value,
|
|
710
|
+
fields: z.value,
|
|
711
|
+
fallback: q.value
|
|
712
|
+
}, null, 8, [
|
|
713
|
+
"record",
|
|
714
|
+
"fields",
|
|
715
|
+
"fallback"
|
|
716
|
+
]),
|
|
717
|
+
R.value?.temporaryPassword ? (C(), v("div", Ae, [
|
|
718
|
+
r[9] ||= y("span", null, "临时密码", -1),
|
|
719
|
+
x(E(u), {
|
|
720
|
+
value: R.value.temporaryPassword,
|
|
721
|
+
disabled: ""
|
|
722
|
+
}, null, 8, ["value"]),
|
|
723
|
+
R.value.expiresAt ? (C(), v("small", je, [r[8] ||= b(" 有效期至 ", -1), x(o, { value: R.value.expiresAt }, null, 8, ["value"])])) : _("v-if", !0)
|
|
724
|
+
])) : _("v-if", !0),
|
|
725
|
+
x(E(s), { record: I.value }, null, 8, ["record"])
|
|
726
|
+
], 64)) : (C(), v(ge, { key: 3 }, [y("form", {
|
|
727
|
+
class: "system-user-form",
|
|
728
|
+
onSubmit: be(ct, ["prevent"])
|
|
729
|
+
}, [A.value === "resetPassword" ? (C(), v("label", Me, [r[10] ||= y("span", { class: "system-user-form-label" }, "新密码", -1), x(E(u), {
|
|
730
|
+
value: L.value,
|
|
731
|
+
type: "password",
|
|
732
|
+
disabled: K.value,
|
|
733
|
+
placeholder: "请输入密码",
|
|
734
|
+
"allow-clear": "",
|
|
735
|
+
"onUpdate:value": r[2] ||= (e) => L.value = e
|
|
736
|
+
}, null, 8, ["value", "disabled"])])) : (C(), g(E(le), {
|
|
737
|
+
key: 0,
|
|
738
|
+
record: I.value,
|
|
739
|
+
"field-names": qe.value,
|
|
740
|
+
fields: z.value,
|
|
741
|
+
fallback: q.value,
|
|
742
|
+
disabled: K.value,
|
|
743
|
+
"disabled-of": bt,
|
|
744
|
+
"onUpdate:field": xt
|
|
745
|
+
}, null, 8, [
|
|
746
|
+
"record",
|
|
747
|
+
"field-names",
|
|
748
|
+
"fields",
|
|
749
|
+
"fallback",
|
|
750
|
+
"disabled"
|
|
751
|
+
]))], 32), A.value === "resetPassword" ? _("v-if", !0) : (C(), g(E(s), {
|
|
752
|
+
key: 0,
|
|
753
|
+
record: I.value
|
|
754
|
+
}, null, 8, ["record"]))], 64))]),
|
|
755
|
+
_: 1
|
|
756
|
+
}, 8, ["title", "subtitle"]))]);
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
}), [["__scopeId", "data-v-01fb79d3"]]);
|
|
760
|
+
//#endregion
|
|
761
|
+
export { O as t };
|