@ximatai/muyun-web-app 0.26.7 → 0.26.8

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