@ximatai/muyun-web-app 0.26.6 → 0.26.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EmployeeDetailWorkspaceView-DHZ4arBj.js → EmployeeDetailWorkspaceView-DYJLlkSz.js} +1 -1
- package/dist/EmployeeManagementView-taxWUa7g.js +1778 -0
- package/dist/{MetadataOrchestrationView-BLxigKBh.js → MetadataOrchestrationView-B-CPudJl.js} +195 -195
- package/dist/{ModuleActionManagementView-ByJzNkQs.js → ModuleActionManagementView-CmVj0e0C.js} +122 -122
- package/dist/RoleAuthorizationView-q_6CsBYq.js +592 -0
- package/dist/{RoleDetailWorkspaceView-Dfdigf04.js → RoleDetailWorkspaceView-DmJlJgAj.js} +1 -1
- package/dist/{RoleManagementView-D0e9nLwW.js → RoleManagementView-HCa9rH0f.js} +283 -283
- package/dist/{SystemUserDetailWorkspaceView-D-UPhCmD.js → SystemUserDetailWorkspaceView-U6Ij0US1.js} +1 -1
- package/dist/SystemUserManagementView-C1CkKivH.js +758 -0
- package/dist/{UserDetailWorkspaceView-BCSCLNSz.js → UserDetailWorkspaceView-OPYvD6mH.js} +1 -1
- package/dist/UserManagementView-gbCL9SnC.js +965 -0
- package/dist/index.css +1 -1
- package/dist/index.js +3257 -2210
- package/dist/{pageRealtime-Be2xkeKK.js → pageRealtime-CzJlr9hs.js} +17 -17
- package/dist/{platform-components-DuAohqJO.js → platform-components-DKKWbNrz.js} +3320 -2102
- package/dist/types/app/CurrentUserProfileDialog.vue.d.ts +33 -0
- package/dist/types/app/LoginView.vue.d.ts +4 -1
- package/dist/types/app/ThemeSkinPreferencesDialog.vue.d.ts +20 -0
- package/dist/types/app/lockedTabPreference.d.ts +6 -0
- package/dist/types/app/themeSkinPreference.d.ts +11 -0
- package/dist/types/app/workbenchStartup.d.ts +14 -1
- package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +43 -0
- package/dist/types/consumer/index.d.ts +15 -1
- package/dist/types/consumer/userPreferencePersistence.d.ts +7 -0
- package/dist/types/consumer/workbenchNavigation.d.ts +8 -0
- package/dist/types/dynamic-page-runtime/index.d.ts +1 -1
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +19 -1
- package/dist/types/platform-components/FileTransferUploader.vue.d.ts +20 -1
- package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +30 -0
- package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +8 -6
- package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +5 -5
- package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +6 -6
- package/dist/types/platform-components/RecordFileReferenceTransfer.vue.d.ts +10 -0
- package/dist/types/platform-components/RecordFormFields.vue.d.ts +5 -1
- package/dist/types/platform-components/SingleImageFileReferenceField.vue.d.ts +23 -0
- package/dist/types/platform-components/fileReferenceTransfer.d.ts +8 -0
- package/dist/types/platform-components/index.d.ts +1 -0
- package/dist/types/platform-components/platformErrorFeedback.d.ts +2 -0
- package/dist/types/platform-components/recordActionBarModel.d.ts +6 -0
- package/dist/types/platform-components/recordFormFieldModel.d.ts +5 -2
- package/dist/types/platform-components/scopedTreeModuleContext.d.ts +1 -1
- package/dist/types/platform-components/staticCrudManagementState.d.ts +1 -1
- package/dist/types/platform-workbench/Workbench.vue.d.ts +12 -2
- package/dist/types/platform-workbench/WorkbenchBrandControl.vue.d.ts +22 -2
- package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +24 -0
- package/dist/types/platform-workbench/WorkbenchSidebarMenuEntry.vue.d.ts +19 -0
- package/dist/types/platform-workbench/menuHoverClickIntent.d.ts +10 -0
- package/dist/types/platform-workbench/menuPointerAim.d.ts +1 -1
- package/dist/types/platform-workbench/workbenchLayout.d.ts +3 -0
- package/dist/types/views/applicationManagementState.d.ts +1 -1
- package/dist/types/views/fieldSpecManagementState.d.ts +1 -1
- package/dist/types/views/fieldUiControlManagementState.d.ts +1 -1
- package/dist/types/views/tenantManagementState.d.ts +11 -1
- package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiTabs.vue.d.ts +6 -0
- package/dist/types/vue-ui-antdv/components/UiThemeProvider.vue.d.ts +21 -0
- package/dist/types/vue-ui-antdv/index.d.ts +3 -0
- package/dist/types/vue-ui-antdv/theme.d.ts +58 -0
- package/dist/types/vue-ui-antdv/themeGlobalScope.d.ts +2 -0
- package/dist/types/vue-ui-antdv/types.d.ts +1 -0
- package/dist/types/web-contracts/index.d.ts +58 -0
- package/dist/types/web-core/clients.d.ts +9 -1
- package/dist/types/web-core/index.d.ts +2 -0
- package/dist/types/web-core/mock.d.ts +3 -1
- package/dist/types/web-core/userPreferences.d.ts +24 -0
- package/dist/{useUserSessionRows-DX9qYU5r.js → useUserSessionRows-CBHEzRFQ.js} +2 -2
- package/dist/workspaceViewSessions-DkB9myrq.js +3252 -0
- package/package.json +1 -1
- package/dist/EmployeeManagementView-BfGb_ssB.js +0 -1706
- package/dist/RoleAuthorizationView-DJSWY3fu.js +0 -592
- package/dist/SystemUserManagementView-DNKRvmDk.js +0 -761
- package/dist/UserManagementView-aY2AeeWK.js +0 -965
- package/dist/workspaceViewSessions-C3GP1UGp.js +0 -2639
|
@@ -1,592 +0,0 @@
|
|
|
1
|
-
import { $ as e, C as t, Ct as n, Et as r, F as i, J as a, Nt as ee, O as te, St as o, Tt as s, at as ne, ct as re, f as ie, mt as ae, pt as oe, st as se, tt as ce, vt as le, zn as c } from "./platform-components-DuAohqJO.js";
|
|
2
|
-
import { i as ue, n as l, r as u, s as d, t as f, x as de } from "./workspaceViewSessions-C3GP1UGp.js";
|
|
3
|
-
import { Fragment as p, computed as m, createBlock as h, createCommentVNode as fe, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, defineComponent as x, guardReactiveProps as pe, normalizeClass as me, normalizeProps as he, onBeforeUnmount as ge, onMounted as _e, openBlock as S, ref as C, renderSlot as w, resolveDynamicComponent as ve, toDisplayString as T, unref as E, watch as ye, withCtx as D } from "vue";
|
|
4
|
-
//#region src/views/roleGrantClient.ts
|
|
5
|
-
function be(e) {
|
|
6
|
-
return {
|
|
7
|
-
accountRoleGrants(t) {
|
|
8
|
-
return e.request({ path: `/iam.role/${encodeURIComponent(t)}/account-grants` });
|
|
9
|
-
},
|
|
10
|
-
grantAccountRole(t, n) {
|
|
11
|
-
return e.request({
|
|
12
|
-
method: "POST",
|
|
13
|
-
path: `/iam.role/${encodeURIComponent(t)}/account-grants`,
|
|
14
|
-
body: n
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
deleteAccountRoleGrant(t, n) {
|
|
18
|
-
return e.request({
|
|
19
|
-
method: "POST",
|
|
20
|
-
path: `/iam.role/${encodeURIComponent(t)}/account-grants/${encodeURIComponent(n)}/delete`
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
userSelector(t) {
|
|
24
|
-
return e.request({
|
|
25
|
-
method: "POST",
|
|
26
|
-
path: "/iam.user/selector/query",
|
|
27
|
-
body: t
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
employmentRoleGrants(t) {
|
|
31
|
-
return e.request({ path: `/iam.role/${encodeURIComponent(t)}/employment-grants` });
|
|
32
|
-
},
|
|
33
|
-
grantEmploymentRole(t, n) {
|
|
34
|
-
return e.request({
|
|
35
|
-
method: "POST",
|
|
36
|
-
path: `/iam.role/${encodeURIComponent(t)}/employment-grants`,
|
|
37
|
-
body: { employeePositionId: n }
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
deleteEmploymentRoleGrant(t, n) {
|
|
41
|
-
return e.request({
|
|
42
|
-
method: "POST",
|
|
43
|
-
path: `/iam.role/${encodeURIComponent(t)}/employment-grants/${encodeURIComponent(n)}/delete`
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
employmentSelector(t, n) {
|
|
47
|
-
return e.request({
|
|
48
|
-
method: "POST",
|
|
49
|
-
path: `/iam.role/${encodeURIComponent(t)}/employment-selector/query`,
|
|
50
|
-
body: n
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
authorizationModules(t) {
|
|
54
|
-
return e.request({ path: `/iam.role/authorizationModules/${encodeURIComponent(t)}` });
|
|
55
|
-
},
|
|
56
|
-
permissionMatrix(t, n) {
|
|
57
|
-
return e.request({
|
|
58
|
-
method: "POST",
|
|
59
|
-
path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}`,
|
|
60
|
-
body: { moduleAliases: n }
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
grantAction(t, n) {
|
|
64
|
-
return e.request({
|
|
65
|
-
method: "POST",
|
|
66
|
-
path: `/iam.role/grant/${encodeURIComponent(t)}`,
|
|
67
|
-
body: n
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
revokeAction(t, n, r) {
|
|
71
|
-
return e.request({
|
|
72
|
-
method: "POST",
|
|
73
|
-
path: `/iam.role/revoke/${encodeURIComponent(t)}`,
|
|
74
|
-
body: {
|
|
75
|
-
moduleAlias: n,
|
|
76
|
-
actionCode: r
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
replacePermissionMatrix(t, n) {
|
|
81
|
-
return e.request({
|
|
82
|
-
method: "POST",
|
|
83
|
-
path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}/replace`,
|
|
84
|
-
body: { actions: n }
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
dataGrantActionMatrix(t) {
|
|
88
|
-
return e.request({ path: `/iam.role/dataGrantActionMatrix/${encodeURIComponent(t)}` });
|
|
89
|
-
},
|
|
90
|
-
dataScopePolicyCatalog(t, n) {
|
|
91
|
-
return e.request({
|
|
92
|
-
path: `/iam.role/dataScopePolicyCatalog/${encodeURIComponent(t)}`,
|
|
93
|
-
query: n ? { moduleAlias: n } : void 0
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
replaceDataGrantActions(t, n) {
|
|
97
|
-
return e.request({
|
|
98
|
-
method: "POST",
|
|
99
|
-
path: `/iam.role/dataGrantActions/${encodeURIComponent(t)}`,
|
|
100
|
-
body: { actions: n }
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/platform-admin-runtime/WorkspaceViewDrawer.vue
|
|
107
|
-
var xe = /* @__PURE__ */ x({
|
|
108
|
-
name: "WorkspaceViewDrawer",
|
|
109
|
-
__name: "WorkspaceViewDrawer",
|
|
110
|
-
props: {
|
|
111
|
-
open: { type: Boolean },
|
|
112
|
-
title: {},
|
|
113
|
-
subtitle: { default: void 0 },
|
|
114
|
-
profile: { default: "detail" },
|
|
115
|
-
promotion: { default: void 0 }
|
|
116
|
-
},
|
|
117
|
-
emits: ["close"],
|
|
118
|
-
setup(e, { emit: t }) {
|
|
119
|
-
let n = e, r = t, a = m(() => n.profile === "wide-work" ? "min(600px, 100vw)" : 520);
|
|
120
|
-
return (t, n) => (S(), h(E(i), {
|
|
121
|
-
open: e.open,
|
|
122
|
-
title: e.title,
|
|
123
|
-
subtitle: e.subtitle,
|
|
124
|
-
width: a.value,
|
|
125
|
-
promotion: e.promotion,
|
|
126
|
-
onClose: n[0] ||= (e) => r("close")
|
|
127
|
-
}, v({
|
|
128
|
-
default: D(() => [w(t.$slots, "default")]),
|
|
129
|
-
_: 2
|
|
130
|
-
}, [t.$slots.operation ? {
|
|
131
|
-
name: "operation",
|
|
132
|
-
fn: D(() => [w(t.$slots, "operation")]),
|
|
133
|
-
key: "0"
|
|
134
|
-
} : void 0]), 1032, [
|
|
135
|
-
"open",
|
|
136
|
-
"title",
|
|
137
|
-
"subtitle",
|
|
138
|
-
"width",
|
|
139
|
-
"promotion"
|
|
140
|
-
]));
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/views/roleAuthorizationWorkspaceSession.ts
|
|
145
|
-
function Se(e, t) {
|
|
146
|
-
return f(d, e, t);
|
|
147
|
-
}
|
|
148
|
-
function Ce(e, t) {
|
|
149
|
-
return l(d, e, t);
|
|
150
|
-
}
|
|
151
|
-
function we(e) {
|
|
152
|
-
return u(d, e);
|
|
153
|
-
}
|
|
154
|
-
//#endregion
|
|
155
|
-
//#region src/views/RoleAuthorizationView.vue?vue&type=script&setup=true&lang.ts
|
|
156
|
-
var Te = { class: "panel-title" }, Ee = {
|
|
157
|
-
key: 4,
|
|
158
|
-
class: "authorization-layout"
|
|
159
|
-
}, De = {
|
|
160
|
-
key: 0,
|
|
161
|
-
class: "authorization-column-header"
|
|
162
|
-
}, Oe = {
|
|
163
|
-
key: 2,
|
|
164
|
-
class: "data-scope-editor"
|
|
165
|
-
}, ke = { key: 0 }, Ae = { key: 1 }, je = { key: 3 }, Me = {
|
|
166
|
-
key: 4,
|
|
167
|
-
class: "not-applicable"
|
|
168
|
-
}, O = /*@__PURE__*/ x({
|
|
169
|
-
name: "RoleAuthorizationView",
|
|
170
|
-
__name: "RoleAuthorizationView",
|
|
171
|
-
props: {
|
|
172
|
-
roleId: {},
|
|
173
|
-
drawer: { type: Boolean }
|
|
174
|
-
},
|
|
175
|
-
emits: ["close"],
|
|
176
|
-
setup(r, { emit: i }) {
|
|
177
|
-
let c = r, l = i, u = ee({ moduleAlias: "iam.role" }), f = be(u.http), x = c.roleId ?? new URLSearchParams(window.location.search).get("roleId") ?? "", w = de(), O = c.roleId ? { roleId: c.roleId } : void 0, k = O ? we(O) : void 0, A = C(), j = C([]), M = C(), N = C([]), P = C(), F = C(), I = C(!1), L = C(!1), R = C(!1), z = C(), B = C(), V = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), U = C(0), Ne, W = m(() => A.value?.roleKind === "group"), G = m(() => A.value?.roleKind === "dataGrant"), K = m(() => A.value?.assignmentType === "employment"), q = m(() => A.value?.title ?? x ?? "角色"), J = m(() => `授权:${q.value}`), Pe = m(() => Fe.value ? `动作授权 - ${Fe.value.title}` : `动作授权 - ${q.value}`), Fe = m(() => j.value.find((e) => e.moduleAlias === M.value)), Ie = m(() => j.value.map((e) => ({
|
|
178
|
-
id: e.moduleAlias,
|
|
179
|
-
parentId: e.parentId,
|
|
180
|
-
title: e.title,
|
|
181
|
-
secondary: e.applicationAlias
|
|
182
|
-
}))), Le = m(() => (F.value?.options ?? []).map((e) => ({
|
|
183
|
-
value: e.code,
|
|
184
|
-
label: e.title
|
|
185
|
-
}))), Re = m(() => (F.value?.referenceDependencies ?? []).map((e) => ({
|
|
186
|
-
value: e.referenceFieldId,
|
|
187
|
-
label: `${e.title} → ${e.targetModuleTitle}`
|
|
188
|
-
}))), ze = m(() => new Map((F.value?.referenceDependencies ?? []).map((e) => [e.referenceFieldId, e]))), Be = [
|
|
189
|
-
{
|
|
190
|
-
key: "title",
|
|
191
|
-
title: "动作",
|
|
192
|
-
width: 130
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
key: "granted",
|
|
196
|
-
title: "授权",
|
|
197
|
-
width: 88,
|
|
198
|
-
align: "center"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
key: "dataScopePolicy",
|
|
202
|
-
title: "数据范围",
|
|
203
|
-
width: 160
|
|
204
|
-
}
|
|
205
|
-
], Ve = [
|
|
206
|
-
{
|
|
207
|
-
key: "title",
|
|
208
|
-
title: "标准动作",
|
|
209
|
-
width: 130
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
key: "configured",
|
|
213
|
-
title: "启用模板",
|
|
214
|
-
width: 104,
|
|
215
|
-
align: "center"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
key: "dataScopePolicy",
|
|
219
|
-
title: "数据范围",
|
|
220
|
-
width: 160
|
|
221
|
-
}
|
|
222
|
-
], He = m(() => N.value), Ue = m(() => P.value?.actions ?? []), Y = m(() => c.drawer === !0 || !!O && w?.presentation === "drawer"), X = m(() => !!O), We = m(() => Y.value ? xe : X.value ? te : "div"), Ge = m(() => Y.value ? {
|
|
223
|
-
open: !0,
|
|
224
|
-
title: J.value,
|
|
225
|
-
profile: d.drawerProfile,
|
|
226
|
-
promotion: Xe.value,
|
|
227
|
-
onClose: ut
|
|
228
|
-
} : X.value ? { title: J.value } : {}), Ke = m(() => {
|
|
229
|
-
let e = P.value;
|
|
230
|
-
return !e || B.value === void 0 ? !1 : JSON.stringify(e.actions) !== B.value;
|
|
231
|
-
}), qe = m(() => U.value >= 0 && [...V.entries()].some(([e, t]) => H.get(e) !== JSON.stringify(t))), Z = m(() => Ke.value || qe.value), Je = m(() => N.value.length > 0 && N.value.every((e) => e.granted)), Ye = m(() => N.value.some((e) => e.granted) && !Je.value), Xe = ue({
|
|
232
|
-
view: d,
|
|
233
|
-
input: () => O,
|
|
234
|
-
title: J,
|
|
235
|
-
eligibility: () => ({
|
|
236
|
-
hasStableIdentity: !!(x && A.value),
|
|
237
|
-
busy: R.value
|
|
238
|
-
}),
|
|
239
|
-
beforePromote: (e) => Se(e, {
|
|
240
|
-
selectedModuleAlias: M.value,
|
|
241
|
-
dataGrantMatrix: P.value,
|
|
242
|
-
actionDrafts: [...V.entries()].map(([e, t]) => ({
|
|
243
|
-
moduleAlias: e,
|
|
244
|
-
actions: t
|
|
245
|
-
})),
|
|
246
|
-
actionSnapshots: [...H.entries()].map(([e, t]) => ({
|
|
247
|
-
moduleAlias: e,
|
|
248
|
-
snapshot: t
|
|
249
|
-
}))
|
|
250
|
-
}).then((e) => e === "accepted"),
|
|
251
|
-
onPromoted: dt,
|
|
252
|
-
onPromotionRejected: () => ce("目标页签存在未确认的授权配置;请先确认或关闭该页签后再固定当前抽屉。", {
|
|
253
|
-
source: "role-authorization",
|
|
254
|
-
phase: "validation"
|
|
255
|
-
})
|
|
256
|
-
});
|
|
257
|
-
_e(() => {
|
|
258
|
-
O && !Y.value && (Ne = Ce(O, ft)), Q();
|
|
259
|
-
}), ye(J, (e) => {
|
|
260
|
-
X.value && w?.setTitle(e);
|
|
261
|
-
}, { immediate: !0 }), ye(M, () => void Ze()), _e(() => window.addEventListener("beforeunload", mt)), ge(() => {
|
|
262
|
-
Ne?.(), window.removeEventListener("beforeunload", mt);
|
|
263
|
-
});
|
|
264
|
-
async function Q() {
|
|
265
|
-
if (!x) {
|
|
266
|
-
z.value = "缺少角色标识,无法打开授权页。";
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
I.value = !0, z.value = void 0;
|
|
270
|
-
try {
|
|
271
|
-
if (A.value = await u.crud.view(x), A.value.roleKind === "group") return;
|
|
272
|
-
if (A.value.roleKind === "dataGrant") {
|
|
273
|
-
let [e, t] = await Promise.all([f.dataGrantActionMatrix(x), f.dataScopePolicyCatalog(x)]);
|
|
274
|
-
P.value = k?.dataGrantMatrix ?? e, F.value = t, B.value = JSON.stringify(e.actions);
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
j.value = (await f.authorizationModules(x)).records, M.value = k?.selectedModuleAlias ?? j.value[0]?.moduleAlias;
|
|
278
|
-
} catch (t) {
|
|
279
|
-
z.value = "授权信息加载失败,请重试。", e(t, {
|
|
280
|
-
source: "role-authorization",
|
|
281
|
-
phase: "load"
|
|
282
|
-
});
|
|
283
|
-
} finally {
|
|
284
|
-
I.value = !1;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
async function Ze() {
|
|
288
|
-
let t = M.value;
|
|
289
|
-
if (!(!t || G.value || W.value)) {
|
|
290
|
-
L.value = !0;
|
|
291
|
-
try {
|
|
292
|
-
let [e, n] = await Promise.all([f.permissionMatrix(x, [t]), f.dataScopePolicyCatalog(x, t)]), r = (e.modules[0]?.actions ?? []).map(st), i = k?.actionDrafts?.find((e) => e.moduleAlias === t)?.actions;
|
|
293
|
-
N.value = V.get(t) ?? i ?? r, V.has(t) || (V.set(t, N.value), H.set(t, k?.actionSnapshots?.find((e) => e.moduleAlias === t)?.snapshot ?? JSON.stringify(r))), U.value += 1, F.value = n;
|
|
294
|
-
} catch (t) {
|
|
295
|
-
e(t, {
|
|
296
|
-
source: "role-authorization",
|
|
297
|
-
phase: "load"
|
|
298
|
-
});
|
|
299
|
-
} finally {
|
|
300
|
-
L.value = !1;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
function Qe(e, t) {
|
|
305
|
-
t && e.dataAuth && K.value && !e.dataScopePolicy && (e.dataScopePolicy = "inheritDataGrant"), t && e.dataScopePolicy === "referenceDependency" && !e.referenceFieldId && (e.dataScopePolicy = "inheritDataGrant"), e.granted = t, U.value += 1;
|
|
306
|
-
}
|
|
307
|
-
function $e(e) {
|
|
308
|
-
N.value.forEach((t) => Qe(t, e));
|
|
309
|
-
}
|
|
310
|
-
function et(e, t) {
|
|
311
|
-
if (e.dataScopePolicy = String(t || "none"), e.dataScopePolicy === "referenceDependency") {
|
|
312
|
-
e.referenceFieldId = void 0, e.referenceActionCode = void 0, U.value += 1;
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
e.referenceFieldId = void 0, e.referenceActionCode = void 0, U.value += 1;
|
|
316
|
-
}
|
|
317
|
-
function tt(e, t) {
|
|
318
|
-
let n = ze.value.get(String(t || ""));
|
|
319
|
-
e.referenceFieldId = n?.referenceFieldId, e.referenceActionCode = n?.referenceActionCode, U.value += 1;
|
|
320
|
-
}
|
|
321
|
-
function nt(e) {
|
|
322
|
-
return ze.value.get(String(e || ""));
|
|
323
|
-
}
|
|
324
|
-
function rt(e) {
|
|
325
|
-
return typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
326
|
-
}
|
|
327
|
-
function it(e) {
|
|
328
|
-
return e.dataScopePolicy ?? "inheritDataGrant";
|
|
329
|
-
}
|
|
330
|
-
function at(e) {
|
|
331
|
-
return !!e.dataAuth && K.value;
|
|
332
|
-
}
|
|
333
|
-
function ot(e, t) {
|
|
334
|
-
return e.key === "dataScopePolicy" && at(t);
|
|
335
|
-
}
|
|
336
|
-
function st(e) {
|
|
337
|
-
return K.value && e.dataAuth && e.dataScopePolicy === "none" ? {
|
|
338
|
-
...e,
|
|
339
|
-
dataScopePolicy: "inheritDataGrant"
|
|
340
|
-
} : e;
|
|
341
|
-
}
|
|
342
|
-
async function ct() {
|
|
343
|
-
if (P.value) {
|
|
344
|
-
R.value = !0;
|
|
345
|
-
try {
|
|
346
|
-
await a(await f.replaceDataGrantActions(x, P.value.actions.map((e) => ({
|
|
347
|
-
actionCode: e.actionCode,
|
|
348
|
-
dataScopePolicy: e.dataScopePolicy,
|
|
349
|
-
enabled: e.configured
|
|
350
|
-
}))), {
|
|
351
|
-
source: "role-authorization",
|
|
352
|
-
phase: "action",
|
|
353
|
-
fallbackMessage: "数据权限模板已保存"
|
|
354
|
-
}), B.value = JSON.stringify(P.value.actions);
|
|
355
|
-
} catch (t) {
|
|
356
|
-
e(t, {
|
|
357
|
-
source: "role-authorization",
|
|
358
|
-
phase: "action"
|
|
359
|
-
});
|
|
360
|
-
} finally {
|
|
361
|
-
R.value = !1;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
async function lt() {
|
|
366
|
-
let t = [...V.entries()].filter(([e, t]) => H.get(e) !== JSON.stringify(t));
|
|
367
|
-
if (t.length) {
|
|
368
|
-
R.value = !0;
|
|
369
|
-
try {
|
|
370
|
-
await a(await f.replacePermissionMatrix(x, t.flatMap(([e, t]) => t.map((t) => ({
|
|
371
|
-
moduleAlias: e,
|
|
372
|
-
actionCode: t.actionCode,
|
|
373
|
-
granted: !!t.granted,
|
|
374
|
-
dataScopePolicy: t.granted && t.dataAuth && K.value ? t.dataScopePolicy ?? "inheritDataGrant" : void 0,
|
|
375
|
-
referenceFieldId: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceFieldId : void 0,
|
|
376
|
-
referenceActionCode: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceActionCode : void 0
|
|
377
|
-
})))), {
|
|
378
|
-
source: "role-authorization",
|
|
379
|
-
phase: "action",
|
|
380
|
-
fallbackMessage: "角色授权已保存"
|
|
381
|
-
}), t.forEach(([e, t]) => H.set(e, JSON.stringify(t))), U.value += 1;
|
|
382
|
-
} catch (t) {
|
|
383
|
-
e(t, {
|
|
384
|
-
source: "role-authorization",
|
|
385
|
-
phase: "action"
|
|
386
|
-
});
|
|
387
|
-
} finally {
|
|
388
|
-
R.value = !1;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
async function $() {
|
|
393
|
-
if (G.value) {
|
|
394
|
-
await ct();
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
await lt();
|
|
398
|
-
}
|
|
399
|
-
async function ut() {
|
|
400
|
-
Z.value && !await ne({
|
|
401
|
-
title: "放弃未确认的授权配置",
|
|
402
|
-
content: "当前修改尚未确认,关闭后将丢失这些修改。",
|
|
403
|
-
okText: "放弃修改",
|
|
404
|
-
danger: !0
|
|
405
|
-
}) || pt();
|
|
406
|
-
}
|
|
407
|
-
function dt() {
|
|
408
|
-
pt();
|
|
409
|
-
}
|
|
410
|
-
function ft(e) {
|
|
411
|
-
return Z.value ? !1 : (M.value = e.selectedModuleAlias, P.value = e.dataGrantMatrix, V.clear(), H.clear(), e.actionDrafts?.forEach(({ moduleAlias: e, actions: t }) => V.set(e, t)), e.actionSnapshots?.forEach(({ moduleAlias: e, snapshot: t }) => H.set(e, t)), U.value += 1, !0);
|
|
412
|
-
}
|
|
413
|
-
function pt() {
|
|
414
|
-
if (c.drawer === !0) {
|
|
415
|
-
l("close");
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
w?.dismiss();
|
|
419
|
-
}
|
|
420
|
-
function mt(e) {
|
|
421
|
-
Z.value && (e.preventDefault(), e.returnValue = "");
|
|
422
|
-
}
|
|
423
|
-
return (e, r) => (S(), h(ve(We.value), he(pe(Ge.value)), v({
|
|
424
|
-
default: D(() => [_("section", { class: me(["role-authorization-page", { "role-authorization-page--drawer": Y.value }]) }, [I.value ? (S(), h(E(re), {
|
|
425
|
-
key: 0,
|
|
426
|
-
tip: "加载授权信息"
|
|
427
|
-
})) : z.value ? (S(), h(E(se), {
|
|
428
|
-
key: 1,
|
|
429
|
-
title: "授权页加载失败",
|
|
430
|
-
message: z.value
|
|
431
|
-
}, null, 8, ["message"])) : W.value ? (S(), h(E(ae), {
|
|
432
|
-
key: 2,
|
|
433
|
-
title: "角色组不独立授权",
|
|
434
|
-
description: "角色组只组合成员角色;请到成员角色分别配置动作和数据权限。"
|
|
435
|
-
})) : G.value && P.value ? (S(), h(E(t), {
|
|
436
|
-
key: 3,
|
|
437
|
-
class: "data-grant-content",
|
|
438
|
-
title: X.value ? "数据权限模板" : `数据权限模板 - ${q.value}`,
|
|
439
|
-
searchable: !1,
|
|
440
|
-
onRefresh: Q
|
|
441
|
-
}, {
|
|
442
|
-
default: D(() => [_("header", Te, [r[3] ||= _("div", null, [_("h3", null, "标准动作的数据范围模板"), _("p", null, "模板只会在具体任职的普通角色动作选择“继承数据授权角色”时生效。")], -1), X.value ? fe("v-if", !0) : (S(), h(E(s), {
|
|
443
|
-
key: 0,
|
|
444
|
-
type: "primary",
|
|
445
|
-
disabled: !Z.value,
|
|
446
|
-
loading: R.value,
|
|
447
|
-
onClick: $
|
|
448
|
-
}, {
|
|
449
|
-
default: D(() => [...r[2] ||= [y(" 确认 ", -1)]]),
|
|
450
|
-
_: 1
|
|
451
|
-
}, 8, ["disabled", "loading"]))]), b(E(oe), {
|
|
452
|
-
columns: Ve,
|
|
453
|
-
rows: Ue.value,
|
|
454
|
-
"row-key": "actionCode",
|
|
455
|
-
"horizontal-scroll": ""
|
|
456
|
-
}, {
|
|
457
|
-
cell: D(({ column: e, record: t }) => [e.key === "title" ? (S(), g(p, { key: 0 }, [_("strong", null, T(t.title || t.actionCode), 1), _("small", null, T(t.actionCode), 1)], 64)) : e.key === "configured" ? (S(), h(E(le), {
|
|
458
|
-
key: 1,
|
|
459
|
-
checked: !!t.configured,
|
|
460
|
-
disabled: R.value,
|
|
461
|
-
onChange: (e) => t.configured = e
|
|
462
|
-
}, null, 8, [
|
|
463
|
-
"checked",
|
|
464
|
-
"disabled",
|
|
465
|
-
"onChange"
|
|
466
|
-
])) : (S(), h(E(o), {
|
|
467
|
-
key: 2,
|
|
468
|
-
value: t.dataScopePolicy,
|
|
469
|
-
options: Le.value,
|
|
470
|
-
disabled: !t.configured || R.value,
|
|
471
|
-
placeholder: "请选择数据范围",
|
|
472
|
-
"allow-clear": !1,
|
|
473
|
-
"onUpdate:value": (e) => t.dataScopePolicy = String(e || "")
|
|
474
|
-
}, null, 8, [
|
|
475
|
-
"value",
|
|
476
|
-
"options",
|
|
477
|
-
"disabled",
|
|
478
|
-
"onUpdate:value"
|
|
479
|
-
]))]),
|
|
480
|
-
_: 1
|
|
481
|
-
}, 8, ["rows"])]),
|
|
482
|
-
_: 1
|
|
483
|
-
}, 8, ["title"])) : (S(), g("section", Ee, [b(E(t), {
|
|
484
|
-
class: "module-panel",
|
|
485
|
-
title: "模块树",
|
|
486
|
-
"refresh-title": "刷新模块目录",
|
|
487
|
-
searchable: !1,
|
|
488
|
-
onRefresh: Q
|
|
489
|
-
}, {
|
|
490
|
-
default: D(() => [b(E(ie), {
|
|
491
|
-
records: Ie.value,
|
|
492
|
-
"selected-id": M.value,
|
|
493
|
-
onSelect: r[0] ||= (e) => M.value = e.id
|
|
494
|
-
}, null, 8, ["records", "selected-id"])]),
|
|
495
|
-
_: 1
|
|
496
|
-
}), b(E(t), {
|
|
497
|
-
class: "action-panel",
|
|
498
|
-
title: Pe.value,
|
|
499
|
-
searchable: !1
|
|
500
|
-
}, v({
|
|
501
|
-
default: D(() => [L.value ? (S(), h(E(re), {
|
|
502
|
-
key: 0,
|
|
503
|
-
tip: "加载模块动作"
|
|
504
|
-
})) : M.value ? (S(), h(E(oe), {
|
|
505
|
-
key: 2,
|
|
506
|
-
columns: Be,
|
|
507
|
-
rows: He.value,
|
|
508
|
-
"row-key": "actionCode",
|
|
509
|
-
"fill-height": "",
|
|
510
|
-
"horizontal-scroll": ""
|
|
511
|
-
}, {
|
|
512
|
-
header: D(({ column: e }) => [e.key === "granted" ? (S(), g("span", De, [b(E(n), {
|
|
513
|
-
checked: Je.value,
|
|
514
|
-
indeterminate: Ye.value,
|
|
515
|
-
disabled: R.value || !N.value.length,
|
|
516
|
-
"aria-label": "全选当前模块动作授权",
|
|
517
|
-
onChange: $e
|
|
518
|
-
}, null, 8, [
|
|
519
|
-
"checked",
|
|
520
|
-
"indeterminate",
|
|
521
|
-
"disabled"
|
|
522
|
-
]), r[5] ||= y(" 授权 ", -1)])) : (S(), g(p, { key: 1 }, [y(T(e.title), 1)], 64))]),
|
|
523
|
-
cell: D(({ column: e, record: t }) => [e.key === "title" ? (S(), g(p, { key: 0 }, [_("strong", null, T(t.title || t.actionCode), 1), _("small", null, T(t.permissionActionCode || t.actionCode), 1)], 64)) : e.key === "granted" ? (S(), h(E(n), {
|
|
524
|
-
key: 1,
|
|
525
|
-
checked: !!t.granted,
|
|
526
|
-
disabled: R.value,
|
|
527
|
-
onChange: (e) => Qe(t, e)
|
|
528
|
-
}, null, 8, [
|
|
529
|
-
"checked",
|
|
530
|
-
"disabled",
|
|
531
|
-
"onChange"
|
|
532
|
-
])) : t.dataAuth && K.value && t.granted ? (S(), g("div", Oe, [b(E(o), {
|
|
533
|
-
value: it(t),
|
|
534
|
-
options: Le.value,
|
|
535
|
-
disabled: R.value,
|
|
536
|
-
"allow-clear": !1,
|
|
537
|
-
"onUpdate:value": (e) => et(t, e)
|
|
538
|
-
}, null, 8, [
|
|
539
|
-
"value",
|
|
540
|
-
"options",
|
|
541
|
-
"disabled",
|
|
542
|
-
"onUpdate:value"
|
|
543
|
-
]), t.dataScopePolicy === "referenceDependency" ? (S(), g(p, { key: 0 }, [b(E(o), {
|
|
544
|
-
value: rt(t.referenceFieldId),
|
|
545
|
-
options: Re.value,
|
|
546
|
-
disabled: R.value,
|
|
547
|
-
placeholder: "请选择引用字段",
|
|
548
|
-
"allow-clear": !1,
|
|
549
|
-
"onUpdate:value": (e) => tt(t, e)
|
|
550
|
-
}, null, 8, [
|
|
551
|
-
"value",
|
|
552
|
-
"options",
|
|
553
|
-
"disabled",
|
|
554
|
-
"onUpdate:value"
|
|
555
|
-
]), t.referenceFieldId ? (S(), g("small", ke, " 依赖目标:" + T(nt(t.referenceFieldId)?.targetModuleTitle) + " · " + T(nt(t.referenceFieldId)?.referenceActionTitle), 1)) : (S(), g("small", Ae, "请先选择引用字段,再开启该动作授权。"))], 64)) : fe("v-if", !0)])) : ot(e, t) ? (S(), g("span", je, "—")) : (S(), g("span", Me, "不适用"))]),
|
|
556
|
-
_: 1
|
|
557
|
-
}, 8, ["rows"])) : (S(), h(E(ae), {
|
|
558
|
-
key: 1,
|
|
559
|
-
title: "请选择模块"
|
|
560
|
-
}))]),
|
|
561
|
-
_: 2
|
|
562
|
-
}, [X.value ? void 0 : {
|
|
563
|
-
name: "actions",
|
|
564
|
-
fn: D(() => [b(E(s), {
|
|
565
|
-
type: "primary",
|
|
566
|
-
disabled: !Z.value,
|
|
567
|
-
loading: R.value,
|
|
568
|
-
onClick: $
|
|
569
|
-
}, {
|
|
570
|
-
default: D(() => [...r[4] ||= [y(" 确认 ", -1)]]),
|
|
571
|
-
_: 1
|
|
572
|
-
}, 8, ["disabled", "loading"])]),
|
|
573
|
-
key: "0"
|
|
574
|
-
}]), 1032, ["title"])]))], 2)]),
|
|
575
|
-
_: 2
|
|
576
|
-
}, [X.value && !W.value ? {
|
|
577
|
-
name: "operation",
|
|
578
|
-
fn: D(() => [b(E(s), {
|
|
579
|
-
type: "primary",
|
|
580
|
-
disabled: !Z.value,
|
|
581
|
-
loading: R.value,
|
|
582
|
-
onClick: $
|
|
583
|
-
}, {
|
|
584
|
-
default: D(() => [...r[1] ||= [y(" 确认 ", -1)]]),
|
|
585
|
-
_: 1
|
|
586
|
-
}, 8, ["disabled", "loading"])]),
|
|
587
|
-
key: "0"
|
|
588
|
-
} : void 0]), 1040));
|
|
589
|
-
}
|
|
590
|
-
}), k = /* @__PURE__ */ c({ default: () => A }), A = /*#__PURE__*/ r(O, [["__scopeId", "data-v-3023b71d"]]);
|
|
591
|
-
//#endregion
|
|
592
|
-
export { k as n, be as r, A as t };
|