@ximatai/muyun-web-app 0.26.3 → 0.26.4

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 (137) hide show
  1. package/dist/{EmployeeDetailWorkspaceView-mtdcsqgF.js → EmployeeDetailWorkspaceView-BySbWjCV.js} +1 -1
  2. package/dist/{EmployeeManagementView-CKKvQZaC.js → EmployeeManagementView-DvmDPxzN.js} +205 -205
  3. package/dist/{MetadataOrchestrationView-CprWBocy.js → MetadataOrchestrationView-2JxJkFEC.js} +194 -194
  4. package/dist/{ModuleActionManagementView-DNuAQUPE.js → ModuleActionManagementView-DRtYMXOK.js} +122 -122
  5. package/dist/{RoleAuthorizationView-CQtSAJoJ.js → RoleAuthorizationView-CK6Vfdup.js} +52 -52
  6. package/dist/{RoleDetailWorkspaceView-Dh8DXpyS.js → RoleDetailWorkspaceView-BPZcZy-r.js} +1 -1
  7. package/dist/{RoleManagementView-BrqaFV7y.js → RoleManagementView-B7TzzVOm.js} +204 -204
  8. package/dist/{SystemUserDetailWorkspaceView-N-kvycAu.js → SystemUserDetailWorkspaceView-BtEDyU-k.js} +1 -1
  9. package/dist/SystemUserManagementView-TKqj92zG.js +761 -0
  10. package/dist/{UserDetailWorkspaceView-Iek6xwix.js → UserDetailWorkspaceView-B6fGrnQ7.js} +1 -1
  11. package/dist/UserManagementView-4IJeDSQS.js +965 -0
  12. package/dist/index.css +1 -1
  13. package/dist/index.js +1054 -1054
  14. package/dist/{pageRealtime-sRtDYlQP.js → pageRealtime-CJriNmzP.js} +12 -12
  15. package/dist/{platform-components-bC1gwhic.js → platform-components-CgMBopmF.js} +1107 -1377
  16. package/dist/types/app/LoginView.vue.d.ts +2 -2
  17. package/dist/types/app/appWorkbenchStartup.d.ts +1 -1
  18. package/dist/types/app/platformMessage.d.ts +1 -1
  19. package/dist/types/app/query.d.ts +1 -1
  20. package/dist/types/app/workbenchStartup.d.ts +3 -3
  21. package/dist/types/consumer/PlatformAdminOutlet.vue.d.ts +1 -1
  22. package/dist/types/dynamic-page-runtime/DynamicModuleHost.vue.d.ts +1 -1
  23. package/dist/types/dynamic-page-runtime/DynamicModulePage.vue.d.ts +1 -1
  24. package/dist/types/dynamic-page-runtime/actionReactions.d.ts +1 -1
  25. package/dist/types/dynamic-page-runtime/mockDescriptor.d.ts +1 -1
  26. package/dist/types/main.d.ts +1 -1
  27. package/dist/types/platform-admin-runtime/PlatformAdminOutlet.vue.d.ts +1 -1
  28. package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +1 -1
  29. package/dist/types/platform-admin-runtime/WorkspaceViewOutlet.vue.d.ts +1 -1
  30. package/dist/types/platform-admin-runtime/backendHttp.d.ts +1 -1
  31. package/dist/types/platform-admin-runtime/currentUserContext.d.ts +1 -1
  32. package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +2 -2
  33. package/dist/types/platform-admin-runtime/pageRealtime.d.ts +1 -1
  34. package/dist/types/platform-admin-runtime/platformAdminRoutes.d.ts +1 -1
  35. package/dist/types/platform-admin-runtime/realtime.d.ts +4 -4
  36. package/dist/types/platform-admin-runtime/sessionRecovery.d.ts +1 -1
  37. package/dist/types/platform-admin-runtime/useWorkspaceViewPromotion.d.ts +1 -1
  38. package/dist/types/platform-admin-runtime/workspaceViewContract.d.ts +1 -1
  39. package/dist/types/platform-admin-runtime/workspaceViews.d.ts +1 -1
  40. package/dist/types/platform-components/ApplicationScopeSwitcher.vue.d.ts +1 -1
  41. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +2 -2
  42. package/dist/types/platform-components/ModuleActionButton.vue.d.ts +2 -2
  43. package/dist/types/platform-components/RecordActionBar.vue.d.ts +1 -1
  44. package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +1 -1
  45. package/dist/types/platform-components/RecordFormFields.vue.d.ts +1 -1
  46. package/dist/types/platform-components/RecordListExplorer.vue.d.ts +1 -1
  47. package/dist/types/platform-components/RecordMetaSection.vue.d.ts +1 -1
  48. package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +1 -1
  49. package/dist/types/platform-components/RecordPicker.vue.d.ts +1 -1
  50. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +1 -1
  51. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +2 -2
  52. package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +1 -1
  53. package/dist/types/platform-components/actionConfirmation.d.ts +1 -1
  54. package/dist/types/platform-components/index.d.ts +1 -0
  55. package/dist/types/platform-components/optionFieldOptions.d.ts +1 -1
  56. package/dist/types/platform-components/pageLayoutContext.d.ts +1 -1
  57. package/dist/types/platform-components/platformActionResultReactions.d.ts +1 -1
  58. package/dist/types/platform-components/platformErrorFeedback.d.ts +1 -1
  59. package/dist/types/platform-components/recordActionBarModel.d.ts +2 -2
  60. package/dist/types/platform-components/recordEditorSessionState.d.ts +1 -1
  61. package/dist/types/platform-components/recordExplorerItemModel.d.ts +1 -1
  62. package/dist/types/platform-components/recordFormFieldModel.d.ts +2 -2
  63. package/dist/types/platform-components/recycleBinState.d.ts +2 -2
  64. package/dist/types/platform-components/scopedResourceTreeModuleContext.d.ts +1 -1
  65. package/dist/types/platform-components/scopedTreeModuleContext.d.ts +1 -1
  66. package/dist/types/platform-components/softDeletedConflictHandler.d.ts +1 -1
  67. package/dist/types/platform-components/staticCrudManagementState.d.ts +2 -2
  68. package/dist/types/platform-components/staticFormActionFlow.d.ts +1 -1
  69. package/dist/types/platform-components/staticTreeResourceModuleContext.d.ts +1 -1
  70. package/dist/types/platform-components/treeRecordModel.d.ts +1 -1
  71. package/dist/types/platform-components/useRecycleBinExplorerMode.d.ts +1 -1
  72. package/dist/types/platform-components/userSessionPresentation.d.ts +1 -1
  73. package/dist/types/platform-workbench/Workbench.vue.d.ts +1 -1
  74. package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +1 -1
  75. package/dist/types/platform-workbench/WorkbenchMenuTree.vue.d.ts +1 -1
  76. package/dist/types/platform-workbench/WorkbenchOutlet.vue.d.ts +1 -1
  77. package/dist/types/platform-workbench/hosts/BusinessRouteHost.vue.d.ts +1 -1
  78. package/dist/types/platform-workbench/hosts/ExternalPageHost.vue.d.ts +1 -1
  79. package/dist/types/platform-workbench/hosts/PlatformRouteHost.vue.d.ts +1 -1
  80. package/dist/types/platform-workbench/menuNavigation.d.ts +1 -1
  81. package/dist/types/platform-workbench/menuTreeModel.d.ts +1 -1
  82. package/dist/types/platform-workbench/pageHostRegistry.d.ts +1 -1
  83. package/dist/types/platform-workbench/workbenchNavigation.d.ts +1 -1
  84. package/dist/types/views/EmployeeDetailContent.vue.d.ts +3 -3
  85. package/dist/types/views/EmployeeEmploymentDrawer.vue.d.ts +1 -1
  86. package/dist/types/views/EmployeeEmploymentTable.vue.d.ts +1 -1
  87. package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +2 -2
  88. package/dist/types/views/RoleDetailWorkspaceView.vue.d.ts +1 -1
  89. package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +2 -2
  90. package/dist/types/views/RoleGroupMemberSelector.vue.d.ts +1 -1
  91. package/dist/types/views/RoleManagementView.vue.d.ts +1 -1
  92. package/dist/types/views/UserDetailContent.vue.d.ts +2 -2
  93. package/dist/types/views/applicationManagementState.d.ts +3 -3
  94. package/dist/types/views/departmentManagementState.d.ts +3 -3
  95. package/dist/types/views/dictionaryManagementState.d.ts +4 -4
  96. package/dist/types/views/employeeDetailWorkspaceSession.d.ts +1 -1
  97. package/dist/types/views/fieldSpecManagementState.d.ts +3 -3
  98. package/dist/types/views/fieldUiControlManagementState.d.ts +3 -3
  99. package/dist/types/views/menuManagementState.d.ts +7 -7
  100. package/dist/types/views/metadataOrchestrationState.d.ts +1 -1
  101. package/dist/types/views/moduleManagementState.d.ts +5 -5
  102. package/dist/types/views/organizationManagementState.d.ts +4 -4
  103. package/dist/types/views/positionManagementState.d.ts +4 -4
  104. package/dist/types/views/roleAuthorizationWorkspaceSession.d.ts +1 -1
  105. package/dist/types/views/roleDetailWorkspaceSession.d.ts +1 -1
  106. package/dist/types/views/roleDetailWorkspaceView.d.ts +1 -1
  107. package/dist/types/views/roleGrantClient.d.ts +2 -2
  108. package/dist/types/views/systemUserDetailWorkspaceSession.d.ts +1 -1
  109. package/dist/types/views/tenantManagementState.d.ts +3 -3
  110. package/dist/types/views/useEmployeeEmploymentRows.d.ts +2 -2
  111. package/dist/types/views/useUserSessionRows.d.ts +3 -3
  112. package/dist/types/views/userDetailWorkspaceSession.d.ts +1 -1
  113. package/dist/types/vue-ui-antdv/components/ActionBar.vue.d.ts +1 -1
  114. package/dist/types/vue-ui-antdv/components/DictionarySelect.vue.d.ts +1 -1
  115. package/dist/types/vue-ui-antdv/components/ReferenceSelect.vue.d.ts +1 -1
  116. package/dist/types/vue-ui-antdv/components/UiForm.vue.d.ts +1 -1
  117. package/dist/types/vue-ui-antdv/components/UiInput.vue.d.ts +1 -1
  118. package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +1 -1
  119. package/dist/types/vue-ui-antdv/components/UiTable.vue.d.ts +1 -1
  120. package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +1 -1
  121. package/dist/types/vue-ui-antdv/dictionaries.d.ts +1 -1
  122. package/dist/types/vue-ui-antdv/references.d.ts +1 -1
  123. package/dist/types/vue-ui-antdv/registry.d.ts +1 -1
  124. package/dist/types/web-core/actionResult.d.ts +1 -2
  125. package/dist/types/web-core/clients.d.ts +1 -1
  126. package/dist/types/web-core/dataChanges.d.ts +1 -1
  127. package/dist/types/web-core/errors.d.ts +1 -1
  128. package/dist/types/web-core/http.d.ts +1 -1
  129. package/dist/types/web-core/mock.d.ts +1 -1
  130. package/dist/types/web-core/module/runtimeContext.d.ts +1 -1
  131. package/dist/types/web-core/module/staticModuleClient.d.ts +1 -1
  132. package/dist/types/web-core/realtime.d.ts +1 -1
  133. package/dist/{useUserSessionRows-CLM0ZvAF.js → useUserSessionRows-DHsyr2Vy.js} +2 -2
  134. package/dist/{workspaceViewSessions-WsJU3OS7.js → workspaceViewSessions-BMbyO9O4.js} +403 -410
  135. package/package.json +1 -1
  136. package/dist/SystemUserManagementView-BVS5moV5.js +0 -761
  137. package/dist/UserManagementView-BR_Jz8O-.js +0 -965
