@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.
- package/dist/{EmployeeDetailWorkspaceView-mtdcsqgF.js → EmployeeDetailWorkspaceView-BySbWjCV.js} +1 -1
- package/dist/{EmployeeManagementView-CKKvQZaC.js → EmployeeManagementView-DvmDPxzN.js} +205 -205
- package/dist/{MetadataOrchestrationView-CprWBocy.js → MetadataOrchestrationView-2JxJkFEC.js} +194 -194
- package/dist/{ModuleActionManagementView-DNuAQUPE.js → ModuleActionManagementView-DRtYMXOK.js} +122 -122
- package/dist/{RoleAuthorizationView-CQtSAJoJ.js → RoleAuthorizationView-CK6Vfdup.js} +52 -52
- package/dist/{RoleDetailWorkspaceView-Dh8DXpyS.js → RoleDetailWorkspaceView-BPZcZy-r.js} +1 -1
- package/dist/{RoleManagementView-BrqaFV7y.js → RoleManagementView-B7TzzVOm.js} +204 -204
- package/dist/{SystemUserDetailWorkspaceView-N-kvycAu.js → SystemUserDetailWorkspaceView-BtEDyU-k.js} +1 -1
- package/dist/SystemUserManagementView-TKqj92zG.js +761 -0
- package/dist/{UserDetailWorkspaceView-Iek6xwix.js → UserDetailWorkspaceView-B6fGrnQ7.js} +1 -1
- package/dist/UserManagementView-4IJeDSQS.js +965 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1054 -1054
- package/dist/{pageRealtime-sRtDYlQP.js → pageRealtime-CJriNmzP.js} +12 -12
- package/dist/{platform-components-bC1gwhic.js → platform-components-CgMBopmF.js} +1107 -1377
- package/dist/types/app/LoginView.vue.d.ts +2 -2
- package/dist/types/app/appWorkbenchStartup.d.ts +1 -1
- package/dist/types/app/platformMessage.d.ts +1 -1
- package/dist/types/app/query.d.ts +1 -1
- package/dist/types/app/workbenchStartup.d.ts +3 -3
- package/dist/types/consumer/PlatformAdminOutlet.vue.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/DynamicModuleHost.vue.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/DynamicModulePage.vue.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/actionReactions.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/mockDescriptor.d.ts +1 -1
- package/dist/types/main.d.ts +1 -1
- package/dist/types/platform-admin-runtime/PlatformAdminOutlet.vue.d.ts +1 -1
- package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +1 -1
- package/dist/types/platform-admin-runtime/WorkspaceViewOutlet.vue.d.ts +1 -1
- package/dist/types/platform-admin-runtime/backendHttp.d.ts +1 -1
- package/dist/types/platform-admin-runtime/currentUserContext.d.ts +1 -1
- package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +2 -2
- package/dist/types/platform-admin-runtime/pageRealtime.d.ts +1 -1
- package/dist/types/platform-admin-runtime/platformAdminRoutes.d.ts +1 -1
- package/dist/types/platform-admin-runtime/realtime.d.ts +4 -4
- package/dist/types/platform-admin-runtime/sessionRecovery.d.ts +1 -1
- package/dist/types/platform-admin-runtime/useWorkspaceViewPromotion.d.ts +1 -1
- package/dist/types/platform-admin-runtime/workspaceViewContract.d.ts +1 -1
- package/dist/types/platform-admin-runtime/workspaceViews.d.ts +1 -1
- package/dist/types/platform-components/ApplicationScopeSwitcher.vue.d.ts +1 -1
- package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +2 -2
- package/dist/types/platform-components/ModuleActionButton.vue.d.ts +2 -2
- package/dist/types/platform-components/RecordActionBar.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordListExplorer.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordMetaSection.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordPicker.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +1 -1
- package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +2 -2
- package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +1 -1
- package/dist/types/platform-components/actionConfirmation.d.ts +1 -1
- package/dist/types/platform-components/index.d.ts +1 -0
- package/dist/types/platform-components/optionFieldOptions.d.ts +1 -1
- package/dist/types/platform-components/pageLayoutContext.d.ts +1 -1
- package/dist/types/platform-components/platformActionResultReactions.d.ts +1 -1
- package/dist/types/platform-components/platformErrorFeedback.d.ts +1 -1
- package/dist/types/platform-components/recordActionBarModel.d.ts +2 -2
- package/dist/types/platform-components/recordEditorSessionState.d.ts +1 -1
- package/dist/types/platform-components/recordExplorerItemModel.d.ts +1 -1
- package/dist/types/platform-components/recordFormFieldModel.d.ts +2 -2
- package/dist/types/platform-components/recycleBinState.d.ts +2 -2
- package/dist/types/platform-components/scopedResourceTreeModuleContext.d.ts +1 -1
- package/dist/types/platform-components/scopedTreeModuleContext.d.ts +1 -1
- package/dist/types/platform-components/softDeletedConflictHandler.d.ts +1 -1
- package/dist/types/platform-components/staticCrudManagementState.d.ts +2 -2
- package/dist/types/platform-components/staticFormActionFlow.d.ts +1 -1
- package/dist/types/platform-components/staticTreeResourceModuleContext.d.ts +1 -1
- package/dist/types/platform-components/treeRecordModel.d.ts +1 -1
- package/dist/types/platform-components/useRecycleBinExplorerMode.d.ts +1 -1
- package/dist/types/platform-components/userSessionPresentation.d.ts +1 -1
- package/dist/types/platform-workbench/Workbench.vue.d.ts +1 -1
- package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +1 -1
- package/dist/types/platform-workbench/WorkbenchMenuTree.vue.d.ts +1 -1
- package/dist/types/platform-workbench/WorkbenchOutlet.vue.d.ts +1 -1
- package/dist/types/platform-workbench/hosts/BusinessRouteHost.vue.d.ts +1 -1
- package/dist/types/platform-workbench/hosts/ExternalPageHost.vue.d.ts +1 -1
- package/dist/types/platform-workbench/hosts/PlatformRouteHost.vue.d.ts +1 -1
- package/dist/types/platform-workbench/menuNavigation.d.ts +1 -1
- package/dist/types/platform-workbench/menuTreeModel.d.ts +1 -1
- package/dist/types/platform-workbench/pageHostRegistry.d.ts +1 -1
- package/dist/types/platform-workbench/workbenchNavigation.d.ts +1 -1
- package/dist/types/views/EmployeeDetailContent.vue.d.ts +3 -3
- package/dist/types/views/EmployeeEmploymentDrawer.vue.d.ts +1 -1
- package/dist/types/views/EmployeeEmploymentTable.vue.d.ts +1 -1
- package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +2 -2
- package/dist/types/views/RoleDetailWorkspaceView.vue.d.ts +1 -1
- package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +2 -2
- package/dist/types/views/RoleGroupMemberSelector.vue.d.ts +1 -1
- package/dist/types/views/RoleManagementView.vue.d.ts +1 -1
- package/dist/types/views/UserDetailContent.vue.d.ts +2 -2
- package/dist/types/views/applicationManagementState.d.ts +3 -3
- package/dist/types/views/departmentManagementState.d.ts +3 -3
- package/dist/types/views/dictionaryManagementState.d.ts +4 -4
- package/dist/types/views/employeeDetailWorkspaceSession.d.ts +1 -1
- package/dist/types/views/fieldSpecManagementState.d.ts +3 -3
- package/dist/types/views/fieldUiControlManagementState.d.ts +3 -3
- package/dist/types/views/menuManagementState.d.ts +7 -7
- package/dist/types/views/metadataOrchestrationState.d.ts +1 -1
- package/dist/types/views/moduleManagementState.d.ts +5 -5
- package/dist/types/views/organizationManagementState.d.ts +4 -4
- package/dist/types/views/positionManagementState.d.ts +4 -4
- package/dist/types/views/roleAuthorizationWorkspaceSession.d.ts +1 -1
- package/dist/types/views/roleDetailWorkspaceSession.d.ts +1 -1
- package/dist/types/views/roleDetailWorkspaceView.d.ts +1 -1
- package/dist/types/views/roleGrantClient.d.ts +2 -2
- package/dist/types/views/systemUserDetailWorkspaceSession.d.ts +1 -1
- package/dist/types/views/tenantManagementState.d.ts +3 -3
- package/dist/types/views/useEmployeeEmploymentRows.d.ts +2 -2
- package/dist/types/views/useUserSessionRows.d.ts +3 -3
- package/dist/types/views/userDetailWorkspaceSession.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/ActionBar.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/DictionarySelect.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/ReferenceSelect.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiForm.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiInput.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/UiTable.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/dictionaries.d.ts +1 -1
- package/dist/types/vue-ui-antdv/references.d.ts +1 -1
- package/dist/types/vue-ui-antdv/registry.d.ts +1 -1
- package/dist/types/web-core/actionResult.d.ts +1 -2
- package/dist/types/web-core/clients.d.ts +1 -1
- package/dist/types/web-core/dataChanges.d.ts +1 -1
- package/dist/types/web-core/errors.d.ts +1 -1
- package/dist/types/web-core/http.d.ts +1 -1
- package/dist/types/web-core/mock.d.ts +1 -1
- package/dist/types/web-core/module/runtimeContext.d.ts +1 -1
- package/dist/types/web-core/module/staticModuleClient.d.ts +1 -1
- package/dist/types/web-core/realtime.d.ts +1 -1
- package/dist/{useUserSessionRows-CLM0ZvAF.js → useUserSessionRows-DHsyr2Vy.js} +2 -2
- package/dist/{workspaceViewSessions-WsJU3OS7.js → workspaceViewSessions-BMbyO9O4.js} +403 -410
- package/package.json +1 -1
- package/dist/SystemUserManagementView-BVS5moV5.js +0 -761
- package/dist/UserManagementView-BR_Jz8O-.js +0 -965
|
@@ -1,965 +0,0 @@
|
|
|
1
|
-
import { C as e, Dt as t, Et as n, G as r, It as i, K as a, L as o, Lt as s, Pt as c, R as ee, S as l, Ut as te, X as ne, Yt as u, Z as re, a as d, cn as ie, d as ae, en as f, et as oe, ht as se, i as ce, ir as le, lt as p, tn as m, tt as ue, y as de, z as fe } from "./platform-components-bC1gwhic.js";
|
|
2
|
-
import { g as pe, i as me, m as h, n as g, r as _, t as v } from "./workspaceViewSessions-WsJU3OS7.js";
|
|
3
|
-
import { n as he, o as y } from "./pageRealtime-sRtDYlQP.js";
|
|
4
|
-
import { n as ge } from "./currentUserContext-B1lj1WgF.js";
|
|
5
|
-
import { t as _e } from "./useUserSessionRows-CLM0ZvAF.js";
|
|
6
|
-
import { Fragment as b, computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createTextVNode as E, createVNode as D, defineComponent as O, normalizeClass as ve, onBeforeUnmount as ye, onMounted as be, openBlock as k, ref as A, toDisplayString as j, unref as M, watch as xe, withCtx as N, withModifiers as P } from "vue";
|
|
7
|
-
//#region src/platform-admin-runtime/sessionRecovery.ts
|
|
8
|
-
var F;
|
|
9
|
-
function I(e, t) {
|
|
10
|
-
return F?.(e, t) ?? !1;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/platform-admin-runtime/backendHttp.ts
|
|
14
|
-
function Se(e = {}) {
|
|
15
|
-
return le({
|
|
16
|
-
baseUrl: void 0,
|
|
17
|
-
token: e.withAuth === !1 ? void 0 : y(void 0),
|
|
18
|
-
credentials: Ce(void 0),
|
|
19
|
-
onAuthenticationRequired: e.withAuth === !1 ? void 0 : (e, t) => I(e, t)
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function Ce(e) {
|
|
23
|
-
return e === "include" || e === "omit" || e === "same-origin" ? e : void 0;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/views/UserDetailContent.vue?vue&type=script&setup=true&lang.ts
|
|
27
|
-
var we = {
|
|
28
|
-
key: 1,
|
|
29
|
-
class: "user-detail-state"
|
|
30
|
-
}, Te = {
|
|
31
|
-
key: 1,
|
|
32
|
-
class: "user-password-reset-result"
|
|
33
|
-
}, Ee = { key: 0 }, L = { key: 1 }, De = { class: "user-form-label" }, Oe = /*#__PURE__*/ m(/* @__PURE__ */ O({
|
|
34
|
-
name: "UserDetailContent",
|
|
35
|
-
__name: "UserDetailContent",
|
|
36
|
-
props: {
|
|
37
|
-
mode: {},
|
|
38
|
-
draft: {},
|
|
39
|
-
selectedUser: {},
|
|
40
|
-
loading: { type: Boolean },
|
|
41
|
-
loadFailed: { type: Boolean },
|
|
42
|
-
saving: { type: Boolean },
|
|
43
|
-
tenantTitle: {},
|
|
44
|
-
fields: {},
|
|
45
|
-
fallback: {},
|
|
46
|
-
fieldNames: {},
|
|
47
|
-
password: {},
|
|
48
|
-
resetPasswordResult: {},
|
|
49
|
-
displayOf: { type: Function },
|
|
50
|
-
disabledOf: { type: Function }
|
|
51
|
-
},
|
|
52
|
-
emits: [
|
|
53
|
-
"retry",
|
|
54
|
-
"save",
|
|
55
|
-
"update:field",
|
|
56
|
-
"update:password"
|
|
57
|
-
],
|
|
58
|
-
setup(t, { emit: n }) {
|
|
59
|
-
let r = n;
|
|
60
|
-
return (n, o) => t.loading ? (k(), S(M(s), {
|
|
61
|
-
key: 0,
|
|
62
|
-
class: "user-detail-state",
|
|
63
|
-
tip: "加载用户详情"
|
|
64
|
-
})) : t.loadFailed ? (k(), w("div", we, [D(M(i), {
|
|
65
|
-
title: "详情加载失败",
|
|
66
|
-
message: "无法加载用户详情,请重试"
|
|
67
|
-
}), D(M(f), {
|
|
68
|
-
type: "primary",
|
|
69
|
-
"icon-name": "reload",
|
|
70
|
-
onClick: o[0] ||= (e) => r("retry")
|
|
71
|
-
}, {
|
|
72
|
-
default: N(() => [...o[4] ||= [E("重试", -1)]]),
|
|
73
|
-
_: 1
|
|
74
|
-
})])) : t.mode === "view" || t.mode === "create" || t.selectedUser ? (k(), w(b, { key: 2 }, [
|
|
75
|
-
t.mode === "view" ? (k(), S(M(a), {
|
|
76
|
-
key: 0,
|
|
77
|
-
record: t.draft,
|
|
78
|
-
fields: t.fields,
|
|
79
|
-
fallback: t.fallback,
|
|
80
|
-
"display-of": t.displayOf
|
|
81
|
-
}, null, 8, [
|
|
82
|
-
"record",
|
|
83
|
-
"fields",
|
|
84
|
-
"fallback",
|
|
85
|
-
"display-of"
|
|
86
|
-
])) : C("v-if", !0),
|
|
87
|
-
t.mode === "view" && t.resetPasswordResult?.temporaryPassword ? (k(), w("div", Te, [
|
|
88
|
-
o[6] ||= T("span", null, "临时密码", -1),
|
|
89
|
-
D(M(u), {
|
|
90
|
-
value: t.resetPasswordResult.temporaryPassword,
|
|
91
|
-
disabled: ""
|
|
92
|
-
}, null, 8, ["value"]),
|
|
93
|
-
t.resetPasswordResult.expiresAt ? (k(), w("small", Ee, [o[5] ||= E(" 有效期至 ", -1), D(M(p), { value: t.resetPasswordResult.expiresAt }, null, 8, ["value"])])) : C("v-if", !0)
|
|
94
|
-
])) : C("v-if", !0),
|
|
95
|
-
t.mode === "view" ? C("v-if", !0) : (k(), w("form", {
|
|
96
|
-
key: 2,
|
|
97
|
-
class: "user-form",
|
|
98
|
-
onSubmit: o[3] ||= P((e) => r("save"), ["prevent"])
|
|
99
|
-
}, [
|
|
100
|
-
T("label", null, [o[7] ||= T("span", { class: "user-form-label" }, "当前租户", -1), D(M(u), {
|
|
101
|
-
value: t.tenantTitle,
|
|
102
|
-
disabled: ""
|
|
103
|
-
}, null, 8, ["value"])]),
|
|
104
|
-
t.mode === "resetPassword" ? C("v-if", !0) : (k(), S(M(e), {
|
|
105
|
-
key: 0,
|
|
106
|
-
record: t.draft,
|
|
107
|
-
"field-names": t.fieldNames,
|
|
108
|
-
fields: t.fields,
|
|
109
|
-
fallback: t.fallback,
|
|
110
|
-
disabled: t.saving,
|
|
111
|
-
"disabled-of": t.disabledOf,
|
|
112
|
-
"onUpdate:field": o[1] ||= (e, t) => r("update:field", e, t)
|
|
113
|
-
}, null, 8, [
|
|
114
|
-
"record",
|
|
115
|
-
"field-names",
|
|
116
|
-
"fields",
|
|
117
|
-
"fallback",
|
|
118
|
-
"disabled",
|
|
119
|
-
"disabled-of"
|
|
120
|
-
])),
|
|
121
|
-
t.mode === "create" || t.mode === "resetPassword" ? (k(), w("label", L, [T("span", De, j(t.mode === "create" ? "初始密码" : "新密码"), 1), D(M(u), {
|
|
122
|
-
value: t.password,
|
|
123
|
-
type: "password",
|
|
124
|
-
disabled: t.saving,
|
|
125
|
-
placeholder: "请输入密码",
|
|
126
|
-
"allow-clear": "",
|
|
127
|
-
"onUpdate:value": o[2] ||= (e) => r("update:password", e)
|
|
128
|
-
}, null, 8, ["value", "disabled"])])) : C("v-if", !0)
|
|
129
|
-
], 32)),
|
|
130
|
-
t.mode !== "create" && t.mode !== "resetPassword" ? (k(), S(M(l), {
|
|
131
|
-
key: 3,
|
|
132
|
-
record: t.draft
|
|
133
|
-
}, null, 8, ["record"])) : C("v-if", !0)
|
|
134
|
-
], 64)) : C("v-if", !0);
|
|
135
|
-
}
|
|
136
|
-
}), [["__scopeId", "data-v-621edc75"]]);
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/views/userDetailWorkspaceSession.ts
|
|
139
|
-
function ke(e, t) {
|
|
140
|
-
return v(h, e, {
|
|
141
|
-
...t,
|
|
142
|
-
selectedUser: { ...t.selectedUser },
|
|
143
|
-
draft: { ...t.draft },
|
|
144
|
-
tenant: t.tenant ? { ...t.tenant } : void 0
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function Ae(e, t) {
|
|
148
|
-
return g(h, e, t);
|
|
149
|
-
}
|
|
150
|
-
function je(e) {
|
|
151
|
-
return _(h, e);
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/views/userDetailStateModel.ts
|
|
155
|
-
function Me(e) {
|
|
156
|
-
return !e;
|
|
157
|
-
}
|
|
158
|
-
function Ne(e) {
|
|
159
|
-
return e.activeRequestSeq === e.requestSeq && e.selectedUserKey === e.recordId;
|
|
160
|
-
}
|
|
161
|
-
function Pe(e) {
|
|
162
|
-
return e === "edit" ? "edit" : "view";
|
|
163
|
-
}
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region src/views/UserManagementView.vue
|
|
166
|
-
var Fe = /*#__PURE__*/ m(/* @__PURE__ */ O({
|
|
167
|
-
name: "UserManagementView",
|
|
168
|
-
__name: "UserManagementView",
|
|
169
|
-
props: {
|
|
170
|
-
recordId: {},
|
|
171
|
-
mode: {}
|
|
172
|
-
},
|
|
173
|
-
setup(e) {
|
|
174
|
-
let i = e, a = ie({ moduleAlias: "iam.tenant" }), s = ie({ moduleAlias: "iam.user" }), l = ge(), u = pe(), f = A(""), le = A(0), p = A(0), m = A(), g = A(), _ = A(), v = A(!1), y = A("view"), b = A(!1), T = A(!1), E = A(!1), O = A(0), j = A(Y(void 0)), P = A(""), F = A(), I = A(re(void 0)), { expandedUserKeys: Ce, handleUserListLoaded: we, handleUserRowExpand: Te, handleUserSessionBusinessEvent: Ee, loadUserSessions: L, resetUserSessionRows: De, userOnlineStatusTitle: Fe, userSessionState: R } = _e({
|
|
175
|
-
context: s,
|
|
176
|
-
source: "user-management"
|
|
177
|
-
}), Ie = x(() => a), z = x(() => !!i.recordId), B = x(() => z.value && u?.presentation === "drawer"), Le = x(() => !z.value || B.value), V = x(() => l?.value?.system === !0), H = x(() => {
|
|
178
|
-
let e = l?.value?.tenantId;
|
|
179
|
-
if (!(l?.value?.system === !0 || !e)) return {
|
|
180
|
-
id: e,
|
|
181
|
-
title: e,
|
|
182
|
-
alias: e,
|
|
183
|
-
enabled: !0
|
|
184
|
-
};
|
|
185
|
-
}), Re = x(() => et(s, m.value)), ze = x(() => [
|
|
186
|
-
{
|
|
187
|
-
key: "username",
|
|
188
|
-
title: "账号",
|
|
189
|
-
width: "180px"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
key: "onlineStatus",
|
|
193
|
-
title: "在线状态",
|
|
194
|
-
width: "100px",
|
|
195
|
-
align: "center"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
key: "enabled",
|
|
199
|
-
title: "状态",
|
|
200
|
-
type: "enabledStatus",
|
|
201
|
-
width: "90px",
|
|
202
|
-
align: "center"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
key: "passwordStatus",
|
|
206
|
-
title: "密码状态",
|
|
207
|
-
width: "120px"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
key: "employeeNo",
|
|
211
|
-
title: "职员工号",
|
|
212
|
-
width: "150px"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
key: "employeeTitle",
|
|
216
|
-
title: "职员姓名",
|
|
217
|
-
width: "150px"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
key: "lastLoginAt",
|
|
221
|
-
title: "最后登录时间",
|
|
222
|
-
type: "datetime",
|
|
223
|
-
width: "180px"
|
|
224
|
-
}
|
|
225
|
-
]), Be = x(() => !!m.value?.id), Ve = x(() => m.value ? `用户列表 - ${$(m.value)}` : "用户列表"), He = x(() => y.value === "create" ? "新建用户" : Q(_.value ?? j.value)), Ue = x(() => {
|
|
226
|
-
if (y.value !== "create") return Ot(_.value ?? j.value);
|
|
227
|
-
}), U = x(() => {
|
|
228
|
-
if (b.value) return !1;
|
|
229
|
-
if (y.value === "create") return !!m.value?.id && s.can("create") === !0;
|
|
230
|
-
if (y.value === "edit") return !!_.value?.id && s.can("update") === !0;
|
|
231
|
-
if (y.value === "resetPassword") {
|
|
232
|
-
let e = _.value?.id;
|
|
233
|
-
return !!e && s.can("changePassword", e) === !0;
|
|
234
|
-
}
|
|
235
|
-
return !1;
|
|
236
|
-
}), We = x(() => !_.value?.id || b.value ? !1 : s.can(Dt(_.value)) === !0), Ge = x(() => y.value === "view" ? _.value?.id ? [
|
|
237
|
-
{
|
|
238
|
-
key: "edit",
|
|
239
|
-
actionCode: "update",
|
|
240
|
-
title: "编辑",
|
|
241
|
-
iconName: "edit",
|
|
242
|
-
disabled: E.value
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
key: "resetPassword",
|
|
246
|
-
actionCode: "changePassword",
|
|
247
|
-
title: "修改密码",
|
|
248
|
-
iconName: "lock",
|
|
249
|
-
disabled: E.value
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
key: "resetGeneratedPassword",
|
|
253
|
-
actionCode: "resetPassword",
|
|
254
|
-
title: "重置密码",
|
|
255
|
-
iconName: "reload",
|
|
256
|
-
disabled: E.value
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
key: "delete",
|
|
260
|
-
actionCode: "delete",
|
|
261
|
-
title: "删除",
|
|
262
|
-
iconName: "delete",
|
|
263
|
-
danger: !0,
|
|
264
|
-
disabled: E.value
|
|
265
|
-
}
|
|
266
|
-
] : [] : [{
|
|
267
|
-
key: "cancel",
|
|
268
|
-
title: "取消",
|
|
269
|
-
iconName: "close",
|
|
270
|
-
disabled: E.value
|
|
271
|
-
}, {
|
|
272
|
-
key: "save",
|
|
273
|
-
actionCode: y.value === "create" ? "create" : y.value === "resetPassword" ? "changePassword" : "update",
|
|
274
|
-
title: "保存",
|
|
275
|
-
iconName: "save",
|
|
276
|
-
primary: !0,
|
|
277
|
-
loading: E.value,
|
|
278
|
-
disabled: !U.value
|
|
279
|
-
}]), Ke = x(() => Ge.value), qe = x(() => y.value === "view" ? _.value?.id ? [{
|
|
280
|
-
key: "edit",
|
|
281
|
-
actionCode: "update",
|
|
282
|
-
title: "编辑",
|
|
283
|
-
iconName: "edit",
|
|
284
|
-
disabled: E.value
|
|
285
|
-
}] : [] : y.value === "edit" ? [{
|
|
286
|
-
key: "cancel",
|
|
287
|
-
title: "取消",
|
|
288
|
-
iconName: "close",
|
|
289
|
-
disabled: E.value
|
|
290
|
-
}, {
|
|
291
|
-
key: "save",
|
|
292
|
-
actionCode: "update",
|
|
293
|
-
title: "保存",
|
|
294
|
-
iconName: "save",
|
|
295
|
-
primary: !0,
|
|
296
|
-
loading: E.value,
|
|
297
|
-
disabled: !U.value
|
|
298
|
-
}] : []), Je = me({
|
|
299
|
-
view: h,
|
|
300
|
-
input: x(() => {
|
|
301
|
-
let e = _.value?.id, t = y.value;
|
|
302
|
-
return e && (t === "view" || t === "edit") ? { recordId: e } : void 0;
|
|
303
|
-
}),
|
|
304
|
-
title: x(() => Q(_.value)),
|
|
305
|
-
eligibility: x(() => ({
|
|
306
|
-
hasStableIdentity: !!_.value?.id && !b.value,
|
|
307
|
-
busy: E.value
|
|
308
|
-
})),
|
|
309
|
-
beforePromote: async (e) => {
|
|
310
|
-
let t = _.value;
|
|
311
|
-
if (t) return await ke(e, {
|
|
312
|
-
selectedUser: t,
|
|
313
|
-
draft: j.value,
|
|
314
|
-
tenant: m.value,
|
|
315
|
-
mode: y.value === "edit" ? "edit" : "view",
|
|
316
|
-
password: P.value,
|
|
317
|
-
resetPasswordResult: F.value
|
|
318
|
-
}) === "accepted";
|
|
319
|
-
},
|
|
320
|
-
onPromoted: G
|
|
321
|
-
});
|
|
322
|
-
xe(_, (e) => {
|
|
323
|
-
!z.value || !e || u?.setTitle(Q(e));
|
|
324
|
-
}, { immediate: !0 });
|
|
325
|
-
let Ye = x(() => ({
|
|
326
|
-
username: {
|
|
327
|
-
label: "账号",
|
|
328
|
-
required: !0,
|
|
329
|
-
visible: !0,
|
|
330
|
-
placeholder: "请输入登录账号"
|
|
331
|
-
},
|
|
332
|
-
enabled: {
|
|
333
|
-
label: "允许登录",
|
|
334
|
-
visible: !0,
|
|
335
|
-
controlType: "enabledStatus"
|
|
336
|
-
}
|
|
337
|
-
})), Xe = x(() => ["username", "enabled"]), Ze;
|
|
338
|
-
be(() => {
|
|
339
|
-
if ($e(), i.recordId) {
|
|
340
|
-
let e = { recordId: i.recordId };
|
|
341
|
-
B.value || (Ze = Ae(e, Qe));
|
|
342
|
-
let t = je(e);
|
|
343
|
-
if (t) {
|
|
344
|
-
bt(t);
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
W({ id: i.recordId }, i.mode ?? "view");
|
|
348
|
-
}
|
|
349
|
-
}), ye(() => Ze?.());
|
|
350
|
-
function Qe(e) {
|
|
351
|
-
return y.value === "view" ? (bt(e), !0) : !1;
|
|
352
|
-
}
|
|
353
|
-
he(Ee), xe(H, rt, { immediate: !0 }), xe(m, () => {
|
|
354
|
-
z.value || (g.value = void 0, _.value = void 0, De(), j.value = Y(m.value), G(), p.value += 1);
|
|
355
|
-
});
|
|
356
|
-
async function $e() {
|
|
357
|
-
try {
|
|
358
|
-
I.value = re((await s.runtime.ready).uiDescriptor);
|
|
359
|
-
} catch (e) {
|
|
360
|
-
n(e, {
|
|
361
|
-
source: "user-management",
|
|
362
|
-
phase: "load"
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function et(e, t) {
|
|
367
|
-
return {
|
|
368
|
-
...e,
|
|
369
|
-
crud: {
|
|
370
|
-
...e.crud,
|
|
371
|
-
query: (n) => e.crud.query(tt(n, t))
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
function tt(e, t) {
|
|
376
|
-
let n = [...e?.conditions ?? []];
|
|
377
|
-
return t?.id && n.push({
|
|
378
|
-
fieldName: "tenantId",
|
|
379
|
-
operator: "EQ",
|
|
380
|
-
values: [t.id]
|
|
381
|
-
}), {
|
|
382
|
-
...e,
|
|
383
|
-
conditions: n
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
function nt(e) {
|
|
387
|
-
!V.value || m.value || e.length > 0 && it(e[0]);
|
|
388
|
-
}
|
|
389
|
-
function rt(e = H.value) {
|
|
390
|
-
z.value || !e || V.value || m.value || (m.value = e);
|
|
391
|
-
}
|
|
392
|
-
function it(e) {
|
|
393
|
-
K() && (m.value = e);
|
|
394
|
-
}
|
|
395
|
-
function at(e) {
|
|
396
|
-
e.key === "create" && ct();
|
|
397
|
-
}
|
|
398
|
-
function ot(e, t) {
|
|
399
|
-
if (K()) {
|
|
400
|
-
if (e.key === "view") {
|
|
401
|
-
W(t, "view");
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
if (e.key === "edit") {
|
|
405
|
-
W(t, "edit");
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
e.key === "delete" && yt(t);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function st(e) {
|
|
412
|
-
K() && W(e, "view");
|
|
413
|
-
}
|
|
414
|
-
function ct() {
|
|
415
|
-
if (K()) {
|
|
416
|
-
if (!m.value?.id) {
|
|
417
|
-
t("请先选择租户", { phase: "validation" });
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
_.value = void 0, g.value = void 0, j.value = Y(m.value), P.value = "", y.value = "create", b.value = !1, T.value = !1, O.value += 1, v.value = !0;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
async function W(e, r) {
|
|
424
|
-
if (!K()) return;
|
|
425
|
-
let i = String(e.id ?? "");
|
|
426
|
-
if (!i) return;
|
|
427
|
-
g.value = i, v.value = !0, y.value = r, _.value = void 0, j.value = X(e), P.value = "", F.value = void 0, b.value = !0, T.value = !1;
|
|
428
|
-
let a = O.value + 1;
|
|
429
|
-
O.value = a;
|
|
430
|
-
try {
|
|
431
|
-
let e = await s.crud.view(i);
|
|
432
|
-
if (!q(i, a)) return;
|
|
433
|
-
if (!e?.id) {
|
|
434
|
-
T.value = !0, t("未找到指定用户", {
|
|
435
|
-
source: "user-management",
|
|
436
|
-
phase: "load"
|
|
437
|
-
});
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
let n = await lt(i);
|
|
441
|
-
if (!q(i, a)) return;
|
|
442
|
-
J({
|
|
443
|
-
...e,
|
|
444
|
-
...n
|
|
445
|
-
}, r);
|
|
446
|
-
} catch (e) {
|
|
447
|
-
q(i, a) && (T.value = !0, n(e, {
|
|
448
|
-
source: "user-management",
|
|
449
|
-
phase: "load"
|
|
450
|
-
}));
|
|
451
|
-
} finally {
|
|
452
|
-
q(i, a) && (b.value = !1);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
function lt(e) {
|
|
456
|
-
return Se().request({ path: `/iam.user/${encodeURIComponent(e)}/employee-binding` });
|
|
457
|
-
}
|
|
458
|
-
function G() {
|
|
459
|
-
E.value || (O.value += 1, b.value = !1, T.value = !1, v.value = !1, y.value = "view", P.value = "", F.value = void 0, j.value = _.value ? X(_.value) : Y(m.value), B.value && u?.dismiss());
|
|
460
|
-
}
|
|
461
|
-
function ut() {
|
|
462
|
-
if (!E.value) {
|
|
463
|
-
if (!_.value?.id || y.value === "create") {
|
|
464
|
-
G();
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
j.value = X(_.value), P.value = "", F.value = void 0, y.value = "view", b.value = !1, T.value = !1;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
function dt(e) {
|
|
471
|
-
if (e.key === "cancel") {
|
|
472
|
-
ut();
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
if (e.key === "save") {
|
|
476
|
-
pt();
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
if (K()) {
|
|
480
|
-
if (e.key === "edit" && _.value) {
|
|
481
|
-
j.value = X(_.value), y.value = "edit";
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
if (e.key === "resetPassword" && _.value) {
|
|
485
|
-
P.value = "", F.value = void 0, y.value = "resetPassword";
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
if (e.key === "resetGeneratedPassword" && _.value) {
|
|
489
|
-
ht();
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
e.key === "delete" && yt(_.value);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
function ft() {
|
|
496
|
-
let e = String(j.value.id ?? g.value ?? "");
|
|
497
|
-
if (!e) return;
|
|
498
|
-
let t = y.value === "create" ? "view" : y.value;
|
|
499
|
-
W({
|
|
500
|
-
...j.value,
|
|
501
|
-
id: e
|
|
502
|
-
}, t);
|
|
503
|
-
}
|
|
504
|
-
async function pt() {
|
|
505
|
-
if (y.value === "resetPassword") {
|
|
506
|
-
await mt();
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
await ce({
|
|
510
|
-
loading: E,
|
|
511
|
-
mode: y.value === "edit" ? "edit" : "create",
|
|
512
|
-
source: "user-management",
|
|
513
|
-
validateContext: () => y.value === "create" && !m.value?.id ? "请先选择租户" : void 0,
|
|
514
|
-
canSave: () => U.value,
|
|
515
|
-
deniedMessage: "当前用户无权保存用户",
|
|
516
|
-
createRecord: () => Ct(j.value, m.value, y.value, P.value),
|
|
517
|
-
validateRecord: wt,
|
|
518
|
-
save: (e, t) => t === "edit" && _.value?.id ? s.crud.update(_.value.id, e) : s.crud.insert(e),
|
|
519
|
-
onSaved: ({ record: e }) => {
|
|
520
|
-
J(e), p.value += 1;
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
async function mt() {
|
|
525
|
-
await d({
|
|
526
|
-
loading: E,
|
|
527
|
-
source: "user-management",
|
|
528
|
-
record: () => _.value?.id ? _.value : void 0,
|
|
529
|
-
canExecute: () => U.value,
|
|
530
|
-
deniedMessage: "当前用户无权重置用户密码",
|
|
531
|
-
execute: (e) => s.http.request({
|
|
532
|
-
method: "POST",
|
|
533
|
-
path: `/iam.user/changePassword/${encodeURIComponent(e.id)}`,
|
|
534
|
-
body: { password: P.value }
|
|
535
|
-
}),
|
|
536
|
-
onExecuted: async (e, t) => {
|
|
537
|
-
J(await s.crud.view(t.id)), p.value += 1;
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
async function ht() {
|
|
542
|
-
await d({
|
|
543
|
-
loading: E,
|
|
544
|
-
source: "user-management",
|
|
545
|
-
record: () => _.value?.id ? _.value : void 0,
|
|
546
|
-
canExecute: (e) => s.can("resetPassword", e.id) === !0,
|
|
547
|
-
deniedMessage: "当前用户无权重置用户密码",
|
|
548
|
-
execute: (e) => s.http.request({
|
|
549
|
-
method: "POST",
|
|
550
|
-
path: `/iam.user/resetPassword/${encodeURIComponent(e.id)}`
|
|
551
|
-
}),
|
|
552
|
-
onExecuted: async (e, t) => {
|
|
553
|
-
J(await s.crud.view(t.id)), F.value = e, p.value += 1;
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
async function gt(e, t) {
|
|
558
|
-
await d({
|
|
559
|
-
loading: E,
|
|
560
|
-
source: "user-management",
|
|
561
|
-
record: () => e?.id ? e : void 0,
|
|
562
|
-
canExecute: (e) => s.can("revokeSession", e.id) === !0 && !t.current,
|
|
563
|
-
deniedMessage: "当前用户无权下线该登录会话",
|
|
564
|
-
confirm: (e) => c({
|
|
565
|
-
title: "下线登录会话",
|
|
566
|
-
content: `确认下线用户「${Z(e)}」的该登录会话?`,
|
|
567
|
-
okText: "下线",
|
|
568
|
-
danger: !0
|
|
569
|
-
}),
|
|
570
|
-
execute: (e) => s.http.request({
|
|
571
|
-
method: "POST",
|
|
572
|
-
path: `/iam.user/${encodeURIComponent(e.id)}/sessions/${encodeURIComponent(t.id)}/revoke`
|
|
573
|
-
}),
|
|
574
|
-
onExecuted: (e, t) => {
|
|
575
|
-
L(t.id), p.value += 1;
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
async function _t(e) {
|
|
580
|
-
let n = xt(String(e.id ?? "")).map((e) => e.id);
|
|
581
|
-
if (n.length === 0) {
|
|
582
|
-
t("当前没有可下线的登录会话", {
|
|
583
|
-
source: "user-management",
|
|
584
|
-
phase: "validation"
|
|
585
|
-
});
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
await d({
|
|
589
|
-
loading: E,
|
|
590
|
-
source: "user-management",
|
|
591
|
-
record: () => e?.id ? e : void 0,
|
|
592
|
-
canExecute: (e) => s.can("revokeSessions", e.id) === !0,
|
|
593
|
-
deniedMessage: "当前用户无权批量下线登录会话",
|
|
594
|
-
confirm: (e) => c({
|
|
595
|
-
title: "批量下线登录会话",
|
|
596
|
-
content: `确认下线用户「${Z(e)}」的 ${n.length} 个登录会话?`,
|
|
597
|
-
okText: "全部下线",
|
|
598
|
-
danger: !0
|
|
599
|
-
}),
|
|
600
|
-
execute: (e) => s.http.request({
|
|
601
|
-
method: "POST",
|
|
602
|
-
path: `/iam.user/${encodeURIComponent(e.id)}/sessions/revoke`,
|
|
603
|
-
body: { sessionIds: n }
|
|
604
|
-
}),
|
|
605
|
-
onExecuted: (e, t) => {
|
|
606
|
-
L(t.id), p.value += 1;
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
async function vt() {
|
|
611
|
-
await d({
|
|
612
|
-
loading: E,
|
|
613
|
-
source: "user-management",
|
|
614
|
-
record: () => _.value?.id ? _.value : void 0,
|
|
615
|
-
canExecute: () => We.value,
|
|
616
|
-
deniedMessage: "当前用户无权变更用户启停状态",
|
|
617
|
-
execute: (e) => e.enabled === !1 ? s.crud.enable(e.id, { version: e.version }) : s.crud.disable(e.id, { version: e.version }),
|
|
618
|
-
onExecuted: async (e, t) => {
|
|
619
|
-
J(await s.crud.view(t.id)), p.value += 1;
|
|
620
|
-
}
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
async function yt(e) {
|
|
624
|
-
await d({
|
|
625
|
-
loading: E,
|
|
626
|
-
source: "user-management",
|
|
627
|
-
record: () => e?.id ? e : void 0,
|
|
628
|
-
canExecute: () => s.can("delete") === !0,
|
|
629
|
-
deniedMessage: "当前用户无权删除用户",
|
|
630
|
-
confirm: (e) => c({
|
|
631
|
-
title: "删除用户",
|
|
632
|
-
content: `确认删除用户「${Z(e)}」?`,
|
|
633
|
-
okText: "删除",
|
|
634
|
-
danger: !0
|
|
635
|
-
}),
|
|
636
|
-
execute: (e) => s.crud.delete(String(e.id), { version: e.version }),
|
|
637
|
-
onExecuted: (e, t) => {
|
|
638
|
-
g.value === String(t.id) && (g.value = void 0, _.value = void 0, j.value = Y(m.value), v.value = !1, y.value = "view", b.value = !1, T.value = !1, O.value += 1), p.value += 1;
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
function K() {
|
|
643
|
-
return Me(E.value);
|
|
644
|
-
}
|
|
645
|
-
function q(e, t) {
|
|
646
|
-
return Ne({
|
|
647
|
-
activeRequestSeq: O.value,
|
|
648
|
-
requestSeq: t,
|
|
649
|
-
selectedUserKey: g.value,
|
|
650
|
-
recordId: e
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
function J(e, t = "view") {
|
|
654
|
-
return _.value = e, g.value = e.id, j.value = X(e), P.value = "", y.value = Pe(t), v.value = !0, b.value = !1, T.value = !1, O.value += 1, O.value;
|
|
655
|
-
}
|
|
656
|
-
function bt(e) {
|
|
657
|
-
_.value = e.selectedUser, g.value = e.selectedUser.id, m.value = e.tenant, j.value = e.draft, y.value = e.mode, P.value = e.password, F.value = e.resetPasswordResult, v.value = !0, b.value = !1, T.value = !1, O.value += 1;
|
|
658
|
-
}
|
|
659
|
-
function xt(e) {
|
|
660
|
-
return !e || s.can("revokeSession", e) !== !0 ? [] : R(e).records.filter((e) => !e.current);
|
|
661
|
-
}
|
|
662
|
-
function St(e, t) {
|
|
663
|
-
return !!e && !t.current && s.can("revokeSession", e) === !0;
|
|
664
|
-
}
|
|
665
|
-
function Y(e) {
|
|
666
|
-
return {
|
|
667
|
-
tenantId: e?.id,
|
|
668
|
-
enabled: !0
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
function X(e) {
|
|
672
|
-
return {
|
|
673
|
-
...e,
|
|
674
|
-
password: void 0
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
function Ct(e, t, n, r) {
|
|
678
|
-
return ae(e, {
|
|
679
|
-
tenantId: t?.id ?? e.tenantId,
|
|
680
|
-
username: e.username?.trim(),
|
|
681
|
-
enabled: e.enabled !== !1,
|
|
682
|
-
password: n === "create" ? r.trim() : void 0
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
function wt(e) {
|
|
686
|
-
for (let t of ["username"]) {
|
|
687
|
-
let n = ne(t, {
|
|
688
|
-
fields: I.value,
|
|
689
|
-
fallback: Ye.value
|
|
690
|
-
});
|
|
691
|
-
if (n.visible && n.required && !e[t]) return `请填写${n.label}`;
|
|
692
|
-
}
|
|
693
|
-
if (y.value === "create" && !e.password) return "请填写初始密码";
|
|
694
|
-
if (y.value === "resetPassword" && !P.value.trim()) return "请填写新密码";
|
|
695
|
-
}
|
|
696
|
-
function Tt(e) {
|
|
697
|
-
return e === "username" && y.value === "edit";
|
|
698
|
-
}
|
|
699
|
-
function Et(e, t) {
|
|
700
|
-
j.value = {
|
|
701
|
-
...j.value,
|
|
702
|
-
[e]: t
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
function Dt(e) {
|
|
706
|
-
return e.enabled === !1 ? "enable" : "disable";
|
|
707
|
-
}
|
|
708
|
-
function Z(e) {
|
|
709
|
-
return String(e?.username ?? e?.id ?? "用户");
|
|
710
|
-
}
|
|
711
|
-
function Q(e) {
|
|
712
|
-
return Z(e);
|
|
713
|
-
}
|
|
714
|
-
function Ot(e) {
|
|
715
|
-
let t = String(e?.employeeTitle ?? "").trim();
|
|
716
|
-
return t ? `职员:${t}` : "未关联职员";
|
|
717
|
-
}
|
|
718
|
-
function $(e) {
|
|
719
|
-
return String(e?.title ?? e?.alias ?? e?.id ?? "未命名租户");
|
|
720
|
-
}
|
|
721
|
-
let kt = () => void 0;
|
|
722
|
-
function At(e) {
|
|
723
|
-
return {
|
|
724
|
-
title: $(e),
|
|
725
|
-
secondary: e.alias ?? e.id,
|
|
726
|
-
muted: e.enabled === !1
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
return (e, t) => (k(), w("section", { class: ve(["user-management-page", { "user-management-page--task": z.value && !B.value }]) }, [
|
|
730
|
-
!z.value || B.value ? (k(), S(M(ee), {
|
|
731
|
-
key: 0,
|
|
732
|
-
class: "user-scope-panel",
|
|
733
|
-
title: "租户",
|
|
734
|
-
"refresh-title": "刷新租户列表",
|
|
735
|
-
"search-keyword": f.value,
|
|
736
|
-
"search-placeholder": "搜索租户名称、alias 或 ID",
|
|
737
|
-
searchable: V.value,
|
|
738
|
-
onRefresh: t[2] ||= (e) => V.value ? le.value += 1 : rt(),
|
|
739
|
-
"onUpdate:searchKeyword": t[3] ||= (e) => f.value = e
|
|
740
|
-
}, {
|
|
741
|
-
default: N(() => [!V.value && H.value ? (k(), w("button", {
|
|
742
|
-
key: 0,
|
|
743
|
-
class: "user-scope-entry",
|
|
744
|
-
type: "button",
|
|
745
|
-
onClick: t[0] ||= (e) => it(H.value)
|
|
746
|
-
}, [D(M(te), {
|
|
747
|
-
title: $(H.value),
|
|
748
|
-
secondary: "当前租户",
|
|
749
|
-
clickable: "",
|
|
750
|
-
selected: m.value?.id === H.value.id
|
|
751
|
-
}, null, 8, ["title", "selected"])])) : C("v-if", !0), V.value ? (k(), S(M(se), {
|
|
752
|
-
key: 1,
|
|
753
|
-
context: Ie.value,
|
|
754
|
-
"selected-id": m.value?.id,
|
|
755
|
-
"reload-key": le.value,
|
|
756
|
-
keyword: f.value,
|
|
757
|
-
"empty-description": "暂无租户",
|
|
758
|
-
"loading-tip": "加载租户列表",
|
|
759
|
-
"fallback-title": "未命名租户",
|
|
760
|
-
"item-of": At,
|
|
761
|
-
onLoaded: nt,
|
|
762
|
-
onSelect: t[1] ||= (e) => it(e)
|
|
763
|
-
}, null, 8, [
|
|
764
|
-
"context",
|
|
765
|
-
"selected-id",
|
|
766
|
-
"reload-key",
|
|
767
|
-
"keyword"
|
|
768
|
-
])) : C("v-if", !0)]),
|
|
769
|
-
_: 1
|
|
770
|
-
}, 8, ["search-keyword", "searchable"])) : C("v-if", !0),
|
|
771
|
-
!z.value || B.value ? (k(), S(M(de), {
|
|
772
|
-
key: 1,
|
|
773
|
-
class: "user-list-panel",
|
|
774
|
-
context: Re.value,
|
|
775
|
-
title: Ve.value,
|
|
776
|
-
columns: ze.value,
|
|
777
|
-
"standard-crud-actions": "",
|
|
778
|
-
"standard-crud-row-actions": "",
|
|
779
|
-
"selected-key": g.value,
|
|
780
|
-
"expanded-row-keys": M(Ce),
|
|
781
|
-
"cell-renderers": { onlineStatus: M(Fe) },
|
|
782
|
-
"reload-key": p.value,
|
|
783
|
-
ready: Be.value,
|
|
784
|
-
"quick-search-placeholder": "搜索账号",
|
|
785
|
-
"empty-description": "当前租户暂无账号",
|
|
786
|
-
"waiting-description": "请选择租户",
|
|
787
|
-
onAction: at,
|
|
788
|
-
onRowAction: ot,
|
|
789
|
-
onRowDblclick: st,
|
|
790
|
-
onRowExpand: M(Te),
|
|
791
|
-
onLoaded: M(we),
|
|
792
|
-
onSelect: t[4] ||= (e) => g.value = String(e.id ?? "")
|
|
793
|
-
}, {
|
|
794
|
-
expandedRow: N(({ record: e }) => [D(M(fe), {
|
|
795
|
-
sessions: M(R)(String(e.id ?? "")).records,
|
|
796
|
-
loading: M(R)(String(e.id ?? "")).loading,
|
|
797
|
-
error: M(R)(String(e.id ?? "")).error,
|
|
798
|
-
"actions-disabled": E.value,
|
|
799
|
-
"can-revoke": (t) => St(String(e.id ?? ""), t),
|
|
800
|
-
"can-revoke-all": xt(String(e.id ?? "")).length > 1,
|
|
801
|
-
onRefresh: (t) => M(L)(String(e.id ?? "")),
|
|
802
|
-
onRevoke: (t) => gt(e, t),
|
|
803
|
-
onRevokeAll: (t) => _t(e)
|
|
804
|
-
}, null, 8, [
|
|
805
|
-
"sessions",
|
|
806
|
-
"loading",
|
|
807
|
-
"error",
|
|
808
|
-
"actions-disabled",
|
|
809
|
-
"can-revoke",
|
|
810
|
-
"can-revoke-all",
|
|
811
|
-
"onRefresh",
|
|
812
|
-
"onRevoke",
|
|
813
|
-
"onRevokeAll"
|
|
814
|
-
])]),
|
|
815
|
-
_: 1
|
|
816
|
-
}, 8, [
|
|
817
|
-
"context",
|
|
818
|
-
"title",
|
|
819
|
-
"columns",
|
|
820
|
-
"selected-key",
|
|
821
|
-
"expanded-row-keys",
|
|
822
|
-
"cell-renderers",
|
|
823
|
-
"reload-key",
|
|
824
|
-
"ready",
|
|
825
|
-
"onRowExpand",
|
|
826
|
-
"onLoaded"
|
|
827
|
-
])) : C("v-if", !0),
|
|
828
|
-
Le.value ? (k(), S(M(oe), {
|
|
829
|
-
key: 2,
|
|
830
|
-
open: v.value,
|
|
831
|
-
title: He.value,
|
|
832
|
-
subtitle: Ue.value,
|
|
833
|
-
"close-on-outside": y.value === "view",
|
|
834
|
-
promotion: M(Je),
|
|
835
|
-
onClose: G
|
|
836
|
-
}, {
|
|
837
|
-
status: N(() => [y.value === "view" && _.value ? (k(), S(M(o), {
|
|
838
|
-
key: 0,
|
|
839
|
-
enabled: _.value.enabled !== !1,
|
|
840
|
-
disabled: E.value || !We.value,
|
|
841
|
-
loading: E.value,
|
|
842
|
-
"show-label": !1,
|
|
843
|
-
onChange: vt
|
|
844
|
-
}, null, 8, [
|
|
845
|
-
"enabled",
|
|
846
|
-
"disabled",
|
|
847
|
-
"loading"
|
|
848
|
-
])) : C("v-if", !0)]),
|
|
849
|
-
operation: N(() => [D(M(ue), {
|
|
850
|
-
context: Re.value,
|
|
851
|
-
actions: Ke.value,
|
|
852
|
-
"record-id": _.value?.id,
|
|
853
|
-
onAction: dt
|
|
854
|
-
}, null, 8, [
|
|
855
|
-
"context",
|
|
856
|
-
"actions",
|
|
857
|
-
"record-id"
|
|
858
|
-
])]),
|
|
859
|
-
default: N(() => [D(Oe, {
|
|
860
|
-
mode: y.value,
|
|
861
|
-
draft: j.value,
|
|
862
|
-
"selected-user": _.value,
|
|
863
|
-
loading: b.value,
|
|
864
|
-
"load-failed": T.value,
|
|
865
|
-
saving: E.value || b.value,
|
|
866
|
-
"tenant-title": $(m.value),
|
|
867
|
-
fields: I.value,
|
|
868
|
-
fallback: Ye.value,
|
|
869
|
-
"field-names": Xe.value,
|
|
870
|
-
password: P.value,
|
|
871
|
-
"reset-password-result": F.value,
|
|
872
|
-
"display-of": kt,
|
|
873
|
-
"disabled-of": Tt,
|
|
874
|
-
onRetry: ft,
|
|
875
|
-
onSave: pt,
|
|
876
|
-
"onUpdate:field": Et,
|
|
877
|
-
"onUpdate:password": t[5] ||= (e) => P.value = e
|
|
878
|
-
}, null, 8, [
|
|
879
|
-
"mode",
|
|
880
|
-
"draft",
|
|
881
|
-
"selected-user",
|
|
882
|
-
"loading",
|
|
883
|
-
"load-failed",
|
|
884
|
-
"saving",
|
|
885
|
-
"tenant-title",
|
|
886
|
-
"fields",
|
|
887
|
-
"fallback",
|
|
888
|
-
"field-names",
|
|
889
|
-
"password",
|
|
890
|
-
"reset-password-result"
|
|
891
|
-
])]),
|
|
892
|
-
_: 1
|
|
893
|
-
}, 8, [
|
|
894
|
-
"open",
|
|
895
|
-
"title",
|
|
896
|
-
"subtitle",
|
|
897
|
-
"close-on-outside",
|
|
898
|
-
"promotion"
|
|
899
|
-
])) : (k(), S(M(r), {
|
|
900
|
-
key: 3,
|
|
901
|
-
title: He.value,
|
|
902
|
-
subtitle: Ue.value
|
|
903
|
-
}, {
|
|
904
|
-
status: N(() => [y.value === "view" && _.value ? (k(), S(M(o), {
|
|
905
|
-
key: 0,
|
|
906
|
-
enabled: _.value.enabled !== !1,
|
|
907
|
-
disabled: E.value || !We.value,
|
|
908
|
-
loading: E.value,
|
|
909
|
-
"show-label": !1,
|
|
910
|
-
onChange: vt
|
|
911
|
-
}, null, 8, [
|
|
912
|
-
"enabled",
|
|
913
|
-
"disabled",
|
|
914
|
-
"loading"
|
|
915
|
-
])) : C("v-if", !0)]),
|
|
916
|
-
operation: N(() => [D(M(ue), {
|
|
917
|
-
context: M(s),
|
|
918
|
-
actions: qe.value,
|
|
919
|
-
"record-id": _.value?.id,
|
|
920
|
-
onAction: dt
|
|
921
|
-
}, null, 8, [
|
|
922
|
-
"context",
|
|
923
|
-
"actions",
|
|
924
|
-
"record-id"
|
|
925
|
-
])]),
|
|
926
|
-
default: N(() => [D(Oe, {
|
|
927
|
-
mode: y.value,
|
|
928
|
-
draft: j.value,
|
|
929
|
-
"selected-user": _.value,
|
|
930
|
-
loading: b.value,
|
|
931
|
-
"load-failed": T.value,
|
|
932
|
-
saving: E.value || b.value,
|
|
933
|
-
"tenant-title": $(m.value ?? { id: j.value.tenantId }),
|
|
934
|
-
fields: I.value,
|
|
935
|
-
fallback: Ye.value,
|
|
936
|
-
"field-names": Xe.value,
|
|
937
|
-
password: P.value,
|
|
938
|
-
"reset-password-result": F.value,
|
|
939
|
-
"display-of": kt,
|
|
940
|
-
"disabled-of": Tt,
|
|
941
|
-
onRetry: ft,
|
|
942
|
-
onSave: pt,
|
|
943
|
-
"onUpdate:field": Et,
|
|
944
|
-
"onUpdate:password": t[6] ||= (e) => P.value = e
|
|
945
|
-
}, null, 8, [
|
|
946
|
-
"mode",
|
|
947
|
-
"draft",
|
|
948
|
-
"selected-user",
|
|
949
|
-
"loading",
|
|
950
|
-
"load-failed",
|
|
951
|
-
"saving",
|
|
952
|
-
"tenant-title",
|
|
953
|
-
"fields",
|
|
954
|
-
"fallback",
|
|
955
|
-
"field-names",
|
|
956
|
-
"password",
|
|
957
|
-
"reset-password-result"
|
|
958
|
-
])]),
|
|
959
|
-
_: 1
|
|
960
|
-
}, 8, ["title", "subtitle"]))
|
|
961
|
-
], 2));
|
|
962
|
-
}
|
|
963
|
-
}), [["__scopeId", "data-v-9f0f413a"]]);
|
|
964
|
-
//#endregion
|
|
965
|
-
export { Se as n, Fe as t };
|