@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
@@ -1,761 +0,0 @@
1
- import { C as e, Dt as t, Et as n, G as r, K as i, L as a, Pt as o, S as s, X as c, Yt as l, Z as u, a as d, cn as ee, cr as te, d as ne, en as re, i as ie, tn as ae, tt as oe, x as se, y as ce, z as le } from "./platform-components-bC1gwhic.js";
2
- import { d as f, g as ue, i as de, n as p, r as m, t as h } from "./workspaceViewSessions-WsJU3OS7.js";
3
- import { i as fe, n as pe } from "./pageRealtime-sRtDYlQP.js";
4
- import { t as me } from "./useUserSessionRows-CLM0ZvAF.js";
5
- import { Fragment as he, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createTextVNode as x, createVNode as S, defineComponent as C, onBeforeUnmount as ge, onMounted as _e, openBlock as w, ref as T, resolveComponent as ve, 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 h(f, e, {
9
- ...t,
10
- selectedUser: { ...t.selectedUser },
11
- draft: { ...t.draft }
12
- });
13
- }
14
- function Se(e, t) {
15
- return p(f, e, t);
16
- }
17
- function Ce(e) {
18
- return m(f, 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__*/ ae(/* @__PURE__ */ C({
32
- name: "SystemUserManagementView",
33
- __name: "SystemUserManagementView",
34
- props: {
35
- recordId: {},
36
- mode: {}
37
- },
38
- setup(ae) {
39
- let p = ae, m = ee({ moduleAlias: "iam.user" }), h = ue(), C = T(), O = T(), k = T(!1), A = T("view"), j = T(!1), M = T(!1), N = T(!1), P = T(0), F = T(0), I = T(Z()), L = T(""), R = T(), z = T(u(void 0)), B = g(() => !!p.recordId), V = g(() => B.value && h?.presentation === "drawer"), Ne = g(() => !B.value || V.value), { expandedUserKeys: Pe, handleUserListLoaded: Fe, handleUserRowExpand: Ie, handleUserSessionBusinessEvent: Le, loadUserSessions: H, userOnlineStatusTitle: Re, userSessionState: U } = me({
40
- context: m,
41
- source: "system-user-management"
42
- }), W = fe({
43
- moduleAlias: "iam.user",
44
- recordId: () => O.value?.id,
45
- editing: () => A.value === "edit",
46
- saving: () => N.value
47
- }), G = g(() => Ze(m)), ze = g(() => [
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 = g(() => $(O.value ?? I.value)), Ve = g(() => A.value === "resetPassword" ? "修改密码" : "系统账号"), K = g(() => N.value || j.value), He = g(() => {
77
- if (j.value) return !1;
78
- if (A.value === "edit") return !!O.value?.id && m.can("update") === !0;
79
- if (A.value === "resetPassword") {
80
- let e = O.value?.id;
81
- return !!e && m.can("changePassword", e) === !0;
82
- }
83
- return !1;
84
- }), Ue = g(() => !O.value?.id || j.value ? !1 : m.can(St(O.value)) === !0), We = g(() => 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 = g(() => We.value), Ke = de({
120
- view: f,
121
- input: g(() => {
122
- let e = O.value?.id;
123
- return e && (A.value === "view" || A.value === "edit") ? { recordId: e } : void 0;
124
- }),
125
- title: g(() => $(O.value)),
126
- eligibility: g(() => ({
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 || h?.setTitle($(e));
144
- }, { immediate: !0 });
145
- let q = g(() => ({
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 = g(() => ["username", "enabled"]), Je;
158
- _e(() => {
159
- if (Xe(), p.recordId) {
160
- let e = { recordId: p.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: p.recordId }, p.mode ?? "view");
168
- }
169
- }), ge(() => Je?.());
170
- function Ye(e) {
171
- return A.value === "view" ? (ht(e), !0) : !1;
172
- }
173
- pe(Le);
174
- async function Xe() {
175
- try {
176
- z.value = u((await m.runtime.ready).uiDescriptor);
177
- } catch (e) {
178
- n(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, r) {
228
- if (!Y()) return;
229
- let i = String(e.id ?? "");
230
- if (!i) return;
231
- C.value = i, W.clearExternalChanged(), k.value = !0, A.value = r, O.value = void 0, I.value = Q(e), L.value = "", R.value = void 0, j.value = !0, M.value = !1;
232
- let a = P.value + 1;
233
- P.value = a;
234
- try {
235
- let e = await m.crud.view(i);
236
- if (!mt(i, a)) return;
237
- if (!e?.id) {
238
- M.value = !0, t("未找到指定系统账号", {
239
- source: "system-user-management",
240
- phase: "load"
241
- });
242
- return;
243
- }
244
- if (e.tenantId) {
245
- rt();
246
- return;
247
- }
248
- X(e, r);
249
- } catch (e) {
250
- mt(i, a) && (M.value = !0, n(e, {
251
- source: "system-user-management",
252
- phase: "load"
253
- }));
254
- } finally {
255
- mt(i, a) && (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 && h?.dismiss());
260
- }
261
- function rt() {
262
- P.value += 1, j.value = !1, M.value = !1, k.value = !1, O.value = void 0, C.value = void 0, I.value = Z(), t("指定账号不属于系统账号管理范围", {
263
- source: "system-user-management",
264
- phase: "validation"
265
- }), B.value && h?.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 ?? C.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 ?? C.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 ie({
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) => m.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
- t("请填写新密码", {
337
- source: "system-user-management",
338
- phase: "validation"
339
- });
340
- return;
341
- }
342
- await d({
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) => m.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 m.crud.view(t.id)), F.value += 1;
355
- }
356
- });
357
- }
358
- async function ut() {
359
- await d({
360
- loading: N,
361
- source: "system-user-management",
362
- record: () => O.value?.id ? O.value : void 0,
363
- canExecute: (e) => m.can("resetPassword", e.id) === !0,
364
- deniedMessage: "当前用户无权重置系统账号密码",
365
- execute: (e) => m.http.request({
366
- method: "POST",
367
- path: `/iam.user/resetPassword/${encodeURIComponent(e.id)}`
368
- }),
369
- onExecuted: async (e, t) => {
370
- X(await m.crud.view(t.id)), R.value = e, F.value += 1;
371
- }
372
- });
373
- }
374
- async function dt(e, t) {
375
- await d({
376
- loading: N,
377
- source: "system-user-management",
378
- record: () => e?.id ? e : void 0,
379
- canExecute: (e) => m.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) => m.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 n = gt(String(e.id ?? "")).map((e) => e.id);
398
- if (n.length === 0) {
399
- t("当前没有可下线的登录会话", {
400
- source: "system-user-management",
401
- phase: "validation"
402
- });
403
- return;
404
- }
405
- await d({
406
- loading: N,
407
- source: "system-user-management",
408
- record: () => e?.id ? e : void 0,
409
- canExecute: (e) => m.can("revokeSessions", e.id) === !0,
410
- deniedMessage: "当前用户无权批量下线登录会话",
411
- confirm: (e) => o({
412
- title: "批量下线登录会话",
413
- content: `确认下线系统账号「${$(e)}」的 ${n.length} 个登录会话?`,
414
- okText: "全部下线",
415
- danger: !0
416
- }),
417
- execute: (e) => m.http.request({
418
- method: "POST",
419
- path: `/iam.user/${encodeURIComponent(e.id)}/sessions/revoke`,
420
- body: { sessionIds: n }
421
- }),
422
- onExecuted: (e, t) => {
423
- H(t.id), F.value += 1;
424
- }
425
- });
426
- }
427
- async function pt() {
428
- await d({
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 ? m.crud.enable(e.id, { version: e.version }) : m.crud.disable(e.id, { version: e.version }),
435
- onExecuted: async (e, t) => {
436
- X(await m.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 && C.value === e;
445
- }
446
- function X(e, t = "view") {
447
- O.value = e, C.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
- C.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 || m.can("revokeSession", e) !== !0 ? [] : U(e).records.filter((e) => !e.current);
454
- }
455
- function _t(e, t) {
456
- return !!e && !t.current && m.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 = c("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 (t, n) => {
499
- let o = ve("UiSpin"), c = ve("UiError"), u = ve("DateTimeText");
500
- return w(), y("section", we, [!B.value || V.value ? (w(), _(E(ce), {
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": C.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: n[0] ||= (e) => C.value = String(e.id ?? "")
519
- }, {
520
- expandedRow: D(({ record: e }) => [S(E(le), {
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("v-if", !0), Ne.value ? (w(), _(E(se), {
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 ? (w(), _(E(a), {
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("v-if", !0)]),
581
- operation: D(() => [S(E(oe), {
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(() => [S(o, {
592
- class: "system-user-detail-state",
593
- tip: "加载系统账号详情"
594
- })]),
595
- error: D(() => [b("div", Te, [S(c, {
596
- title: "详情加载失败",
597
- message: "无法加载系统账号详情,请重试"
598
- }), S(E(re), {
599
- type: "primary",
600
- "icon-name": "reload",
601
- onClick: ot
602
- }, {
603
- default: D(() => [...n[3] ||= [x("重试", -1)]]),
604
- _: 1
605
- })])]),
606
- view: D(() => [
607
- S(E(i), {
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 ? (w(), y("div", Ee, [
617
- n[5] ||= b("span", null, "临时密码", -1),
618
- S(E(l), {
619
- value: R.value.temporaryPassword,
620
- disabled: ""
621
- }, null, 8, ["value"]),
622
- R.value.expiresAt ? (w(), y("small", De, [n[4] ||= x(" 有效期至 ", -1), S(u, { value: R.value.expiresAt }, null, 8, ["value"])])) : v("v-if", !0)
623
- ])) : v("v-if", !0),
624
- S(E(s), { record: I.value }, null, 8, ["record"])
625
- ]),
626
- form: D(() => [b("form", {
627
- class: "system-user-form",
628
- onSubmit: be(ct, ["prevent"])
629
- }, [A.value === "resetPassword" ? (w(), y("label", Oe, [n[6] ||= b("span", { class: "system-user-form-label" }, "新密码", -1), S(E(l), {
630
- value: L.value,
631
- type: "password",
632
- disabled: K.value,
633
- placeholder: "请输入密码",
634
- "allow-clear": "",
635
- "onUpdate:value": n[1] ||= (e) => L.value = e
636
- }, null, 8, ["value", "disabled"])])) : (w(), _(E(e), {
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("v-if", !0) : (w(), _(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
- ])) : (w(), _(E(r), {
667
- key: 2,
668
- title: Be.value,
669
- subtitle: Ve.value
670
- }, {
671
- status: D(() => [A.value === "view" && O.value ? (w(), _(E(a), {
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("v-if", !0)]),
683
- operation: D(() => [S(E(oe), {
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 ? (w(), _(o, {
694
- key: 0,
695
- class: "system-user-detail-state",
696
- tip: "加载系统账号详情"
697
- })) : M.value ? (w(), y("div", ke, [S(c, {
698
- title: "详情加载失败",
699
- message: "无法加载系统账号详情,请重试"
700
- }), S(E(re), {
701
- type: "primary",
702
- "icon-name": "reload",
703
- onClick: ot
704
- }, {
705
- default: D(() => [...n[7] ||= [x("重试", -1)]]),
706
- _: 1
707
- })])) : A.value === "view" ? (w(), y(he, { key: 2 }, [
708
- S(E(i), {
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 ? (w(), y("div", Ae, [
718
- n[9] ||= b("span", null, "临时密码", -1),
719
- S(E(l), {
720
- value: R.value.temporaryPassword,
721
- disabled: ""
722
- }, null, 8, ["value"]),
723
- R.value.expiresAt ? (w(), y("small", je, [n[8] ||= x(" 有效期至 ", -1), S(u, { value: R.value.expiresAt }, null, 8, ["value"])])) : v("v-if", !0)
724
- ])) : v("v-if", !0),
725
- S(E(s), { record: I.value }, null, 8, ["record"])
726
- ], 64)) : (w(), y(he, { key: 3 }, [b("form", {
727
- class: "system-user-form",
728
- onSubmit: be(ct, ["prevent"])
729
- }, [A.value === "resetPassword" ? (w(), y("label", Me, [n[10] ||= b("span", { class: "system-user-form-label" }, "新密码", -1), S(E(l), {
730
- value: L.value,
731
- type: "password",
732
- disabled: K.value,
733
- placeholder: "请输入密码",
734
- "allow-clear": "",
735
- "onUpdate:value": n[2] ||= (e) => L.value = e
736
- }, null, 8, ["value", "disabled"])])) : (w(), _(E(e), {
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("v-if", !0) : (w(), _(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 };