@@ -0,0 +1,761 @@
1
+ import { $t as e, C as t, Dt as n, Et as r, G as i, Jt as a, K as ee, L as te, Pt as o, Qt as ne, S as s, X as c, Z as re, a as l, d as ie, i as ae, on as oe, or as se, tt as ce, x as le, y as ue, z as de } from "./platform-components-CgMBopmF.js";
2
+ import { d as u, g as fe, i as pe, n as d, r as f, t as p } from "./workspaceViewSessions-BMbyO9O4.js";
3
+ import { i as me, n as he } from "./pageRealtime-CJriNmzP.js";
4
+ import { t as ge } from "./useUserSessionRows-DHsyr2Vy.js";
5
+ import { Fragment as _e, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as y, createVNode as b, defineComponent as x, onBeforeUnmount as ve, onMounted as ye, openBlock as S, ref as C, resolveComponent as w, unref as T, watch as be, withCtx as E, withModifiers as xe } from "vue";
6
+ //#region src/views/systemUserDetailWorkspaceSession.ts
7
+ function Se(e, t) {
8
+ return p(u, e, {
9
+ ...t,
10
+ selectedUser: { ...t.selectedUser },
11
+ draft: { ...t.draft }
12
+ });
13
+ }
14
+ function Ce(e, t) {
15
+ return d(u, e, t);
16
+ }
17
+ function we(e) {
18
+ return f(u, e);
19
+ }
20
+ //#endregion
21
+ //#region src/views/SystemUserManagementView.vue?vue&type=script&setup=true&lang.ts
22
+ var Te = { class: "system-user-management-page" }, Ee = { class: "system-user-detail-state" }, De = {
23
+ key: 0,
24
+ class: "system-user-password-reset-result"
25
+ }, Oe = { key: 0 }, ke = { key: 1 }, Ae = {
26
+ key: 1,
27
+ class: "system-user-detail-state"
28
+ }, je = {
29
+ key: 0,
30
+ class: "system-user-password-reset-result"
31
+ }, Me = { key: 0 }, Ne = { key: 1 }, D = /*#__PURE__*/ e(/* @__PURE__ */ x({
32
+ name: "SystemUserManagementView",
33
+ __name: "SystemUserManagementView",
34
+ props: {
35
+ recordId: {},
36
+ mode: {}
37
+ },
38
+ setup(e) {
39
+ let d = e, f = oe({ moduleAlias: "iam.user" }), p = fe(), x = C(), D = C(), O = C(!1), k = C("view"), A = C(!1), j = C(!1), M = C(!1), N = C(0), P = C(0), F = C(Z()), I = C(""), L = C(), R = C(re(void 0)), z = m(() => !!d.recordId), B = m(() => z.value && p?.presentation === "drawer"), Pe = m(() => !z.value || B.value), { expandedUserKeys: Fe, handleUserListLoaded: Ie, handleUserRowExpand: Le, handleUserSessionBusinessEvent: Re, loadUserSessions: V, userOnlineStatusTitle: ze, userSessionState: H } = ge({
40
+ context: f,
41
+ source: "system-user-management"
42
+ }), U = me({
43
+ moduleAlias: "iam.user",
44
+ recordId: () => D.value?.id,
45
+ editing: () => k.value === "edit",
46
+ saving: () => M.value
47
+ }), W = m(() => Ze(f)), Be = m(() => [
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
+ ]), Ve = m(() => $(D.value ?? F.value)), He = m(() => k.value === "resetPassword" ? "修改密码" : "系统账号"), G = m(() => M.value || A.value), K = m(() => {
77
+ if (A.value) return !1;
78
+ if (k.value === "edit") return !!D.value?.id && f.can("update") === !0;
79
+ if (k.value === "resetPassword") {
80
+ let e = D.value?.id;
81
+ return !!e && f.can("changePassword", e) === !0;
82
+ }
83
+ return !1;
84
+ }), Ue = m(() => !D.value?.id || A.value ? !1 : f.can(St(D.value)) === !0), We = m(() => k.value === "view" ? D.value?.id ? [
85
+ {
86
+ key: "edit",
87
+ actionCode: "update",
88
+ title: "编辑",
89
+ iconName: "edit",
90
+ disabled: M.value
91
+ },
92
+ {
93
+ key: "resetPassword",
94
+ actionCode: "changePassword",
95
+ title: "修改密码",
96
+ iconName: "lock",
97
+ disabled: M.value
98
+ },
99
+ {
100
+ key: "resetGeneratedPassword",
101
+ actionCode: "resetPassword",
102
+ title: "重置密码",
103
+ iconName: "reload",
104
+ disabled: M.value
105
+ }
106
+ ] : [] : [{
107
+ key: "cancel",
108
+ title: "取消",
109
+ iconName: "close",
110
+ disabled: M.value
111
+ }, {
112
+ key: "save",
113
+ actionCode: k.value === "resetPassword" ? "changePassword" : "update",
114
+ title: "保存",
115
+ iconName: "save",
116
+ primary: !0,
117
+ loading: M.value,
118
+ disabled: !K.value
119
+ }]), Ge = m(() => We.value), Ke = pe({
120
+ view: u,
121
+ input: m(() => {
122
+ let e = D.value?.id;
123
+ return e && (k.value === "view" || k.value === "edit") ? { recordId: e } : void 0;
124
+ }),
125
+ title: m(() => $(D.value)),
126
+ eligibility: m(() => ({
127
+ hasStableIdentity: !!D.value?.id && !A.value,
128
+ busy: M.value
129
+ })),
130
+ beforePromote: async (e) => {
131
+ let t = D.value;
132
+ if (t) return await Se(e, {
133
+ selectedUser: t,
134
+ draft: F.value,
135
+ mode: k.value === "edit" ? "edit" : "view",
136
+ password: I.value,
137
+ resetPasswordResult: L.value
138
+ }) === "accepted";
139
+ },
140
+ onPromoted: nt
141
+ });
142
+ be(D, (e) => {
143
+ !z.value || !e || p?.setTitle($(e));
144
+ }, { immediate: !0 });
145
+ let q = m(() => ({
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 = m(() => ["username", "enabled"]), Je;
158
+ ye(() => {
159
+ if (Xe(), d.recordId) {
160
+ let e = { recordId: d.recordId };
161
+ B.value || (Je = Ce(e, Ye));
162
+ let t = we(e);
163
+ if (t) {
164
+ ht(t);
165
+ return;
166
+ }
167
+ J({ id: d.recordId }, d.mode ?? "view");
168
+ }
169
+ }), ve(() => Je?.());
170
+ function Ye(e) {
171
+ return k.value === "view" ? (ht(e), !0) : !1;
172
+ }
173
+ he(Re);
174
+ async function Xe() {
175
+ try {
176
+ R.value = re((await f.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 i = String(e.id ?? "");
230
+ if (!i) return;
231
+ x.value = i, U.clearExternalChanged(), O.value = !0, k.value = t, D.value = void 0, F.value = Q(e), I.value = "", L.value = void 0, A.value = !0, j.value = !1;
232
+ let a = N.value + 1;
233
+ N.value = a;
234
+ try {
235
+ let e = await f.crud.view(i);
236
+ if (!mt(i, a)) return;
237
+ if (!e?.id) {
238
+ j.value = !0, n("未找到指定系统账号", {
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(i, a) && (j.value = !0, r(e, {
251
+ source: "system-user-management",
252
+ phase: "load"
253
+ }));
254
+ } finally {
255
+ mt(i, a) && (A.value = !1);
256
+ }
257
+ }
258
+ function nt() {
259
+ M.value || (N.value += 1, A.value = !1, j.value = !1, O.value = !1, k.value = "view", I.value = "", L.value = void 0, U.clearExternalChanged(), F.value = D.value ? Q(D.value) : Z(), B.value && p?.dismiss());
260
+ }
261
+ function rt() {
262
+ N.value += 1, A.value = !1, j.value = !1, O.value = !1, D.value = void 0, x.value = void 0, F.value = Z(), n("指定账号不属于系统账号管理范围", {
263
+ source: "system-user-management",
264
+ phase: "validation"
265
+ }), z.value && p?.dismiss();
266
+ }
267
+ function it() {
268
+ if (!M.value) {
269
+ if (!D.value?.id) {
270
+ nt();
271
+ return;
272
+ }
273
+ F.value = Q(D.value), I.value = "", L.value = void 0, U.clearExternalChanged(), k.value = "view", A.value = !1, j.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" && D.value) {
287
+ F.value = Q(D.value), U.clearExternalChanged(), k.value = "edit";
288
+ return;
289
+ }
290
+ if (e.key === "resetPassword" && D.value) {
291
+ I.value = "", L.value = void 0, U.clearExternalChanged(), k.value = "resetPassword";
292
+ return;
293
+ }
294
+ e.key === "resetGeneratedPassword" && D.value && ut();
295
+ }
296
+ }
297
+ function ot() {
298
+ let e = String(F.value.id ?? x.value ?? "");
299
+ e && J({
300
+ ...F.value,
301
+ id: e
302
+ }, k.value);
303
+ }
304
+ function st() {
305
+ let e = String(U.externalChangedRecordId.value ?? F.value.id ?? x.value ?? "");
306
+ e && (U.clearExternalChanged(), J({
307
+ ...F.value,
308
+ id: e
309
+ }, "edit"));
310
+ }
311
+ async function ct() {
312
+ if (k.value === "resetPassword") {
313
+ await lt();
314
+ return;
315
+ }
316
+ await ae({
317
+ loading: M,
318
+ mode: "edit",
319
+ source: "system-user-management",
320
+ canSave: () => K.value,
321
+ deniedMessage: "当前用户无权保存系统账号",
322
+ createRecord: () => vt(F.value),
323
+ validateRecord: yt,
324
+ save: (e) => f.crud.update(D.value.id, e),
325
+ actionErrorHandlers: [{
326
+ code: se.conflictVersion,
327
+ handle: (e, { mode: t, record: n }) => t === "edit" && U.markExternalRecordChanged(n.id)
328
+ }],
329
+ onSaved: ({ record: e }) => {
330
+ X(e), P.value += 1;
331
+ }
332
+ });
333
+ }
334
+ async function lt() {
335
+ if (!I.value.trim()) {
336
+ n("请填写新密码", {
337
+ source: "system-user-management",
338
+ phase: "validation"
339
+ });
340
+ return;
341
+ }
342
+ await l({
343
+ loading: M,
344
+ source: "system-user-management",
345
+ record: () => D.value?.id ? D.value : void 0,
346
+ canExecute: () => K.value,
347
+ deniedMessage: "当前用户无权重置系统账号密码",
348
+ execute: (e) => f.http.request({
349
+ method: "POST",
350
+ path: `/iam.user/changePassword/${encodeURIComponent(e.id)}`,
351
+ body: { password: I.value }
352
+ }),
353
+ onExecuted: async (e, t) => {
354
+ X(await f.crud.view(t.id)), P.value += 1;
355
+ }
356
+ });
357
+ }
358
+ async function ut() {
359
+ await l({
360
+ loading: M,
361
+ source: "system-user-management",
362
+ record: () => D.value?.id ? D.value : void 0,
363
+ canExecute: (e) => f.can("resetPassword", e.id) === !0,
364
+ deniedMessage: "当前用户无权重置系统账号密码",
365
+ execute: (e) => f.http.request({
366
+ method: "POST",
367
+ path: `/iam.user/resetPassword/${encodeURIComponent(e.id)}`
368
+ }),
369
+ onExecuted: async (e, t) => {
370
+ X(await f.crud.view(t.id)), L.value = e, P.value += 1;
371
+ }
372
+ });
373
+ }
374
+ async function dt(e, t) {
375
+ await l({
376
+ loading: M,
377
+ source: "system-user-management",
378
+ record: () => e?.id ? e : void 0,
379
+ canExecute: (e) => f.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) => f.http.request({
388
+ method: "POST",
389
+ path: `/iam.user/${encodeURIComponent(e.id)}/sessions/${encodeURIComponent(t.id)}/revoke`
390
+ }),
391
+ onExecuted: (e, t) => {
392
+ V(t.id), P.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
+ n("当前没有可下线的登录会话", {
400
+ source: "system-user-management",
401
+ phase: "validation"
402
+ });
403
+ return;
404
+ }
405
+ await l({
406
+ loading: M,
407
+ source: "system-user-management",
408
+ record: () => e?.id ? e : void 0,
409
+ canExecute: (e) => f.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) => f.http.request({
418
+ method: "POST",
419
+ path: `/iam.user/${encodeURIComponent(e.id)}/sessions/revoke`,
420
+ body: { sessionIds: t }
421
+ }),
422
+ onExecuted: (e, t) => {
423
+ V(t.id), P.value += 1;
424
+ }
425
+ });
426
+ }
427
+ async function pt() {
428
+ await l({
429
+ loading: M,
430
+ source: "system-user-management",
431
+ record: () => D.value?.id ? D.value : void 0,
432
+ canExecute: () => Ue.value,
433
+ deniedMessage: "当前用户无权变更系统账号启停状态",
434
+ execute: (e) => e.enabled === !1 ? f.crud.enable(e.id, { version: e.version }) : f.crud.disable(e.id, { version: e.version }),
435
+ onExecuted: async (e, t) => {
436
+ X(await f.crud.view(t.id)), P.value += 1;
437
+ }
438
+ });
439
+ }
440
+ function Y() {
441
+ return !M.value;
442
+ }
443
+ function mt(e, t) {
444
+ return N.value === t && x.value === e;
445
+ }
446
+ function X(e, t = "view") {
447
+ D.value = e, x.value = e.id, F.value = Q(e), I.value = "", k.value = t === "edit" ? "edit" : "view", U.clearExternalChanged(), O.value = !0, A.value = !1, j.value = !1, N.value += 1;
448
+ }
449
+ function ht(e) {
450
+ x.value = e.selectedUser.id, D.value = { ...e.selectedUser }, F.value = Q(e.draft), k.value = e.mode, I.value = e.password, L.value = e.resetPasswordResult, O.value = !0, A.value = !1, j.value = !1;
451
+ }
452
+ function gt(e) {
453
+ return !e || f.can("revokeSession", e) !== !0 ? [] : H(e).records.filter((e) => !e.current);
454
+ }
455
+ function _t(e, t) {
456
+ return !!e && !t.current && f.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 ie(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 = c("username", {
477
+ fields: R.value,
478
+ fallback: q.value
479
+ });
480
+ if (t.visible && t.required && !e.username) return `请填写${t.label}`;
481
+ if (k.value === "resetPassword" && !I.value.trim()) return "请填写新密码";
482
+ }
483
+ function bt(e) {
484
+ return e === "username";
485
+ }
486
+ function xt(e, t) {
487
+ F.value = {
488
+ ...F.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, n) => {
499
+ let r = w("UiSpin"), o = w("UiError"), c = w("DateTimeText");
500
+ return S(), _("section", Te, [!z.value || B.value ? (S(), h(T(ue), {
501
+ key: 0,
502
+ class: "system-user-list-panel",
503
+ context: W.value,
504
+ title: "系统账号",
505
+ columns: Be.value,
506
+ "cell-renderers": { onlineStatus: T(ze) },
507
+ "row-actions-of": $e,
508
+ "selected-key": x.value,
509
+ "expanded-row-keys": T(Fe),
510
+ "reload-key": P.value,
511
+ ready: !0,
512
+ "quick-search-placeholder": "搜索账号、姓名、手机号或邮箱",
513
+ "empty-description": "暂无系统账号",
514
+ onRowAction: et,
515
+ onRowDblclick: tt,
516
+ onRowExpand: T(Le),
517
+ onLoaded: T(Ie),
518
+ onSelect: n[0] ||= (e) => x.value = String(e.id ?? "")
519
+ }, {
520
+ expandedRow: E(({ record: e }) => [b(T(de), {
521
+ sessions: T(H)(String(e.id ?? "")).records,
522
+ loading: T(H)(String(e.id ?? "")).loading,
523
+ error: T(H)(String(e.id ?? "")).error,
524
+ "actions-disabled": M.value,
525
+ "can-revoke": (t) => _t(String(e.id ?? ""), t),
526
+ "can-revoke-all": gt(String(e.id ?? "")).length > 1,
527
+ onRefresh: (t) => T(V)(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
+ ])) : g("v-if", !0), Pe.value ? (S(), h(T(le), {
552
+ key: 1,
553
+ open: O.value,
554
+ title: Ve.value,
555
+ subtitle: He.value,
556
+ mode: k.value,
557
+ "form-modes": ["edit", "resetPassword"],
558
+ loading: A.value,
559
+ "load-failed": j.value,
560
+ "externally-changed": T(U).externallyChanged.value,
561
+ promotion: T(Ke),
562
+ "error-title": "详情加载失败",
563
+ "error-message": "无法加载系统账号详情,请重试",
564
+ onClose: nt,
565
+ onRetry: ot,
566
+ onReloadExternalChange: st,
567
+ onDismissExternalChange: T(U).clearExternalChanged
568
+ }, {
569
+ status: E(() => [k.value === "view" && D.value ? (S(), h(T(te), {
570
+ key: 0,
571
+ enabled: D.value.enabled !== !1,
572
+ disabled: M.value || !Ue.value,
573
+ loading: M.value,
574
+ "show-label": !1,
575
+ onChange: pt
576
+ }, null, 8, [
577
+ "enabled",
578
+ "disabled",
579
+ "loading"
580
+ ])) : g("v-if", !0)]),
581
+ operation: E(() => [b(T(ce), {
582
+ context: W.value,
583
+ actions: Ge.value,
584
+ "record-id": D.value?.id,
585
+ onAction: at
586
+ }, null, 8, [
587
+ "context",
588
+ "actions",
589
+ "record-id"
590
+ ])]),
591
+ loading: E(() => [b(r, {
592
+ class: "system-user-detail-state",
593
+ tip: "加载系统账号详情"
594
+ })]),
595
+ error: E(() => [v("div", Ee, [b(o, {
596
+ title: "详情加载失败",
597
+ message: "无法加载系统账号详情,请重试"
598
+ }), b(T(ne), {
599
+ type: "primary",
600
+ "icon-name": "reload",
601
+ onClick: ot
602
+ }, {
603
+ default: E(() => [...n[3] ||= [y("重试", -1)]]),
604
+ _: 1
605
+ })])]),
606
+ view: E(() => [
607
+ b(T(ee), {
608
+ record: F.value,
609
+ fields: R.value,
610
+ fallback: q.value
611
+ }, null, 8, [
612
+ "record",
613
+ "fields",
614
+ "fallback"
615
+ ]),
616
+ k.value === "view" && L.value?.temporaryPassword ? (S(), _("div", De, [
617
+ n[5] ||= v("span", null, "临时密码", -1),
618
+ b(T(a), {
619
+ value: L.value.temporaryPassword,
620
+ disabled: ""
621
+ }, null, 8, ["value"]),
622
+ L.value.expiresAt ? (S(), _("small", Oe, [n[4] ||= y(" 有效期至 ", -1), b(c, { value: L.value.expiresAt }, null, 8, ["value"])])) : g("v-if", !0)
623
+ ])) : g("v-if", !0),
624
+ b(T(s), { record: F.value }, null, 8, ["record"])
625
+ ]),
626
+ form: E(() => [v("form", {
627
+ class: "system-user-form",
628
+ onSubmit: xe(ct, ["prevent"])
629
+ }, [k.value === "resetPassword" ? (S(), _("label", ke, [n[6] ||= v("span", { class: "system-user-form-label" }, "新密码", -1), b(T(a), {
630
+ value: I.value,
631
+ type: "password",
632
+ disabled: G.value,
633
+ placeholder: "请输入密码",
634
+ "allow-clear": "",
635
+ "onUpdate:value": n[1] ||= (e) => I.value = e
636
+ }, null, 8, ["value", "disabled"])])) : (S(), h(T(t), {
637
+ key: 0,
638
+ record: F.value,
639
+ "field-names": qe.value,
640
+ fields: R.value,
641
+ fallback: q.value,
642
+ disabled: G.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), k.value === "resetPassword" ? g("v-if", !0) : (S(), h(T(s), {
652
+ key: 0,
653
+ record: F.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
+ ])) : (S(), h(T(i), {
667
+ key: 2,
668
+ title: Ve.value,
669
+ subtitle: He.value
670
+ }, {
671
+ status: E(() => [k.value === "view" && D.value ? (S(), h(T(te), {
672
+ key: 0,
673
+ enabled: D.value.enabled !== !1,
674
+ disabled: M.value || !Ue.value,
675
+ loading: M.value,
676
+ "show-label": !1,
677
+ onChange: pt
678
+ }, null, 8, [
679
+ "enabled",
680
+ "disabled",
681
+ "loading"
682
+ ])) : g("v-if", !0)]),
683
+ operation: E(() => [b(T(ce), {
684
+ context: W.value,
685
+ actions: Ge.value,
686
+ "record-id": D.value?.id,
687
+ onAction: at
688
+ }, null, 8, [
689
+ "context",
690
+ "actions",
691
+ "record-id"
692
+ ])]),
693
+ default: E(() => [A.value ? (S(), h(r, {
694
+ key: 0,
695
+ class: "system-user-detail-state",
696
+ tip: "加载系统账号详情"
697
+ })) : j.value ? (S(), _("div", Ae, [b(o, {
698
+ title: "详情加载失败",
699
+ message: "无法加载系统账号详情,请重试"
700
+ }), b(T(ne), {
701
+ type: "primary",
702
+ "icon-name": "reload",
703
+ onClick: ot
704
+ }, {
705
+ default: E(() => [...n[7] ||= [y("重试", -1)]]),
706
+ _: 1
707
+ })])) : k.value === "view" ? (S(), _(_e, { key: 2 }, [
708
+ b(T(ee), {
709
+ record: F.value,
710
+ fields: R.value,
711
+ fallback: q.value
712
+ }, null, 8, [
713
+ "record",
714
+ "fields",
715
+ "fallback"
716
+ ]),
717
+ L.value?.temporaryPassword ? (S(), _("div", je, [
718
+ n[9] ||= v("span", null, "临时密码", -1),
719
+ b(T(a), {
720
+ value: L.value.temporaryPassword,
721
+ disabled: ""
722
+ }, null, 8, ["value"]),
723
+ L.value.expiresAt ? (S(), _("small", Me, [n[8] ||= y(" 有效期至 ", -1), b(c, { value: L.value.expiresAt }, null, 8, ["value"])])) : g("v-if", !0)
724
+ ])) : g("v-if", !0),
725
+ b(T(s), { record: F.value }, null, 8, ["record"])
726
+ ], 64)) : (S(), _(_e, { key: 3 }, [v("form", {
727
+ class: "system-user-form",
728
+ onSubmit: xe(ct, ["prevent"])
729
+ }, [k.value === "resetPassword" ? (S(), _("label", Ne, [n[10] ||= v("span", { class: "system-user-form-label" }, "新密码", -1), b(T(a), {
730
+ value: I.value,
731
+ type: "password",
732
+ disabled: G.value,
733
+ placeholder: "请输入密码",
734
+ "allow-clear": "",
735
+ "onUpdate:value": n[2] ||= (e) => I.value = e
736
+ }, null, 8, ["value", "disabled"])])) : (S(), h(T(t), {
737
+ key: 0,
738
+ record: F.value,
739
+ "field-names": qe.value,
740
+ fields: R.value,
741
+ fallback: q.value,
742
+ disabled: G.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), k.value === "resetPassword" ? g("v-if", !0) : (S(), h(T(s), {
752
+ key: 0,
753
+ record: F.value
754
+ }, null, 8, ["record"]))], 64))]),
755
+ _: 1
756
+ }, 8, ["title", "subtitle"]))]);
757
+ };
758
+ }
759
+ }), [["__scopeId", "data-v-01fb79d3"]]);
760
+ //#endregion
761
+ export { D as t };