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