@ximatai/muyun-web-app 0.26.12 → 0.26.13
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/BusinessActivityLogView-UC4rH4Fn.js +16 -0
- package/dist/BusinessLogListDrawer-BtaXVJKz.js +564 -0
- package/dist/LoginAuditLogView-Cjrp8MKX.js +16 -0
- package/dist/{ModuleActionManagementView-BHEooZ5L.js → ModuleActionManagementView-Dkb35QXc.js} +139 -138
- package/dist/{ModuleGovernanceView-DB3TWlMy.js → ModuleGovernanceView-Dx43QvGf.js} +2878 -2748
- package/dist/RequestErrorLogView-WnGvMWiF.js +16 -0
- package/dist/RoleDetailWorkspaceView-DPDb_QOn.js +1397 -0
- package/dist/RuntimeLogView-BRl4ZDkU.js +330 -0
- package/dist/http-B0TC0pJB.js +157 -0
- package/dist/index.css +1 -1
- package/dist/index.js +505 -475
- package/dist/{moduleGovernanceWorkspaceView-C5pqJOEJ.js → moduleGovernanceWorkspaceView-4V_UW-Bt.js} +2 -2
- package/dist/platform-components-1cvOeHmo.js +17854 -0
- package/dist/platform-workbench-Cu14Xd9d.js +10299 -0
- package/dist/types/consumer/index.d.ts +7 -0
- package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +2208 -0
- package/dist/types/dynamic-page-runtime/ModulePageBusinessState.vue.d.ts +11 -0
- package/dist/types/dynamic-page-runtime/ModulePageHost.vue.d.ts +20 -4
- package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +4431 -0
- package/dist/types/dynamic-page-runtime/ModulePageHostSession.vue.d.ts +43 -0
- package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +3 -0
- package/dist/types/dynamic-page-runtime/ModuleReferenceRecordDetailBrowser.vue.d.ts +42 -0
- package/dist/types/dynamic-page-runtime/RecordFormSurface.vue.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/TenantScopeExplorer.vue.d.ts +21 -0
- package/dist/types/dynamic-page-runtime/composables/useModulePageActions.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailActionRuntime.d.ts +5 -0
- package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +1 -0
- package/dist/types/dynamic-page-runtime/formActionResult.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/index.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/inputValidationActionStatus.d.ts +20 -0
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +7 -3
- package/dist/types/dynamic-page-runtime/modulePageUnsavedState.d.ts +10 -0
- package/dist/types/dynamic-page-runtime/recordDetailController.d.ts +1 -0
- package/dist/types/dynamic-page-runtime/recordMutationPayload.d.ts +3 -2
- package/dist/types/dynamic-page-runtime/referenceRecordProjection.d.ts +6 -0
- package/dist/types/dynamic-page-runtime/sessionViewBindings.d.ts +3 -0
- package/dist/types/dynamic-page-runtime/sourceReferencePickerConfig.d.ts +26 -0
- package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +1728 -0
- package/dist/types/dynamic-page-runtime/useTenantScopeController.d.ts +18 -0
- package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +5 -0
- package/dist/types/platform-admin-runtime/role/roleScopeSelectionClient.d.ts +52 -0
- package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +5 -2
- package/dist/types/platform-components/DictionaryOptionDialog.vue.d.ts +37 -0
- package/dist/types/platform-components/DictionaryOptionDialogChoiceList.vue.d.ts +21 -0
- package/dist/types/platform-components/DictionaryPicker.vue.d.ts +47 -0
- package/dist/types/platform-components/DictionaryRadioGroup.vue.d.ts +20 -0
- package/dist/types/platform-components/EmployeePicker.vue.d.ts +40 -0
- package/dist/types/platform-components/FileTransferUploader.vue.d.ts +1 -1
- package/dist/types/platform-components/ObjectPickerInput.vue.d.ts +34 -0
- package/dist/types/platform-components/QueryCriteriaComposer.vue.d.ts +29 -0
- package/dist/types/platform-components/QueryCriteriaGroupEditor.vue.d.ts +36 -0
- package/dist/types/platform-components/QueryValueEditor.vue.d.ts +33 -0
- package/dist/types/platform-components/ReadonlyReferenceValue.vue.d.ts +11 -0
- package/dist/types/platform-components/RecordContentSectionHeading.vue.d.ts +4 -2
- package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +8 -3
- package/dist/types/platform-components/RecordDetailExtensionSection.vue.d.ts +7 -3
- package/dist/types/platform-components/RecordDetailFields.vue.d.ts +3 -5
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +5 -5
- package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +11 -3
- package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +2 -2
- package/dist/types/platform-components/RecordPicker.vue.d.ts +2 -2
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +18 -4
- package/dist/types/platform-components/RecordQueryListSurface.vue.d.ts +20 -0
- package/dist/types/platform-components/ReferencePicker.vue.d.ts +47 -0
- package/dist/types/platform-components/ReferenceRecordDetailBrowser.vue.d.ts +55 -0
- package/dist/types/platform-components/ScopedTreePicker.vue.d.ts +31 -0
- package/dist/types/platform-components/UserPicker.vue.d.ts +47 -0
- package/dist/types/platform-components/dictionaryOptionDialogModel.d.ts +23 -0
- package/dist/types/platform-components/employeePickerModel.d.ts +19 -0
- package/dist/types/platform-components/identityPickerModel.d.ts +18 -0
- package/dist/types/platform-components/index.d.ts +28 -1
- package/dist/types/platform-components/optionFieldOptionCache.d.ts +1 -1
- package/dist/types/platform-components/queryCriteriaDraft.d.ts +24 -0
- package/dist/types/platform-components/queryReferencePickerProvider.d.ts +19 -0
- package/dist/types/platform-components/readonlyReferenceDisplay.d.ts +19 -0
- package/dist/types/platform-components/recordEditorSessionState.d.ts +11 -4
- package/dist/types/platform-components/recordFormFieldModel.d.ts +28 -2
- package/dist/types/platform-components/recordQueryListColumnModel.d.ts +3 -1
- package/dist/types/platform-components/referencePickerModel.d.ts +103 -0
- package/dist/types/platform-components/referencePickerReadError.d.ts +24 -0
- package/dist/types/platform-components/referenceRecordDetailBrowser.d.ts +48 -0
- package/dist/types/platform-components/scopedTreePickerModel.d.ts +46 -0
- package/dist/types/platform-components/sourceReferencePickerProvider.d.ts +26 -0
- package/dist/types/platform-components/staticCrudManagementState.d.ts +7 -6
- package/dist/types/platform-components/userPickerModel.d.ts +45 -0
- package/dist/types/platform-components/userReferencePicker.d.ts +17 -0
- package/dist/types/platform-workbench/useWorkspaceViewUnsavedState.d.ts +1 -1
- package/dist/types/platform-workbench/workspaceViewHost.d.ts +1 -1
- package/dist/types/platform-workbench/workspaceViewUnsavedState.d.ts +3 -1
- package/dist/types/views/BusinessActivityLogView.vue.d.ts +3 -0
- package/dist/types/views/BusinessLogListDrawer.vue.d.ts +9 -0
- package/dist/types/views/LoginAuditLogView.vue.d.ts +3 -0
- package/dist/types/views/RequestErrorLogView.vue.d.ts +3 -0
- package/dist/types/views/RuntimeLogView.vue.d.ts +3 -0
- package/dist/types/views/businessLogClient.d.ts +85 -0
- package/dist/types/views/dictionaryRadioEligibility.d.ts +18 -0
- package/dist/types/views/dictionaryRadioFactRequestEpoch.d.ts +10 -0
- package/dist/types/views/metadataModelEditSession.d.ts +10 -1
- package/dist/types/views/pageCompositionDraftState.d.ts +29 -0
- package/dist/types/views/roleDetailWorkspaceSession.d.ts +1 -0
- package/dist/types/views/roleGrantClient.d.ts +0 -1
- package/dist/types/views/runtimeLogClient.d.ts +12 -0
- package/dist/types/views/runtimeLogSse.d.ts +13 -0
- package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +15 -0
- package/dist/types/vue-ui-antdv/components/UiSearchInput.vue.d.ts +16 -2
- package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +23 -1
- package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +9 -2
- package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +23 -1
- package/dist/types/vue-ui-antdv/drawerDismissal.d.ts +18 -0
- package/dist/types/vue-ui-antdv/drawerWidth.d.ts +22 -0
- package/dist/types/vue-ui-antdv/index.d.ts +4 -0
- package/dist/types/web-contracts/index.d.ts +66 -6
- package/dist/types/web-core/http.d.ts +2 -0
- package/dist/types/web-core/module/moduleContext.d.ts +15 -2
- package/dist/types/web-core/module/runtimeContext.d.ts +3 -2
- package/dist/types/web-core/module/staticModuleClient.d.ts +5 -1
- package/dist/{workspaceViews-DI_1vYX9.js → workspaceViews-CCg6V0pr.js} +1245 -1140
- package/package.json +1 -1
- package/dist/RoleDetailWorkspaceView-D6X7pAj5.js +0 -1379
- package/dist/platform-workbench-DJj42YQP.js +0 -22911
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-DPVXH0ON.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Bn as t, C as n, Cn as r, Gt as i, Ht as a, I as o, It as s, Jt as c, L as l, Lt as u, O as d, Ot as f, Rn as p, Rt as m, T as h, Un as g, Ut as _, Vn as v, Wt as y, bn as b, cn as x, dn as S, f as C, jt as w, kt as T, ln as E, lr as D, nn as O, nr as k, on as A, pn as j, qn as ee, rt as M, sn as N, tn as P, u as te, zn as ne, zt as re } from "./platform-components-1cvOeHmo.js";
|
|
3
|
+
import { r as ie, t as F } from "./http-B0TC0pJB.js";
|
|
4
|
+
import { K as I, _ as ae, it as L, q as oe, s as se, t as ce, u as le } from "./platform-workbench-Cu14Xd9d.js";
|
|
5
|
+
import { n as ue, r as de } from "./moduleGovernanceWorkspaceView-4V_UW-Bt.js";
|
|
6
|
+
import { Fragment as R, computed as z, createBlock as B, createCommentVNode as V, createElementBlock as H, createElementVNode as U, createSlots as fe, createTextVNode as W, createVNode as G, defineAsyncComponent as pe, defineComponent as K, guardReactiveProps as me, mergeProps as he, nextTick as ge, normalizeClass as _e, normalizeProps as ve, onBeforeUnmount as ye, onMounted as be, onUnmounted as xe, openBlock as q, ref as J, renderList as Se, renderSlot as Ce, resolveDynamicComponent as we, toDisplayString as Y, toValue as Te, unref as X, watch as Z, withCtx as Q, withKeys as Ee, withModifiers as De } from "vue";
|
|
5
7
|
//#region src/web-core/dataChanges.ts
|
|
6
|
-
function
|
|
8
|
+
function Oe(e = {}) {
|
|
7
9
|
let t = Math.max(1, e.maxHandledChangeSetIds ?? 1e3), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
8
10
|
return {
|
|
9
11
|
async dispatch(e) {
|
|
10
|
-
let t =
|
|
12
|
+
let t = ke(e);
|
|
11
13
|
return !t || n.has(t.changeSetId) ? !1 : (i(t.changeSetId), await Promise.allSettled([...r].map((e) => Promise.resolve().then(() => e(t)))), !0);
|
|
12
14
|
},
|
|
13
15
|
subscribe(e) {
|
|
@@ -16,7 +18,7 @@ function De(e = {}) {
|
|
|
16
18
|
} };
|
|
17
19
|
},
|
|
18
20
|
markHandled(e) {
|
|
19
|
-
let t =
|
|
21
|
+
let t = Ae(e);
|
|
20
22
|
t && i(t);
|
|
21
23
|
}
|
|
22
24
|
};
|
|
@@ -28,32 +30,32 @@ function De(e = {}) {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
let t =
|
|
33
|
+
function ke(e) {
|
|
34
|
+
let t = Ae(e?.changeSetId);
|
|
33
35
|
if (t && Array.isArray(e?.changes)) return {
|
|
34
36
|
changeSetId: t,
|
|
35
|
-
changes: e.changes.filter(
|
|
37
|
+
changes: e.changes.filter(je)
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function Ae(e) {
|
|
39
41
|
return e?.trim() || void 0;
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function je(e) {
|
|
42
44
|
if (!e || typeof e != "object") return !1;
|
|
43
45
|
let t = e.type, n = e.moduleAlias;
|
|
44
46
|
return typeof t == "string" && t.trim() !== "" && typeof n == "string" && n.trim() !== "";
|
|
45
47
|
}
|
|
46
48
|
//#endregion
|
|
47
49
|
//#region src/views/roleDetailWorkspaceView.ts
|
|
48
|
-
var
|
|
50
|
+
var Me = /* @__PURE__ */ new Set([
|
|
49
51
|
"platform",
|
|
50
52
|
"tenant",
|
|
51
53
|
"organization"
|
|
52
|
-
]),
|
|
54
|
+
]), Ne = de({
|
|
53
55
|
type: "iam.role.detail",
|
|
54
56
|
route: "/iam/role",
|
|
55
57
|
moduleAlias: "iam.role",
|
|
56
|
-
component: pe(() => import("./RoleDetailWorkspaceView-
|
|
58
|
+
component: pe(() => import("./RoleDetailWorkspaceView-DPDb_QOn.js")),
|
|
57
59
|
layout: "workspace",
|
|
58
60
|
routeTitle: "角色管理",
|
|
59
61
|
presentations: ["drawer", "tab"],
|
|
@@ -66,17 +68,17 @@ var je = /* @__PURE__ */ new Set([
|
|
|
66
68
|
},
|
|
67
69
|
parse(e) {
|
|
68
70
|
let t = e.recordId, n = e.scopeKind, r = e.scopeId;
|
|
69
|
-
if (!(typeof t != "string" || !t || typeof n != "string" || !
|
|
71
|
+
if (!(typeof t != "string" || !t || typeof n != "string" || !Me.has(n) || (n === "platform" ? r !== void 0 : typeof r != "string" || !r))) return {
|
|
70
72
|
recordId: t,
|
|
71
73
|
scopeKind: n,
|
|
72
74
|
...typeof r == "string" ? { scopeId: r } : {}
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
|
-
}),
|
|
77
|
+
}), Pe = de({
|
|
76
78
|
type: "iam.role.authorization",
|
|
77
79
|
route: "/iam/role/authorization",
|
|
78
80
|
moduleAlias: "iam.role",
|
|
79
|
-
component: pe(() => Promise.resolve().then(() =>
|
|
81
|
+
component: pe(() => Promise.resolve().then(() => Tr)),
|
|
80
82
|
layout: "workspace",
|
|
81
83
|
routeTitle: "角色授权",
|
|
82
84
|
drawerProfile: "wide-work",
|
|
@@ -86,11 +88,11 @@ var je = /* @__PURE__ */ new Set([
|
|
|
86
88
|
let t = e.roleId;
|
|
87
89
|
return typeof t == "string" && t ? { roleId: t } : void 0;
|
|
88
90
|
}
|
|
89
|
-
}),
|
|
91
|
+
}), Fe = [Ne, Pe], Ie = de({
|
|
90
92
|
type: "platform.module.actions",
|
|
91
93
|
route: "/_platform/workspace/platform.module.actions",
|
|
92
94
|
moduleAlias: "platform.module",
|
|
93
|
-
component: pe(() => import("./ModuleActionManagementView-
|
|
95
|
+
component: pe(() => import("./ModuleActionManagementView-Dkb35QXc.js").then((e) => e.n)),
|
|
94
96
|
layout: "workspace",
|
|
95
97
|
routeTitle: "模块管理",
|
|
96
98
|
presentations: ["tab"],
|
|
@@ -107,8 +109,8 @@ var je = /* @__PURE__ */ new Set([
|
|
|
107
109
|
});
|
|
108
110
|
//#endregion
|
|
109
111
|
//#region src/platform-admin-runtime/module-menu/moduleMenuClient.ts
|
|
110
|
-
function
|
|
111
|
-
let t =
|
|
112
|
+
function Le(e) {
|
|
113
|
+
let t = r(e, { moduleAlias: "platform.menu_scheme" });
|
|
112
114
|
return {
|
|
113
115
|
async schemes() {
|
|
114
116
|
let e = [];
|
|
@@ -129,9 +131,9 @@ function Ie(e) {
|
|
|
129
131
|
})).records;
|
|
130
132
|
},
|
|
131
133
|
insert(t, n) {
|
|
132
|
-
return
|
|
134
|
+
return r(ie(e, { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) }), { moduleAlias: "platform.menu" }).insert(n);
|
|
133
135
|
},
|
|
134
|
-
visible: () =>
|
|
136
|
+
visible: () => L(e).mine().then((e) => e.records)
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
function $(e, t = "") {
|
|
@@ -143,104 +145,104 @@ function $(e, t = "") {
|
|
|
143
145
|
}, ...$(n, r)];
|
|
144
146
|
});
|
|
145
147
|
}
|
|
146
|
-
function
|
|
148
|
+
function Re(e, t = !1) {
|
|
147
149
|
return e.map(({ record: e, children: n }) => {
|
|
148
150
|
let r = t || e.enabled === !1;
|
|
149
151
|
return {
|
|
150
152
|
value: e.id,
|
|
151
153
|
title: e.title,
|
|
152
154
|
disabled: r || !!e.moduleAlias,
|
|
153
|
-
children:
|
|
155
|
+
children: Re(n, r)
|
|
154
156
|
};
|
|
155
157
|
});
|
|
156
158
|
}
|
|
157
159
|
//#endregion
|
|
158
160
|
//#region src/platform-admin-runtime/module-menu/ModuleMenuDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
159
|
-
var
|
|
161
|
+
var ze = { class: "module-menu-form" }, Be = { key: 0 }, Ve = {
|
|
160
162
|
key: 1,
|
|
161
163
|
class: "hint"
|
|
162
|
-
},
|
|
164
|
+
}, He = {
|
|
163
165
|
key: 1,
|
|
164
166
|
class: "hint"
|
|
165
|
-
},
|
|
167
|
+
}, Ue = {
|
|
166
168
|
key: 2,
|
|
167
169
|
role: "status"
|
|
168
|
-
},
|
|
170
|
+
}, We = {
|
|
169
171
|
key: 4,
|
|
170
172
|
role: "alert"
|
|
171
|
-
},
|
|
173
|
+
}, Ge = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
172
174
|
__name: "ModuleMenuDrawer",
|
|
173
175
|
props: { context: {} },
|
|
174
176
|
setup(e) {
|
|
175
|
-
let t = e, n =
|
|
176
|
-
|
|
177
|
+
let t = e, n = le(), r = Le(t.context.module.http), i = String(t.context.record?.alias ?? t.context.record?.id ?? ""), a = b({ moduleAlias: i }), o = J(""), s = J(!1), c = J(String(t.context.record?.title ?? i)), l = J([]), u = J(""), d = J("root"), f = J("tab"), p = J([]), m = J(!0), h = J(!1), g = J(!1), _ = J(""), v = J(), y = J(""), x = J(), C = J(!1), w = 0;
|
|
178
|
+
ye(() => w++);
|
|
177
179
|
let T = z(() => [{
|
|
178
180
|
value: "root",
|
|
179
181
|
title: "顶层",
|
|
180
|
-
children:
|
|
182
|
+
children: Re(p.value)
|
|
181
183
|
}]), E = z(() => l.value.filter((e) => e.enabled !== !1).map((e) => {
|
|
182
184
|
let t = e.title ?? e.alias ?? e.id, n = l.value.some((t) => t.id !== e.id && t.title === e.title), r = e.organizationId ?? e.tenantId ?? "系统";
|
|
183
185
|
return {
|
|
184
186
|
value: e.id,
|
|
185
187
|
label: n ? `${t} · ${r}` : t
|
|
186
188
|
};
|
|
187
|
-
})),
|
|
189
|
+
})), D = z(() => $(p.value).find(({ menu: e }) => e.moduleAlias === i && e.parentId === d.value)), O = z(() => !m.value && !g.value && !v.value && !!(i && u.value && c.value.trim()) && h.value && s.value);
|
|
188
190
|
Z([
|
|
189
|
-
|
|
191
|
+
O,
|
|
190
192
|
g,
|
|
191
|
-
|
|
193
|
+
v
|
|
192
194
|
], () => {
|
|
193
|
-
t.context.setCloseBlocked(g.value), t.context.setTitleActions(
|
|
195
|
+
t.context.setCloseBlocked(g.value), t.context.setTitleActions(v.value ? [] : [{
|
|
194
196
|
key: "add-menu",
|
|
195
197
|
label: "添加",
|
|
196
198
|
emphasis: "primary",
|
|
197
|
-
disabled: !
|
|
199
|
+
disabled: !O.value,
|
|
198
200
|
loading: g.value,
|
|
199
|
-
run:
|
|
201
|
+
run: M
|
|
200
202
|
}]);
|
|
201
|
-
}, { immediate: !0 }), Z(u, () => void
|
|
202
|
-
async function
|
|
203
|
-
s.value = !1, h.value = !1, m.value = !0,
|
|
204
|
-
let e = ++
|
|
203
|
+
}, { immediate: !0 }), Z(u, () => void j()), k();
|
|
204
|
+
async function k() {
|
|
205
|
+
s.value = !1, h.value = !1, m.value = !0, _.value = "";
|
|
206
|
+
let e = ++w;
|
|
205
207
|
try {
|
|
206
208
|
let [t, n] = await Promise.all([r.schemes(), a.runtime.load()]);
|
|
207
|
-
if (e !==
|
|
208
|
-
if (f.value = n.entryType === "link" ? "window" : "tab", o.value =
|
|
209
|
-
|
|
209
|
+
if (e !== w) return;
|
|
210
|
+
if (f.value = n.entryType === "link" ? "window" : "tab", o.value = te(n), s.value = !o.value, l.value = t, !E.value.length) {
|
|
211
|
+
_.value = "暂无可用菜单方案,请先在菜单管理中配置方案。", m.value = !1;
|
|
210
212
|
return;
|
|
211
213
|
}
|
|
212
214
|
let i = await r.visible();
|
|
213
|
-
if (e !==
|
|
215
|
+
if (e !== w) return;
|
|
214
216
|
let c = i[0]?.record.schemeId, d = E.value.some((e) => e.value === c) ? c : String(E.value[0].value);
|
|
215
|
-
u.value === d ? await
|
|
217
|
+
u.value === d ? await j() : u.value = d;
|
|
216
218
|
} catch (t) {
|
|
217
|
-
e ===
|
|
219
|
+
e === w && (_.value = ne(t), m.value = !1);
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
|
-
async function
|
|
221
|
-
let e = ++
|
|
222
|
-
d.value = "root", p.value = [], h.value = !1,
|
|
222
|
+
async function j() {
|
|
223
|
+
let e = ++w;
|
|
224
|
+
d.value = "root", p.value = [], h.value = !1, _.value = "", m.value = !0;
|
|
223
225
|
try {
|
|
224
226
|
let t = await r.tree(u.value);
|
|
225
|
-
e ===
|
|
227
|
+
e === w && (p.value = t, h.value = !0);
|
|
226
228
|
} catch (t) {
|
|
227
|
-
e ===
|
|
229
|
+
e === w && (_.value = ne(t));
|
|
228
230
|
} finally {
|
|
229
|
-
e ===
|
|
231
|
+
e === w && (m.value = !1);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
|
-
async function
|
|
233
|
-
|
|
234
|
+
async function ee() {
|
|
235
|
+
C.value = !1, _.value = "";
|
|
234
236
|
try {
|
|
235
237
|
let e = await (n?.refreshMenus?.() ?? r.visible());
|
|
236
|
-
x.value = $(e).find(({ menu: e }) => e.id ===
|
|
238
|
+
x.value = $(e).find(({ menu: e }) => e.id === v.value?.id)?.menu, C.value = !0;
|
|
237
239
|
} catch {
|
|
238
|
-
|
|
240
|
+
_.value = "菜单已添加,导航刷新失败。请重试刷新,无需重复添加。";
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
|
-
async function
|
|
242
|
-
if (
|
|
243
|
-
g.value = !0,
|
|
243
|
+
async function M() {
|
|
244
|
+
if (O.value) {
|
|
245
|
+
g.value = !0, _.value = "";
|
|
244
246
|
try {
|
|
245
247
|
let e = await r.insert(u.value, {
|
|
246
248
|
title: c.value.trim(),
|
|
@@ -250,57 +252,57 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
250
252
|
openMode: f.value,
|
|
251
253
|
enabled: !0
|
|
252
254
|
});
|
|
253
|
-
|
|
255
|
+
v.value = e.record;
|
|
254
256
|
let n = $(p.value).find(({ menu: e }) => e.id === d.value)?.path, a = l.value.find((e) => e.id === u.value);
|
|
255
|
-
|
|
257
|
+
y.value = [
|
|
256
258
|
a?.title,
|
|
257
259
|
n,
|
|
258
260
|
c.value.trim()
|
|
259
|
-
].filter(Boolean).join(" / "), t.context.refreshDetailExtensions(), await
|
|
261
|
+
].filter(Boolean).join(" / "), t.context.refreshDetailExtensions(), await ee();
|
|
260
262
|
} catch (e) {
|
|
261
|
-
|
|
263
|
+
_.value = ne(e);
|
|
262
264
|
} finally {
|
|
263
265
|
g.value = !1;
|
|
264
266
|
}
|
|
265
267
|
}
|
|
266
268
|
}
|
|
267
|
-
function
|
|
269
|
+
function te(e) {
|
|
268
270
|
return e.entryType === "route" ? e.entryRoute ? "" : "该模块尚未配置页面地址,请返回模块补充。" : e.entryType === "link" ? e.entryExternalUrl ? "" : "该模块尚未配置链接地址,请返回模块补充。" : e.uiDescriptor?.page ? "" : "该模块尚无可用业务页面,请返回模块完成页面配置;使用草稿配置的页面需先发布。";
|
|
269
271
|
}
|
|
270
|
-
function
|
|
272
|
+
function ne(e) {
|
|
271
273
|
return e instanceof Error ? e.message : "加载失败,请重试。";
|
|
272
274
|
}
|
|
273
|
-
function
|
|
275
|
+
function re() {
|
|
274
276
|
x.value && n?.openMenu && (n.openMenu(x.value), t.context.close());
|
|
275
277
|
}
|
|
276
|
-
return (t, r) => (q(), H("div",
|
|
277
|
-
|
|
278
|
+
return (t, r) => (q(), H("div", ze, [
|
|
279
|
+
v.value ? (q(), H(R, { key: 1 }, [
|
|
278
280
|
r[12] ||= U("strong", null, "已添加到菜单", -1),
|
|
279
|
-
U("p", null, Y(
|
|
280
|
-
x.value && X(n)?.openMenu ? (q(), B(X(
|
|
281
|
+
U("p", null, Y(y.value), 1),
|
|
282
|
+
x.value && X(n)?.openMenu ? (q(), B(X(S), {
|
|
281
283
|
key: 0,
|
|
282
284
|
type: "primary",
|
|
283
|
-
onClick:
|
|
285
|
+
onClick: re
|
|
284
286
|
}, {
|
|
285
287
|
default: Q(() => [...r[10] ||= [W("打开", -1)]]),
|
|
286
288
|
_: 1
|
|
287
|
-
})) :
|
|
288
|
-
|
|
289
|
+
})) : C.value ? (q(), H("p", He, " 当前用户的导航中暂不可见,请检查菜单方案适用范围、上级菜单状态及模块访问权限。 ")) : V("v-if", !0),
|
|
290
|
+
_.value ? (q(), B(X(S), {
|
|
289
291
|
key: 2,
|
|
290
292
|
disabled: g.value,
|
|
291
|
-
onClick:
|
|
293
|
+
onClick: ee
|
|
292
294
|
}, {
|
|
293
295
|
default: Q(() => [...r[11] ||= [W("刷新导航", -1)]]),
|
|
294
296
|
_: 1
|
|
295
297
|
}, 8, ["disabled"])) : V("v-if", !0)
|
|
296
298
|
], 64)) : (q(), H(R, { key: 0 }, [
|
|
297
|
-
U("label", null, [r[5] ||= W("菜单名称", -1), G(X(
|
|
299
|
+
U("label", null, [r[5] ||= W("菜单名称", -1), G(X(A), {
|
|
298
300
|
value: c.value,
|
|
299
301
|
"onUpdate:value": r[0] ||= (e) => c.value = e,
|
|
300
302
|
disabled: g.value,
|
|
301
303
|
"aria-label": "菜单名称"
|
|
302
304
|
}, null, 8, ["value", "disabled"])]),
|
|
303
|
-
E.value.length > 1 ? (q(), H("label",
|
|
305
|
+
E.value.length > 1 ? (q(), H("label", Be, [r[6] ||= W("菜单方案 ", -1), G(X(N), {
|
|
304
306
|
value: u.value,
|
|
305
307
|
options: E.value,
|
|
306
308
|
"allow-clear": !1,
|
|
@@ -311,7 +313,7 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
311
313
|
"options",
|
|
312
314
|
"disabled"
|
|
313
315
|
])])) : V("v-if", !0),
|
|
314
|
-
U("label", null, [r[7] ||= W("放置位置 ", -1), G(X(
|
|
316
|
+
U("label", null, [r[7] ||= W("放置位置 ", -1), G(X(P), {
|
|
315
317
|
value: d.value,
|
|
316
318
|
"tree-data": T.value,
|
|
317
319
|
"allow-clear": !1,
|
|
@@ -324,7 +326,7 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
324
326
|
"disabled",
|
|
325
327
|
"loading"
|
|
326
328
|
])]),
|
|
327
|
-
U("details", null, [r[9] ||= U("summary", null, "更多设置", -1), U("label", null, [r[8] ||= W("打开方式 ", -1), G(X(
|
|
329
|
+
U("details", null, [r[9] ||= U("summary", null, "更多设置", -1), U("label", null, [r[8] ||= W("打开方式 ", -1), G(X(N), {
|
|
328
330
|
value: f.value,
|
|
329
331
|
"allow-clear": !1,
|
|
330
332
|
disabled: g.value,
|
|
@@ -337,38 +339,38 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
337
339
|
}],
|
|
338
340
|
"onUpdate:value": r[3] ||= (e) => f.value = e === "window" ? "window" : "tab"
|
|
339
341
|
}, null, 8, ["value", "disabled"])])]),
|
|
340
|
-
|
|
342
|
+
D.value ? (q(), H("p", Ve, "此位置已有「" + Y(D.value.menu.title) + "」,仍可添加另一个入口。", 1)) : V("v-if", !0)
|
|
341
343
|
], 64)),
|
|
342
|
-
o.value ? (q(), H("p",
|
|
343
|
-
o.value ? (q(), B(X(
|
|
344
|
+
o.value ? (q(), H("p", Ue, Y(o.value), 1)) : V("v-if", !0),
|
|
345
|
+
o.value ? (q(), B(X(S), {
|
|
344
346
|
key: 3,
|
|
345
347
|
onClick: r[4] ||= (t) => e.context.close()
|
|
346
348
|
}, {
|
|
347
349
|
default: Q(() => [...r[13] ||= [W("返回模块", -1)]]),
|
|
348
350
|
_: 1
|
|
349
351
|
})) : V("v-if", !0),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
_.value ? (q(), H("p", We, Y(_.value), 1)) : V("v-if", !0),
|
|
353
|
+
_.value && !v.value && !h.value ? (q(), B(X(S), {
|
|
352
354
|
key: 5,
|
|
353
355
|
disabled: g.value,
|
|
354
|
-
onClick:
|
|
356
|
+
onClick: k
|
|
355
357
|
}, {
|
|
356
358
|
default: Q(() => [...r[14] ||= [W("重试", -1)]]),
|
|
357
359
|
_: 1
|
|
358
360
|
}, 8, ["disabled"])) : V("v-if", !0)
|
|
359
361
|
]));
|
|
360
362
|
}
|
|
361
|
-
}), [["__scopeId", "data-v-38eeb884"]]),
|
|
363
|
+
}), [["__scopeId", "data-v-38eeb884"]]), Ke = { class: "module-menu-entries" }, qe = { key: 0 }, Je = {
|
|
362
364
|
key: 1,
|
|
363
365
|
role: "status"
|
|
364
|
-
},
|
|
366
|
+
}, Ye = { key: 2 }, Xe = { key: 0 }, Ze = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
365
367
|
__name: "ModuleMenuEntriesSection",
|
|
366
368
|
props: { context: {} },
|
|
367
369
|
setup(e) {
|
|
368
|
-
let t = e, n =
|
|
369
|
-
|
|
370
|
+
let t = e, n = le(), r = J([]), i = J(/* @__PURE__ */ new Map()), a = J(!1), o = J(""), s = 0;
|
|
371
|
+
ye(() => s++), Z(() => [t.context.record.id, t.context.refreshKey], () => void c(), { immediate: !0 });
|
|
370
372
|
async function c() {
|
|
371
|
-
let e = ++s, n = String(t.context.record.alias ?? t.context.record.id ?? ""), c =
|
|
373
|
+
let e = ++s, n = String(t.context.record.alias ?? t.context.record.id ?? ""), c = Le(t.context.module.http);
|
|
372
374
|
a.value = !0, o.value = "", r.value = [], i.value = /* @__PURE__ */ new Map();
|
|
373
375
|
try {
|
|
374
376
|
let [t, a] = await Promise.all([c.schemes(), c.visible()]), o = await Promise.all(t.map(async (e) => $(await c.tree(e.id), e.title ?? e.alias ?? e.id).filter(({ menu: e }) => e.moduleAlias === n)));
|
|
@@ -380,16 +382,16 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
380
382
|
e === s && (a.value = !1);
|
|
381
383
|
}
|
|
382
384
|
}
|
|
383
|
-
return (e, t) => (q(), H("div",
|
|
385
|
+
return (e, t) => (q(), H("div", Ke, [a.value ? (q(), H("span", qe, "正在加载…")) : o.value ? (q(), H("div", Je, [W(Y(o.value) + " ", 1), G(X(S), {
|
|
384
386
|
type: "link",
|
|
385
387
|
onClick: c
|
|
386
388
|
}, {
|
|
387
389
|
default: Q(() => [...t[0] ||= [W("重试", -1)]]),
|
|
388
390
|
_: 1
|
|
389
|
-
})])) : r.value.length ? V("v-if", !0) : (q(), H("span",
|
|
391
|
+
})])) : r.value.length ? V("v-if", !0) : (q(), H("span", Ye, "尚未添加到菜单,可通过上方“添加到菜单”设置入口。")), (q(!0), H(R, null, Se(r.value, (e) => (q(), H("div", {
|
|
390
392
|
key: e.menu.id,
|
|
391
393
|
class: "menu-entry"
|
|
392
|
-
}, [U("span", null, [W(Y(e.path), 1), e.menu.enabled === !1 ? (q(), H("small",
|
|
394
|
+
}, [U("span", null, [W(Y(e.path), 1), e.menu.enabled === !1 ? (q(), H("small", Xe, " · 已停用")) : V("v-if", !0)]), i.value.has(e.menu.id) && X(n)?.openMenu ? (q(), B(X(S), {
|
|
393
395
|
key: 0,
|
|
394
396
|
type: "link",
|
|
395
397
|
onClick: (t) => X(n).openMenu(i.value.get(e.menu.id))
|
|
@@ -398,65 +400,65 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
398
400
|
_: 1
|
|
399
401
|
}, 8, ["onClick"])) : V("v-if", !0)]))), 128))]));
|
|
400
402
|
}
|
|
401
|
-
}), [["__scopeId", "data-v-ff7756d2"]]),
|
|
403
|
+
}), [["__scopeId", "data-v-ff7756d2"]]), Qe = Ie, $e = ue, et = {
|
|
402
404
|
id: "platform-module-workspace-actions",
|
|
403
405
|
target: { moduleAlias: "platform.module" },
|
|
404
|
-
workspaceViews: [
|
|
406
|
+
workspaceViews: [$e, Qe],
|
|
405
407
|
detail: {
|
|
406
408
|
sections: [{
|
|
407
409
|
key: "module-menu-entries",
|
|
408
410
|
title: "菜单入口",
|
|
409
|
-
component:
|
|
411
|
+
component: Ze
|
|
410
412
|
}],
|
|
411
413
|
actions: [
|
|
412
414
|
{
|
|
413
415
|
key: "module-add-to-menu",
|
|
414
416
|
title: "添加到菜单",
|
|
415
|
-
state: (e) => ({ visible:
|
|
417
|
+
state: (e) => ({ visible: rt(e) !== void 0 }),
|
|
416
418
|
run({ openDrawer: e }) {
|
|
417
419
|
e({
|
|
418
420
|
title: "添加到菜单",
|
|
419
|
-
width:
|
|
420
|
-
component:
|
|
421
|
+
width: "narrow",
|
|
422
|
+
component: Ge
|
|
421
423
|
});
|
|
422
424
|
}
|
|
423
425
|
},
|
|
424
426
|
{
|
|
425
427
|
key: "module-actions-workspace",
|
|
426
428
|
title: "动作",
|
|
427
|
-
state: (e) => ({ visible:
|
|
429
|
+
state: (e) => ({ visible: rt(e) !== void 0 }),
|
|
428
430
|
run({ record: e, openWorkspaceTab: t }) {
|
|
429
|
-
let n =
|
|
430
|
-
n && t(
|
|
431
|
+
let n = rt(e);
|
|
432
|
+
n && t(Qe, {
|
|
431
433
|
moduleAlias: n,
|
|
432
|
-
moduleTitle:
|
|
433
|
-
moduleKind:
|
|
434
|
+
moduleTitle: it(e),
|
|
435
|
+
moduleKind: at(e)
|
|
434
436
|
});
|
|
435
437
|
}
|
|
436
438
|
},
|
|
437
439
|
{
|
|
438
440
|
key: "module-ui-orchestration-workspace",
|
|
439
441
|
title: "低代码",
|
|
440
|
-
state: (e) => ({ visible:
|
|
442
|
+
state: (e) => ({ visible: rt(e) !== void 0 && at(e) === "dynamic" }),
|
|
441
443
|
run({ record: e, openWorkspaceTab: t }) {
|
|
442
|
-
let n =
|
|
443
|
-
n &&
|
|
444
|
+
let n = rt(e);
|
|
445
|
+
n && at(e) === "dynamic" && t($e, {
|
|
444
446
|
moduleAlias: n,
|
|
445
|
-
moduleTitle:
|
|
447
|
+
moduleTitle: it(e),
|
|
446
448
|
governanceTab: "overview"
|
|
447
449
|
});
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
452
|
]
|
|
451
453
|
}
|
|
452
|
-
},
|
|
454
|
+
}, tt = {
|
|
453
455
|
id: "dictionary-category-tree-parent-policy",
|
|
454
456
|
target: { moduleAlias: "platform.dictionary_category" },
|
|
455
457
|
navigator: { treeParentPolicy: {
|
|
456
458
|
canUseAsParent: (e) => e.categoryKind === "folder",
|
|
457
459
|
rejectionMessage: "字典类目只能挂在目录下"
|
|
458
460
|
} }
|
|
459
|
-
},
|
|
461
|
+
}, nt = {
|
|
460
462
|
id: "platform-module-action-entry-scope",
|
|
461
463
|
target: { moduleAlias: "platform.module_action" },
|
|
462
464
|
navigator: {
|
|
@@ -468,35 +470,35 @@ var Re = { class: "module-menu-form" }, ze = { key: 0 }, Be = {
|
|
|
468
470
|
},
|
|
469
471
|
standardActions: { disabled: ["create"] }
|
|
470
472
|
};
|
|
471
|
-
function nt(e) {
|
|
472
|
-
return at(e, "alias") ?? at(e, "id");
|
|
473
|
-
}
|
|
474
473
|
function rt(e) {
|
|
475
|
-
return
|
|
474
|
+
return ot(e, "alias") ?? ot(e, "id");
|
|
476
475
|
}
|
|
477
476
|
function it(e) {
|
|
478
|
-
|
|
477
|
+
return ot(e, "title");
|
|
478
|
+
}
|
|
479
|
+
function at(e) {
|
|
480
|
+
let t = ot(e, "moduleKind");
|
|
479
481
|
return t === "static" || t === "dynamic" ? t : void 0;
|
|
480
482
|
}
|
|
481
|
-
function
|
|
483
|
+
function ot(e, t) {
|
|
482
484
|
let n = e[t];
|
|
483
485
|
return typeof n == "string" && n.trim() ? n : void 0;
|
|
484
486
|
}
|
|
485
487
|
//#endregion
|
|
486
488
|
//#region src/views/PasswordPolicyPreview.vue?vue&type=script&setup=true&lang.ts
|
|
487
|
-
var
|
|
489
|
+
var st = { class: "password-policy-preview" }, ct = {
|
|
488
490
|
key: 0,
|
|
489
491
|
class: "preview-results"
|
|
490
|
-
},
|
|
492
|
+
}, lt = {
|
|
491
493
|
id: "iam-password-policy-preview",
|
|
492
494
|
target: { moduleAlias: "iam.password_policy_rule" },
|
|
493
495
|
card: { assistant: {
|
|
494
|
-
component: /* @__PURE__ */
|
|
496
|
+
component: /* @__PURE__ */ j(/* @__PURE__ */ K({
|
|
495
497
|
name: "PasswordPolicyPreview",
|
|
496
498
|
__name: "PasswordPolicyPreview",
|
|
497
499
|
props: { context: {} },
|
|
498
500
|
setup(e) {
|
|
499
|
-
let t = e, n = J("CURRENT"), r = J(""), i = J(), a = J(!1), o = J(!1), s = 0, c = z(() =>
|
|
501
|
+
let t = e, n = J("CURRENT"), r = J(""), i = J(), a = J(!1), o = J(!1), s = 0, c = z(() => g(t.context.record)), l = z(() => t.context.mode !== "view" || b(c.value?.id) !== void 0), u = z(() => [{
|
|
500
502
|
value: "CURRENT",
|
|
501
503
|
label: "本规则",
|
|
502
504
|
disabled: !l.value
|
|
@@ -531,13 +533,13 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
531
533
|
let e = l.value ? c.value : void 0;
|
|
532
534
|
if (n.value === "CURRENT") return e ? [e] : [];
|
|
533
535
|
if (!i.value) return [];
|
|
534
|
-
let t = i.value.filter(
|
|
536
|
+
let t = i.value.filter(S), r = b(e?.id);
|
|
535
537
|
if (r) {
|
|
536
|
-
let e = t.findIndex((e) =>
|
|
538
|
+
let e = t.findIndex((e) => b(e.id) === r);
|
|
537
539
|
e >= 0 && t.splice(e, 1);
|
|
538
540
|
}
|
|
539
|
-
return e &&
|
|
540
|
-
}), m = z(() => r.value ? p.value.map((e, t) =>
|
|
541
|
+
return e && S(e) && t.push(e), t.length > 0 ? t.sort(v) : [];
|
|
542
|
+
}), m = z(() => r.value ? p.value.map((e, t) => _(e, r.value, t)) : []), h = z(() => {
|
|
541
543
|
if (!l.value && n.value === "CURRENT") return "请选择或新建一条规则";
|
|
542
544
|
if (n.value === "ALL" && o.value) return "正在加载权威规则集";
|
|
543
545
|
if (n.value === "ALL" && a.value) return "无法加载权威规则集";
|
|
@@ -546,13 +548,13 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
546
548
|
let e = m.value.filter((e) => !e.passed).length;
|
|
547
549
|
return e === 0 ? `全部通过(${m.value.length}/${m.value.length})` : `${e} 条规则未通过`;
|
|
548
550
|
});
|
|
549
|
-
function
|
|
551
|
+
function g(e) {
|
|
550
552
|
if (e) return e;
|
|
551
553
|
}
|
|
552
|
-
function
|
|
553
|
-
let r =
|
|
554
|
+
function _(e, t, n) {
|
|
555
|
+
let r = x(e.title, "未命名规则"), i = x(e.message, "未配置失败提示"), a = e.pattern;
|
|
554
556
|
if (!a?.trim()) return {
|
|
555
|
-
key:
|
|
557
|
+
key: y(e, n),
|
|
556
558
|
title: r,
|
|
557
559
|
message: i,
|
|
558
560
|
passed: !1,
|
|
@@ -561,14 +563,14 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
561
563
|
try {
|
|
562
564
|
let o = RegExp(`^(?:${a})$`).test(t);
|
|
563
565
|
return {
|
|
564
|
-
key:
|
|
566
|
+
key: y(e, n),
|
|
565
567
|
title: r,
|
|
566
568
|
message: i,
|
|
567
569
|
passed: o
|
|
568
570
|
};
|
|
569
571
|
} catch {
|
|
570
572
|
return {
|
|
571
|
-
key:
|
|
573
|
+
key: y(e, n),
|
|
572
574
|
title: r,
|
|
573
575
|
message: i,
|
|
574
576
|
passed: !1,
|
|
@@ -576,23 +578,23 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
576
578
|
};
|
|
577
579
|
}
|
|
578
580
|
}
|
|
579
|
-
function _(e, t) {
|
|
580
|
-
return (e.sortOrder ?? 2 ** 53 - 1) - (t.sortOrder ?? 2 ** 53 - 1) || b(e.title, "").localeCompare(b(t.title, ""));
|
|
581
|
-
}
|
|
582
581
|
function v(e, t) {
|
|
583
|
-
return
|
|
582
|
+
return (e.sortOrder ?? 2 ** 53 - 1) - (t.sortOrder ?? 2 ** 53 - 1) || x(e.title, "").localeCompare(x(t.title, ""));
|
|
583
|
+
}
|
|
584
|
+
function y(e, t) {
|
|
585
|
+
return b(e.id) ?? `draft:${t}`;
|
|
584
586
|
}
|
|
585
|
-
function
|
|
587
|
+
function b(e) {
|
|
586
588
|
return e?.trim() || void 0;
|
|
587
589
|
}
|
|
588
|
-
function
|
|
590
|
+
function x(e, t) {
|
|
589
591
|
return e?.trim() || t;
|
|
590
592
|
}
|
|
591
|
-
function
|
|
593
|
+
function S(e) {
|
|
592
594
|
return e.enabled !== !1 && (e.scopeType == null || e.scopeType.toLowerCase() === "global");
|
|
593
595
|
}
|
|
594
|
-
return (e, t) => (q(), H("section",
|
|
595
|
-
U("header", null, [t[1] ||= U("h3", null, "密码试算", -1), U("span", { class:
|
|
596
|
+
return (e, t) => (q(), H("section", st, [
|
|
597
|
+
U("header", null, [t[1] ||= U("h3", null, "密码试算", -1), U("span", { class: _e({ failed: m.value.some((e) => !e.passed) }) }, Y(h.value), 3)]),
|
|
596
598
|
G(X(O), {
|
|
597
599
|
class: "preview-scope",
|
|
598
600
|
value: n.value,
|
|
@@ -600,7 +602,7 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
600
602
|
size: "small",
|
|
601
603
|
"onUpdate:value": d
|
|
602
604
|
}, null, 8, ["value", "options"]),
|
|
603
|
-
G(X(
|
|
605
|
+
G(X(A), {
|
|
604
606
|
value: r.value,
|
|
605
607
|
"onUpdate:value": t[0] ||= (e) => r.value = e,
|
|
606
608
|
type: "text",
|
|
@@ -608,9 +610,9 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
608
610
|
placeholder: "输入测试密码",
|
|
609
611
|
"aria-label": "测试密码"
|
|
610
612
|
}, null, 8, ["value"]),
|
|
611
|
-
m.value.length ? (q(), H("ul",
|
|
613
|
+
m.value.length ? (q(), H("ul", ct, [(q(!0), H(R, null, Se(m.value, (e) => (q(), H("li", {
|
|
612
614
|
key: e.key,
|
|
613
|
-
class:
|
|
615
|
+
class: _e({
|
|
614
616
|
passed: e.passed,
|
|
615
617
|
failed: !e.passed
|
|
616
618
|
})
|
|
@@ -623,26 +625,26 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
623
625
|
position: "bottom"
|
|
624
626
|
}
|
|
625
627
|
} }
|
|
626
|
-
},
|
|
628
|
+
}, ut = { class: "tenant-applications-detail" }, dt = { class: "tenant-applications-summary" }, ft = {
|
|
627
629
|
key: 0,
|
|
628
630
|
class: "tenant-applications-status"
|
|
629
|
-
},
|
|
631
|
+
}, pt = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
630
632
|
name: "TenantApplicationsDetailSection",
|
|
631
633
|
__name: "TenantApplicationsDetailSection",
|
|
632
634
|
props: { context: {} },
|
|
633
635
|
setup(e) {
|
|
634
|
-
let t = e, n = J([]), r = J(!1),
|
|
636
|
+
let t = e, n = J([]), r = J(!1), i = 0, a = J(/* @__PURE__ */ new Map()), o = z(() => n.value.map((e) => e.applicationAlias).filter((e) => typeof e == "string" && e.length > 0).map((e) => ({
|
|
635
637
|
key: e,
|
|
636
|
-
label:
|
|
638
|
+
label: a.value.get(e) ? `${a.value.get(e)} · ${e}` : e
|
|
637
639
|
})));
|
|
638
|
-
Z(() => [t.context.record.id, t.context.refreshKey], () => void
|
|
639
|
-
async function
|
|
640
|
-
let e = String(t.context.record.id ?? ""),
|
|
640
|
+
Z(() => [t.context.record.id, t.context.refreshKey], () => void s(), { immediate: !0 });
|
|
641
|
+
async function s() {
|
|
642
|
+
let e = String(t.context.record.id ?? ""), o = ++i;
|
|
641
643
|
if (!e) {
|
|
642
|
-
n.value = [],
|
|
644
|
+
n.value = [], a.value = /* @__PURE__ */ new Map(), r.value = !1;
|
|
643
645
|
return;
|
|
644
646
|
}
|
|
645
|
-
r.value = !0, n.value = [],
|
|
647
|
+
r.value = !0, n.value = [], a.value = /* @__PURE__ */ new Map();
|
|
646
648
|
try {
|
|
647
649
|
let [r, s] = await Promise.all([t.context.module.http.request({
|
|
648
650
|
method: "POST",
|
|
@@ -653,38 +655,38 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
653
655
|
} }
|
|
654
656
|
}), t.context.module.http.request({
|
|
655
657
|
method: "POST",
|
|
656
|
-
path:
|
|
658
|
+
path: c(e, "query"),
|
|
657
659
|
body: { page: {
|
|
658
660
|
pageNum: 1,
|
|
659
661
|
pageSize: 200
|
|
660
662
|
} }
|
|
661
663
|
})]);
|
|
662
|
-
|
|
664
|
+
o === i && (a.value = new Map(r.records.filter((e) => e.alias && e.title).map((e) => [e.alias, e.title])), n.value = s.records);
|
|
663
665
|
} catch (e) {
|
|
664
|
-
|
|
666
|
+
o === i && T(e, {
|
|
665
667
|
source: "tenant-applications-detail",
|
|
666
668
|
phase: "load"
|
|
667
669
|
});
|
|
668
670
|
} finally {
|
|
669
|
-
|
|
671
|
+
o === i && (r.value = !1);
|
|
670
672
|
}
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function c(e, t) {
|
|
673
675
|
return `/iam.tenant/${encodeURIComponent(e)}/applications/${t}`;
|
|
674
676
|
}
|
|
675
|
-
return (e, t) => (q(), H("section",
|
|
677
|
+
return (e, t) => (q(), H("section", ut, [U("div", dt, [r.value ? (q(), H("span", ft, "正在加载…")) : (q(), B(X(E), {
|
|
676
678
|
key: 1,
|
|
677
|
-
items:
|
|
679
|
+
items: o.value,
|
|
678
680
|
"max-visible": 8,
|
|
679
681
|
"empty-text": "暂无记录"
|
|
680
682
|
}, null, 8, ["items"]))])]));
|
|
681
683
|
}
|
|
682
|
-
}), [["__scopeId", "data-v-2f879564"]]),
|
|
684
|
+
}), [["__scopeId", "data-v-2f879564"]]), mt = { class: "tenant-application-configuration" }, ht = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
683
685
|
name: "TenantApplicationConfigurationDrawer",
|
|
684
686
|
__name: "TenantApplicationConfigurationDrawer",
|
|
685
687
|
props: { context: {} },
|
|
686
688
|
setup(e) {
|
|
687
|
-
let t = e, n = J([]), r = J(/* @__PURE__ */ new Set()), i = J(!1),
|
|
689
|
+
let t = e, n = J([]), r = J(/* @__PURE__ */ new Set()), i = J(!1), o = J(!1), s = [{
|
|
688
690
|
key: "title",
|
|
689
691
|
title: "应用名称",
|
|
690
692
|
width: 260
|
|
@@ -692,35 +694,35 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
692
694
|
key: "alias",
|
|
693
695
|
title: "应用 alias",
|
|
694
696
|
width: 220
|
|
695
|
-
}],
|
|
697
|
+
}], c = z(() => n.value), l = z(() => ({
|
|
696
698
|
selectedRowKeys: [...r.value],
|
|
697
699
|
preserveSelectedRowKeys: !0,
|
|
698
|
-
disabledOf: (e) =>
|
|
700
|
+
disabledOf: (e) => o.value || e.alias === "iam",
|
|
699
701
|
onChange: (e) => {
|
|
700
702
|
r.value = new Set(e.map(String));
|
|
701
703
|
}
|
|
702
704
|
}));
|
|
703
|
-
function
|
|
704
|
-
t.context.setCloseBlocked(
|
|
705
|
+
function u() {
|
|
706
|
+
t.context.setCloseBlocked(o.value), t.context.setTitleActions([{
|
|
705
707
|
key: "cancel",
|
|
706
708
|
label: "取消",
|
|
707
|
-
disabled:
|
|
709
|
+
disabled: o.value,
|
|
708
710
|
run: () => {
|
|
709
|
-
|
|
711
|
+
o.value || t.context.close();
|
|
710
712
|
}
|
|
711
713
|
}, {
|
|
712
714
|
key: "confirm",
|
|
713
715
|
label: "确认",
|
|
714
716
|
emphasis: "primary",
|
|
715
|
-
disabled:
|
|
716
|
-
loading:
|
|
717
|
-
run:
|
|
717
|
+
disabled: o.value,
|
|
718
|
+
loading: o.value,
|
|
719
|
+
run: f
|
|
718
720
|
}]);
|
|
719
721
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}), Z(
|
|
723
|
-
async function
|
|
722
|
+
be(() => {
|
|
723
|
+
u(), d();
|
|
724
|
+
}), Z(o, u);
|
|
725
|
+
async function d() {
|
|
724
726
|
let e = String(t.context.record?.id ?? "");
|
|
725
727
|
if (e) {
|
|
726
728
|
i.value = !0;
|
|
@@ -734,7 +736,7 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
734
736
|
} }
|
|
735
737
|
}), t.context.module.http.request({
|
|
736
738
|
method: "POST",
|
|
737
|
-
path:
|
|
739
|
+
path: p(e, "query"),
|
|
738
740
|
body: { page: {
|
|
739
741
|
pageNum: 1,
|
|
740
742
|
pageSize: 200
|
|
@@ -744,7 +746,7 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
744
746
|
let o = new Set(n.value.map((e) => e.alias).filter(Boolean));
|
|
745
747
|
r.value = /* @__PURE__ */ new Set(["iam", ...a.records.map((e) => e.applicationAlias).filter((e) => typeof e == "string" && o.has(e))]);
|
|
746
748
|
} catch (e) {
|
|
747
|
-
|
|
749
|
+
T(e, {
|
|
748
750
|
source: "tenant-application-configuration",
|
|
749
751
|
phase: "load"
|
|
750
752
|
});
|
|
@@ -753,35 +755,35 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
753
755
|
}
|
|
754
756
|
}
|
|
755
757
|
}
|
|
756
|
-
async function
|
|
758
|
+
async function f() {
|
|
757
759
|
let e = String(t.context.record?.id ?? "");
|
|
758
|
-
if (e && !
|
|
759
|
-
|
|
760
|
+
if (e && !o.value) {
|
|
761
|
+
o.value = !0;
|
|
760
762
|
try {
|
|
761
763
|
await t.context.module.http.request({
|
|
762
764
|
method: "POST",
|
|
763
|
-
path:
|
|
765
|
+
path: p(e, "configure"),
|
|
764
766
|
body: { applicationAliases: [...r.value] }
|
|
765
767
|
}), t.context.refreshDetailExtensions(), t.context.refreshList(), t.context.close();
|
|
766
768
|
} catch (e) {
|
|
767
|
-
|
|
769
|
+
T(e, {
|
|
768
770
|
source: "tenant-application-configuration",
|
|
769
771
|
phase: "action"
|
|
770
772
|
});
|
|
771
773
|
} finally {
|
|
772
|
-
|
|
774
|
+
o.value = !1;
|
|
773
775
|
}
|
|
774
776
|
}
|
|
775
777
|
}
|
|
776
|
-
function
|
|
778
|
+
function p(e, t) {
|
|
777
779
|
return `/iam.tenant/${encodeURIComponent(e)}/applications/${t}`;
|
|
778
780
|
}
|
|
779
|
-
return (e, t) => (q(), H("section",
|
|
780
|
-
columns:
|
|
781
|
-
rows:
|
|
781
|
+
return (e, t) => (q(), H("section", mt, [t[0] ||= U("p", null, "勾选表示向当前租户开通应用;取消勾选将移除该租户的应用开通记录。", -1), G(X(a), {
|
|
782
|
+
columns: s,
|
|
783
|
+
rows: c.value,
|
|
782
784
|
loading: i.value,
|
|
783
785
|
pagination: !1,
|
|
784
|
-
selection:
|
|
786
|
+
selection: l.value,
|
|
785
787
|
"row-key": (e) => String(e.alias ?? e.id ?? ""),
|
|
786
788
|
"empty-description": "暂无可配置应用"
|
|
787
789
|
}, null, 8, [
|
|
@@ -791,7 +793,7 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
791
793
|
"row-key"
|
|
792
794
|
])]));
|
|
793
795
|
}
|
|
794
|
-
}), [["__scopeId", "data-v-2e68af88"]]),
|
|
796
|
+
}), [["__scopeId", "data-v-2e68af88"]]), gt = {
|
|
795
797
|
id: "iam-tenant-standard-page-enhancement",
|
|
796
798
|
target: { moduleAlias: "iam.tenant" },
|
|
797
799
|
form: {
|
|
@@ -808,7 +810,7 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
808
810
|
...["lightLogoAssetId", "darkLogoAssetId"].map((e) => ({
|
|
809
811
|
fieldName: e,
|
|
810
812
|
imageUploadHint: ({ draft: e }) => e.workbenchBrandMode === "logoOnly" ? "纯 Logo 模式支持横向或正方形图片(最大 512 KB)" : "Logo + 标题模式仅支持正方形图片(建议 128 × 128 px,最大 512 KB)",
|
|
811
|
-
imageUploadAdvisory: ({ draft: e }) => e.workbenchBrandMode === "logoOnly" ? void 0 :
|
|
813
|
+
imageUploadAdvisory: ({ draft: e }) => e.workbenchBrandMode === "logoOnly" ? void 0 : _t
|
|
812
814
|
}))
|
|
813
815
|
]
|
|
814
816
|
},
|
|
@@ -820,28 +822,28 @@ var ot = { class: "password-policy-preview" }, st = {
|
|
|
820
822
|
run({ openDrawer: e }) {
|
|
821
823
|
e({
|
|
822
824
|
title: "配置应用",
|
|
823
|
-
width:
|
|
824
|
-
component:
|
|
825
|
+
width: "wide",
|
|
826
|
+
component: ht
|
|
825
827
|
});
|
|
826
828
|
}
|
|
827
829
|
}],
|
|
828
830
|
sections: [{
|
|
829
831
|
key: "tenant-applications",
|
|
830
832
|
title: "已开通应用",
|
|
831
|
-
component:
|
|
833
|
+
component: pt
|
|
832
834
|
}]
|
|
833
835
|
}
|
|
834
836
|
};
|
|
835
|
-
async function
|
|
837
|
+
async function _t(e) {
|
|
836
838
|
if (!e.type.startsWith("image/") || typeof Image > "u") return "Logo + 标题模式需要可读取的正方形图片。";
|
|
837
839
|
try {
|
|
838
|
-
let { width: t, height: n } = await
|
|
840
|
+
let { width: t, height: n } = await vt(e), r = t / n;
|
|
839
841
|
return r >= .9 && r <= 1.1 ? void 0 : `“${e.name}”为 ${t} × ${n} px;Logo + 标题模式仅允许上传正方形 Logo。`;
|
|
840
842
|
} catch {
|
|
841
843
|
return "无法读取图片尺寸,请选择正方形 PNG、JPG 或 GIF 图片。";
|
|
842
844
|
}
|
|
843
845
|
}
|
|
844
|
-
function
|
|
846
|
+
function vt(e) {
|
|
845
847
|
let t = URL.createObjectURL(e);
|
|
846
848
|
return new Promise((e, n) => {
|
|
847
849
|
let r = new Image();
|
|
@@ -857,38 +859,38 @@ function _t(e) {
|
|
|
857
859
|
}
|
|
858
860
|
//#endregion
|
|
859
861
|
//#region src/platform-admin-runtime/employee/EmployeeAccountDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
860
|
-
var
|
|
862
|
+
var yt = {
|
|
861
863
|
key: 1,
|
|
862
864
|
class: "employee-account-drawer"
|
|
863
|
-
},
|
|
865
|
+
}, bt = { class: "employee-account-existing-picker" }, xt = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
864
866
|
name: "EmployeeAccountDrawer",
|
|
865
867
|
__name: "EmployeeAccountDrawer",
|
|
866
868
|
props: { context: {} },
|
|
867
869
|
setup(e) {
|
|
868
|
-
let
|
|
869
|
-
|
|
870
|
+
let t = e, n = J(), r = J(), i = J(""), a = J(""), o = J(!1), c = J(!1);
|
|
871
|
+
be(() => void l());
|
|
870
872
|
async function l() {
|
|
871
|
-
let e =
|
|
873
|
+
let e = v();
|
|
872
874
|
if (e) {
|
|
873
|
-
|
|
875
|
+
o.value = !0;
|
|
874
876
|
try {
|
|
875
|
-
|
|
877
|
+
n.value = await t.context.module.http.request({ path: `/iam.employee/${encodeURIComponent(e)}/account` });
|
|
876
878
|
} catch (e) {
|
|
877
|
-
|
|
879
|
+
T(e, {
|
|
878
880
|
source: "employee-account",
|
|
879
881
|
phase: "load"
|
|
880
882
|
});
|
|
881
883
|
} finally {
|
|
882
|
-
|
|
884
|
+
o.value = !1;
|
|
883
885
|
}
|
|
884
886
|
}
|
|
885
887
|
}
|
|
886
888
|
async function u() {
|
|
887
|
-
let e =
|
|
889
|
+
let e = v();
|
|
888
890
|
if (!e || c.value) return;
|
|
889
|
-
let
|
|
890
|
-
if (!
|
|
891
|
-
|
|
891
|
+
let r = i.value.trim();
|
|
892
|
+
if (!r || !a.value) {
|
|
893
|
+
w("请输入账号和初始密码。", {
|
|
892
894
|
source: "employee-account",
|
|
893
895
|
phase: "validation"
|
|
894
896
|
});
|
|
@@ -896,17 +898,17 @@ var vt = {
|
|
|
896
898
|
}
|
|
897
899
|
c.value = !0;
|
|
898
900
|
try {
|
|
899
|
-
let i = await
|
|
901
|
+
let i = await t.context.module.http.request({
|
|
900
902
|
method: "POST",
|
|
901
903
|
path: `/iam.employee/${encodeURIComponent(e)}/account/provision`,
|
|
902
904
|
body: {
|
|
903
|
-
username:
|
|
904
|
-
password:
|
|
905
|
+
username: r,
|
|
906
|
+
password: a.value
|
|
905
907
|
}
|
|
906
908
|
});
|
|
907
|
-
|
|
909
|
+
n.value = D(i).binding, a.value = "", t.context.refreshList();
|
|
908
910
|
} catch (e) {
|
|
909
|
-
|
|
911
|
+
T(e, {
|
|
910
912
|
source: "employee-account",
|
|
911
913
|
phase: "action"
|
|
912
914
|
});
|
|
@@ -914,63 +916,84 @@ var vt = {
|
|
|
914
916
|
c.value = !1;
|
|
915
917
|
}
|
|
916
918
|
}
|
|
917
|
-
async function d() {
|
|
918
|
-
let
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
body: {
|
|
932
|
-
keyword: t,
|
|
933
|
-
enabledOnly: !0,
|
|
934
|
-
page: {
|
|
935
|
-
pageNum: 1,
|
|
936
|
-
pageSize: 20
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
})).records.find((e) => e.username === t);
|
|
940
|
-
if (!a?.id) {
|
|
941
|
-
T("未找到启用中的同名用户账号。", {
|
|
919
|
+
async function d(e) {
|
|
920
|
+
let t = e[0];
|
|
921
|
+
t && await f(t.id);
|
|
922
|
+
}
|
|
923
|
+
async function f(e) {
|
|
924
|
+
let i = v();
|
|
925
|
+
if (i && e && !c.value) {
|
|
926
|
+
c.value = !0;
|
|
927
|
+
try {
|
|
928
|
+
n.value = await t.context.module.http.request({
|
|
929
|
+
method: "POST",
|
|
930
|
+
path: `/iam.employee/${encodeURIComponent(i)}/account`,
|
|
931
|
+
body: { userId: e }
|
|
932
|
+
}), r.value = void 0, t.context.refreshList(), w("账号已绑定到当前职员。", {
|
|
942
933
|
source: "employee-account",
|
|
943
934
|
phase: "action"
|
|
944
935
|
});
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
if (a.employeeId) {
|
|
948
|
-
T("该用户已绑定其他职员,不能重复绑定。", {
|
|
936
|
+
} catch (e) {
|
|
937
|
+
T(e, {
|
|
949
938
|
source: "employee-account",
|
|
950
939
|
phase: "action"
|
|
951
940
|
});
|
|
952
|
-
|
|
941
|
+
} finally {
|
|
942
|
+
c.value = !1;
|
|
953
943
|
}
|
|
954
|
-
r.value = await n.context.module.http.request({
|
|
955
|
-
method: "POST",
|
|
956
|
-
path: `/iam.employee/${encodeURIComponent(e)}/account`,
|
|
957
|
-
body: { userId: a.id }
|
|
958
|
-
}), i.value = "", n.context.refreshList(), T("账号已绑定到当前职员。", {
|
|
959
|
-
source: "employee-account",
|
|
960
|
-
phase: "action"
|
|
961
|
-
});
|
|
962
|
-
} catch (e) {
|
|
963
|
-
L(e, {
|
|
964
|
-
source: "employee-account",
|
|
965
|
-
phase: "action"
|
|
966
|
-
});
|
|
967
|
-
} finally {
|
|
968
|
-
c.value = !1;
|
|
969
944
|
}
|
|
970
945
|
}
|
|
971
|
-
async function
|
|
972
|
-
let
|
|
973
|
-
if (
|
|
946
|
+
async function p(e) {
|
|
947
|
+
let n = v();
|
|
948
|
+
if (!n) return {
|
|
949
|
+
records: [],
|
|
950
|
+
total: 0
|
|
951
|
+
};
|
|
952
|
+
let r = await t.context.module.http.request({
|
|
953
|
+
method: "POST",
|
|
954
|
+
path: `/iam.employee/${encodeURIComponent(n)}/account-candidates/query`,
|
|
955
|
+
body: {
|
|
956
|
+
keyword: e.keyword,
|
|
957
|
+
page: {
|
|
958
|
+
pageNum: e.pageNum,
|
|
959
|
+
pageSize: e.pageSize
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
return {
|
|
964
|
+
records: r.records.map(g),
|
|
965
|
+
total: r.total
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
async function h(e) {
|
|
969
|
+
let n = v();
|
|
970
|
+
return !n || e.length === 0 ? [] : (await t.context.module.http.request({
|
|
971
|
+
method: "POST",
|
|
972
|
+
path: `/iam.employee/${encodeURIComponent(n)}/account-candidates/query`,
|
|
973
|
+
body: {
|
|
974
|
+
ids: e,
|
|
975
|
+
page: {
|
|
976
|
+
pageNum: 1,
|
|
977
|
+
pageSize: e.length
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
})).records.map(g);
|
|
981
|
+
}
|
|
982
|
+
function g(e) {
|
|
983
|
+
return {
|
|
984
|
+
id: e.id,
|
|
985
|
+
title: e.username ?? e.id,
|
|
986
|
+
account: e.username ?? e.id,
|
|
987
|
+
employeeName: e.employeeTitle,
|
|
988
|
+
organizationId: e.organizationId,
|
|
989
|
+
organizationName: e.organizationTitle,
|
|
990
|
+
departmentId: e.departmentId,
|
|
991
|
+
departmentName: e.departmentTitle
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
async function _() {
|
|
995
|
+
let e = v();
|
|
996
|
+
if (e && n.value && !c.value && await s({
|
|
974
997
|
title: "移除账户",
|
|
975
998
|
content: "确认移除该职员的账户?该用户账号会同步删除。",
|
|
976
999
|
okText: "移除",
|
|
@@ -978,12 +1001,12 @@ var vt = {
|
|
|
978
1001
|
})) {
|
|
979
1002
|
c.value = !0;
|
|
980
1003
|
try {
|
|
981
|
-
await
|
|
1004
|
+
await t.context.module.http.request({
|
|
982
1005
|
method: "POST",
|
|
983
1006
|
path: `/iam.employee/${encodeURIComponent(e)}/account/delete`
|
|
984
|
-
}),
|
|
1007
|
+
}), n.value = void 0, t.context.refreshList();
|
|
985
1008
|
} catch (e) {
|
|
986
|
-
|
|
1009
|
+
T(e, {
|
|
987
1010
|
source: "employee-account",
|
|
988
1011
|
phase: "action"
|
|
989
1012
|
});
|
|
@@ -992,67 +1015,61 @@ var vt = {
|
|
|
992
1015
|
}
|
|
993
1016
|
}
|
|
994
1017
|
}
|
|
995
|
-
function
|
|
996
|
-
let e =
|
|
1018
|
+
function v() {
|
|
1019
|
+
let e = t.context.record?.id;
|
|
997
1020
|
return e == null ? void 0 : String(e);
|
|
998
1021
|
}
|
|
999
|
-
return (e,
|
|
1022
|
+
return (e, t) => o.value ? (q(), B(X(re), {
|
|
1000
1023
|
key: 0,
|
|
1001
1024
|
tip: "加载账号绑定"
|
|
1002
|
-
})) : (q(), H("section",
|
|
1025
|
+
})) : (q(), H("section", yt, [v() ? n.value ? (q(), H(R, { key: 1 }, [U("p", null, "当前已绑定用户:" + Y(n.value.userId ?? "-"), 1), G(X(S), {
|
|
1003
1026
|
danger: "",
|
|
1004
1027
|
"icon-name": "delete",
|
|
1005
1028
|
loading: c.value,
|
|
1006
|
-
onClick:
|
|
1029
|
+
onClick: _
|
|
1007
1030
|
}, {
|
|
1008
|
-
default: Q(() => [...
|
|
1031
|
+
default: Q(() => [...t[3] ||= [W("移除账户", -1)]]),
|
|
1009
1032
|
_: 1
|
|
1010
|
-
}, 8, ["loading"])], 64)) : (q(), H(R, { key: 2 }, [U("
|
|
1011
|
-
|
|
1012
|
-
|
|
1033
|
+
}, 8, ["loading"])], 64)) : (q(), H(R, { key: 2 }, [U("section", bt, [t[4] ||= U("p", null, "绑定已有用户账号;仅显示当前租户内启用且尚未绑定其他职员的账号。", -1), G(X(C), {
|
|
1034
|
+
value: r.value,
|
|
1035
|
+
disabled: c.value,
|
|
1036
|
+
placeholder: "搜索并选择已有登录账号",
|
|
1037
|
+
title: "选择已有登录账号",
|
|
1038
|
+
"search-page": p,
|
|
1039
|
+
"resolve-users": h,
|
|
1040
|
+
"onUpdate:value": t[0] ||= (e) => r.value = typeof e == "string" ? e : void 0,
|
|
1041
|
+
onSelect: d
|
|
1042
|
+
}, null, 8, ["value", "disabled"])]), U("form", { onSubmit: De(u, ["prevent"]) }, [
|
|
1043
|
+
t[8] ||= U("p", null, "也可直接创建登录账号并自动绑定到当前职员。", -1),
|
|
1044
|
+
U("label", null, [t[5] ||= U("span", null, "账号", -1), G(X(A), {
|
|
1013
1045
|
value: i.value,
|
|
1014
|
-
"onUpdate:value":
|
|
1015
|
-
disabled: c.value,
|
|
1016
|
-
placeholder: "请输入已有登录账号"
|
|
1017
|
-
}, null, 8, ["value", "disabled"])]),
|
|
1018
|
-
G(X(_), {
|
|
1019
|
-
"html-type": "submit",
|
|
1020
|
-
loading: c.value
|
|
1021
|
-
}, {
|
|
1022
|
-
default: Q(() => [...n[5] ||= [W(" 绑定已有账号 ", -1)]]),
|
|
1023
|
-
_: 1
|
|
1024
|
-
}, 8, ["loading"])
|
|
1025
|
-
], 32), U("form", { onSubmit: Ee(u, ["prevent"]) }, [
|
|
1026
|
-
n[10] ||= U("p", null, "也可直接创建登录账号并自动绑定到当前职员。", -1),
|
|
1027
|
-
U("label", null, [n[7] ||= U("span", null, "账号", -1), G(X(w), {
|
|
1028
|
-
value: a.value,
|
|
1029
|
-
"onUpdate:value": n[1] ||= (e) => a.value = e,
|
|
1046
|
+
"onUpdate:value": t[1] ||= (e) => i.value = e,
|
|
1030
1047
|
disabled: c.value,
|
|
1031
1048
|
placeholder: "请输入登录账号"
|
|
1032
1049
|
}, null, 8, ["value", "disabled"])]),
|
|
1033
|
-
U("label", null, [
|
|
1034
|
-
value:
|
|
1035
|
-
"onUpdate:value":
|
|
1050
|
+
U("label", null, [t[6] ||= U("span", null, "初始密码", -1), G(X(A), {
|
|
1051
|
+
value: a.value,
|
|
1052
|
+
"onUpdate:value": t[2] ||= (e) => a.value = e,
|
|
1036
1053
|
type: "password",
|
|
1037
1054
|
disabled: c.value,
|
|
1038
1055
|
placeholder: "请输入初始密码"
|
|
1039
1056
|
}, null, 8, ["value", "disabled"])]),
|
|
1040
|
-
G(X(
|
|
1057
|
+
G(X(S), {
|
|
1041
1058
|
type: "primary",
|
|
1042
1059
|
"html-type": "submit",
|
|
1043
1060
|
"icon-name": "plus",
|
|
1044
1061
|
loading: c.value
|
|
1045
1062
|
}, {
|
|
1046
|
-
default: Q(() => [...
|
|
1063
|
+
default: Q(() => [...t[7] ||= [W(" 创建账号并绑定 ", -1)]]),
|
|
1047
1064
|
_: 1
|
|
1048
1065
|
}, 8, ["loading"])
|
|
1049
|
-
], 32)], 64)) : (q(), B(X(
|
|
1066
|
+
], 32)], 64)) : (q(), B(X(m), {
|
|
1050
1067
|
key: 0,
|
|
1051
1068
|
title: "职员不存在",
|
|
1052
1069
|
message: "请重新打开职员档案后再设置账号。"
|
|
1053
1070
|
}))]));
|
|
1054
1071
|
}
|
|
1055
|
-
}), [["__scopeId", "data-v-
|
|
1072
|
+
}), [["__scopeId", "data-v-aa8474e1"]]), St = {
|
|
1056
1073
|
id: "iam-employee-account-drawer",
|
|
1057
1074
|
target: { moduleAlias: "iam.employee" },
|
|
1058
1075
|
detail: { actions: [{
|
|
@@ -1063,88 +1080,88 @@ var vt = {
|
|
|
1063
1080
|
let r = t.id == null ? void 0 : String(t.id);
|
|
1064
1081
|
r && e.can("employeeAccounts", r) !== !1 && n({
|
|
1065
1082
|
title: "设置账号",
|
|
1066
|
-
width:
|
|
1067
|
-
component:
|
|
1083
|
+
width: "standard",
|
|
1084
|
+
component: xt
|
|
1068
1085
|
});
|
|
1069
1086
|
}
|
|
1070
1087
|
}] }
|
|
1071
|
-
},
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1088
|
+
}, Ct = "muyun.auth.token", wt = "muyun.auth.sessionId";
|
|
1089
|
+
function Tt(e) {
|
|
1090
|
+
return Et() ?? jt(e);
|
|
1074
1091
|
}
|
|
1075
|
-
function
|
|
1076
|
-
if (!(typeof window > "u")) return
|
|
1092
|
+
function Et() {
|
|
1093
|
+
if (!(typeof window > "u")) return jt(window.localStorage.getItem(Ct));
|
|
1077
1094
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!(typeof window > "u")) return
|
|
1095
|
+
function Dt() {
|
|
1096
|
+
if (!(typeof window > "u")) return jt(window.localStorage.getItem(wt));
|
|
1080
1097
|
}
|
|
1081
|
-
function
|
|
1082
|
-
typeof window > "u" || window.localStorage.setItem(
|
|
1098
|
+
function Ot(e) {
|
|
1099
|
+
typeof window > "u" || window.localStorage.setItem(Ct, e);
|
|
1083
1100
|
}
|
|
1084
|
-
function
|
|
1101
|
+
function kt(e) {
|
|
1085
1102
|
if (typeof window > "u") return;
|
|
1086
|
-
let t =
|
|
1103
|
+
let t = jt(e);
|
|
1087
1104
|
if (t) {
|
|
1088
|
-
window.localStorage.setItem(
|
|
1105
|
+
window.localStorage.setItem(wt, t);
|
|
1089
1106
|
return;
|
|
1090
1107
|
}
|
|
1091
|
-
window.localStorage.removeItem(
|
|
1108
|
+
window.localStorage.removeItem(wt);
|
|
1092
1109
|
}
|
|
1093
|
-
function
|
|
1094
|
-
typeof window > "u" || (window.localStorage.removeItem(
|
|
1110
|
+
function At() {
|
|
1111
|
+
typeof window > "u" || (window.localStorage.removeItem(Ct), window.localStorage.removeItem(wt));
|
|
1095
1112
|
}
|
|
1096
|
-
function
|
|
1113
|
+
function jt(e) {
|
|
1097
1114
|
return e?.trim() || void 0;
|
|
1098
1115
|
}
|
|
1099
|
-
function
|
|
1116
|
+
function Mt(e, t) {
|
|
1100
1117
|
return !1;
|
|
1101
1118
|
}
|
|
1102
1119
|
//#endregion
|
|
1103
1120
|
//#region src/platform-admin-runtime/backendHttp.ts
|
|
1104
|
-
function
|
|
1105
|
-
return
|
|
1121
|
+
function Nt(e = {}) {
|
|
1122
|
+
return F({
|
|
1106
1123
|
baseUrl: void 0,
|
|
1107
|
-
token: e.withAuth === !1 ? void 0 :
|
|
1108
|
-
credentials:
|
|
1109
|
-
onAuthenticationRequired: e.withAuth === !1 ? void 0 : (e, t) =>
|
|
1124
|
+
token: e.withAuth === !1 ? void 0 : Tt(void 0),
|
|
1125
|
+
credentials: Pt(void 0),
|
|
1126
|
+
onAuthenticationRequired: e.withAuth === !1 ? void 0 : (e, t) => Mt(e, t)
|
|
1110
1127
|
});
|
|
1111
1128
|
}
|
|
1112
|
-
function
|
|
1129
|
+
function Pt(e) {
|
|
1113
1130
|
return e === "include" || e === "omit" || e === "same-origin" ? e : void 0;
|
|
1114
1131
|
}
|
|
1115
1132
|
//#endregion
|
|
1116
1133
|
//#region src/platform-admin-runtime/realtime.ts
|
|
1117
|
-
var
|
|
1118
|
-
function
|
|
1119
|
-
return
|
|
1134
|
+
var Ft = Oe(), It = /* @__PURE__ */ new Map(), Lt = /* @__PURE__ */ new Set(), Rt, zt, Bt = 3e4;
|
|
1135
|
+
function Vt(e = {}) {
|
|
1136
|
+
return g({
|
|
1120
1137
|
baseUrl: e.baseUrl ?? void 0,
|
|
1121
|
-
token: e.token ??
|
|
1138
|
+
token: e.token ?? Tt(void 0),
|
|
1122
1139
|
onStateChange: (t) => {
|
|
1123
1140
|
e.onStateChange?.(t), t === "unauthorized" && e.onUnauthorized?.();
|
|
1124
1141
|
}
|
|
1125
1142
|
});
|
|
1126
1143
|
}
|
|
1127
|
-
function
|
|
1128
|
-
if (
|
|
1129
|
-
let
|
|
1130
|
-
|
|
1131
|
-
let
|
|
1144
|
+
function Ht(e = {}) {
|
|
1145
|
+
if (zt) throw Error("App realtime is already connected. Disconnect the active connection before reconnecting.");
|
|
1146
|
+
let n = Vt(e);
|
|
1147
|
+
Rt = n;
|
|
1148
|
+
let r = t(n, Ft), i = v(n, (t) => {
|
|
1132
1149
|
e.onUserNotification?.(t);
|
|
1133
|
-
}),
|
|
1150
|
+
}), a = ne(n, (t) => {
|
|
1134
1151
|
e.onBusinessNotification?.(t);
|
|
1135
|
-
}),
|
|
1136
|
-
for (let t of
|
|
1137
|
-
}),
|
|
1138
|
-
|
|
1139
|
-
let
|
|
1140
|
-
|
|
1152
|
+
}), o = p(n, (e) => {
|
|
1153
|
+
for (let t of Lt) t(e);
|
|
1154
|
+
}), s = Wt(n);
|
|
1155
|
+
s.start(), Jt(n), n.connect();
|
|
1156
|
+
let c = !1, l = { async disconnect() {
|
|
1157
|
+
c || (c = !0, r.unsubscribe(), i.unsubscribe(), a.unsubscribe(), o.unsubscribe(), s.stop(), Yt(), zt === l && (zt = void 0), Rt === n && (Rt = void 0), await n.disconnect());
|
|
1141
1158
|
} };
|
|
1142
|
-
return
|
|
1159
|
+
return zt = l, l;
|
|
1143
1160
|
}
|
|
1144
|
-
async function
|
|
1145
|
-
await
|
|
1161
|
+
async function Ut() {
|
|
1162
|
+
await zt?.disconnect();
|
|
1146
1163
|
}
|
|
1147
|
-
function
|
|
1164
|
+
function Wt(e) {
|
|
1148
1165
|
let t = 0, n = [
|
|
1149
1166
|
"pointermove",
|
|
1150
1167
|
"pointerdown",
|
|
@@ -1170,57 +1187,57 @@ function Ht(e) {
|
|
|
1170
1187
|
function a(n) {
|
|
1171
1188
|
if (e.state() !== "connected") return;
|
|
1172
1189
|
let r = Date.now();
|
|
1173
|
-
if (!(!n && r - t <
|
|
1190
|
+
if (!(!n && r - t < Bt)) {
|
|
1174
1191
|
t = r;
|
|
1175
1192
|
try {
|
|
1176
|
-
e.publish(
|
|
1193
|
+
e.publish(k, { timestamp: new Date(r).toISOString() });
|
|
1177
1194
|
} catch {}
|
|
1178
1195
|
}
|
|
1179
1196
|
}
|
|
1180
1197
|
}
|
|
1181
|
-
function
|
|
1198
|
+
function Gt(e) {
|
|
1182
1199
|
let t = e.trim();
|
|
1183
1200
|
if (!t) throw Error("Module data change subscription requires a moduleAlias");
|
|
1184
|
-
let n =
|
|
1201
|
+
let n = It.get(t) ?? {
|
|
1185
1202
|
moduleAlias: t,
|
|
1186
1203
|
references: 0
|
|
1187
1204
|
};
|
|
1188
|
-
return n.references += 1,
|
|
1189
|
-
--n.references, !(n.references > 0) && (n.active?.unsubscribe(), n.active = void 0,
|
|
1205
|
+
return n.references += 1, It.set(t, n), !n.active && Rt && (n.active = Xt(Rt, t)), { unsubscribe() {
|
|
1206
|
+
--n.references, !(n.references > 0) && (n.active?.unsubscribe(), n.active = void 0, It.delete(t));
|
|
1190
1207
|
} };
|
|
1191
1208
|
}
|
|
1192
|
-
function
|
|
1193
|
-
return
|
|
1209
|
+
function Kt(e) {
|
|
1210
|
+
return Ft.subscribe(e);
|
|
1194
1211
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1197
|
-
|
|
1212
|
+
function qt(e) {
|
|
1213
|
+
return Lt.add(e), { unsubscribe() {
|
|
1214
|
+
Lt.delete(e);
|
|
1198
1215
|
} };
|
|
1199
1216
|
}
|
|
1200
|
-
function
|
|
1201
|
-
for (let t of
|
|
1217
|
+
function Jt(e) {
|
|
1218
|
+
for (let t of It.values()) t.active?.unsubscribe(), t.active = Xt(e, t.moduleAlias);
|
|
1202
1219
|
}
|
|
1203
|
-
function
|
|
1204
|
-
for (let e of
|
|
1220
|
+
function Yt() {
|
|
1221
|
+
for (let e of It.values()) e.active?.unsubscribe(), e.active = void 0;
|
|
1205
1222
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return e.subscribe(
|
|
1208
|
-
|
|
1223
|
+
function Xt(e, t) {
|
|
1224
|
+
return e.subscribe(ee(t), (e) => {
|
|
1225
|
+
Ft.dispatch(e);
|
|
1209
1226
|
});
|
|
1210
1227
|
}
|
|
1211
1228
|
//#endregion
|
|
1212
1229
|
//#region src/platform-admin-runtime/user/userOnlineStatusStore.ts
|
|
1213
|
-
var
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1230
|
+
var Zt = "iam.user.session.collectionChanged", Qt = J({}), $t = /* @__PURE__ */ new Set(), en = !1, tn = !1;
|
|
1231
|
+
function nn() {
|
|
1232
|
+
rn();
|
|
1216
1233
|
function e(e) {
|
|
1217
|
-
e && !
|
|
1234
|
+
e && !Qt.value[e] && ($t.add(e), an());
|
|
1218
1235
|
}
|
|
1219
1236
|
function t(e) {
|
|
1220
|
-
return e ?
|
|
1237
|
+
return e ? Qt.value[e] : void 0;
|
|
1221
1238
|
}
|
|
1222
1239
|
function n(e) {
|
|
1223
|
-
e && (
|
|
1240
|
+
e && ($t.add(e), an());
|
|
1224
1241
|
}
|
|
1225
1242
|
return {
|
|
1226
1243
|
observe: e,
|
|
@@ -1228,41 +1245,41 @@ function en() {
|
|
|
1228
1245
|
refresh: n
|
|
1229
1246
|
};
|
|
1230
1247
|
}
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1233
|
-
|
|
1248
|
+
function rn() {
|
|
1249
|
+
tn || (tn = !0, qt((e) => {
|
|
1250
|
+
sn(e) && ($t.add(e.recordId), an());
|
|
1234
1251
|
}));
|
|
1235
1252
|
}
|
|
1236
|
-
function
|
|
1237
|
-
|
|
1238
|
-
|
|
1253
|
+
function an() {
|
|
1254
|
+
en || (en = !0, queueMicrotask(() => {
|
|
1255
|
+
en = !1, on();
|
|
1239
1256
|
}));
|
|
1240
1257
|
}
|
|
1241
|
-
async function
|
|
1242
|
-
let e = Array.from(
|
|
1243
|
-
if (
|
|
1244
|
-
let t = await
|
|
1258
|
+
async function on() {
|
|
1259
|
+
let e = Array.from($t);
|
|
1260
|
+
if ($t.clear(), e.length !== 0) try {
|
|
1261
|
+
let t = await Nt().request({
|
|
1245
1262
|
method: "POST",
|
|
1246
1263
|
path: "/iam.user/sessions/status",
|
|
1247
1264
|
body: { userIds: e }
|
|
1248
1265
|
});
|
|
1249
|
-
|
|
1250
|
-
...
|
|
1266
|
+
Qt.value = {
|
|
1267
|
+
...Qt.value,
|
|
1251
1268
|
...Object.fromEntries(t.map((e) => [e.userId, e]))
|
|
1252
1269
|
};
|
|
1253
1270
|
} catch (e) {
|
|
1254
|
-
|
|
1271
|
+
T(e, {
|
|
1255
1272
|
source: "iam-user-online-status",
|
|
1256
1273
|
phase: "load"
|
|
1257
1274
|
});
|
|
1258
1275
|
}
|
|
1259
1276
|
}
|
|
1260
|
-
function
|
|
1261
|
-
return e.type ===
|
|
1277
|
+
function sn(e) {
|
|
1278
|
+
return e.type === Zt && e.moduleAlias === "iam.user" && !!e.recordId;
|
|
1262
1279
|
}
|
|
1263
1280
|
//#endregion
|
|
1264
1281
|
//#region src/platform-admin-runtime/user/UserOnlineStatusCell.vue
|
|
1265
|
-
var
|
|
1282
|
+
var cn = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
1266
1283
|
name: "UserOnlineStatusCell",
|
|
1267
1284
|
__name: "UserOnlineStatusCell",
|
|
1268
1285
|
props: {
|
|
@@ -1270,7 +1287,7 @@ var on = /*#__PURE__*/ a(/* @__PURE__ */ K({
|
|
|
1270
1287
|
column: {}
|
|
1271
1288
|
},
|
|
1272
1289
|
setup(e) {
|
|
1273
|
-
let t = e, n =
|
|
1290
|
+
let t = e, n = nn(), r = z(() => t.record.id == null ? void 0 : String(t.record.id)), i = z(() => n.statusOf(r.value)), a = z(() => {
|
|
1274
1291
|
let e = i.value;
|
|
1275
1292
|
if (!e) return "-";
|
|
1276
1293
|
if (e.present) {
|
|
@@ -1282,100 +1299,100 @@ var on = /*#__PURE__*/ a(/* @__PURE__ */ K({
|
|
|
1282
1299
|
function o() {
|
|
1283
1300
|
n.observe(r.value);
|
|
1284
1301
|
}
|
|
1285
|
-
return
|
|
1302
|
+
return be(o), Z(r, o), (e, t) => (q(), H("span", { class: _e({
|
|
1286
1303
|
"user-online-status--present": i.value?.present,
|
|
1287
1304
|
"user-online-status--offline": i.value && !i.value.online
|
|
1288
1305
|
}) }, Y(a.value), 3));
|
|
1289
1306
|
}
|
|
1290
|
-
}), [["__scopeId", "data-v-789ddd4a"]]),
|
|
1307
|
+
}), [["__scopeId", "data-v-789ddd4a"]]), ln = {
|
|
1291
1308
|
key: 1,
|
|
1292
1309
|
class: "user-password-drawer"
|
|
1293
|
-
},
|
|
1310
|
+
}, un = { key: 0 }, dn = {
|
|
1294
1311
|
key: 1,
|
|
1295
1312
|
class: "user-password-reset"
|
|
1296
|
-
},
|
|
1313
|
+
}, fn = { key: 0 }, pn = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
1297
1314
|
name: "UserPasswordDrawer",
|
|
1298
1315
|
__name: "UserPasswordDrawer",
|
|
1299
1316
|
props: { context: {} },
|
|
1300
1317
|
setup(e) {
|
|
1301
|
-
let
|
|
1302
|
-
async function
|
|
1303
|
-
let e =
|
|
1304
|
-
if (e && !
|
|
1305
|
-
if (!
|
|
1306
|
-
|
|
1318
|
+
let t = e, n = J(""), r = J(), i = J(!1), a = z(() => t.context.record?.id == null ? void 0 : String(t.context.record.id));
|
|
1319
|
+
async function o() {
|
|
1320
|
+
let e = a.value;
|
|
1321
|
+
if (e && !i.value && t.context.module.can("changePassword", e) === !0) {
|
|
1322
|
+
if (!n.value) {
|
|
1323
|
+
w("请输入新密码。", {
|
|
1307
1324
|
source: "iam-user-password",
|
|
1308
1325
|
phase: "validation"
|
|
1309
1326
|
});
|
|
1310
1327
|
return;
|
|
1311
1328
|
}
|
|
1312
|
-
|
|
1329
|
+
i.value = !0, t.context.setCloseBlocked(!0);
|
|
1313
1330
|
try {
|
|
1314
|
-
await
|
|
1331
|
+
await t.context.module.http.request({
|
|
1315
1332
|
method: "POST",
|
|
1316
1333
|
path: `/iam.user/changePassword/${encodeURIComponent(e)}`,
|
|
1317
|
-
body: { password:
|
|
1318
|
-
}),
|
|
1334
|
+
body: { password: n.value }
|
|
1335
|
+
}), n.value = "", w("密码已修改。", {
|
|
1319
1336
|
source: "iam-user-password",
|
|
1320
1337
|
phase: "action"
|
|
1321
|
-
}),
|
|
1338
|
+
}), t.context.refreshList(), t.context.refreshDetailExtensions();
|
|
1322
1339
|
} catch (e) {
|
|
1323
|
-
|
|
1340
|
+
T(e, {
|
|
1324
1341
|
source: "iam-user-password",
|
|
1325
1342
|
phase: "action"
|
|
1326
1343
|
});
|
|
1327
1344
|
} finally {
|
|
1328
|
-
|
|
1345
|
+
t.context.setCloseBlocked(!1), i.value = !1;
|
|
1329
1346
|
}
|
|
1330
1347
|
}
|
|
1331
1348
|
}
|
|
1332
|
-
async function
|
|
1333
|
-
let e =
|
|
1334
|
-
if (e && !
|
|
1335
|
-
|
|
1349
|
+
async function s() {
|
|
1350
|
+
let e = a.value;
|
|
1351
|
+
if (e && !i.value && t.context.module.can("resetPassword", e) === !0) {
|
|
1352
|
+
i.value = !0, t.context.setCloseBlocked(!0);
|
|
1336
1353
|
try {
|
|
1337
|
-
|
|
1354
|
+
r.value = await t.context.module.http.request({
|
|
1338
1355
|
method: "POST",
|
|
1339
1356
|
path: `/iam.user/resetPassword/${encodeURIComponent(e)}`
|
|
1340
|
-
}),
|
|
1357
|
+
}), t.context.refreshList(), t.context.refreshDetailExtensions();
|
|
1341
1358
|
} catch (e) {
|
|
1342
|
-
|
|
1359
|
+
T(e, {
|
|
1343
1360
|
source: "iam-user-password",
|
|
1344
1361
|
phase: "action"
|
|
1345
1362
|
});
|
|
1346
1363
|
} finally {
|
|
1347
|
-
|
|
1364
|
+
t.context.setCloseBlocked(!1), i.value = !1;
|
|
1348
1365
|
}
|
|
1349
1366
|
}
|
|
1350
1367
|
}
|
|
1351
|
-
return (
|
|
1352
|
-
|
|
1353
|
-
G(X(
|
|
1354
|
-
value:
|
|
1355
|
-
"onUpdate:value":
|
|
1368
|
+
return (t, c) => a.value ? (q(), H("section", ln, [e.context.module.can("changePassword", a.value) === !0 ? (q(), H("label", un, [
|
|
1369
|
+
c[2] ||= U("span", null, "新密码", -1),
|
|
1370
|
+
G(X(A), {
|
|
1371
|
+
value: n.value,
|
|
1372
|
+
"onUpdate:value": c[0] ||= (e) => n.value = e,
|
|
1356
1373
|
type: "password",
|
|
1357
|
-
disabled:
|
|
1374
|
+
disabled: i.value,
|
|
1358
1375
|
placeholder: "请输入新密码"
|
|
1359
1376
|
}, null, 8, ["value", "disabled"]),
|
|
1360
|
-
G(X(
|
|
1377
|
+
G(X(S), {
|
|
1361
1378
|
type: "primary",
|
|
1362
|
-
loading:
|
|
1363
|
-
onClick:
|
|
1379
|
+
loading: i.value,
|
|
1380
|
+
onClick: o
|
|
1364
1381
|
}, {
|
|
1365
|
-
default: Q(() => [...
|
|
1382
|
+
default: Q(() => [...c[1] ||= [W("修改密码", -1)]]),
|
|
1366
1383
|
_: 1
|
|
1367
1384
|
}, 8, ["loading"])
|
|
1368
|
-
])) : V("v-if", !0), e.context.module.can("resetPassword",
|
|
1369
|
-
|
|
1370
|
-
G(X(
|
|
1371
|
-
loading:
|
|
1372
|
-
onClick:
|
|
1385
|
+
])) : V("v-if", !0), e.context.module.can("resetPassword", a.value) === !0 ? (q(), H("section", dn, [
|
|
1386
|
+
c[6] ||= U("p", null, "由系统生成临时密码。请在安全渠道交付给用户,并提醒其尽快修改。", -1),
|
|
1387
|
+
G(X(S), {
|
|
1388
|
+
loading: i.value,
|
|
1389
|
+
onClick: s
|
|
1373
1390
|
}, {
|
|
1374
|
-
default: Q(() => [...
|
|
1391
|
+
default: Q(() => [...c[3] ||= [W("生成临时密码", -1)]]),
|
|
1375
1392
|
_: 1
|
|
1376
1393
|
}, 8, ["loading"]),
|
|
1377
|
-
|
|
1378
|
-
])) : V("v-if", !0)])) : (q(), B(X(
|
|
1394
|
+
r.value ? (q(), H("dl", fn, [U("div", null, [c[4] ||= U("dt", null, "临时密码", -1), U("dd", null, Y(r.value.temporaryPassword), 1)]), U("div", null, [c[5] ||= U("dt", null, "失效时间", -1), U("dd", null, Y(r.value.expiresAt ?? "-"), 1)])])) : V("v-if", !0)
|
|
1395
|
+
])) : V("v-if", !0)])) : (q(), B(X(m), {
|
|
1379
1396
|
key: 0,
|
|
1380
1397
|
title: "用户不存在",
|
|
1381
1398
|
message: "请重新打开用户详情后再管理密码。"
|
|
@@ -1384,7 +1401,7 @@ var on = /*#__PURE__*/ a(/* @__PURE__ */ K({
|
|
|
1384
1401
|
}), [["__scopeId", "data-v-f6125048"]]);
|
|
1385
1402
|
//#endregion
|
|
1386
1403
|
//#region src/platform-admin-runtime/pageRealtime.ts
|
|
1387
|
-
function
|
|
1404
|
+
function mn(e) {
|
|
1388
1405
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r, i = 0, a = !0;
|
|
1389
1406
|
function o(n) {
|
|
1390
1407
|
if (!a) return;
|
|
@@ -1417,8 +1434,8 @@ function fn(e) {
|
|
|
1417
1434
|
}
|
|
1418
1435
|
//#endregion
|
|
1419
1436
|
//#region src/platform-admin-runtime/user/useUserSessionRows.ts
|
|
1420
|
-
function
|
|
1421
|
-
let t = J([]), n = J({}), r =
|
|
1437
|
+
function hn(e) {
|
|
1438
|
+
let t = J([]), n = J({}), r = mn({ load: async (e) => {
|
|
1422
1439
|
await Promise.all(e.keys.map((t) => a(t, e.isLatest)));
|
|
1423
1440
|
} });
|
|
1424
1441
|
function i(e) {
|
|
@@ -1443,7 +1460,7 @@ function pn(e) {
|
|
|
1443
1460
|
});
|
|
1444
1461
|
} catch (r) {
|
|
1445
1462
|
if (!n(t)) return;
|
|
1446
|
-
let i =
|
|
1463
|
+
let i = T(r, {
|
|
1447
1464
|
source: `${e.source}-sessions`,
|
|
1448
1465
|
phase: "load"
|
|
1449
1466
|
});
|
|
@@ -1492,7 +1509,7 @@ function pn(e) {
|
|
|
1492
1509
|
}
|
|
1493
1510
|
//#endregion
|
|
1494
1511
|
//#region src/platform-admin-runtime/userModulePageEnhancement.ts
|
|
1495
|
-
var
|
|
1512
|
+
var gn = {
|
|
1496
1513
|
id: "iam-user-standard-page-enhancement",
|
|
1497
1514
|
target: { moduleAlias: "iam.user" },
|
|
1498
1515
|
navigator: { emptyListScope: ({ currentUser: e, selectedNavigatorRecords: t }) => {
|
|
@@ -1510,52 +1527,52 @@ var mn = {
|
|
|
1510
1527
|
__name: "UserSessionListExpansion",
|
|
1511
1528
|
props: { context: {} },
|
|
1512
1529
|
setup(e) {
|
|
1513
|
-
let t = e,
|
|
1530
|
+
let t = e, r = z(() => t.context.record.id == null ? void 0 : String(t.context.record.id)), i = hn({
|
|
1514
1531
|
context: t.context.module,
|
|
1515
1532
|
source: "iam-user-list-expansion"
|
|
1516
|
-
}),
|
|
1517
|
-
Z([
|
|
1518
|
-
e &&
|
|
1533
|
+
}), a = z(() => i.userSessionState(r.value)), o = z(() => a.value.records.filter((e) => !e.current && t.context.module.can("revokeSession", r.value) === !0)), c = z(() => o.value.length > 1 && t.context.module.can("revokeSessions", r.value) === !0);
|
|
1534
|
+
Z([r, () => t.context.expanded], ([e, t]) => {
|
|
1535
|
+
e && i.handleUserRowExpand({ id: e }, t);
|
|
1519
1536
|
}, { immediate: !0 });
|
|
1520
|
-
let
|
|
1521
|
-
|
|
1522
|
-
|
|
1537
|
+
let l = qt((e) => i.handleUserSessionBusinessEvent(e));
|
|
1538
|
+
xe(() => {
|
|
1539
|
+
l.unsubscribe(), i.reset();
|
|
1523
1540
|
});
|
|
1524
|
-
async function
|
|
1525
|
-
let
|
|
1526
|
-
|
|
1541
|
+
async function u(e) {
|
|
1542
|
+
let n = r.value;
|
|
1543
|
+
n && !e.current && t.context.module.can("revokeSession", n) === !0 && await s({
|
|
1527
1544
|
title: "下线登录会话",
|
|
1528
1545
|
content: "确认下线该登录会话?",
|
|
1529
1546
|
okText: "下线",
|
|
1530
1547
|
danger: !0
|
|
1531
1548
|
}) && (await t.context.module.http.request({
|
|
1532
1549
|
method: "POST",
|
|
1533
|
-
path: `/iam.user/${encodeURIComponent(
|
|
1534
|
-
}),
|
|
1550
|
+
path: `/iam.user/${encodeURIComponent(n)}/sessions/${encodeURIComponent(e.id)}/revoke`
|
|
1551
|
+
}), i.loadUserSessions(n));
|
|
1535
1552
|
}
|
|
1536
|
-
async function
|
|
1537
|
-
let e =
|
|
1538
|
-
e &&
|
|
1553
|
+
async function d() {
|
|
1554
|
+
let e = r.value, n = o.value.map((e) => e.id);
|
|
1555
|
+
e && n.length !== 0 && t.context.module.can("revokeSessions", e) === !0 && await s({
|
|
1539
1556
|
title: "全部下线",
|
|
1540
|
-
content: `确认下线该用户的 ${
|
|
1557
|
+
content: `确认下线该用户的 ${n.length} 个登录会话?`,
|
|
1541
1558
|
okText: "全部下线",
|
|
1542
1559
|
danger: !0
|
|
1543
1560
|
}) && (await t.context.module.http.request({
|
|
1544
1561
|
method: "POST",
|
|
1545
1562
|
path: `/iam.user/${encodeURIComponent(e)}/sessions/revoke`,
|
|
1546
|
-
body: { sessionIds:
|
|
1547
|
-
}),
|
|
1563
|
+
body: { sessionIds: n }
|
|
1564
|
+
}), i.loadUserSessions(e));
|
|
1548
1565
|
}
|
|
1549
|
-
return (t,
|
|
1566
|
+
return (t, o) => (q(), B(X(n), {
|
|
1550
1567
|
embedded: "",
|
|
1551
|
-
sessions:
|
|
1552
|
-
loading:
|
|
1553
|
-
error:
|
|
1554
|
-
"can-revoke": (t) => !t.current && e.context.module.can("revokeSession",
|
|
1555
|
-
"can-revoke-all":
|
|
1556
|
-
onRefresh:
|
|
1557
|
-
onRevoke:
|
|
1558
|
-
onRevokeAll:
|
|
1568
|
+
sessions: a.value.records,
|
|
1569
|
+
loading: a.value.loading,
|
|
1570
|
+
error: a.value.error,
|
|
1571
|
+
"can-revoke": (t) => !t.current && e.context.module.can("revokeSession", r.value) === !0,
|
|
1572
|
+
"can-revoke-all": c.value,
|
|
1573
|
+
onRefresh: o[0] ||= (e) => X(i).loadUserSessions(r.value),
|
|
1574
|
+
onRevoke: u,
|
|
1575
|
+
onRevokeAll: d
|
|
1559
1576
|
}, null, 8, [
|
|
1560
1577
|
"sessions",
|
|
1561
1578
|
"loading",
|
|
@@ -1572,14 +1589,7 @@ var mn = {
|
|
|
1572
1589
|
width: "112px",
|
|
1573
1590
|
align: "center",
|
|
1574
1591
|
before: "enabled",
|
|
1575
|
-
cell:
|
|
1576
|
-
}]
|
|
1577
|
-
},
|
|
1578
|
-
form: {
|
|
1579
|
-
contributions: [],
|
|
1580
|
-
fieldPolicies: [{
|
|
1581
|
-
fieldName: "password",
|
|
1582
|
-
visible: ({ mode: e }) => e === "create"
|
|
1592
|
+
cell: cn
|
|
1583
1593
|
}]
|
|
1584
1594
|
},
|
|
1585
1595
|
detail: { actions: [{
|
|
@@ -1591,197 +1601,295 @@ var mn = {
|
|
|
1591
1601
|
run({ openDrawer: e }) {
|
|
1592
1602
|
e({
|
|
1593
1603
|
title: "密码管理",
|
|
1594
|
-
width:
|
|
1595
|
-
component:
|
|
1604
|
+
width: "narrow",
|
|
1605
|
+
component: pn
|
|
1596
1606
|
});
|
|
1597
1607
|
}
|
|
1598
1608
|
}] }
|
|
1599
|
-
},
|
|
1609
|
+
}, _n = "/iam.role/scope-selection/descriptor", vn = "/iam.role/scope-selection/candidates";
|
|
1610
|
+
function yn(e) {
|
|
1611
|
+
return {
|
|
1612
|
+
async descriptor() {
|
|
1613
|
+
return bn(await e.request({ path: _n }));
|
|
1614
|
+
},
|
|
1615
|
+
async candidates(t) {
|
|
1616
|
+
let n = Nn(t.pageNum) ?? 1, r = Nn(t.pageSize) ?? 100;
|
|
1617
|
+
return xn(await e.request({
|
|
1618
|
+
method: "POST",
|
|
1619
|
+
path: vn,
|
|
1620
|
+
body: {
|
|
1621
|
+
navigationKey: An(t.navigationKey, "navigationKey"),
|
|
1622
|
+
level: t.level,
|
|
1623
|
+
keyword: kn(t.keyword),
|
|
1624
|
+
parentId: kn(t.parentId),
|
|
1625
|
+
page: {
|
|
1626
|
+
pageNum: n,
|
|
1627
|
+
pageSize: r
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
}), n);
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
function bn(e) {
|
|
1635
|
+
let t = En(e);
|
|
1636
|
+
return {
|
|
1637
|
+
directSelections: Dn(t.directSelections).flatMap(Sn),
|
|
1638
|
+
navigations: Dn(t.navigations).flatMap(Cn)
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
function xn(e, t) {
|
|
1642
|
+
let n = En(e), r = Dn(n.records).flatMap(wn), i = Mn(n.pageNum) ?? t, a = Mn(n.pages), o = jn(n.totalKnown, !0) && a != null ? i < a : r.length > 0;
|
|
1643
|
+
return {
|
|
1644
|
+
records: r,
|
|
1645
|
+
hasMore: o,
|
|
1646
|
+
...o ? { nextPage: i + 1 } : {}
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
function Sn(e) {
|
|
1650
|
+
let t = En(e), n = On(t.selectionKey);
|
|
1651
|
+
return n ? [{
|
|
1652
|
+
selectionKey: n,
|
|
1653
|
+
label: On(t.title ?? t.label) ?? n
|
|
1654
|
+
}] : [];
|
|
1655
|
+
}
|
|
1656
|
+
function Cn(e) {
|
|
1657
|
+
let t = En(e), n = On(t.navigationKey), r = Tn(t.level);
|
|
1658
|
+
return !n || !r ? [] : [{
|
|
1659
|
+
navigationKey: n,
|
|
1660
|
+
level: r,
|
|
1661
|
+
label: On(t.title ?? t.label) ?? n
|
|
1662
|
+
}];
|
|
1663
|
+
}
|
|
1664
|
+
function wn(e) {
|
|
1665
|
+
let t = En(e), n = On(t.id), r = On(t.selectionKey);
|
|
1666
|
+
return !n || !r ? [] : [{
|
|
1667
|
+
id: n,
|
|
1668
|
+
selectionKey: r,
|
|
1669
|
+
label: On(t.title ?? t.label) ?? r,
|
|
1670
|
+
...On(t.subtitle ?? t.secondaryLabel) ? { secondaryLabel: On(t.subtitle ?? t.secondaryLabel) } : {},
|
|
1671
|
+
expandable: jn(t.expandable, !1)
|
|
1672
|
+
}];
|
|
1673
|
+
}
|
|
1674
|
+
function Tn(e) {
|
|
1675
|
+
return e === "TENANT" || e === "ORGANIZATION" ? e : void 0;
|
|
1676
|
+
}
|
|
1677
|
+
function En(e) {
|
|
1678
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
1679
|
+
}
|
|
1680
|
+
function Dn(e) {
|
|
1681
|
+
return Array.isArray(e) ? e : [];
|
|
1682
|
+
}
|
|
1683
|
+
function On(e) {
|
|
1684
|
+
return typeof e == "string" ? kn(e) : void 0;
|
|
1685
|
+
}
|
|
1686
|
+
function kn(e) {
|
|
1687
|
+
return e?.trim() || void 0;
|
|
1688
|
+
}
|
|
1689
|
+
function An(e, t) {
|
|
1690
|
+
let n = kn(e);
|
|
1691
|
+
if (!n) throw Error(`角色归属范围${t}不能为空`);
|
|
1692
|
+
return n;
|
|
1693
|
+
}
|
|
1694
|
+
function jn(e, t) {
|
|
1695
|
+
return typeof e == "boolean" ? e : t;
|
|
1696
|
+
}
|
|
1697
|
+
function Mn(e) {
|
|
1698
|
+
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
1699
|
+
}
|
|
1700
|
+
function Nn(e) {
|
|
1701
|
+
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
1702
|
+
}
|
|
1703
|
+
//#endregion
|
|
1704
|
+
//#region src/platform-admin-runtime/role/RoleScopeTree.vue
|
|
1705
|
+
var Pn = /* @__PURE__ */ K({
|
|
1600
1706
|
name: "RoleScopeTree",
|
|
1601
1707
|
__name: "RoleScopeTree",
|
|
1602
1708
|
props: { context: {} },
|
|
1603
1709
|
setup(e) {
|
|
1604
|
-
let t = e, n =
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
nodes: () => p.value,
|
|
1614
|
-
loader: () => k,
|
|
1615
|
-
version: () => h.value
|
|
1616
|
-
}), E = T.nodes, te = T.states, re = z(() => t.context.selectionKey);
|
|
1617
|
-
Z(w, (e) => {
|
|
1618
|
-
e?.id && !C.value && !t.context.selectionKey && t.context.selectSelectionKey(`tenant:${e.id}`);
|
|
1619
|
-
}, { immediate: !0 }), ye(() => void D()), ve(() => {
|
|
1620
|
-
x && clearTimeout(x);
|
|
1621
|
-
}), Z([C, w], () => void D()), Z(a, () => {
|
|
1622
|
-
C.value && (x && clearTimeout(x), x = setTimeout(() => void D(), 240));
|
|
1710
|
+
let t = e, n = yn(Nt()), r = J(), a = J(""), s = J(!1), c = J([]), l = J([]), u = J(0), d = J(/* @__PURE__ */ new Map()), f = z(() => t.context.selectionKey), p = z(() => r.value?.navigations.some((e) => e.level === "TENANT") === !0), m = z(() => r.value?.navigations.length !== 0), h = z(() => p.value ? "租户" : "机构"), g = i({
|
|
1711
|
+
nodes: () => c.value,
|
|
1712
|
+
loader: () => A,
|
|
1713
|
+
version: () => u.value
|
|
1714
|
+
}), _ = g.nodes, v = g.states, b = 0, x;
|
|
1715
|
+
be(() => void S()), ye(() => {
|
|
1716
|
+
b += 1, x && clearTimeout(x);
|
|
1717
|
+
}), Z(a, () => {
|
|
1718
|
+
m.value && (x && clearTimeout(x), x = setTimeout(() => void w(), 240));
|
|
1623
1719
|
});
|
|
1624
|
-
async function
|
|
1625
|
-
|
|
1626
|
-
if (t || (m.value = [], h.value += 1, f.value = 0, u.value = !1), !C.value) {
|
|
1627
|
-
let e = w.value;
|
|
1628
|
-
if (!e?.id) {
|
|
1629
|
-
p.value = [];
|
|
1630
|
-
return;
|
|
1631
|
-
}
|
|
1632
|
-
g.clear(), g.set(e.id, e), p.value = [O(e)];
|
|
1633
|
-
return;
|
|
1634
|
-
}
|
|
1635
|
-
o.value = !t, c.value = t;
|
|
1720
|
+
async function S() {
|
|
1721
|
+
s.value = !0;
|
|
1636
1722
|
try {
|
|
1637
|
-
await n.
|
|
1638
|
-
let e =
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
quickSearch: a.value.trim() || void 0
|
|
1644
|
-
});
|
|
1645
|
-
if (r !== b) return;
|
|
1646
|
-
t || g.clear();
|
|
1647
|
-
let o = new Set(t ? p.value.map((e) => e.key) : []);
|
|
1648
|
-
i.records.forEach((e) => {
|
|
1649
|
-
e.id && g.set(e.id, e);
|
|
1650
|
-
});
|
|
1651
|
-
let s = i.records.map(O).filter((e) => !o.has(e.key));
|
|
1652
|
-
p.value = t ? [...p.value, ...s] : s, f.value = e, u.value = i.totalKnown ? e < i.pages : i.records.length === hn;
|
|
1723
|
+
r.value = await n.descriptor();
|
|
1724
|
+
let e = r.value.directSelections[0];
|
|
1725
|
+
!t.context.selectionKey && e && M({
|
|
1726
|
+
key: e.selectionKey,
|
|
1727
|
+
label: e.label
|
|
1728
|
+
}), await C();
|
|
1653
1729
|
} catch (e) {
|
|
1654
|
-
|
|
1655
|
-
p.value = [], u.value = !1, L(e, {
|
|
1730
|
+
T(e, {
|
|
1656
1731
|
source: "role-scope-tree",
|
|
1657
1732
|
phase: "load"
|
|
1658
1733
|
});
|
|
1659
1734
|
} finally {
|
|
1660
|
-
|
|
1735
|
+
s.value = !1;
|
|
1661
1736
|
}
|
|
1662
1737
|
}
|
|
1663
|
-
function
|
|
1738
|
+
async function C(e = {}) {
|
|
1739
|
+
let t = r.value;
|
|
1740
|
+
if (!t) return;
|
|
1741
|
+
let n = ++b;
|
|
1742
|
+
if (!e.append) {
|
|
1743
|
+
l.value = [], u.value += 1, s.value = !0;
|
|
1744
|
+
try {
|
|
1745
|
+
let e = E(t);
|
|
1746
|
+
if (n !== b) return;
|
|
1747
|
+
d.value = /* @__PURE__ */ new Map(), j(e), c.value = e.map((e) => e.ui);
|
|
1748
|
+
} catch (e) {
|
|
1749
|
+
if (n !== b) return;
|
|
1750
|
+
c.value = [], T(e, {
|
|
1751
|
+
source: "role-scope-tree",
|
|
1752
|
+
phase: "load"
|
|
1753
|
+
});
|
|
1754
|
+
} finally {
|
|
1755
|
+
n === b && (s.value = !1);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
async function w() {
|
|
1760
|
+
if (await C(), !a.value.trim()) return;
|
|
1761
|
+
let e = (r.value?.navigations ?? []).map((e) => `navigation:${e.navigationKey}`);
|
|
1762
|
+
l.value = e, await ge(), await Promise.all(e.map((e) => g.request(e, "refresh")));
|
|
1763
|
+
}
|
|
1764
|
+
function E(e) {
|
|
1765
|
+
return [
|
|
1766
|
+
...e.directSelections.map((e) => ({
|
|
1767
|
+
ui: {
|
|
1768
|
+
key: e.selectionKey,
|
|
1769
|
+
title: e.label,
|
|
1770
|
+
isLeaf: !0
|
|
1771
|
+
},
|
|
1772
|
+
selection: {
|
|
1773
|
+
key: e.selectionKey,
|
|
1774
|
+
label: e.label
|
|
1775
|
+
}
|
|
1776
|
+
})),
|
|
1777
|
+
...e.navigations.filter((e) => e.level === "ORGANIZATION").map((e) => D(e)),
|
|
1778
|
+
...e.navigations.filter((e) => e.level === "TENANT").map((e) => D(e))
|
|
1779
|
+
];
|
|
1780
|
+
}
|
|
1781
|
+
function D(e) {
|
|
1782
|
+
return {
|
|
1783
|
+
ui: {
|
|
1784
|
+
key: `navigation:${e.navigationKey}`,
|
|
1785
|
+
title: e.label,
|
|
1786
|
+
isLeaf: !1
|
|
1787
|
+
},
|
|
1788
|
+
children: {
|
|
1789
|
+
navigationKey: e.navigationKey,
|
|
1790
|
+
level: e.level
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
function O(e, t, n) {
|
|
1795
|
+
let r = k(e, t, n);
|
|
1664
1796
|
return {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1797
|
+
ui: {
|
|
1798
|
+
key: e.selectionKey,
|
|
1799
|
+
title: e.label,
|
|
1800
|
+
secondary: e.secondaryLabel,
|
|
1801
|
+
isLeaf: !r
|
|
1802
|
+
},
|
|
1803
|
+
selection: {
|
|
1804
|
+
key: e.selectionKey,
|
|
1805
|
+
label: e.label,
|
|
1806
|
+
secondaryLabel: e.secondaryLabel
|
|
1807
|
+
},
|
|
1808
|
+
children: r
|
|
1670
1809
|
};
|
|
1671
1810
|
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1811
|
+
function k(e, t, n) {
|
|
1812
|
+
return t === "TENANT" ? {
|
|
1813
|
+
navigationKey: e.selectionKey,
|
|
1814
|
+
level: "ORGANIZATION"
|
|
1815
|
+
} : e.expandable ? {
|
|
1816
|
+
navigationKey: n,
|
|
1817
|
+
level: "ORGANIZATION",
|
|
1818
|
+
parentId: e.id
|
|
1819
|
+
} : void 0;
|
|
1820
|
+
}
|
|
1821
|
+
async function A(e, t) {
|
|
1822
|
+
let r = d.value.get(e.key);
|
|
1823
|
+
if (!r?.children) throw Error("角色归属范围已失效");
|
|
1675
1824
|
try {
|
|
1676
|
-
let e =
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1825
|
+
let e = await n.candidates({
|
|
1826
|
+
...r.children,
|
|
1827
|
+
keyword: a.value.trim() || void 0,
|
|
1828
|
+
pageNum: t.reason === "load-more" ? Number(t.cursor) : 1
|
|
1680
1829
|
});
|
|
1681
|
-
|
|
1682
|
-
let i =
|
|
1683
|
-
return
|
|
1684
|
-
mode: "replace",
|
|
1685
|
-
nodes:
|
|
1686
|
-
hasMore:
|
|
1830
|
+
t.signal.throwIfAborted();
|
|
1831
|
+
let i = e.records.map((e) => O(e, r.children.level, r.children.navigationKey));
|
|
1832
|
+
return j(i), {
|
|
1833
|
+
mode: t.reason === "load-more" ? "append" : "replace",
|
|
1834
|
+
nodes: i.map((e) => e.ui),
|
|
1835
|
+
hasMore: e.hasMore,
|
|
1836
|
+
nextCursor: e.nextPage == null ? void 0 : String(e.nextPage)
|
|
1687
1837
|
};
|
|
1688
1838
|
} catch (e) {
|
|
1689
|
-
throw t.signal.aborted ||
|
|
1839
|
+
throw t.signal.aborted || T(e, {
|
|
1690
1840
|
source: "role-scope-tree",
|
|
1691
1841
|
phase: "load"
|
|
1692
1842
|
}), e;
|
|
1693
1843
|
}
|
|
1694
1844
|
}
|
|
1695
|
-
function
|
|
1696
|
-
let
|
|
1697
|
-
|
|
1698
|
-
let r = j(e, t);
|
|
1699
|
-
return n.has(r.key) ? [] : (n.add(r.key), [r]);
|
|
1700
|
-
});
|
|
1845
|
+
function j(e) {
|
|
1846
|
+
let t = new Map(d.value);
|
|
1847
|
+
e.forEach((e) => t.set(e.ui.key, e)), d.value = t;
|
|
1701
1848
|
}
|
|
1702
|
-
function
|
|
1703
|
-
let
|
|
1704
|
-
|
|
1705
|
-
key: `organization:${n.id ?? ""}`,
|
|
1706
|
-
title: I(n),
|
|
1707
|
-
secondary: n.code ?? n.id,
|
|
1708
|
-
muted: n.enabled === !1,
|
|
1709
|
-
isLeaf: e.children.length === 0,
|
|
1710
|
-
children: e.children.map((e) => j(e, t))
|
|
1711
|
-
};
|
|
1849
|
+
function ee(e) {
|
|
1850
|
+
let t = d.value.get(e.key)?.selection;
|
|
1851
|
+
t && M(t);
|
|
1712
1852
|
}
|
|
1713
1853
|
function M(e) {
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
label: F(e),
|
|
1719
|
-
secondaryLabel: e?.alias ?? n
|
|
1720
|
-
});
|
|
1721
|
-
return;
|
|
1722
|
-
}
|
|
1723
|
-
let r = ae(e.key);
|
|
1724
|
-
if (r && v.has(r) && y.has(r)) {
|
|
1725
|
-
let e = v.get(r);
|
|
1726
|
-
t.context.selectSelectionKey(`organization:${r}`, {
|
|
1727
|
-
label: I(e),
|
|
1728
|
-
secondaryLabel: e?.code ?? r
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1854
|
+
t.context.selectSelectionKey(e.key, {
|
|
1855
|
+
label: e.label,
|
|
1856
|
+
secondaryLabel: e.secondaryLabel
|
|
1857
|
+
});
|
|
1731
1858
|
}
|
|
1732
1859
|
function N() {
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
if (e) {
|
|
1739
|
-
let n = g.get(e);
|
|
1740
|
-
t.context.selectSelectionKey(`tenant:${e}`, {
|
|
1741
|
-
label: F(n),
|
|
1742
|
-
secondaryLabel: n?.alias ?? e
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
function P(e) {
|
|
1747
|
-
return e.startsWith("tenant:") ? e.slice(7) : void 0;
|
|
1748
|
-
}
|
|
1749
|
-
function ae(e) {
|
|
1750
|
-
return e.startsWith("organization:") ? e.slice(13) : void 0;
|
|
1751
|
-
}
|
|
1752
|
-
function F(e) {
|
|
1753
|
-
return String(e?.title ?? e?.alias ?? e?.id ?? "未命名租户");
|
|
1754
|
-
}
|
|
1755
|
-
function I(e) {
|
|
1756
|
-
return String(e?.title ?? e?.code ?? e?.id ?? "未命名机构");
|
|
1860
|
+
let e = r.value?.directSelections[0];
|
|
1861
|
+
e && M({
|
|
1862
|
+
key: e.selectionKey,
|
|
1863
|
+
label: e.label
|
|
1864
|
+
});
|
|
1757
1865
|
}
|
|
1758
|
-
return (e, t) => (q(), B(X(
|
|
1866
|
+
return (e, t) => (q(), B(X(o), {
|
|
1759
1867
|
class: "role-scope-tree",
|
|
1760
|
-
title:
|
|
1761
|
-
"refresh-title": "
|
|
1868
|
+
title: h.value,
|
|
1869
|
+
"refresh-title": "刷新角色归属范围",
|
|
1762
1870
|
"search-keyword": a.value,
|
|
1763
|
-
"search-placeholder": "
|
|
1764
|
-
searchable:
|
|
1765
|
-
onRefresh:
|
|
1766
|
-
"onUpdate:searchKeyword": t[
|
|
1767
|
-
},
|
|
1768
|
-
default: Q(() => [
|
|
1871
|
+
"search-placeholder": "搜索名称、编码或标识",
|
|
1872
|
+
searchable: m.value,
|
|
1873
|
+
onRefresh: C,
|
|
1874
|
+
"onUpdate:searchKeyword": t[3] ||= (e) => a.value = e
|
|
1875
|
+
}, {
|
|
1876
|
+
default: Q(() => [s.value ? (q(), B(X(re), {
|
|
1769
1877
|
key: 0,
|
|
1770
|
-
tip: "
|
|
1771
|
-
})) : (q(), B(X(
|
|
1878
|
+
tip: "加载角色归属范围"
|
|
1879
|
+
})) : (q(), B(X(y), {
|
|
1772
1880
|
key: 1,
|
|
1773
|
-
"expanded-keys":
|
|
1774
|
-
"onUpdate:expandedKeys": t[0] ||= (e) =>
|
|
1775
|
-
nodes: X(
|
|
1776
|
-
"selected-key":
|
|
1777
|
-
"reload-key":
|
|
1881
|
+
"expanded-keys": l.value,
|
|
1882
|
+
"onUpdate:expandedKeys": t[0] ||= (e) => l.value = e,
|
|
1883
|
+
nodes: X(_),
|
|
1884
|
+
"selected-key": f.value,
|
|
1885
|
+
"reload-key": u.value,
|
|
1778
1886
|
"load-strategy": "controlled",
|
|
1779
1887
|
"reload-on-reexpand": "",
|
|
1780
|
-
"branch-states": X(
|
|
1781
|
-
onLoadRequest: t[1] ||= (e) => X(
|
|
1782
|
-
onSelect:
|
|
1888
|
+
"branch-states": X(v),
|
|
1889
|
+
onLoadRequest: t[1] ||= (e) => X(g).request(e.node.key, e.reason, X(g).stateOf(e.node.key).status === "error"),
|
|
1890
|
+
onSelect: ee,
|
|
1783
1891
|
onDeselect: N,
|
|
1784
|
-
onUnloadChildren: t[2] ||= (e) => X(
|
|
1892
|
+
onUnloadChildren: t[2] ||= (e) => X(g).release(e.key)
|
|
1785
1893
|
}, null, 8, [
|
|
1786
1894
|
"expanded-keys",
|
|
1787
1895
|
"nodes",
|
|
@@ -1789,22 +1897,14 @@ var mn = {
|
|
|
1789
1897
|
"reload-key",
|
|
1790
1898
|
"branch-states"
|
|
1791
1899
|
]))]),
|
|
1792
|
-
_:
|
|
1793
|
-
}, [
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
loading: c.value,
|
|
1799
|
-
onClick: t[3] ||= (e) => D({ append: !0 })
|
|
1800
|
-
}, {
|
|
1801
|
-
default: Q(() => [...t[5] ||= [W(" 加载更多租户 ", -1)]]),
|
|
1802
|
-
_: 1
|
|
1803
|
-
}, 8, ["loading"])]),
|
|
1804
|
-
key: "0"
|
|
1805
|
-
} : void 0]), 1032, ["search-keyword", "searchable"]));
|
|
1900
|
+
_: 1
|
|
1901
|
+
}, 8, [
|
|
1902
|
+
"title",
|
|
1903
|
+
"search-keyword",
|
|
1904
|
+
"searchable"
|
|
1905
|
+
]));
|
|
1806
1906
|
}
|
|
1807
|
-
}),
|
|
1907
|
+
}), Fn = /* @__PURE__ */ K({
|
|
1808
1908
|
name: "RoleEnumTitleCell",
|
|
1809
1909
|
__name: "RoleEnumTitleCell",
|
|
1810
1910
|
props: {
|
|
@@ -1832,7 +1932,7 @@ var mn = {
|
|
|
1832
1932
|
});
|
|
1833
1933
|
//#endregion
|
|
1834
1934
|
//#region src/views/roleGrantClient.ts
|
|
1835
|
-
function
|
|
1935
|
+
function In(e) {
|
|
1836
1936
|
return {
|
|
1837
1937
|
accountRoleGrants(t, n) {
|
|
1838
1938
|
return e.request({
|
|
@@ -1854,13 +1954,6 @@ function vn(e) {
|
|
|
1854
1954
|
query: r ? { targetTenantId: r } : void 0
|
|
1855
1955
|
});
|
|
1856
1956
|
},
|
|
1857
|
-
userSelector(t) {
|
|
1858
|
-
return e.request({
|
|
1859
|
-
method: "POST",
|
|
1860
|
-
path: "/iam.user/selector/query",
|
|
1861
|
-
body: t
|
|
1862
|
-
});
|
|
1863
|
-
},
|
|
1864
1957
|
accountRoleCandidates(t, n) {
|
|
1865
1958
|
return e.request({
|
|
1866
1959
|
method: "POST",
|
|
@@ -1945,19 +2038,19 @@ function vn(e) {
|
|
|
1945
2038
|
}
|
|
1946
2039
|
//#endregion
|
|
1947
2040
|
//#region src/views/RoleAccountGrantDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
1948
|
-
var
|
|
2041
|
+
var Ln = {
|
|
1949
2042
|
key: 1,
|
|
1950
2043
|
class: "role-account-grant-drawer-state"
|
|
1951
|
-
},
|
|
2044
|
+
}, Rn = {
|
|
1952
2045
|
key: 0,
|
|
1953
2046
|
class: "role-account-grant-target-tenant"
|
|
1954
|
-
},
|
|
2047
|
+
}, zn = {
|
|
1955
2048
|
key: 1,
|
|
1956
2049
|
class: "role-account-grant-target-hint"
|
|
1957
|
-
},
|
|
2050
|
+
}, Bn = { class: "role-account-grant-search" }, Vn = {
|
|
1958
2051
|
key: 0,
|
|
1959
2052
|
class: "role-account-grant-selected"
|
|
1960
|
-
},
|
|
2053
|
+
}, Hn = { class: "role-account-grant-selected-title" }, Un = { class: "role-account-grant-selected-list" }, Wn = ["disabled", "onClick"], Gn = 20, Kn = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
1961
2054
|
name: "RoleAccountGrantDrawer",
|
|
1962
2055
|
__name: "RoleAccountGrantDrawer",
|
|
1963
2056
|
props: {
|
|
@@ -1969,26 +2062,26 @@ var yn = {
|
|
|
1969
2062
|
role: {}
|
|
1970
2063
|
},
|
|
1971
2064
|
emits: ["close", "saved"],
|
|
1972
|
-
setup(e, { emit:
|
|
1973
|
-
let
|
|
1974
|
-
open:
|
|
1975
|
-
title:
|
|
1976
|
-
renderMode:
|
|
2065
|
+
setup(e, { emit: t }) {
|
|
2066
|
+
let n = e, r = t, i = J([]), a = J({}), o = J([]), s = J(/* @__PURE__ */ new Set()), c = J(/* @__PURE__ */ new Set()), d = J(""), p = J(""), h = J(1), g = J(0), _ = J(!1), v = J(!1), y = J(!1), x = J(!1), C = J(), w = z(() => In(n.context.http)), E = b({ moduleAlias: "iam.tenant" }), D = z(() => n.role?.id), O = z(() => n.role ? `绑定用户 - ${je(n.role)}` : "绑定用户"), k = z(() => n.embedded ? "section" : M), j = z(() => n.embedded ? {} : {
|
|
2067
|
+
open: n.open,
|
|
2068
|
+
title: O.value,
|
|
2069
|
+
renderMode: n.container ? "inline" : "portal",
|
|
1977
2070
|
closeTitle: "关闭",
|
|
1978
|
-
onClose:
|
|
1979
|
-
}),
|
|
2071
|
+
onClose: ve
|
|
2072
|
+
}), ee = z(() => n.role?.ownerScopeType === "platform"), N = z(() => C.value?.id), P = z(() => !ee.value || !!N.value), te = z(() => E), ne = z(() => {
|
|
1980
2073
|
let e = /* @__PURE__ */ new Map();
|
|
1981
|
-
for (let t of
|
|
2074
|
+
for (let t of i.value) t.userId && e.set(t.userId, t);
|
|
1982
2075
|
return e;
|
|
1983
|
-
}),
|
|
2076
|
+
}), ie = z(() => o.value.filter((e) => e.id).map((e) => ({
|
|
1984
2077
|
id: e.id,
|
|
1985
2078
|
username: ke(e),
|
|
1986
2079
|
employeeNo: e.employeeNo ?? "",
|
|
1987
2080
|
employeeTitle: e.employeeTitle ?? "",
|
|
1988
2081
|
organizationTitle: e.organizationTitle ?? e.organizationId ?? "",
|
|
1989
2082
|
departmentTitle: e.departmentTitle ?? e.departmentId ?? "",
|
|
1990
|
-
boundTitle:
|
|
1991
|
-
}))),
|
|
2083
|
+
boundTitle: c.value.has(e.id) ? "已绑定" : "未绑定"
|
|
2084
|
+
}))), F = z(() => [...s.value].map((e) => a.value[e] ?? Oe(e))), I = z(() => [...s.value].filter((e) => !c.value.has(e))), ae = z(() => [...c.value].filter((e) => !s.value.has(e))), L = z(() => I.value.length > 0 || ae.value.length > 0), oe = {
|
|
1992
2085
|
rowKey: "id",
|
|
1993
2086
|
columns: [
|
|
1994
2087
|
{
|
|
@@ -2023,100 +2116,100 @@ var yn = {
|
|
|
2023
2116
|
}
|
|
2024
2117
|
]
|
|
2025
2118
|
}, se = z(() => ({
|
|
2026
|
-
selectedRowKeys: [...
|
|
2119
|
+
selectedRowKeys: [...s.value],
|
|
2027
2120
|
preserveSelectedRowKeys: !0,
|
|
2028
|
-
disabledOf: () =>
|
|
2121
|
+
disabledOf: () => y.value,
|
|
2029
2122
|
onChange: (e) => {
|
|
2030
|
-
|
|
2123
|
+
s.value = new Set(e.map((e) => String(e)));
|
|
2031
2124
|
}
|
|
2032
2125
|
})), ce = z(() => ({
|
|
2033
|
-
current:
|
|
2034
|
-
total:
|
|
2035
|
-
pageSize:
|
|
2126
|
+
current: h.value,
|
|
2127
|
+
total: g.value,
|
|
2128
|
+
pageSize: Gn,
|
|
2036
2129
|
showSizeChanger: !1,
|
|
2037
2130
|
showQuickJumper: !1,
|
|
2038
2131
|
onChange: (e) => void pe(e)
|
|
2039
2132
|
}));
|
|
2040
|
-
Z(() => [
|
|
2133
|
+
Z(() => [n.open, n.role?.id], ([e]) => {
|
|
2041
2134
|
e ? de() : be();
|
|
2042
2135
|
}, { immediate: !0 }), Z([
|
|
2043
|
-
() =>
|
|
2044
|
-
() =>
|
|
2045
|
-
|
|
2136
|
+
() => n.embedded,
|
|
2137
|
+
() => n.drawerContext,
|
|
2138
|
+
s,
|
|
2139
|
+
L,
|
|
2140
|
+
P,
|
|
2046
2141
|
I,
|
|
2047
|
-
j,
|
|
2048
2142
|
ae,
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
], le, { immediate: !0 }), ve(() => r.drawerContext?.setOperation(void 0));
|
|
2143
|
+
y,
|
|
2144
|
+
_
|
|
2145
|
+
], le, { immediate: !0 }), ye(() => n.drawerContext?.setOperation(void 0));
|
|
2053
2146
|
function le() {
|
|
2054
|
-
let e =
|
|
2055
|
-
|
|
2147
|
+
let e = n.drawerContext;
|
|
2148
|
+
n.embedded && e && (e.setSubtitle(`角色:${je(n.role ?? {})} · ${Me(n.role)}`), e.setOperation({
|
|
2056
2149
|
summary: ue(),
|
|
2057
2150
|
actions: [{
|
|
2058
2151
|
key: "cancel-account-role-grants",
|
|
2059
2152
|
label: "取消",
|
|
2060
|
-
disabled:
|
|
2061
|
-
run:
|
|
2153
|
+
disabled: y.value || _.value,
|
|
2154
|
+
run: ve
|
|
2062
2155
|
}, {
|
|
2063
2156
|
key: "save-account-role-grants",
|
|
2064
2157
|
label: "确定",
|
|
2065
2158
|
emphasis: "primary",
|
|
2066
|
-
disabled:
|
|
2067
|
-
loading:
|
|
2068
|
-
run: () => void
|
|
2159
|
+
disabled: _.value || !P.value || !L.value,
|
|
2160
|
+
loading: y.value,
|
|
2161
|
+
run: () => void ge()
|
|
2069
2162
|
}]
|
|
2070
2163
|
}));
|
|
2071
2164
|
}
|
|
2072
2165
|
function ue() {
|
|
2073
|
-
return
|
|
2166
|
+
return P.value ? L.value ? `已选 ${s.value.size} 个用户 · 新增 ${I.value.length} · 移除 ${ae.value.length}` : `已选 ${s.value.size} 个用户` : "请选择目标租户";
|
|
2074
2167
|
}
|
|
2075
2168
|
async function de() {
|
|
2076
|
-
let e =
|
|
2169
|
+
let e = D.value;
|
|
2077
2170
|
if (!e) {
|
|
2078
2171
|
be();
|
|
2079
2172
|
return;
|
|
2080
2173
|
}
|
|
2081
|
-
if (!
|
|
2082
|
-
|
|
2174
|
+
if (!P.value) {
|
|
2175
|
+
xe();
|
|
2083
2176
|
return;
|
|
2084
2177
|
}
|
|
2085
|
-
|
|
2178
|
+
_.value = !0, x.value = !1;
|
|
2086
2179
|
try {
|
|
2087
|
-
let t = await
|
|
2088
|
-
|
|
2180
|
+
let t = await w.value.accountRoleGrants(e, N.value);
|
|
2181
|
+
i.value = t;
|
|
2089
2182
|
let n = new Set(t.map((e) => e.userId).filter((e) => !!e));
|
|
2090
|
-
|
|
2183
|
+
c.value = n, s.value = new Set(n), a.value = De([...t.map((e) => Oe(e.userId)).filter((e) => !!e)]), await pe(1);
|
|
2091
2184
|
} catch (e) {
|
|
2092
|
-
|
|
2185
|
+
x.value = !0, T(e, {
|
|
2093
2186
|
source: "role-account-grants",
|
|
2094
2187
|
phase: "load"
|
|
2095
2188
|
});
|
|
2096
2189
|
} finally {
|
|
2097
|
-
|
|
2190
|
+
_.value = !1;
|
|
2098
2191
|
}
|
|
2099
2192
|
}
|
|
2100
2193
|
async function pe(e) {
|
|
2101
|
-
let t =
|
|
2102
|
-
if (t &&
|
|
2194
|
+
let t = D.value;
|
|
2195
|
+
if (t && P.value) {
|
|
2103
2196
|
v.value = !0;
|
|
2104
2197
|
try {
|
|
2105
|
-
let n = await
|
|
2106
|
-
targetTenantId:
|
|
2107
|
-
keyword:
|
|
2198
|
+
let n = await w.value.accountRoleCandidates(t, {
|
|
2199
|
+
targetTenantId: N.value,
|
|
2200
|
+
keyword: p.value,
|
|
2108
2201
|
enabledOnly: !0,
|
|
2109
2202
|
page: {
|
|
2110
2203
|
pageNum: Math.max(0, e),
|
|
2111
|
-
pageSize:
|
|
2204
|
+
pageSize: Gn
|
|
2112
2205
|
}
|
|
2113
2206
|
});
|
|
2114
|
-
|
|
2115
|
-
...
|
|
2207
|
+
o.value = n.records, a.value = {
|
|
2208
|
+
...a.value,
|
|
2116
2209
|
...De(n.records)
|
|
2117
|
-
},
|
|
2210
|
+
}, h.value = n.pageNum, g.value = n.total;
|
|
2118
2211
|
} catch (e) {
|
|
2119
|
-
|
|
2212
|
+
T(e, {
|
|
2120
2213
|
source: "role-account-grants",
|
|
2121
2214
|
phase: "load"
|
|
2122
2215
|
});
|
|
@@ -2126,59 +2219,59 @@ var yn = {
|
|
|
2126
2219
|
}
|
|
2127
2220
|
}
|
|
2128
2221
|
function K() {
|
|
2129
|
-
|
|
2222
|
+
p.value = d.value.trim(), pe(0);
|
|
2130
2223
|
}
|
|
2131
2224
|
function me(e, t) {
|
|
2132
|
-
let n = new Set(
|
|
2133
|
-
t ? n.add(e) : n.delete(e),
|
|
2134
|
-
}
|
|
2135
|
-
async function
|
|
2136
|
-
let e =
|
|
2137
|
-
if (e &&
|
|
2138
|
-
if (!
|
|
2139
|
-
|
|
2225
|
+
let n = new Set(s.value);
|
|
2226
|
+
t ? n.add(e) : n.delete(e), s.value = n;
|
|
2227
|
+
}
|
|
2228
|
+
async function ge() {
|
|
2229
|
+
let e = D.value;
|
|
2230
|
+
if (e && P.value) {
|
|
2231
|
+
if (!L.value) {
|
|
2232
|
+
r("close");
|
|
2140
2233
|
return;
|
|
2141
2234
|
}
|
|
2142
|
-
|
|
2235
|
+
y.value = !0;
|
|
2143
2236
|
try {
|
|
2144
|
-
for (let t of
|
|
2237
|
+
for (let t of I.value) await w.value.grantAccountRole(e, {
|
|
2145
2238
|
userId: t,
|
|
2146
|
-
targetTenantId:
|
|
2239
|
+
targetTenantId: N.value
|
|
2147
2240
|
});
|
|
2148
|
-
for (let t of
|
|
2149
|
-
let n =
|
|
2150
|
-
n && await
|
|
2241
|
+
for (let t of ae.value) {
|
|
2242
|
+
let n = ne.value.get(t)?.id;
|
|
2243
|
+
n && await w.value.deleteAccountRoleGrant(e, n, N.value);
|
|
2151
2244
|
}
|
|
2152
|
-
await
|
|
2245
|
+
await f({
|
|
2153
2246
|
success: !0,
|
|
2154
2247
|
message: "用户绑定已保存"
|
|
2155
2248
|
}, {
|
|
2156
2249
|
source: "role-account-grants",
|
|
2157
2250
|
phase: "action",
|
|
2158
2251
|
fallbackMessage: "用户绑定已保存"
|
|
2159
|
-
}),
|
|
2252
|
+
}), r("saved"), r("close");
|
|
2160
2253
|
} catch (e) {
|
|
2161
|
-
|
|
2254
|
+
T(e, {
|
|
2162
2255
|
source: "role-account-grants",
|
|
2163
2256
|
phase: "action"
|
|
2164
2257
|
});
|
|
2165
2258
|
} finally {
|
|
2166
|
-
|
|
2259
|
+
y.value = !1;
|
|
2167
2260
|
}
|
|
2168
2261
|
}
|
|
2169
2262
|
}
|
|
2170
|
-
function
|
|
2171
|
-
|
|
2263
|
+
function ve() {
|
|
2264
|
+
y.value || r("close");
|
|
2172
2265
|
}
|
|
2173
2266
|
function be() {
|
|
2174
|
-
C.value = void 0,
|
|
2267
|
+
C.value = void 0, xe();
|
|
2175
2268
|
}
|
|
2176
|
-
function
|
|
2177
|
-
|
|
2269
|
+
function xe() {
|
|
2270
|
+
i.value = [], a.value = {}, o.value = [], s.value = /* @__PURE__ */ new Set(), c.value = /* @__PURE__ */ new Set(), d.value = "", p.value = "", h.value = 1, g.value = 0, _.value = !1, v.value = !1, y.value = !1, x.value = !1;
|
|
2178
2271
|
}
|
|
2179
|
-
async function
|
|
2272
|
+
async function Ce(e) {
|
|
2180
2273
|
if (!e) {
|
|
2181
|
-
C.value = void 0,
|
|
2274
|
+
C.value = void 0, xe();
|
|
2182
2275
|
return;
|
|
2183
2276
|
}
|
|
2184
2277
|
let t = await E.crud.view(e);
|
|
@@ -2187,7 +2280,7 @@ var yn = {
|
|
|
2187
2280
|
title: e
|
|
2188
2281
|
}, await de();
|
|
2189
2282
|
}
|
|
2190
|
-
function
|
|
2283
|
+
function Te(e) {
|
|
2191
2284
|
me(e, !1);
|
|
2192
2285
|
}
|
|
2193
2286
|
function De(e) {
|
|
@@ -2213,56 +2306,56 @@ var yn = {
|
|
|
2213
2306
|
function Me(e) {
|
|
2214
2307
|
return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
|
|
2215
2308
|
}
|
|
2216
|
-
return (
|
|
2217
|
-
default: Q(() => [
|
|
2309
|
+
return (t, n) => (q(), B(we(k.value), he(j.value, { class: { "role-account-grant-drawer-surface": e.embedded } }), fe({
|
|
2310
|
+
default: Q(() => [_.value ? (q(), B(X(re), {
|
|
2218
2311
|
key: 0,
|
|
2219
2312
|
class: "role-account-grant-drawer-state",
|
|
2220
2313
|
tip: "加载用户"
|
|
2221
|
-
})) :
|
|
2314
|
+
})) : x.value ? (q(), H("div", Ln, [G(X(m), {
|
|
2222
2315
|
title: "用户加载失败",
|
|
2223
2316
|
message: "无法加载当前角色的用户绑定"
|
|
2224
|
-
}), G(X(
|
|
2317
|
+
}), G(X(S), {
|
|
2225
2318
|
type: "primary",
|
|
2226
2319
|
"icon-name": "reload",
|
|
2227
2320
|
onClick: de
|
|
2228
2321
|
}, {
|
|
2229
|
-
default: Q(() => [...
|
|
2322
|
+
default: Q(() => [...n[3] ||= [W("重试", -1)]]),
|
|
2230
2323
|
_: 1
|
|
2231
2324
|
})])) : (q(), H("section", {
|
|
2232
2325
|
key: 2,
|
|
2233
|
-
class:
|
|
2234
|
-
}, [
|
|
2235
|
-
context:
|
|
2236
|
-
value:
|
|
2326
|
+
class: _e(["role-account-grant-drawer-body", { "role-account-grant-drawer-body--target-tenant": ee.value }])
|
|
2327
|
+
}, [ee.value ? (q(), H("label", Rn, [n[4] ||= U("span", null, "目标租户", -1), G(X(l), {
|
|
2328
|
+
context: te.value,
|
|
2329
|
+
value: N.value,
|
|
2237
2330
|
mode: "list",
|
|
2238
2331
|
placeholder: "请选择角色下发的目标租户",
|
|
2239
|
-
disabled:
|
|
2240
|
-
"onUpdate:value":
|
|
2332
|
+
disabled: y.value || _.value,
|
|
2333
|
+
"onUpdate:value": Ce
|
|
2241
2334
|
}, null, 8, [
|
|
2242
2335
|
"context",
|
|
2243
2336
|
"value",
|
|
2244
2337
|
"disabled"
|
|
2245
|
-
])])) : V("v-if", !0),
|
|
2246
|
-
U("div",
|
|
2247
|
-
value:
|
|
2338
|
+
])])) : V("v-if", !0), P.value ? (q(), H(R, { key: 2 }, [
|
|
2339
|
+
U("div", Bn, [G(X(A), {
|
|
2340
|
+
value: d.value,
|
|
2248
2341
|
"allow-clear": "",
|
|
2249
|
-
disabled:
|
|
2342
|
+
disabled: y.value,
|
|
2250
2343
|
placeholder: "搜索用户账号",
|
|
2251
|
-
"onUpdate:value":
|
|
2252
|
-
onKeydown:
|
|
2253
|
-
}, null, 8, ["value", "disabled"]), G(X(
|
|
2344
|
+
"onUpdate:value": n[0] ||= (e) => d.value = e,
|
|
2345
|
+
onKeydown: Ee(K, ["enter"])
|
|
2346
|
+
}, null, 8, ["value", "disabled"]), G(X(S), {
|
|
2254
2347
|
"icon-name": "search",
|
|
2255
|
-
disabled:
|
|
2348
|
+
disabled: y.value,
|
|
2256
2349
|
onClick: K
|
|
2257
2350
|
}, {
|
|
2258
|
-
default: Q(() => [...
|
|
2351
|
+
default: Q(() => [...n[5] ||= [W("查询", -1)]]),
|
|
2259
2352
|
_: 1
|
|
2260
2353
|
}, 8, ["disabled"])]),
|
|
2261
|
-
G(X(
|
|
2354
|
+
G(X(u), {
|
|
2262
2355
|
class: "role-account-grant-table",
|
|
2263
2356
|
size: "middle",
|
|
2264
2357
|
contract: oe,
|
|
2265
|
-
rows:
|
|
2358
|
+
rows: ie.value,
|
|
2266
2359
|
loading: v.value,
|
|
2267
2360
|
pagination: ce.value,
|
|
2268
2361
|
selection: se.value,
|
|
@@ -2273,41 +2366,41 @@ var yn = {
|
|
|
2273
2366
|
"pagination",
|
|
2274
2367
|
"selection"
|
|
2275
2368
|
]),
|
|
2276
|
-
|
|
2369
|
+
F.value.length > 0 ? (q(), H("section", Vn, [U("div", Hn, [n[6] ||= U("strong", null, "已选用户", -1), U("span", null, Y(F.value.length) + " 个", 1)]), U("div", Un, [(q(!0), H(R, null, Se(F.value, (e) => (q(), H("button", {
|
|
2277
2370
|
key: e.id,
|
|
2278
2371
|
type: "button",
|
|
2279
|
-
disabled:
|
|
2280
|
-
onClick: (t) =>
|
|
2281
|
-
}, [U("span", null, Y(ke(e)), 1), U("small", null, Y(Ae(e)), 1)], 8,
|
|
2282
|
-
], 64)) : (q(), H("div",
|
|
2372
|
+
disabled: y.value,
|
|
2373
|
+
onClick: (t) => Te(e.id)
|
|
2374
|
+
}, [U("span", null, Y(ke(e)), 1), U("small", null, Y(Ae(e)), 1)], 8, Wn))), 128))])])) : V("v-if", !0)
|
|
2375
|
+
], 64)) : (q(), H("div", zn, " 平台共享角色需要先选择目标租户,再加载可绑定账号。 "))], 2))]),
|
|
2283
2376
|
_: 2
|
|
2284
2377
|
}, [e.embedded ? void 0 : {
|
|
2285
2378
|
name: "operation",
|
|
2286
|
-
fn: Q(() => [G(X(
|
|
2287
|
-
disabled:
|
|
2288
|
-
onClick:
|
|
2379
|
+
fn: Q(() => [G(X(S), {
|
|
2380
|
+
disabled: y.value || _.value,
|
|
2381
|
+
onClick: ve
|
|
2289
2382
|
}, {
|
|
2290
|
-
default: Q(() => [...
|
|
2383
|
+
default: Q(() => [...n[1] ||= [W("取消", -1)]]),
|
|
2291
2384
|
_: 1
|
|
2292
|
-
}, 8, ["disabled"]), G(X(
|
|
2385
|
+
}, 8, ["disabled"]), G(X(S), {
|
|
2293
2386
|
type: "primary",
|
|
2294
|
-
loading:
|
|
2295
|
-
disabled:
|
|
2296
|
-
onClick:
|
|
2387
|
+
loading: y.value,
|
|
2388
|
+
disabled: _.value || !L.value,
|
|
2389
|
+
onClick: ge
|
|
2297
2390
|
}, {
|
|
2298
|
-
default: Q(() => [...
|
|
2391
|
+
default: Q(() => [...n[2] ||= [W(" 确定 ", -1)]]),
|
|
2299
2392
|
_: 1
|
|
2300
2393
|
}, 8, ["loading", "disabled"])]),
|
|
2301
2394
|
key: "0"
|
|
2302
2395
|
}]), 1040, ["class"]));
|
|
2303
2396
|
}
|
|
2304
|
-
}), [["__scopeId", "data-v-fc27c9ca"]]),
|
|
2397
|
+
}), [["__scopeId", "data-v-fc27c9ca"]]), qn = /* @__PURE__ */ K({
|
|
2305
2398
|
name: "RoleAccountGrantDrawerSurface",
|
|
2306
2399
|
__name: "RoleAccountGrantDrawerSurface",
|
|
2307
2400
|
props: { context: {} },
|
|
2308
2401
|
setup(e) {
|
|
2309
2402
|
let t = e, n = z(() => t.context.module), r = z(() => t.context.record);
|
|
2310
|
-
return (e, i) => (q(), B(
|
|
2403
|
+
return (e, i) => (q(), B(Kn, {
|
|
2311
2404
|
open: "",
|
|
2312
2405
|
embedded: "",
|
|
2313
2406
|
"drawer-context": t.context,
|
|
@@ -2323,7 +2416,7 @@ var yn = {
|
|
|
2323
2416
|
"onSaved"
|
|
2324
2417
|
]));
|
|
2325
2418
|
}
|
|
2326
|
-
}),
|
|
2419
|
+
}), Jn = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
2327
2420
|
name: "EmployeeEmploymentTable",
|
|
2328
2421
|
__name: "EmployeeEmploymentTable",
|
|
2329
2422
|
props: {
|
|
@@ -2348,7 +2441,7 @@ var yn = {
|
|
|
2348
2441
|
},
|
|
2349
2442
|
emits: ["update:selectedIds"],
|
|
2350
2443
|
setup(e, { emit: t }) {
|
|
2351
|
-
let n = e, r = t, i = J([]),
|
|
2444
|
+
let n = e, r = t, i = J([]), o = [
|
|
2352
2445
|
{
|
|
2353
2446
|
key: "title",
|
|
2354
2447
|
title: "职员",
|
|
@@ -2376,7 +2469,7 @@ var yn = {
|
|
|
2376
2469
|
width: 88,
|
|
2377
2470
|
align: "right"
|
|
2378
2471
|
}
|
|
2379
|
-
],
|
|
2472
|
+
], s = [
|
|
2380
2473
|
{
|
|
2381
2474
|
key: "position",
|
|
2382
2475
|
title: "岗位",
|
|
@@ -2397,7 +2490,7 @@ var yn = {
|
|
|
2397
2490
|
title: "主岗位",
|
|
2398
2491
|
width: 88
|
|
2399
2492
|
}
|
|
2400
|
-
],
|
|
2493
|
+
], c = z(() => {
|
|
2401
2494
|
let e = /* @__PURE__ */ new Map();
|
|
2402
2495
|
for (let t of n.rows) {
|
|
2403
2496
|
let n = t.employeeId ?? t.id, r = e.get(n) ?? {
|
|
@@ -2410,65 +2503,65 @@ var yn = {
|
|
|
2410
2503
|
r.positions.push(t), e.set(n, r);
|
|
2411
2504
|
}
|
|
2412
2505
|
return [...e.values()];
|
|
2413
|
-
}),
|
|
2414
|
-
function
|
|
2506
|
+
}), l = z(() => c.value);
|
|
2507
|
+
function u(e, t) {
|
|
2415
2508
|
let n = t;
|
|
2416
|
-
return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${
|
|
2509
|
+
return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${f(n)} 项` : "";
|
|
2417
2510
|
}
|
|
2418
|
-
function
|
|
2511
|
+
function d(e, t) {
|
|
2419
2512
|
let n = t;
|
|
2420
2513
|
return e.key === "position" ? n.positionTitle ?? n.positionId : e.key === "organization" ? n.organizationTitle ?? n.organizationId : e.key === "department" ? n.departmentTitle ?? n.departmentId : e.key === "primaryPosition" ? n.primaryPosition ? "是" : "否" : "";
|
|
2421
2514
|
}
|
|
2422
|
-
function
|
|
2515
|
+
function f(e) {
|
|
2423
2516
|
return e.positions.filter((e) => n.selectedIds.has(e.id)).length;
|
|
2424
2517
|
}
|
|
2425
|
-
function
|
|
2518
|
+
function p(e) {
|
|
2426
2519
|
if (n.selectable) return {
|
|
2427
2520
|
selectedRowKeys: e.positions.filter((e) => n.selectedIds.has(e.id)).map((e) => e.id),
|
|
2428
2521
|
preserveSelectedRowKeys: !0,
|
|
2429
2522
|
disabledOf: () => n.disabled,
|
|
2430
|
-
onChange: (t) =>
|
|
2523
|
+
onChange: (t) => m(e, t)
|
|
2431
2524
|
};
|
|
2432
2525
|
}
|
|
2433
|
-
function
|
|
2526
|
+
function m(e, t) {
|
|
2434
2527
|
let i = new Set(n.selectedIds);
|
|
2435
2528
|
for (let t of e.positions) i.delete(t.id);
|
|
2436
2529
|
for (let e of t) i.add(String(e));
|
|
2437
2530
|
r("update:selectedIds", i);
|
|
2438
2531
|
}
|
|
2439
|
-
function
|
|
2532
|
+
function g(e, t) {
|
|
2440
2533
|
let n = e.employeeId;
|
|
2441
2534
|
i.value = t ? Array.from(/* @__PURE__ */ new Set([...i.value, n])) : i.value.filter((e) => e !== n);
|
|
2442
2535
|
}
|
|
2443
|
-
function
|
|
2536
|
+
function _(e) {
|
|
2444
2537
|
let t = e.employeeId;
|
|
2445
|
-
|
|
2538
|
+
g(e, !i.value.includes(t));
|
|
2446
2539
|
}
|
|
2447
|
-
return (t, n) => (q(), B(X(
|
|
2540
|
+
return (t, n) => (q(), B(X(a), {
|
|
2448
2541
|
class: "employee-employment-table",
|
|
2449
|
-
columns:
|
|
2450
|
-
rows:
|
|
2542
|
+
columns: o,
|
|
2543
|
+
rows: l.value,
|
|
2451
2544
|
"row-key": "employeeId",
|
|
2452
2545
|
pagination: e.pagination,
|
|
2453
2546
|
"expanded-row-keys": i.value,
|
|
2454
2547
|
"clickable-rows": "",
|
|
2455
2548
|
"horizontal-scroll": "",
|
|
2456
2549
|
"fill-height": e.fillHeight,
|
|
2457
|
-
onRowExpand:
|
|
2458
|
-
onRowDblclick:
|
|
2550
|
+
onRowExpand: g,
|
|
2551
|
+
onRowDblclick: _
|
|
2459
2552
|
}, {
|
|
2460
|
-
cell: Q(({ column: e, record: t }) => [W(Y(
|
|
2553
|
+
cell: Q(({ column: e, record: t }) => [W(Y(u(e, t)), 1)]),
|
|
2461
2554
|
expandedRow: Q(({ record: e }) => [G(X(h), { title: "任职信息" }, {
|
|
2462
|
-
default: Q(() => [G(X(
|
|
2463
|
-
columns:
|
|
2555
|
+
default: Q(() => [G(X(a), {
|
|
2556
|
+
columns: s,
|
|
2464
2557
|
rows: e.positions,
|
|
2465
2558
|
"row-key": "id",
|
|
2466
2559
|
pagination: !1,
|
|
2467
|
-
selection:
|
|
2560
|
+
selection: p(e),
|
|
2468
2561
|
"horizontal-scroll": "",
|
|
2469
2562
|
"row-muted": (e) => e.enabled === !1
|
|
2470
2563
|
}, {
|
|
2471
|
-
cell: Q(({ column: e, record: t }) => [W(Y(
|
|
2564
|
+
cell: Q(({ column: e, record: t }) => [W(Y(d(e, t)), 1)]),
|
|
2472
2565
|
_: 1
|
|
2473
2566
|
}, 8, [
|
|
2474
2567
|
"rows",
|
|
@@ -2485,13 +2578,13 @@ var yn = {
|
|
|
2485
2578
|
"fill-height"
|
|
2486
2579
|
]));
|
|
2487
2580
|
}
|
|
2488
|
-
}), [["__scopeId", "data-v-21f1027e"]]),
|
|
2581
|
+
}), [["__scopeId", "data-v-21f1027e"]]), Yn = { key: 1 }, Xn = {
|
|
2489
2582
|
key: 2,
|
|
2490
2583
|
class: "role-employment-grant-body"
|
|
2491
|
-
},
|
|
2584
|
+
}, Zn = {
|
|
2492
2585
|
key: 0,
|
|
2493
2586
|
class: "role-employment-grant-selected"
|
|
2494
|
-
},
|
|
2587
|
+
}, Qn = { class: "role-employment-grant-selected-title" }, $n = { class: "role-employment-grant-selected-list" }, er = ["disabled", "onClick"], tr = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
2495
2588
|
name: "RoleEmploymentGrantDrawer",
|
|
2496
2589
|
__name: "RoleEmploymentGrantDrawer",
|
|
2497
2590
|
props: {
|
|
@@ -2503,108 +2596,108 @@ var yn = {
|
|
|
2503
2596
|
role: {}
|
|
2504
2597
|
},
|
|
2505
2598
|
emits: ["close", "saved"],
|
|
2506
|
-
setup(e, { emit:
|
|
2507
|
-
let
|
|
2508
|
-
open:
|
|
2599
|
+
setup(e, { emit: t }) {
|
|
2600
|
+
let n = e, r = t, i = J([]), a = J([]), o = J({}), s = J(/* @__PURE__ */ new Set()), c = J(/* @__PURE__ */ new Set()), l = J(!1), u = J(!1), d = J(!1), p = J(!1), h = J(1), g = J(0), _ = J(""), v = z(() => n.role?.id), y = z(() => In(n.context.http)), b = z(() => `绑定任职 - ${n.role?.title ?? n.role?.id ?? ""}`), x = z(() => n.embedded ? "section" : M), C = z(() => n.embedded ? {} : {
|
|
2601
|
+
open: n.open,
|
|
2509
2602
|
title: b.value,
|
|
2510
|
-
renderMode:
|
|
2603
|
+
renderMode: n.container ? "inline" : "portal",
|
|
2511
2604
|
closeTitle: "关闭",
|
|
2512
|
-
onClose: () => !
|
|
2513
|
-
}),
|
|
2514
|
-
current:
|
|
2515
|
-
total:
|
|
2605
|
+
onClose: () => !d.value && r("close")
|
|
2606
|
+
}), w = z(() => [...s.value].filter((e) => !c.value.has(e))), E = z(() => [...c.value].filter((e) => !s.value.has(e))), D = z(() => new Map(i.value.map((e) => [e.employeePositionId, e]))), O = z(() => a.value.filter((e) => !_.value.trim() || ne(e).includes(_.value.trim()))), k = z(() => [...s.value].map((e) => o.value[e] ?? I(e))), j = z(() => ({
|
|
2607
|
+
current: h.value,
|
|
2608
|
+
total: g.value,
|
|
2516
2609
|
pageSize: 50,
|
|
2517
2610
|
showSizeChanger: !1,
|
|
2518
2611
|
showQuickJumper: !1,
|
|
2519
|
-
onChange: (e) => void
|
|
2612
|
+
onChange: (e) => void N(e)
|
|
2520
2613
|
}));
|
|
2521
|
-
Z(() => [
|
|
2522
|
-
e ?
|
|
2614
|
+
Z(() => [n.open, n.role?.id], ([e]) => {
|
|
2615
|
+
e ? N() : te();
|
|
2523
2616
|
}, { immediate: !0 }), Z([
|
|
2524
|
-
() =>
|
|
2525
|
-
() =>
|
|
2526
|
-
|
|
2527
|
-
|
|
2617
|
+
() => n.embedded,
|
|
2618
|
+
() => n.drawerContext,
|
|
2619
|
+
s,
|
|
2620
|
+
w,
|
|
2528
2621
|
E,
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
],
|
|
2532
|
-
function
|
|
2533
|
-
let e =
|
|
2534
|
-
|
|
2535
|
-
summary: `已选 ${
|
|
2622
|
+
d,
|
|
2623
|
+
u
|
|
2624
|
+
], ee, { immediate: !0 }), ye(() => n.drawerContext?.setOperation(void 0));
|
|
2625
|
+
function ee() {
|
|
2626
|
+
let e = n.drawerContext;
|
|
2627
|
+
n.embedded && e && (e.setSubtitle(`角色:${n.role?.title ?? n.role?.id ?? "角色"} · ${oe(n.role)}`), e.setOperation({
|
|
2628
|
+
summary: `已选 ${s.value.size} 个任职${w.value.length || E.value.length ? ` · 新增 ${w.value.length} · 移除 ${E.value.length}` : ""}`,
|
|
2536
2629
|
actions: [{
|
|
2537
2630
|
key: "cancel-employment-role-grants",
|
|
2538
2631
|
label: "取消",
|
|
2539
|
-
disabled:
|
|
2540
|
-
run: () =>
|
|
2632
|
+
disabled: d.value,
|
|
2633
|
+
run: () => r("close")
|
|
2541
2634
|
}, {
|
|
2542
2635
|
key: "save-employment-role-grants",
|
|
2543
2636
|
label: "确定",
|
|
2544
2637
|
emphasis: "primary",
|
|
2545
|
-
disabled:
|
|
2546
|
-
loading:
|
|
2547
|
-
run: () => void
|
|
2638
|
+
disabled: u.value || w.value.length === 0 && E.value.length === 0,
|
|
2639
|
+
loading: d.value,
|
|
2640
|
+
run: () => void P()
|
|
2548
2641
|
}]
|
|
2549
2642
|
}));
|
|
2550
2643
|
}
|
|
2551
|
-
async function
|
|
2552
|
-
let t =
|
|
2644
|
+
async function N(e = 1) {
|
|
2645
|
+
let t = v.value;
|
|
2553
2646
|
if (t) {
|
|
2554
|
-
|
|
2647
|
+
u.value = !0, p.value = !1;
|
|
2555
2648
|
try {
|
|
2556
|
-
let [n, r] = await Promise.all([
|
|
2649
|
+
let [n, r] = await Promise.all([y.value.employmentRoleGrants(t), y.value.employmentSelector(t, {
|
|
2557
2650
|
enabledOnly: !0,
|
|
2558
2651
|
page: {
|
|
2559
2652
|
pageNum: e,
|
|
2560
2653
|
pageSize: 50
|
|
2561
2654
|
}
|
|
2562
2655
|
})]);
|
|
2563
|
-
|
|
2564
|
-
...
|
|
2565
|
-
...
|
|
2566
|
-
},
|
|
2656
|
+
i.value = n, c.value = new Set(n.map((e) => e.employeePositionId).filter((e) => !!e)), o.value = {
|
|
2657
|
+
...o.value,
|
|
2658
|
+
...F(r.records)
|
|
2659
|
+
}, l.value ||= (s.value = new Set(c.value), !0), a.value = r.records, h.value = r.pageNum, g.value = r.total;
|
|
2567
2660
|
} catch (e) {
|
|
2568
|
-
p.value = !0,
|
|
2661
|
+
p.value = !0, T(e, {
|
|
2569
2662
|
source: "role-employment-grants",
|
|
2570
2663
|
phase: "load"
|
|
2571
2664
|
});
|
|
2572
2665
|
} finally {
|
|
2573
|
-
|
|
2666
|
+
u.value = !1;
|
|
2574
2667
|
}
|
|
2575
2668
|
}
|
|
2576
2669
|
}
|
|
2577
|
-
async function
|
|
2578
|
-
let e =
|
|
2670
|
+
async function P() {
|
|
2671
|
+
let e = v.value;
|
|
2579
2672
|
if (e) {
|
|
2580
|
-
|
|
2673
|
+
d.value = !0;
|
|
2581
2674
|
try {
|
|
2582
|
-
for (let t of
|
|
2675
|
+
for (let t of w.value) await y.value.grantEmploymentRole(e, t);
|
|
2583
2676
|
for (let t of E.value) {
|
|
2584
|
-
let n =
|
|
2585
|
-
n && await
|
|
2677
|
+
let n = D.value.get(t)?.id;
|
|
2678
|
+
n && await y.value.deleteEmploymentRoleGrant(e, n);
|
|
2586
2679
|
}
|
|
2587
|
-
await
|
|
2680
|
+
await f({
|
|
2588
2681
|
success: !0,
|
|
2589
2682
|
message: "任职角色授权已保存"
|
|
2590
2683
|
}, {
|
|
2591
2684
|
source: "role-employment-grants",
|
|
2592
2685
|
phase: "action"
|
|
2593
|
-
}),
|
|
2686
|
+
}), r("saved"), r("close");
|
|
2594
2687
|
} catch (e) {
|
|
2595
|
-
|
|
2688
|
+
T(e, {
|
|
2596
2689
|
source: "role-employment-grants",
|
|
2597
2690
|
phase: "action"
|
|
2598
2691
|
});
|
|
2599
2692
|
} finally {
|
|
2600
|
-
|
|
2693
|
+
d.value = !1;
|
|
2601
2694
|
}
|
|
2602
2695
|
}
|
|
2603
2696
|
}
|
|
2604
|
-
function
|
|
2605
|
-
|
|
2697
|
+
function te() {
|
|
2698
|
+
i.value = [], a.value = [], o.value = {}, s.value = /* @__PURE__ */ new Set(), c.value = /* @__PURE__ */ new Set(), l.value = !1, _.value = "", h.value = 1, g.value = 0, p.value = !1;
|
|
2606
2699
|
}
|
|
2607
|
-
function
|
|
2700
|
+
function ne(e) {
|
|
2608
2701
|
return [
|
|
2609
2702
|
e.employeeTitle,
|
|
2610
2703
|
e.employeeNo,
|
|
@@ -2613,26 +2706,26 @@ var yn = {
|
|
|
2613
2706
|
e.positionTitle
|
|
2614
2707
|
].filter(Boolean).join(" ");
|
|
2615
2708
|
}
|
|
2616
|
-
function P(e) {
|
|
2617
|
-
let t = new Set(c.value);
|
|
2618
|
-
t.delete(e), c.value = t;
|
|
2619
|
-
}
|
|
2620
2709
|
function ie(e) {
|
|
2710
|
+
let t = new Set(s.value);
|
|
2711
|
+
t.delete(e), s.value = t;
|
|
2712
|
+
}
|
|
2713
|
+
function F(e) {
|
|
2621
2714
|
let t = {};
|
|
2622
2715
|
for (let n of e) n.id && (t[n.id] = n);
|
|
2623
2716
|
return t;
|
|
2624
2717
|
}
|
|
2625
|
-
function
|
|
2718
|
+
function I(e) {
|
|
2626
2719
|
return {
|
|
2627
2720
|
id: e,
|
|
2628
2721
|
positionId: e
|
|
2629
2722
|
};
|
|
2630
2723
|
}
|
|
2631
|
-
function
|
|
2724
|
+
function ae(e) {
|
|
2632
2725
|
let t = e.positionTitle ?? e.positionId ?? e.id;
|
|
2633
2726
|
return e.employeeTitle ? `${e.employeeTitle} · ${t}` : t;
|
|
2634
2727
|
}
|
|
2635
|
-
function
|
|
2728
|
+
function L(e) {
|
|
2636
2729
|
return [
|
|
2637
2730
|
e.employeeNo,
|
|
2638
2731
|
e.organizationTitle ?? e.organizationId,
|
|
@@ -2642,30 +2735,30 @@ var yn = {
|
|
|
2642
2735
|
function oe(e) {
|
|
2643
2736
|
return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
|
|
2644
2737
|
}
|
|
2645
|
-
return (
|
|
2646
|
-
default: Q(() => [
|
|
2738
|
+
return (t, n) => (q(), B(we(x.value), he(C.value, { class: { "role-employment-grant-drawer-surface": e.embedded } }), fe({
|
|
2739
|
+
default: Q(() => [u.value ? (q(), B(X(re), {
|
|
2647
2740
|
key: 0,
|
|
2648
2741
|
tip: "加载任职"
|
|
2649
|
-
})) : p.value ? (q(), H("div",
|
|
2742
|
+
})) : p.value ? (q(), H("div", Yn, [G(X(m), {
|
|
2650
2743
|
title: "任职加载失败",
|
|
2651
2744
|
message: "无法加载任职授权"
|
|
2652
|
-
}), G(X(
|
|
2653
|
-
default: Q(() => [...
|
|
2745
|
+
}), G(X(S), { onClick: n[1] ||= (e) => N() }, {
|
|
2746
|
+
default: Q(() => [...n[6] ||= [W("重试", -1)]]),
|
|
2654
2747
|
_: 1
|
|
2655
|
-
})])) : (q(), H("section",
|
|
2656
|
-
G(X(
|
|
2657
|
-
value:
|
|
2658
|
-
"onUpdate:value":
|
|
2748
|
+
})])) : (q(), H("section", Xn, [
|
|
2749
|
+
G(X(A), {
|
|
2750
|
+
value: _.value,
|
|
2751
|
+
"onUpdate:value": n[2] ||= (e) => _.value = e,
|
|
2659
2752
|
"allow-clear": "",
|
|
2660
2753
|
placeholder: "筛选职员、工号、机构、部门或岗位"
|
|
2661
2754
|
}, null, 8, ["value"]),
|
|
2662
|
-
G(
|
|
2663
|
-
"selected-ids":
|
|
2664
|
-
"onUpdate:selectedIds":
|
|
2665
|
-
rows:
|
|
2755
|
+
G(Jn, {
|
|
2756
|
+
"selected-ids": s.value,
|
|
2757
|
+
"onUpdate:selectedIds": n[3] ||= (e) => s.value = e,
|
|
2758
|
+
rows: O.value,
|
|
2666
2759
|
selectable: "",
|
|
2667
|
-
disabled:
|
|
2668
|
-
pagination:
|
|
2760
|
+
disabled: d.value,
|
|
2761
|
+
pagination: j.value,
|
|
2669
2762
|
"fill-height": ""
|
|
2670
2763
|
}, null, 8, [
|
|
2671
2764
|
"selected-ids",
|
|
@@ -2673,41 +2766,41 @@ var yn = {
|
|
|
2673
2766
|
"disabled",
|
|
2674
2767
|
"pagination"
|
|
2675
2768
|
]),
|
|
2676
|
-
|
|
2769
|
+
k.value.length > 0 ? (q(), H("section", Zn, [U("div", Qn, [n[7] ||= U("strong", null, "已选任职", -1), U("span", null, Y(k.value.length) + " 个", 1)]), U("div", $n, [(q(!0), H(R, null, Se(k.value, (e) => (q(), H("button", {
|
|
2677
2770
|
key: e.id,
|
|
2678
2771
|
type: "button",
|
|
2679
|
-
disabled:
|
|
2680
|
-
onClick: (t) =>
|
|
2681
|
-
}, [U("span", null, Y(
|
|
2772
|
+
disabled: d.value,
|
|
2773
|
+
onClick: (t) => ie(e.id)
|
|
2774
|
+
}, [U("span", null, Y(ae(e)), 1), U("small", null, Y(L(e)), 1)], 8, er))), 128))])])) : V("v-if", !0)
|
|
2682
2775
|
]))]),
|
|
2683
2776
|
_: 2
|
|
2684
2777
|
}, [e.embedded ? void 0 : {
|
|
2685
2778
|
name: "operation",
|
|
2686
|
-
fn: Q(() => [G(X(
|
|
2687
|
-
disabled:
|
|
2688
|
-
onClick:
|
|
2779
|
+
fn: Q(() => [G(X(S), {
|
|
2780
|
+
disabled: d.value,
|
|
2781
|
+
onClick: n[0] ||= (e) => r("close")
|
|
2689
2782
|
}, {
|
|
2690
|
-
default: Q(() => [...
|
|
2783
|
+
default: Q(() => [...n[4] ||= [W("取消", -1)]]),
|
|
2691
2784
|
_: 1
|
|
2692
|
-
}, 8, ["disabled"]), G(X(
|
|
2785
|
+
}, 8, ["disabled"]), G(X(S), {
|
|
2693
2786
|
type: "primary",
|
|
2694
|
-
loading:
|
|
2695
|
-
disabled:
|
|
2696
|
-
onClick:
|
|
2787
|
+
loading: d.value,
|
|
2788
|
+
disabled: u.value || w.value.length === 0 && E.value.length === 0,
|
|
2789
|
+
onClick: P
|
|
2697
2790
|
}, {
|
|
2698
|
-
default: Q(() => [...
|
|
2791
|
+
default: Q(() => [...n[5] ||= [W(" 确定 ", -1)]]),
|
|
2699
2792
|
_: 1
|
|
2700
2793
|
}, 8, ["loading", "disabled"])]),
|
|
2701
2794
|
key: "0"
|
|
2702
2795
|
}]), 1040, ["class"]));
|
|
2703
2796
|
}
|
|
2704
|
-
}), [["__scopeId", "data-v-06db3659"]]),
|
|
2797
|
+
}), [["__scopeId", "data-v-06db3659"]]), nr = /* @__PURE__ */ K({
|
|
2705
2798
|
name: "RoleEmploymentGrantDrawerSurface",
|
|
2706
2799
|
__name: "RoleEmploymentGrantDrawerSurface",
|
|
2707
2800
|
props: { context: {} },
|
|
2708
2801
|
setup(e) {
|
|
2709
2802
|
let t = e, n = z(() => t.context.module), r = z(() => t.context.record);
|
|
2710
|
-
return (e, i) => (q(), B(
|
|
2803
|
+
return (e, i) => (q(), B(tr, {
|
|
2711
2804
|
open: "",
|
|
2712
2805
|
embedded: "",
|
|
2713
2806
|
"drawer-context": t.context,
|
|
@@ -2723,7 +2816,7 @@ var yn = {
|
|
|
2723
2816
|
"onSaved"
|
|
2724
2817
|
]));
|
|
2725
2818
|
}
|
|
2726
|
-
}),
|
|
2819
|
+
}), rr = /* @__PURE__ */ K({
|
|
2727
2820
|
name: "WorkspaceViewDrawer",
|
|
2728
2821
|
__name: "WorkspaceViewDrawer",
|
|
2729
2822
|
props: {
|
|
@@ -2732,25 +2825,32 @@ var yn = {
|
|
|
2732
2825
|
container: {},
|
|
2733
2826
|
subtitle: { default: void 0 },
|
|
2734
2827
|
profile: { default: "detail" },
|
|
2735
|
-
promotion: { default: void 0 }
|
|
2828
|
+
promotion: { default: void 0 },
|
|
2829
|
+
dismissal: { default: void 0 },
|
|
2830
|
+
beforeClose: {
|
|
2831
|
+
type: Function,
|
|
2832
|
+
default: void 0
|
|
2833
|
+
}
|
|
2736
2834
|
},
|
|
2737
2835
|
emits: ["close"],
|
|
2738
2836
|
setup(e, { emit: t }) {
|
|
2739
|
-
let n = e, r = t, i = z(() => n.profile === "wide-work" ? "
|
|
2740
|
-
return (t, n) => (q(), B(X(
|
|
2837
|
+
let n = e, r = t, i = z(() => n.profile === "wide-work" ? "wide" : "standard");
|
|
2838
|
+
return (t, n) => (q(), B(X(M), {
|
|
2741
2839
|
open: e.open,
|
|
2742
2840
|
title: e.title,
|
|
2743
2841
|
"render-mode": e.container ? "inline" : "portal",
|
|
2744
2842
|
subtitle: e.subtitle,
|
|
2745
2843
|
width: i.value,
|
|
2746
2844
|
promotion: e.promotion,
|
|
2845
|
+
dismissal: e.dismissal,
|
|
2846
|
+
"before-close": e.beforeClose,
|
|
2747
2847
|
onClose: n[0] ||= (e) => r("close")
|
|
2748
2848
|
}, fe({
|
|
2749
|
-
default: Q(() => [
|
|
2849
|
+
default: Q(() => [Ce(t.$slots, "default")]),
|
|
2750
2850
|
_: 2
|
|
2751
2851
|
}, [t.$slots.operation ? {
|
|
2752
2852
|
name: "operation",
|
|
2753
|
-
fn: Q(() => [
|
|
2853
|
+
fn: Q(() => [Ce(t.$slots, "operation")]),
|
|
2754
2854
|
key: "0"
|
|
2755
2855
|
} : void 0]), 1032, [
|
|
2756
2856
|
"open",
|
|
@@ -2758,27 +2858,29 @@ var yn = {
|
|
|
2758
2858
|
"render-mode",
|
|
2759
2859
|
"subtitle",
|
|
2760
2860
|
"width",
|
|
2761
|
-
"promotion"
|
|
2861
|
+
"promotion",
|
|
2862
|
+
"dismissal",
|
|
2863
|
+
"before-close"
|
|
2762
2864
|
]));
|
|
2763
2865
|
}
|
|
2764
2866
|
});
|
|
2765
2867
|
//#endregion
|
|
2766
2868
|
//#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
|
|
2767
|
-
function
|
|
2869
|
+
function ir(e) {
|
|
2768
2870
|
return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
|
|
2769
2871
|
}
|
|
2770
|
-
function
|
|
2771
|
-
let t =
|
|
2872
|
+
function ar(e) {
|
|
2873
|
+
let t = le();
|
|
2772
2874
|
return z(() => {
|
|
2773
|
-
let n =
|
|
2774
|
-
if (n &&
|
|
2875
|
+
let n = Te(e.input);
|
|
2876
|
+
if (n && ir(Te(e.eligibility)) && t) return {
|
|
2775
2877
|
title: "固定为页签",
|
|
2776
2878
|
promote: async () => {
|
|
2777
2879
|
if (await e.beforePromote?.(n) === !1) {
|
|
2778
2880
|
e.onPromotionRejected?.();
|
|
2779
2881
|
return;
|
|
2780
2882
|
}
|
|
2781
|
-
let r = t.openPage(
|
|
2883
|
+
let r = t.openPage(oe(e.view, n, "tab", Te(e.title)));
|
|
2782
2884
|
e.onPromoted?.(r);
|
|
2783
2885
|
}
|
|
2784
2886
|
};
|
|
@@ -2786,53 +2888,53 @@ function Vn(e) {
|
|
|
2786
2888
|
}
|
|
2787
2889
|
//#endregion
|
|
2788
2890
|
//#region src/platform-admin-runtime/workspaceViewSessions.ts
|
|
2789
|
-
var
|
|
2790
|
-
function
|
|
2791
|
-
return `${e.type}:${
|
|
2792
|
-
}
|
|
2793
|
-
async function
|
|
2794
|
-
let r =
|
|
2795
|
-
return a ? await a(
|
|
2796
|
-
}
|
|
2797
|
-
function
|
|
2798
|
-
let r =
|
|
2799
|
-
return i.add(n),
|
|
2800
|
-
i.delete(n), i.size === 0 &&
|
|
2891
|
+
var or = /* @__PURE__ */ new Map(), sr = /* @__PURE__ */ new Map();
|
|
2892
|
+
function cr(e, t) {
|
|
2893
|
+
return `${e.type}:${fr(t)}`;
|
|
2894
|
+
}
|
|
2895
|
+
async function lr(e, t, n) {
|
|
2896
|
+
let r = cr(e, t), i = sr.get(r), a = i && [...i].at(-1);
|
|
2897
|
+
return a ? await a(pr(n)) ? "accepted" : "rejected" : (or.set(r, pr(n)), "accepted");
|
|
2898
|
+
}
|
|
2899
|
+
function ur(e, t, n) {
|
|
2900
|
+
let r = cr(e, t), i = sr.get(r) ?? /* @__PURE__ */ new Set();
|
|
2901
|
+
return i.add(n), sr.set(r, i), () => {
|
|
2902
|
+
i.delete(n), i.size === 0 && sr.delete(r);
|
|
2801
2903
|
};
|
|
2802
2904
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let n =
|
|
2805
|
-
return
|
|
2905
|
+
function dr(e, t) {
|
|
2906
|
+
let n = cr(e, t), r = or.get(n);
|
|
2907
|
+
return or.delete(n), r;
|
|
2806
2908
|
}
|
|
2807
|
-
function
|
|
2808
|
-
return Array.isArray(e) ? `[${e.map(
|
|
2909
|
+
function fr(e) {
|
|
2910
|
+
return Array.isArray(e) ? `[${e.map(fr).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${fr(t)}`).join(",")}}` : JSON.stringify(e);
|
|
2809
2911
|
}
|
|
2810
|
-
function
|
|
2912
|
+
function pr(e) {
|
|
2811
2913
|
return JSON.parse(JSON.stringify(e));
|
|
2812
2914
|
}
|
|
2813
2915
|
//#endregion
|
|
2814
2916
|
//#region src/views/roleAuthorizationWorkspaceSession.ts
|
|
2815
|
-
function
|
|
2816
|
-
return
|
|
2917
|
+
function mr(e, t) {
|
|
2918
|
+
return lr(Pe, e, t);
|
|
2817
2919
|
}
|
|
2818
|
-
function
|
|
2819
|
-
return
|
|
2920
|
+
function hr(e, t) {
|
|
2921
|
+
return ur(Pe, e, t);
|
|
2820
2922
|
}
|
|
2821
|
-
function
|
|
2822
|
-
return
|
|
2923
|
+
function gr(e) {
|
|
2924
|
+
return dr(Pe, e);
|
|
2823
2925
|
}
|
|
2824
2926
|
//#endregion
|
|
2825
2927
|
//#region src/views/RoleAuthorizationView.vue?vue&type=script&setup=true&lang.ts
|
|
2826
|
-
var
|
|
2928
|
+
var _r = { class: "panel-title" }, vr = {
|
|
2827
2929
|
key: 0,
|
|
2828
2930
|
class: "authorization-column-header"
|
|
2829
|
-
},
|
|
2931
|
+
}, yr = {
|
|
2830
2932
|
key: 2,
|
|
2831
2933
|
class: "data-scope-editor"
|
|
2832
|
-
},
|
|
2934
|
+
}, br = { key: 0 }, xr = { key: 1 }, Sr = { key: 3 }, Cr = {
|
|
2833
2935
|
key: 4,
|
|
2834
2936
|
class: "not-applicable"
|
|
2835
|
-
},
|
|
2937
|
+
}, wr = /*@__PURE__*/ K({
|
|
2836
2938
|
name: "RoleAuthorizationView",
|
|
2837
2939
|
__name: "RoleAuthorizationView",
|
|
2838
2940
|
props: {
|
|
@@ -2843,30 +2945,30 @@ var $n = { class: "panel-title" }, er = {
|
|
|
2843
2945
|
drawerContext: {}
|
|
2844
2946
|
},
|
|
2845
2947
|
emits: ["close"],
|
|
2846
|
-
setup(e, { emit:
|
|
2847
|
-
let
|
|
2848
|
-
let e =
|
|
2948
|
+
setup(e, { emit: t }) {
|
|
2949
|
+
let n = e, r = t, i = b({ moduleAlias: "iam.role" }), l = n.moduleContext ?? i, u = In(l.http), p = n.roleId ?? new URLSearchParams(window.location.search).get("roleId") ?? "", h = se(), g = n.roleId ? { roleId: n.roleId } : void 0, v = g ? gr(g) : void 0, y = J(), C = J([]), E = J(), D = J(""), O = J([]), k = J(), A = J(), j = J(!1), ee = J(!1), M = J(!1), P = J(), ne = J(), ie = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), I = J(0), ae, L = z(() => y.value?.roleKind === "group"), oe = z(() => y.value?.roleKind === "dataGrant"), le = z(() => y.value?.assignmentType === "employment"), ue = z(() => !!n.drawerContext), de = z(() => y.value?.title ?? p ?? "角色"), pe = z(() => `授权:${de.value}`), K = z(() => he.value ? `动作授权 - ${he.value.title}` : `动作授权 - ${de.value}`), he = z(() => C.value.find((e) => e.moduleAlias === E.value)), ge = z(() => {
|
|
2950
|
+
let e = D.value.trim().toLocaleLowerCase(), t = new Set(e ? C.value.filter((t) => [
|
|
2849
2951
|
t.title,
|
|
2850
2952
|
t.moduleAlias,
|
|
2851
2953
|
t.applicationAlias
|
|
2852
|
-
].filter((e) => !!e).some((t) => t.toLocaleLowerCase().includes(e))).map((e) => e.moduleAlias) :
|
|
2954
|
+
].filter((e) => !!e).some((t) => t.toLocaleLowerCase().includes(e))).map((e) => e.moduleAlias) : C.value.map((e) => e.moduleAlias)), n = new Map(C.value.map((e) => [e.moduleAlias, e]));
|
|
2853
2955
|
for (let e of [...t]) {
|
|
2854
2956
|
let r = n.get(e)?.parentId;
|
|
2855
2957
|
for (; r && n.has(r) && !t.has(r);) t.add(r), r = n.get(r)?.parentId;
|
|
2856
2958
|
}
|
|
2857
|
-
return
|
|
2959
|
+
return C.value.filter((e) => t.has(e.moduleAlias)).map((e) => ({
|
|
2858
2960
|
id: e.moduleAlias,
|
|
2859
2961
|
parentId: e.parentId,
|
|
2860
2962
|
title: e.title,
|
|
2861
2963
|
secondary: e.applicationAlias
|
|
2862
2964
|
}));
|
|
2863
|
-
}),
|
|
2965
|
+
}), xe = z(() => (A.value?.options ?? []).map((e) => ({
|
|
2864
2966
|
value: e.code,
|
|
2865
2967
|
label: e.title
|
|
2866
|
-
}))),
|
|
2968
|
+
}))), Se = z(() => (A.value?.referenceDependencies ?? []).map((e) => ({
|
|
2867
2969
|
value: e.referenceFieldId,
|
|
2868
2970
|
label: `${e.title} → ${e.targetModuleTitle}`
|
|
2869
|
-
}))),
|
|
2971
|
+
}))), Ce = z(() => new Map((A.value?.referenceDependencies ?? []).map((e) => [e.referenceFieldId, e]))), Te = z(() => le.value && O.value.some((e) => !!e.dataAuth)), Ee = z(() => [
|
|
2870
2972
|
{
|
|
2871
2973
|
key: "title",
|
|
2872
2974
|
title: "动作",
|
|
@@ -2878,12 +2980,12 @@ var $n = { class: "panel-title" }, er = {
|
|
|
2878
2980
|
width: 104,
|
|
2879
2981
|
align: "center"
|
|
2880
2982
|
},
|
|
2881
|
-
...
|
|
2983
|
+
...Te.value ? [{
|
|
2882
2984
|
key: "dataScopePolicy",
|
|
2883
2985
|
title: "数据范围",
|
|
2884
2986
|
width: 200
|
|
2885
2987
|
}] : []
|
|
2886
|
-
]),
|
|
2988
|
+
]), De = [
|
|
2887
2989
|
{
|
|
2888
2990
|
key: "title",
|
|
2889
2991
|
title: "标准动作",
|
|
@@ -2900,291 +3002,298 @@ var $n = { class: "panel-title" }, er = {
|
|
|
2900
3002
|
title: "数据范围",
|
|
2901
3003
|
width: 160
|
|
2902
3004
|
}
|
|
2903
|
-
],
|
|
3005
|
+
], Oe = z(() => O.value), ke = z(() => k.value?.actions ?? []), Ae = z(() => n.drawer === !0 || !!g && h?.presentation === "drawer"), je = z(() => !!g), Me = z(() => je.value && !ue.value), Ne = z(() => ue.value ? "div" : Ae.value ? rr : je.value ? d : "div"), Fe = z(() => Ae.value ? {
|
|
2904
3006
|
open: !0,
|
|
2905
|
-
title:
|
|
2906
|
-
container:
|
|
2907
|
-
profile:
|
|
2908
|
-
promotion:
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
3007
|
+
title: pe.value,
|
|
3008
|
+
container: n.container ?? null,
|
|
3009
|
+
profile: Pe.drawerProfile,
|
|
3010
|
+
promotion: Ve.value,
|
|
3011
|
+
dismissal: "guarded",
|
|
3012
|
+
beforeClose: it,
|
|
3013
|
+
onClose: at
|
|
3014
|
+
} : Me.value ? { title: pe.value } : {}), Ie = z(() => {
|
|
3015
|
+
let e = k.value;
|
|
3016
|
+
return !e || ne.value === void 0 ? !1 : JSON.stringify(e.actions) !== ne.value;
|
|
3017
|
+
}), Le = z(() => I.value >= 0 && [...ie.entries()].some(([e, t]) => F.get(e) !== JSON.stringify(t))), $ = z(() => Ie.value || Le.value);
|
|
3018
|
+
ce("角色授权", () => $.value, () => M.value);
|
|
3019
|
+
let Re = z(() => O.value.length > 0 && O.value.every((e) => e.granted)), ze = z(() => O.value.some((e) => e.granted) && !Re.value), Be = z(() => {
|
|
3020
|
+
let e = he.value?.title ?? "未选择模块", t = O.value.filter((e) => e.granted).length, n = $.value ? "有未确认修改" : "未修改";
|
|
3021
|
+
return `当前模块:${e} · 已授权 ${t}/${O.value.length} 项 · ${n}`;
|
|
3022
|
+
}), Ve = ar({
|
|
3023
|
+
view: Pe,
|
|
3024
|
+
input: () => g,
|
|
3025
|
+
title: pe,
|
|
2920
3026
|
eligibility: () => ({
|
|
2921
|
-
hasStableIdentity: !!(
|
|
2922
|
-
busy:
|
|
3027
|
+
hasStableIdentity: !!(p && y.value),
|
|
3028
|
+
busy: M.value
|
|
2923
3029
|
}),
|
|
2924
|
-
beforePromote: (e) =>
|
|
2925
|
-
selectedModuleAlias:
|
|
2926
|
-
dataGrantMatrix:
|
|
2927
|
-
actionDrafts: [...
|
|
3030
|
+
beforePromote: (e) => mr(e, {
|
|
3031
|
+
selectedModuleAlias: E.value,
|
|
3032
|
+
dataGrantMatrix: k.value,
|
|
3033
|
+
actionDrafts: [...ie.entries()].map(([e, t]) => ({
|
|
2928
3034
|
moduleAlias: e,
|
|
2929
3035
|
actions: t
|
|
2930
3036
|
})),
|
|
2931
|
-
actionSnapshots: [...
|
|
3037
|
+
actionSnapshots: [...F.entries()].map(([e, t]) => ({
|
|
2932
3038
|
moduleAlias: e,
|
|
2933
3039
|
snapshot: t
|
|
2934
3040
|
}))
|
|
2935
3041
|
}).then((e) => e === "accepted"),
|
|
2936
|
-
onPromoted:
|
|
2937
|
-
onPromotionRejected: () =>
|
|
3042
|
+
onPromoted: ot,
|
|
3043
|
+
onPromotionRejected: () => w("目标页签存在未确认的授权配置;请先确认或关闭该页签后再固定当前抽屉。", {
|
|
2938
3044
|
source: "role-authorization",
|
|
2939
3045
|
phase: "validation"
|
|
2940
3046
|
})
|
|
2941
3047
|
});
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
}), Z(
|
|
2945
|
-
|
|
2946
|
-
}, { immediate: !0 }), Z(
|
|
2947
|
-
|
|
2948
|
-
|
|
3048
|
+
be(() => {
|
|
3049
|
+
g && !Ae.value && (ae = hr(g, st)), Ue();
|
|
3050
|
+
}), Z(pe, (e) => {
|
|
3051
|
+
je.value && h?.setTitle(e);
|
|
3052
|
+
}, { immediate: !0 }), Z(E, () => void We()), Z([
|
|
3053
|
+
de,
|
|
3054
|
+
Be,
|
|
2949
3055
|
$,
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
],
|
|
2954
|
-
|
|
3056
|
+
M,
|
|
3057
|
+
L,
|
|
3058
|
+
oe
|
|
3059
|
+
], He, { immediate: !0 }), be(() => window.addEventListener("beforeunload", lt)), ye(() => {
|
|
3060
|
+
ae?.(), n.drawerContext?.setOperation(void 0), n.drawerContext?.setSubtitle(void 0), window.removeEventListener("beforeunload", lt);
|
|
2955
3061
|
});
|
|
2956
|
-
function
|
|
2957
|
-
let e =
|
|
3062
|
+
function He() {
|
|
3063
|
+
let e = n.drawerContext;
|
|
2958
3064
|
if (e) {
|
|
2959
|
-
if (e.setSubtitle(`${
|
|
3065
|
+
if (e.setSubtitle(`${de.value} · ${ut(y.value)}`), L.value) {
|
|
2960
3066
|
e.setOperation(void 0);
|
|
2961
3067
|
return;
|
|
2962
3068
|
}
|
|
2963
3069
|
e.setOperation({
|
|
2964
|
-
summary:
|
|
3070
|
+
summary: oe.value ? $.value ? "有未确认修改" : "未修改" : Be.value,
|
|
2965
3071
|
actions: [{
|
|
2966
3072
|
key: "confirm-role-authorization",
|
|
2967
3073
|
label: "确认",
|
|
2968
3074
|
emphasis: "primary",
|
|
2969
|
-
disabled:
|
|
2970
|
-
loading:
|
|
2971
|
-
run: () => void
|
|
3075
|
+
disabled: M.value || !$.value,
|
|
3076
|
+
loading: M.value,
|
|
3077
|
+
run: () => void rt()
|
|
2972
3078
|
}]
|
|
2973
3079
|
});
|
|
2974
3080
|
}
|
|
2975
3081
|
}
|
|
2976
|
-
async function
|
|
2977
|
-
if (!
|
|
2978
|
-
|
|
3082
|
+
async function Ue() {
|
|
3083
|
+
if (!p) {
|
|
3084
|
+
P.value = "缺少角色标识,无法打开授权页。";
|
|
2979
3085
|
return;
|
|
2980
3086
|
}
|
|
2981
|
-
|
|
3087
|
+
j.value = !0, P.value = void 0;
|
|
2982
3088
|
try {
|
|
2983
|
-
if (
|
|
2984
|
-
if (
|
|
2985
|
-
let [e, t] = await Promise.all([
|
|
2986
|
-
|
|
3089
|
+
if (y.value = await l.crud.view(p), y.value.roleKind === "group") return;
|
|
3090
|
+
if (y.value.roleKind === "dataGrant") {
|
|
3091
|
+
let [e, t] = await Promise.all([u.dataGrantActionMatrix(p), u.dataScopePolicyCatalog(p)]);
|
|
3092
|
+
k.value = v?.dataGrantMatrix ?? e, A.value = t, ne.value = JSON.stringify(e.actions);
|
|
2987
3093
|
return;
|
|
2988
3094
|
}
|
|
2989
|
-
|
|
3095
|
+
C.value = (await u.authorizationModules(p)).records, E.value = v?.selectedModuleAlias ?? C.value[0]?.moduleAlias;
|
|
2990
3096
|
} catch (e) {
|
|
2991
|
-
|
|
3097
|
+
P.value = "授权信息加载失败,请重试。", T(e, {
|
|
2992
3098
|
source: "role-authorization",
|
|
2993
3099
|
phase: "load"
|
|
2994
3100
|
});
|
|
2995
3101
|
} finally {
|
|
2996
|
-
|
|
3102
|
+
j.value = !1;
|
|
2997
3103
|
}
|
|
2998
3104
|
}
|
|
2999
|
-
async function
|
|
3000
|
-
let e =
|
|
3001
|
-
if (!(!e ||
|
|
3002
|
-
|
|
3105
|
+
async function We() {
|
|
3106
|
+
let e = E.value;
|
|
3107
|
+
if (!(!e || oe.value || L.value)) {
|
|
3108
|
+
ee.value = !0;
|
|
3003
3109
|
try {
|
|
3004
|
-
let [t, n] = await Promise.all([
|
|
3005
|
-
|
|
3110
|
+
let [t, n] = await Promise.all([u.permissionMatrix(p, [e]), u.dataScopePolicyCatalog(p, e)]), r = (t.modules[0]?.actions ?? []).map(et), i = v?.actionDrafts?.find((t) => t.moduleAlias === e)?.actions, a = ie.get(e) ?? i;
|
|
3111
|
+
O.value = a ?? r, ie.has(e) || (ie.set(e, O.value), F.set(e, v?.actionSnapshots?.find((t) => t.moduleAlias === e)?.snapshot ?? JSON.stringify(r))), I.value += 1, A.value = n;
|
|
3006
3112
|
} catch (e) {
|
|
3007
|
-
|
|
3113
|
+
T(e, {
|
|
3008
3114
|
source: "role-authorization",
|
|
3009
3115
|
phase: "load"
|
|
3010
3116
|
});
|
|
3011
3117
|
} finally {
|
|
3012
|
-
|
|
3118
|
+
ee.value = !1;
|
|
3013
3119
|
}
|
|
3014
3120
|
}
|
|
3015
3121
|
}
|
|
3016
|
-
function
|
|
3017
|
-
t && e.dataAuth &&
|
|
3122
|
+
function Ge(e, t) {
|
|
3123
|
+
t && e.dataAuth && le.value && !e.dataScopePolicy && (e.dataScopePolicy = "inheritDataGrant"), t && e.dataScopePolicy === "referenceDependency" && !e.referenceFieldId && (e.dataScopePolicy = "inheritDataGrant"), e.granted = t, I.value += 1;
|
|
3018
3124
|
}
|
|
3019
|
-
function
|
|
3020
|
-
|
|
3125
|
+
function Ke(e) {
|
|
3126
|
+
O.value.forEach((t) => Ge(t, e));
|
|
3021
3127
|
}
|
|
3022
|
-
function
|
|
3128
|
+
function qe(e, t) {
|
|
3023
3129
|
if (e.dataScopePolicy = String(t || "none"), e.dataScopePolicy === "referenceDependency") {
|
|
3024
|
-
e.referenceFieldId = void 0, e.referenceActionCode = void 0,
|
|
3130
|
+
e.referenceFieldId = void 0, e.referenceActionCode = void 0, I.value += 1;
|
|
3025
3131
|
return;
|
|
3026
3132
|
}
|
|
3027
|
-
e.referenceFieldId = void 0, e.referenceActionCode = void 0,
|
|
3028
|
-
}
|
|
3029
|
-
function qe(e, t) {
|
|
3030
|
-
let n = Se.value.get(String(t || ""));
|
|
3031
|
-
e.referenceFieldId = n?.referenceFieldId, e.referenceActionCode = n?.referenceActionCode, P.value += 1;
|
|
3133
|
+
e.referenceFieldId = void 0, e.referenceActionCode = void 0, I.value += 1;
|
|
3032
3134
|
}
|
|
3033
|
-
function Je(e) {
|
|
3034
|
-
|
|
3135
|
+
function Je(e, t) {
|
|
3136
|
+
let n = Ce.value.get(String(t || ""));
|
|
3137
|
+
e.referenceFieldId = n?.referenceFieldId, e.referenceActionCode = n?.referenceActionCode, I.value += 1;
|
|
3035
3138
|
}
|
|
3036
3139
|
function Ye(e) {
|
|
3037
|
-
return
|
|
3140
|
+
return Ce.value.get(String(e || ""));
|
|
3038
3141
|
}
|
|
3039
3142
|
function Xe(e) {
|
|
3040
|
-
return e
|
|
3143
|
+
return typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
3041
3144
|
}
|
|
3042
3145
|
function Ze(e) {
|
|
3043
|
-
return
|
|
3146
|
+
return e.dataScopePolicy ?? "inheritDataGrant";
|
|
3044
3147
|
}
|
|
3045
|
-
function Qe(e
|
|
3046
|
-
return e.
|
|
3148
|
+
function Qe(e) {
|
|
3149
|
+
return !!e.dataAuth && le.value;
|
|
3047
3150
|
}
|
|
3048
|
-
function $e(e) {
|
|
3049
|
-
return
|
|
3151
|
+
function $e(e, t) {
|
|
3152
|
+
return e.key === "dataScopePolicy" && Qe(t);
|
|
3153
|
+
}
|
|
3154
|
+
function et(e) {
|
|
3155
|
+
return le.value && e.dataAuth && e.dataScopePolicy === "none" ? {
|
|
3050
3156
|
...e,
|
|
3051
3157
|
dataScopePolicy: "inheritDataGrant"
|
|
3052
3158
|
} : e;
|
|
3053
3159
|
}
|
|
3054
|
-
async function
|
|
3055
|
-
if (
|
|
3056
|
-
|
|
3160
|
+
async function tt() {
|
|
3161
|
+
if (k.value) {
|
|
3162
|
+
M.value = !0;
|
|
3057
3163
|
try {
|
|
3058
|
-
let e = await
|
|
3164
|
+
let e = await u.replaceDataGrantActions(p, k.value.actions.map((e) => ({
|
|
3059
3165
|
actionCode: e.actionCode,
|
|
3060
3166
|
dataScopePolicy: e.dataScopePolicy,
|
|
3061
3167
|
enabled: e.configured
|
|
3062
3168
|
})));
|
|
3063
|
-
await
|
|
3169
|
+
await f(e, {
|
|
3064
3170
|
source: "role-authorization",
|
|
3065
3171
|
phase: "action",
|
|
3066
3172
|
fallbackMessage: "数据权限模板已保存"
|
|
3067
|
-
}),
|
|
3173
|
+
}), ne.value = JSON.stringify(k.value.actions);
|
|
3068
3174
|
} catch (e) {
|
|
3069
|
-
|
|
3175
|
+
T(e, {
|
|
3070
3176
|
source: "role-authorization",
|
|
3071
3177
|
phase: "action"
|
|
3072
3178
|
});
|
|
3073
3179
|
} finally {
|
|
3074
|
-
|
|
3180
|
+
M.value = !1;
|
|
3075
3181
|
}
|
|
3076
3182
|
}
|
|
3077
3183
|
}
|
|
3078
|
-
async function
|
|
3079
|
-
let e = [...
|
|
3184
|
+
async function nt() {
|
|
3185
|
+
let e = [...ie.entries()].filter(([e, t]) => F.get(e) !== JSON.stringify(t));
|
|
3080
3186
|
if (e.length) {
|
|
3081
|
-
|
|
3187
|
+
M.value = !0;
|
|
3082
3188
|
try {
|
|
3083
|
-
let t = await
|
|
3189
|
+
let t = await u.replacePermissionMatrix(p, e.flatMap(([e, t]) => t.map((t) => ({
|
|
3084
3190
|
moduleAlias: e,
|
|
3085
3191
|
actionCode: t.actionCode,
|
|
3086
3192
|
granted: !!t.granted,
|
|
3087
|
-
dataScopePolicy: t.granted && t.dataAuth &&
|
|
3193
|
+
dataScopePolicy: t.granted && t.dataAuth && le.value ? t.dataScopePolicy ?? "inheritDataGrant" : void 0,
|
|
3088
3194
|
referenceFieldId: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceFieldId : void 0,
|
|
3089
3195
|
referenceActionCode: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceActionCode : void 0
|
|
3090
3196
|
}))));
|
|
3091
|
-
await
|
|
3197
|
+
await f(t, {
|
|
3092
3198
|
source: "role-authorization",
|
|
3093
3199
|
phase: "action",
|
|
3094
3200
|
fallbackMessage: "角色授权已保存"
|
|
3095
|
-
}), e.forEach(([e, t]) =>
|
|
3201
|
+
}), e.forEach(([e, t]) => F.set(e, JSON.stringify(t))), I.value += 1;
|
|
3096
3202
|
} catch (e) {
|
|
3097
|
-
|
|
3203
|
+
T(e, {
|
|
3098
3204
|
source: "role-authorization",
|
|
3099
3205
|
phase: "action"
|
|
3100
3206
|
});
|
|
3101
3207
|
} finally {
|
|
3102
|
-
|
|
3208
|
+
M.value = !1;
|
|
3103
3209
|
}
|
|
3104
3210
|
}
|
|
3105
3211
|
}
|
|
3106
|
-
async function
|
|
3107
|
-
if (
|
|
3108
|
-
await
|
|
3212
|
+
async function rt() {
|
|
3213
|
+
if (oe.value) {
|
|
3214
|
+
await tt();
|
|
3109
3215
|
return;
|
|
3110
3216
|
}
|
|
3111
|
-
await
|
|
3217
|
+
await nt();
|
|
3112
3218
|
}
|
|
3113
|
-
async function
|
|
3114
|
-
|
|
3219
|
+
async function it() {
|
|
3220
|
+
return !$.value || s({
|
|
3115
3221
|
title: "放弃未确认的授权配置",
|
|
3116
3222
|
content: "当前修改尚未确认,关闭后将丢失这些修改。",
|
|
3117
3223
|
okText: "放弃修改",
|
|
3118
3224
|
danger: !0
|
|
3119
|
-
})
|
|
3120
|
-
}
|
|
3121
|
-
function it() {
|
|
3122
|
-
ot();
|
|
3225
|
+
});
|
|
3123
3226
|
}
|
|
3124
|
-
function at(
|
|
3125
|
-
|
|
3227
|
+
function at() {
|
|
3228
|
+
ct();
|
|
3126
3229
|
}
|
|
3127
3230
|
function ot() {
|
|
3128
|
-
|
|
3129
|
-
|
|
3231
|
+
ct();
|
|
3232
|
+
}
|
|
3233
|
+
function st(e) {
|
|
3234
|
+
return !$.value && (E.value = e.selectedModuleAlias, k.value = e.dataGrantMatrix, ie.clear(), F.clear(), e.actionDrafts?.forEach(({ moduleAlias: e, actions: t }) => ie.set(e, t)), e.actionSnapshots?.forEach(({ moduleAlias: e, snapshot: t }) => F.set(e, t)), I.value += 1, !0);
|
|
3235
|
+
}
|
|
3236
|
+
function ct() {
|
|
3237
|
+
if (n.drawer === !0) {
|
|
3238
|
+
r("close");
|
|
3130
3239
|
return;
|
|
3131
3240
|
}
|
|
3132
|
-
|
|
3241
|
+
h?.dismiss();
|
|
3133
3242
|
}
|
|
3134
|
-
function
|
|
3243
|
+
function lt(e) {
|
|
3135
3244
|
$.value && (e.preventDefault(), e.returnValue = "");
|
|
3136
3245
|
}
|
|
3137
|
-
function
|
|
3246
|
+
function ut(e) {
|
|
3138
3247
|
return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
|
|
3139
3248
|
}
|
|
3140
|
-
return (e,
|
|
3141
|
-
default: Q(() => [U("section", { class:
|
|
3249
|
+
return (e, t) => (q(), B(we(Ne.value), ve(me(Fe.value)), fe({
|
|
3250
|
+
default: Q(() => [U("section", { class: _e(["role-authorization-page", { "role-authorization-page--drawer": Ae.value || ue.value }]) }, [j.value ? (q(), B(X(re), {
|
|
3142
3251
|
key: 0,
|
|
3143
3252
|
tip: "加载授权信息"
|
|
3144
|
-
})) :
|
|
3253
|
+
})) : P.value ? (q(), B(X(m), {
|
|
3145
3254
|
key: 1,
|
|
3146
3255
|
title: "授权页加载失败",
|
|
3147
|
-
message:
|
|
3148
|
-
}, null, 8, ["message"])) :
|
|
3256
|
+
message: P.value
|
|
3257
|
+
}, null, 8, ["message"])) : L.value ? (q(), B(X(_), {
|
|
3149
3258
|
key: 2,
|
|
3150
3259
|
title: "角色组不独立授权",
|
|
3151
3260
|
description: "角色组只组合成员角色;请到成员角色分别配置动作和数据权限。"
|
|
3152
|
-
})) :
|
|
3261
|
+
})) : oe.value && k.value ? (q(), B(X(o), {
|
|
3153
3262
|
key: 3,
|
|
3154
3263
|
class: "data-grant-content",
|
|
3155
|
-
title:
|
|
3264
|
+
title: Me.value ? "数据权限模板" : `数据权限模板 - ${de.value}`,
|
|
3156
3265
|
searchable: !1,
|
|
3157
|
-
onRefresh:
|
|
3266
|
+
onRefresh: Ue
|
|
3158
3267
|
}, {
|
|
3159
|
-
default: Q(() => [U("header",
|
|
3268
|
+
default: Q(() => [U("header", _r, [t[4] ||= U("div", null, [U("h3", null, "标准动作的数据范围模板"), U("p", null, "模板只会在具体任职的普通角色动作选择“继承数据授权角色”时生效。")], -1), je.value ? V("v-if", !0) : (q(), B(X(S), {
|
|
3160
3269
|
key: 0,
|
|
3161
3270
|
type: "primary",
|
|
3162
3271
|
disabled: !$.value,
|
|
3163
|
-
loading:
|
|
3164
|
-
onClick:
|
|
3272
|
+
loading: M.value,
|
|
3273
|
+
onClick: rt
|
|
3165
3274
|
}, {
|
|
3166
|
-
default: Q(() => [...
|
|
3275
|
+
default: Q(() => [...t[3] ||= [W(" 确认 ", -1)]]),
|
|
3167
3276
|
_: 1
|
|
3168
|
-
}, 8, ["disabled", "loading"]))]), G(X(
|
|
3169
|
-
columns:
|
|
3170
|
-
rows:
|
|
3277
|
+
}, 8, ["disabled", "loading"]))]), G(X(a), {
|
|
3278
|
+
columns: De,
|
|
3279
|
+
rows: ke.value,
|
|
3171
3280
|
"row-key": "actionCode",
|
|
3172
3281
|
"horizontal-scroll": ""
|
|
3173
3282
|
}, {
|
|
3174
|
-
cell: Q(({ column: e, record: t }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(t.title || t.actionCode), 1), U("small", null, Y(t.actionCode), 1)], 64)) : e.key === "configured" ? (q(), B(X(
|
|
3283
|
+
cell: Q(({ column: e, record: t }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(t.title || t.actionCode), 1), U("small", null, Y(t.actionCode), 1)], 64)) : e.key === "configured" ? (q(), B(X(c), {
|
|
3175
3284
|
key: 1,
|
|
3176
3285
|
checked: !!t.configured,
|
|
3177
|
-
disabled:
|
|
3286
|
+
disabled: M.value,
|
|
3178
3287
|
onChange: (e) => t.configured = e
|
|
3179
3288
|
}, null, 8, [
|
|
3180
3289
|
"checked",
|
|
3181
3290
|
"disabled",
|
|
3182
3291
|
"onChange"
|
|
3183
|
-
])) : (q(), B(X(
|
|
3292
|
+
])) : (q(), B(X(N), {
|
|
3184
3293
|
key: 2,
|
|
3185
3294
|
value: t.dataScopePolicy,
|
|
3186
|
-
options:
|
|
3187
|
-
disabled: !t.configured ||
|
|
3295
|
+
options: xe.value,
|
|
3296
|
+
disabled: !t.configured || M.value,
|
|
3188
3297
|
placeholder: "请选择数据范围",
|
|
3189
3298
|
"allow-clear": !1,
|
|
3190
3299
|
"onUpdate:value": (e) => t.dataScopePolicy = String(e || "")
|
|
@@ -3199,123 +3308,123 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3199
3308
|
_: 1
|
|
3200
3309
|
}, 8, ["title"])) : (q(), H("section", {
|
|
3201
3310
|
key: 4,
|
|
3202
|
-
class:
|
|
3203
|
-
}, [G(X(
|
|
3204
|
-
"search-keyword":
|
|
3205
|
-
"onUpdate:searchKeyword":
|
|
3311
|
+
class: _e(["authorization-layout", { "authorization-layout--compact-actions": !Te.value }])
|
|
3312
|
+
}, [G(X(o), {
|
|
3313
|
+
"search-keyword": D.value,
|
|
3314
|
+
"onUpdate:searchKeyword": t[1] ||= (e) => D.value = e,
|
|
3206
3315
|
class: "module-panel",
|
|
3207
3316
|
title: "模块树",
|
|
3208
3317
|
"refresh-title": "刷新模块目录",
|
|
3209
3318
|
"search-placeholder": "搜索模块名称或别名",
|
|
3210
|
-
onRefresh:
|
|
3319
|
+
onRefresh: Ue
|
|
3211
3320
|
}, {
|
|
3212
|
-
default: Q(() => [G(X(
|
|
3213
|
-
records:
|
|
3214
|
-
"selected-id":
|
|
3215
|
-
onSelect:
|
|
3321
|
+
default: Q(() => [G(X(te), {
|
|
3322
|
+
records: ge.value,
|
|
3323
|
+
"selected-id": E.value,
|
|
3324
|
+
onSelect: t[0] ||= (e) => E.value = e.id
|
|
3216
3325
|
}, null, 8, ["records", "selected-id"])]),
|
|
3217
3326
|
_: 1
|
|
3218
|
-
}, 8, ["search-keyword"]), G(X(
|
|
3327
|
+
}, 8, ["search-keyword"]), G(X(o), {
|
|
3219
3328
|
class: "action-panel",
|
|
3220
|
-
title:
|
|
3329
|
+
title: K.value,
|
|
3221
3330
|
searchable: !1
|
|
3222
3331
|
}, fe({
|
|
3223
|
-
default: Q(() => [
|
|
3332
|
+
default: Q(() => [ee.value ? (q(), B(X(re), {
|
|
3224
3333
|
key: 0,
|
|
3225
3334
|
tip: "加载模块动作"
|
|
3226
|
-
})) :
|
|
3335
|
+
})) : E.value ? (q(), B(X(a), {
|
|
3227
3336
|
key: 2,
|
|
3228
|
-
columns:
|
|
3229
|
-
rows:
|
|
3337
|
+
columns: Ee.value,
|
|
3338
|
+
rows: Oe.value,
|
|
3230
3339
|
"row-key": "actionCode",
|
|
3231
3340
|
"fill-height": "",
|
|
3232
3341
|
"horizontal-scroll": ""
|
|
3233
3342
|
}, {
|
|
3234
|
-
header: Q(({ column: e }) => [e.key === "granted" ? (q(), H("span",
|
|
3235
|
-
checked:
|
|
3236
|
-
indeterminate:
|
|
3237
|
-
disabled:
|
|
3343
|
+
header: Q(({ column: e }) => [e.key === "granted" ? (q(), H("span", vr, [G(X(x), {
|
|
3344
|
+
checked: Re.value,
|
|
3345
|
+
indeterminate: ze.value,
|
|
3346
|
+
disabled: M.value || !O.value.length,
|
|
3238
3347
|
"aria-label": "全选当前模块动作授权",
|
|
3239
|
-
onChange:
|
|
3348
|
+
onChange: Ke
|
|
3240
3349
|
}, null, 8, [
|
|
3241
3350
|
"checked",
|
|
3242
3351
|
"indeterminate",
|
|
3243
3352
|
"disabled"
|
|
3244
|
-
]),
|
|
3245
|
-
cell: Q(({ column: e, record: t }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(t.title || t.actionCode), 1), U("small", null, Y(t.permissionActionCode || t.actionCode), 1)], 64)) : e.key === "granted" ? (q(), B(X(
|
|
3353
|
+
]), t[6] ||= W(" 授权 ", -1)])) : (q(), H(R, { key: 1 }, [W(Y(e.title), 1)], 64))]),
|
|
3354
|
+
cell: Q(({ column: e, record: t }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(t.title || t.actionCode), 1), U("small", null, Y(t.permissionActionCode || t.actionCode), 1)], 64)) : e.key === "granted" ? (q(), B(X(x), {
|
|
3246
3355
|
key: 1,
|
|
3247
3356
|
checked: !!t.granted,
|
|
3248
|
-
disabled:
|
|
3249
|
-
onChange: (e) =>
|
|
3357
|
+
disabled: M.value,
|
|
3358
|
+
onChange: (e) => Ge(t, e)
|
|
3250
3359
|
}, null, 8, [
|
|
3251
3360
|
"checked",
|
|
3252
3361
|
"disabled",
|
|
3253
3362
|
"onChange"
|
|
3254
|
-
])) : t.dataAuth &&
|
|
3255
|
-
value:
|
|
3256
|
-
options:
|
|
3257
|
-
disabled:
|
|
3363
|
+
])) : t.dataAuth && le.value && t.granted ? (q(), H("div", yr, [G(X(N), {
|
|
3364
|
+
value: Ze(t),
|
|
3365
|
+
options: xe.value,
|
|
3366
|
+
disabled: M.value,
|
|
3258
3367
|
"allow-clear": !1,
|
|
3259
|
-
"onUpdate:value": (e) =>
|
|
3368
|
+
"onUpdate:value": (e) => qe(t, e)
|
|
3260
3369
|
}, null, 8, [
|
|
3261
3370
|
"value",
|
|
3262
3371
|
"options",
|
|
3263
3372
|
"disabled",
|
|
3264
3373
|
"onUpdate:value"
|
|
3265
|
-
]), t.dataScopePolicy === "referenceDependency" ? (q(), H(R, { key: 0 }, [G(X(
|
|
3266
|
-
value:
|
|
3267
|
-
options:
|
|
3268
|
-
disabled:
|
|
3374
|
+
]), t.dataScopePolicy === "referenceDependency" ? (q(), H(R, { key: 0 }, [G(X(N), {
|
|
3375
|
+
value: Xe(t.referenceFieldId),
|
|
3376
|
+
options: Se.value,
|
|
3377
|
+
disabled: M.value,
|
|
3269
3378
|
placeholder: "请选择引用字段",
|
|
3270
3379
|
"allow-clear": !1,
|
|
3271
|
-
"onUpdate:value": (e) =>
|
|
3380
|
+
"onUpdate:value": (e) => Je(t, e)
|
|
3272
3381
|
}, null, 8, [
|
|
3273
3382
|
"value",
|
|
3274
3383
|
"options",
|
|
3275
3384
|
"disabled",
|
|
3276
3385
|
"onUpdate:value"
|
|
3277
|
-
]), t.referenceFieldId ? (q(), H("small",
|
|
3386
|
+
]), t.referenceFieldId ? (q(), H("small", br, " 依赖目标:" + Y(Ye(t.referenceFieldId)?.targetModuleTitle) + " · " + Y(Ye(t.referenceFieldId)?.referenceActionTitle), 1)) : (q(), H("small", xr, "请先选择引用字段,再开启该动作授权。"))], 64)) : V("v-if", !0)])) : $e(e, t) ? (q(), H("span", Sr, "—")) : (q(), H("span", Cr, "不适用"))]),
|
|
3278
3387
|
_: 1
|
|
3279
|
-
}, 8, ["columns", "rows"])) : (q(), B(X(
|
|
3388
|
+
}, 8, ["columns", "rows"])) : (q(), B(X(_), {
|
|
3280
3389
|
key: 1,
|
|
3281
3390
|
title: "请选择模块"
|
|
3282
3391
|
}))]),
|
|
3283
3392
|
_: 2
|
|
3284
|
-
}, [
|
|
3393
|
+
}, [je.value ? void 0 : {
|
|
3285
3394
|
name: "actions",
|
|
3286
|
-
fn: Q(() => [G(X(
|
|
3395
|
+
fn: Q(() => [G(X(S), {
|
|
3287
3396
|
type: "primary",
|
|
3288
3397
|
disabled: !$.value,
|
|
3289
|
-
loading:
|
|
3290
|
-
onClick:
|
|
3398
|
+
loading: M.value,
|
|
3399
|
+
onClick: rt
|
|
3291
3400
|
}, {
|
|
3292
|
-
default: Q(() => [...
|
|
3401
|
+
default: Q(() => [...t[5] ||= [W(" 确认 ", -1)]]),
|
|
3293
3402
|
_: 1
|
|
3294
3403
|
}, 8, ["disabled", "loading"])]),
|
|
3295
3404
|
key: "0"
|
|
3296
3405
|
}]), 1032, ["title"])], 2))], 2)]),
|
|
3297
3406
|
_: 2
|
|
3298
|
-
}, [
|
|
3407
|
+
}, [Me.value && !L.value ? {
|
|
3299
3408
|
name: "operation",
|
|
3300
|
-
fn: Q(() => [G(X(
|
|
3409
|
+
fn: Q(() => [G(X(S), {
|
|
3301
3410
|
type: "primary",
|
|
3302
3411
|
disabled: !$.value,
|
|
3303
|
-
loading:
|
|
3304
|
-
onClick:
|
|
3412
|
+
loading: M.value,
|
|
3413
|
+
onClick: rt
|
|
3305
3414
|
}, {
|
|
3306
|
-
default: Q(() => [...
|
|
3415
|
+
default: Q(() => [...t[2] ||= [W(" 确认 ", -1)]]),
|
|
3307
3416
|
_: 1
|
|
3308
3417
|
}, 8, ["disabled", "loading"])]),
|
|
3309
3418
|
key: "0"
|
|
3310
3419
|
} : void 0]), 1040));
|
|
3311
3420
|
}
|
|
3312
|
-
}),
|
|
3421
|
+
}), Tr = /* @__PURE__ */ e({ default: () => Er }), Er = /*#__PURE__*/ j(wr, [["__scopeId", "data-v-ee79d1ea"]]), Dr = { class: "role-authorization-drawer-surface" }, Or = /*#__PURE__*/ j(/* @__PURE__ */ K({
|
|
3313
3422
|
name: "RoleAuthorizationDrawerSurface",
|
|
3314
3423
|
__name: "RoleAuthorizationDrawerSurface",
|
|
3315
3424
|
props: { context: {} },
|
|
3316
3425
|
setup(e) {
|
|
3317
3426
|
let t = e, n = t.context.module;
|
|
3318
|
-
return (e, r) => (q(), H("section",
|
|
3427
|
+
return (e, r) => (q(), H("section", Dr, [t.context.record?.id == null ? V("v-if", !0) : (q(), B(Er, {
|
|
3319
3428
|
key: 0,
|
|
3320
3429
|
"role-id": String(t.context.record.id),
|
|
3321
3430
|
"module-context": X(n),
|
|
@@ -3326,42 +3435,38 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3326
3435
|
"drawer-context"
|
|
3327
3436
|
]))]));
|
|
3328
3437
|
}
|
|
3329
|
-
}), [["__scopeId", "data-v-04d29709"]]),
|
|
3438
|
+
}), [["__scopeId", "data-v-04d29709"]]), kr = {
|
|
3330
3439
|
key: 0,
|
|
3331
3440
|
class: "role-group-member-form-field"
|
|
3332
|
-
},
|
|
3441
|
+
}, Ar = {
|
|
3333
3442
|
id: "iam-role-scope-and-actions",
|
|
3334
3443
|
target: { moduleAlias: "iam.role" },
|
|
3335
3444
|
navigator: {
|
|
3336
3445
|
bypassListScope: !0,
|
|
3337
3446
|
extension: {
|
|
3338
3447
|
key: "iam-role-scope-tree",
|
|
3339
|
-
component:
|
|
3340
|
-
selection: {
|
|
3341
|
-
kind: "roleScope",
|
|
3342
|
-
initialKey: (e) => e?.system === !0 ? "platform" : e?.tenantId ? `tenant:${e.tenantId}` : void 0,
|
|
3343
|
-
initialPresentation: (e) => e?.system === !0 ? { label: "平台角色" } : e?.tenantId ? { label: e.tenantId } : void 0
|
|
3344
|
-
}
|
|
3448
|
+
component: Pn,
|
|
3449
|
+
selection: { kind: "roleScope" }
|
|
3345
3450
|
}
|
|
3346
3451
|
},
|
|
3347
3452
|
list: { cellComponents: [
|
|
3348
3453
|
{
|
|
3349
3454
|
key: "assignmentType",
|
|
3350
|
-
cell:
|
|
3455
|
+
cell: Fn
|
|
3351
3456
|
},
|
|
3352
3457
|
{
|
|
3353
3458
|
key: "roleKind",
|
|
3354
|
-
cell:
|
|
3459
|
+
cell: Fn
|
|
3355
3460
|
},
|
|
3356
3461
|
{
|
|
3357
3462
|
key: "sharePolicy",
|
|
3358
|
-
cell:
|
|
3463
|
+
cell: Fn
|
|
3359
3464
|
}
|
|
3360
3465
|
] },
|
|
3361
3466
|
form: {
|
|
3362
3467
|
contributions: [{
|
|
3363
3468
|
key: "role-group-members",
|
|
3364
|
-
component: /* @__PURE__ */
|
|
3469
|
+
component: /* @__PURE__ */ j(/* @__PURE__ */ K({
|
|
3365
3470
|
name: "RoleGroupMemberFormField",
|
|
3366
3471
|
__name: "RoleGroupMemberFormField",
|
|
3367
3472
|
props: { context: {} },
|
|
@@ -3425,7 +3530,7 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3425
3530
|
function d(e) {
|
|
3426
3531
|
return typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
3427
3532
|
}
|
|
3428
|
-
return (t, n) => i.value ? (q(), H("label",
|
|
3533
|
+
return (t, n) => i.value ? (q(), H("label", kr, [n[0] ||= U("span", null, "成员角色", -1), G(X(N), {
|
|
3429
3534
|
mode: "multiple",
|
|
3430
3535
|
value: a.value,
|
|
3431
3536
|
options: c.value,
|
|
@@ -3465,8 +3570,8 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3465
3570
|
run({ openDrawer: e }) {
|
|
3466
3571
|
e({
|
|
3467
3572
|
title: "绑定用户",
|
|
3468
|
-
width:
|
|
3469
|
-
component:
|
|
3573
|
+
width: "extraWide",
|
|
3574
|
+
component: qn
|
|
3470
3575
|
});
|
|
3471
3576
|
}
|
|
3472
3577
|
},
|
|
@@ -3481,8 +3586,8 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3481
3586
|
run({ openDrawer: e }) {
|
|
3482
3587
|
e({
|
|
3483
3588
|
title: "绑定任职",
|
|
3484
|
-
width:
|
|
3485
|
-
component:
|
|
3589
|
+
width: "extraWide",
|
|
3590
|
+
component: nr
|
|
3486
3591
|
});
|
|
3487
3592
|
}
|
|
3488
3593
|
},
|
|
@@ -3497,22 +3602,22 @@ var $n = { class: "panel-title" }, er = {
|
|
|
3497
3602
|
run({ openDrawer: e }) {
|
|
3498
3603
|
e({
|
|
3499
3604
|
title: "角色授权",
|
|
3500
|
-
width:
|
|
3501
|
-
component:
|
|
3605
|
+
width: "wide",
|
|
3606
|
+
component: Or
|
|
3502
3607
|
});
|
|
3503
3608
|
}
|
|
3504
3609
|
}
|
|
3505
3610
|
]
|
|
3506
3611
|
};
|
|
3507
|
-
|
|
3508
|
-
$e,
|
|
3612
|
+
I("platform-admin-runtime", Fe), ae("platform-admin-runtime", [
|
|
3509
3613
|
et,
|
|
3510
3614
|
tt,
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3615
|
+
nt,
|
|
3616
|
+
lt,
|
|
3617
|
+
gt,
|
|
3618
|
+
St,
|
|
3619
|
+
gn,
|
|
3620
|
+
Ar
|
|
3516
3621
|
]);
|
|
3517
3622
|
//#endregion
|
|
3518
|
-
export {
|
|
3623
|
+
export { ke as C, Oe as S, kt as _, dr as a, Et as b, Kn as c, qt as d, Kt as f, Tt as g, At as h, ur as i, Ht as l, Nt as m, Tr as n, ar as o, Gt as p, lr as r, tr as s, Er as t, Ut as u, Ot as v, Ne as x, Dt as y };
|