@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.
Files changed (74) hide show
  1. package/dist/{EmployeeDetailWorkspaceView-DHZ4arBj.js → EmployeeDetailWorkspaceView-DYJLlkSz.js} +1 -1
  2. package/dist/EmployeeManagementView-taxWUa7g.js +1778 -0
  3. package/dist/{MetadataOrchestrationView-BLxigKBh.js → MetadataOrchestrationView-B-CPudJl.js} +195 -195
  4. package/dist/{ModuleActionManagementView-ByJzNkQs.js → ModuleActionManagementView-CmVj0e0C.js} +122 -122
  5. package/dist/RoleAuthorizationView-q_6CsBYq.js +592 -0
  6. package/dist/{RoleDetailWorkspaceView-Dfdigf04.js → RoleDetailWorkspaceView-DmJlJgAj.js} +1 -1
  7. package/dist/{RoleManagementView-D0e9nLwW.js → RoleManagementView-HCa9rH0f.js} +283 -283
  8. package/dist/{SystemUserDetailWorkspaceView-D-UPhCmD.js → SystemUserDetailWorkspaceView-U6Ij0US1.js} +1 -1
  9. package/dist/SystemUserManagementView-C1CkKivH.js +758 -0
  10. package/dist/{UserDetailWorkspaceView-BCSCLNSz.js → UserDetailWorkspaceView-OPYvD6mH.js} +1 -1
  11. package/dist/UserManagementView-gbCL9SnC.js +965 -0
  12. package/dist/index.css +1 -1
  13. package/dist/index.js +3257 -2210
  14. package/dist/{pageRealtime-Be2xkeKK.js → pageRealtime-CzJlr9hs.js} +17 -17
  15. package/dist/{platform-components-DuAohqJO.js → platform-components-DKKWbNrz.js} +3320 -2102
  16. package/dist/types/app/CurrentUserProfileDialog.vue.d.ts +33 -0
  17. package/dist/types/app/LoginView.vue.d.ts +4 -1
  18. package/dist/types/app/ThemeSkinPreferencesDialog.vue.d.ts +20 -0
  19. package/dist/types/app/lockedTabPreference.d.ts +6 -0
  20. package/dist/types/app/themeSkinPreference.d.ts +11 -0
  21. package/dist/types/app/workbenchStartup.d.ts +14 -1
  22. package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +43 -0
  23. package/dist/types/consumer/index.d.ts +15 -1
  24. package/dist/types/consumer/userPreferencePersistence.d.ts +7 -0
  25. package/dist/types/consumer/workbenchNavigation.d.ts +8 -0
  26. package/dist/types/dynamic-page-runtime/index.d.ts +1 -1
  27. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +19 -1
  28. package/dist/types/platform-components/FileTransferUploader.vue.d.ts +20 -1
  29. package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +30 -0
  30. package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +8 -6
  31. package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +5 -5
  32. package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +6 -6
  33. package/dist/types/platform-components/RecordFileReferenceTransfer.vue.d.ts +10 -0
  34. package/dist/types/platform-components/RecordFormFields.vue.d.ts +5 -1
  35. package/dist/types/platform-components/SingleImageFileReferenceField.vue.d.ts +23 -0
  36. package/dist/types/platform-components/fileReferenceTransfer.d.ts +8 -0
  37. package/dist/types/platform-components/index.d.ts +1 -0
  38. package/dist/types/platform-components/platformErrorFeedback.d.ts +2 -0
  39. package/dist/types/platform-components/recordActionBarModel.d.ts +6 -0
  40. package/dist/types/platform-components/recordFormFieldModel.d.ts +5 -2
  41. package/dist/types/platform-components/scopedTreeModuleContext.d.ts +1 -1
  42. package/dist/types/platform-components/staticCrudManagementState.d.ts +1 -1
  43. package/dist/types/platform-workbench/Workbench.vue.d.ts +12 -2
  44. package/dist/types/platform-workbench/WorkbenchBrandControl.vue.d.ts +22 -2
  45. package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +24 -0
  46. package/dist/types/platform-workbench/WorkbenchSidebarMenuEntry.vue.d.ts +19 -0
  47. package/dist/types/platform-workbench/menuHoverClickIntent.d.ts +10 -0
  48. package/dist/types/platform-workbench/menuPointerAim.d.ts +1 -1
  49. package/dist/types/platform-workbench/workbenchLayout.d.ts +3 -0
  50. package/dist/types/views/applicationManagementState.d.ts +1 -1
  51. package/dist/types/views/fieldSpecManagementState.d.ts +1 -1
  52. package/dist/types/views/fieldUiControlManagementState.d.ts +1 -1
  53. package/dist/types/views/tenantManagementState.d.ts +11 -1
  54. package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +1 -1
  55. package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
  56. package/dist/types/vue-ui-antdv/components/UiTabs.vue.d.ts +6 -0
  57. package/dist/types/vue-ui-antdv/components/UiThemeProvider.vue.d.ts +21 -0
  58. package/dist/types/vue-ui-antdv/index.d.ts +3 -0
  59. package/dist/types/vue-ui-antdv/theme.d.ts +58 -0
  60. package/dist/types/vue-ui-antdv/themeGlobalScope.d.ts +2 -0
  61. package/dist/types/vue-ui-antdv/types.d.ts +1 -0
  62. package/dist/types/web-contracts/index.d.ts +58 -0
  63. package/dist/types/web-core/clients.d.ts +9 -1
  64. package/dist/types/web-core/index.d.ts +2 -0
  65. package/dist/types/web-core/mock.d.ts +3 -1
  66. package/dist/types/web-core/userPreferences.d.ts +24 -0
  67. package/dist/{useUserSessionRows-DX9qYU5r.js → useUserSessionRows-CBHEzRFQ.js} +2 -2
  68. package/dist/workspaceViewSessions-DkB9myrq.js +3252 -0
  69. package/package.json +1 -1
  70. package/dist/EmployeeManagementView-BfGb_ssB.js +0 -1706
  71. package/dist/RoleAuthorizationView-DJSWY3fu.js +0 -592
  72. package/dist/SystemUserManagementView-DNKRvmDk.js +0 -761
  73. package/dist/UserManagementView-aY2AeeWK.js +0 -965
  74. package/dist/workspaceViewSessions-C3GP1UGp.js +0 -2639
@@ -1,2639 +0,0 @@
1
- import { $ as e, A as t, At as n, B as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, I as u, L as ee, N as te, Nt as ne, O as re, Ot as d, R as ie, S as f, Wt as ae, _ as oe, _t as p, at as se, ct as ce, ft as m, g as h, k as g, l as le, lt as _, m as ue, mt as v, q as de, st as fe, v as y, x as pe, xt as b, z as me } from "./platform-components-DuAohqJO.js";
2
- import { Fragment as x, Transition as he, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createSlots as ge, createTextVNode as D, createVNode as O, defineAsyncComponent as k, defineComponent as A, inject as j, mergeProps as M, nextTick as _e, normalizeClass as N, normalizeStyle as P, onMounted as ve, onUnmounted as ye, openBlock as F, provide as I, ref as L, renderList as be, renderSlot as R, resolveComponent as xe, resolveDynamicComponent as Se, toDisplayString as z, toValue as Ce, unref as B, vShow as V, watch as we, withCtx as H, withDirectives as Te, withModifiers as Ee } from "vue";
3
- //#region src/platform-workbench/WorkbenchBrandControl.vue?vue&type=script&setup=true&lang.ts
4
- var U = { class: "workbench-brand-mark" }, W = { class: "workbench-brand-copy" }, G = ["aria-label", "title"], De = /*#__PURE__*/ c(/* @__PURE__ */ A({
5
- name: "WorkbenchBrandControl",
6
- __name: "WorkbenchBrandControl",
7
- props: {
8
- presentation: {},
9
- compactOpen: {
10
- type: Boolean,
11
- default: !1
12
- },
13
- tenantLabel: { default: "系统工作区" }
14
- },
15
- emits: [
16
- "openCompactMenu",
17
- "scheduleCompactMenuClose",
18
- "closeCompactMenu",
19
- "changePresentation"
20
- ],
21
- setup(e, { emit: t }) {
22
- let n = e, r = t;
23
- function i(e) {
24
- n.presentation === "compact" && r("openCompactMenu", e);
25
- }
26
- function a() {
27
- n.presentation === "compact" && r("scheduleCompactMenuClose");
28
- }
29
- function s(e) {
30
- n.presentation === "compact" && e.key === "Escape" && r("closeCompactMenu");
31
- }
32
- function c() {
33
- r("changePresentation", n.presentation === "compact" ? "expanded" : "compact");
34
- }
35
- return (t, n) => (F(), T("div", { class: N(["workbench-brand-control", `workbench-brand-control--${e.presentation}`]) }, [(F(), C(Se(e.presentation === "compact" ? "button" : "div"), {
36
- class: N(["workbench-brand-identity", { "workbench-brand-identity--open": e.compactOpen }]),
37
- type: e.presentation === "compact" ? "button" : void 0,
38
- "aria-label": e.presentation === "compact" ? "系统菜单" : void 0,
39
- "aria-expanded": e.presentation === "compact" ? e.compactOpen : void 0,
40
- "aria-controls": e.presentation === "compact" ? "workbench-compact-menu" : void 0,
41
- onMouseenter: n[0] ||= (e) => i("pointer"),
42
- onMouseleave: a,
43
- onFocus: n[1] ||= (e) => i("focus"),
44
- onFocusout: a,
45
- onClick: n[2] ||= (e) => i("click"),
46
- onKeydown: s
47
- }, {
48
- default: H(() => [E("span", U, [O(B(o), { name: "app" })]), E("span", W, [n[3] ||= E("strong", null, "MuYun", -1), E("small", null, z(e.tenantLabel), 1)])]),
49
- _: 1
50
- }, 40, [
51
- "class",
52
- "type",
53
- "aria-label",
54
- "aria-expanded",
55
- "aria-controls"
56
- ])), E("button", {
57
- class: "workbench-brand-presentation-toggle",
58
- type: "button",
59
- "aria-label": e.presentation === "compact" ? "展开侧栏菜单" : "收敛侧栏菜单",
60
- title: e.presentation === "compact" ? "展开侧栏菜单" : "收敛侧栏菜单",
61
- onClick: c
62
- }, [O(B(o), { name: e.presentation === "compact" ? "menu-expand" : "menu-collapse" }, null, 8, ["name"])], 8, G)], 2));
63
- }
64
- }), [["__scopeId", "data-v-bb887d44"]]), Oe = ["disabled", "aria-current"], ke = { key: 0 }, K = {
65
- key: 0,
66
- class: "deep-children"
67
- }, q = /*#__PURE__*/ c(/* @__PURE__ */ A({
68
- name: "WorkbenchMenuTree",
69
- __name: "WorkbenchMenuTree",
70
- props: {
71
- node: {},
72
- level: {},
73
- selectedMenuId: {},
74
- selectedPathIds: {}
75
- },
76
- emits: ["selectMenu"],
77
- setup(e, { emit: t }) {
78
- let n = e, r = t, i = S(() => n.level ?? 0), a = S(() => n.node.record.id === n.selectedMenuId), o = S(() => !a.value && n.selectedPathIds?.includes(n.node.record.id) === !0);
79
- function s() {
80
- n.node.target && r("selectMenu", n.node.record, n.node.target);
81
- }
82
- function c(e, t) {
83
- r("selectMenu", e, t);
84
- }
85
- return (t, n) => {
86
- let r = xe("WorkbenchMenuTree", !0);
87
- return F(), T("li", {
88
- class: "deep-node",
89
- style: P({ "--depth": i.value })
90
- }, [E("button", {
91
- class: N(["deep-node-button", {
92
- navigable: e.node.navigable,
93
- branch: e.node.hasChildren,
94
- selected: a.value,
95
- "selected-path": o.value
96
- }]),
97
- type: "button",
98
- disabled: !e.node.navigable && !e.node.hasChildren,
99
- "aria-current": a.value ? "page" : void 0,
100
- onClick: s
101
- }, [E("span", null, z(e.node.record.title), 1), e.node.navigable ? (F(), T("small", ke, "打开")) : w("v-if", !0)], 10, Oe), e.node.hasChildren ? (F(), T("ul", K, [(F(!0), T(x, null, be(e.node.children, (t) => (F(), C(r, {
102
- key: t.record.id,
103
- node: t,
104
- level: i.value + 1,
105
- "selected-menu-id": e.selectedMenuId,
106
- "selected-path-ids": e.selectedPathIds,
107
- onSelectMenu: c
108
- }, null, 8, [
109
- "node",
110
- "level",
111
- "selected-menu-id",
112
- "selected-path-ids"
113
- ]))), 128))])) : w("v-if", !0)], 4);
114
- };
115
- }
116
- }), [["__scopeId", "data-v-05878614"]]);
117
- //#endregion
118
- //#region src/platform-workbench/menuPointerAim.ts
119
- function Ae(e, t, n) {
120
- return e.x < t.x ? !1 : J(e, t, {
121
- x: n.left + 12,
122
- y: n.top - 8
123
- }, {
124
- x: n.left + 12,
125
- y: n.bottom + 8
126
- });
127
- }
128
- function J(e, t, n, r) {
129
- let i = je(e, t, n), a = je(e, n, r), o = je(e, r, t);
130
- return !((i < 0 || a < 0 || o < 0) && (i > 0 || a > 0 || o > 0));
131
- }
132
- function je(e, t, n) {
133
- return (e.y - t.y) * (n.x - t.x) - (e.x - t.x) * (n.y - t.y);
134
- }
135
- //#endregion
136
- //#region src/platform-workbench/menuNavigation.ts
137
- var Me = ["/_workspace"], Y = "_muyunMenuId", X = "_muyunTitle", Z = "_muyunEntryParams", Ne = [
138
- "entryParamsJson",
139
- "menuId",
140
- "title"
141
- ];
142
- function Pe(e) {
143
- if (e.enabled !== !1 && !(!e.openMode || !e.moduleAlias)) return e.externalUrl ? {
144
- menuId: e.id,
145
- menuType: "link",
146
- openMode: e.openMode,
147
- externalUrl: e.externalUrl,
148
- moduleAlias: e.moduleAlias,
149
- entryParamsJson: e.entryParamsJson
150
- } : e.route ? {
151
- menuId: e.id,
152
- menuType: "route",
153
- openMode: e.openMode,
154
- route: e.route,
155
- moduleAlias: e.moduleAlias,
156
- entryParamsJson: e.entryParamsJson
157
- } : {
158
- menuId: e.id,
159
- menuType: "module",
160
- openMode: e.openMode,
161
- moduleAlias: e.moduleAlias,
162
- pageMode: e.pageMode,
163
- defaultUiConfigId: e.defaultUiConfigId,
164
- defaultQueryTemplateId: e.defaultQueryTemplateId,
165
- entryParamsJson: e.entryParamsJson
166
- };
167
- }
168
- function Fe(e) {
169
- return e.openMode === "tab";
170
- }
171
- function Ie(e) {
172
- return e.openMode === "window";
173
- }
174
- function Le(e, t = {}) {
175
- if (e.menuType === "module") {
176
- let n = t.businessModuleRoutes?.[e.moduleAlias];
177
- return n ? {
178
- pageType: "business-route",
179
- openMode: "workbench-route",
180
- hostType: "business-route-host",
181
- title: t.title,
182
- layout: Ke({ route: n }, t),
183
- menuId: e.menuId,
184
- target: {
185
- route: n,
186
- moduleAlias: e.moduleAlias
187
- },
188
- entryParamsJson: e.entryParamsJson,
189
- tabPolicy: {
190
- identity: "by-menu",
191
- closable: !0,
192
- cacheable: !0
193
- }
194
- } : {
195
- pageType: "dynamic-module",
196
- openMode: "dynamic-runner",
197
- hostType: "dynamic-module-host",
198
- title: t.title,
199
- menuId: e.menuId,
200
- target: {
201
- moduleAlias: e.moduleAlias,
202
- pageMode: e.pageMode,
203
- defaultUiConfigId: e.defaultUiConfigId,
204
- defaultQueryTemplateId: e.defaultQueryTemplateId
205
- },
206
- params: e.query,
207
- entryParamsJson: e.entryParamsJson,
208
- tabPolicy: {
209
- identity: "by-menu",
210
- closable: !0,
211
- cacheable: !0
212
- }
213
- };
214
- }
215
- if (e.menuType === "route") {
216
- let n = We(e.route, e.query, e.moduleAlias), r = Ge(n, t) ? "business-route" : "platform-route", i = {
217
- openMode: "workbench-route",
218
- title: t.title,
219
- menuId: e.menuId,
220
- target: n,
221
- params: e.query,
222
- entryParamsJson: e.entryParamsJson,
223
- tabPolicy: {
224
- identity: e.menuId ? "by-menu" : "by-target",
225
- closable: !0,
226
- cacheable: !0
227
- }
228
- };
229
- return r === "business-route" ? {
230
- ...i,
231
- pageType: r,
232
- hostType: "business-route-host",
233
- layout: Ke(n, t)
234
- } : {
235
- ...i,
236
- pageType: r,
237
- hostType: "platform-route-host"
238
- };
239
- }
240
- return e.openMode === "tab" ? {
241
- pageType: "remote-url",
242
- openMode: "iframe",
243
- hostType: "external-page-host",
244
- title: t.title,
245
- menuId: e.menuId,
246
- target: {
247
- url: e.externalUrl,
248
- moduleAlias: e.moduleAlias
249
- },
250
- entryParamsJson: e.entryParamsJson,
251
- tabPolicy: {
252
- identity: e.menuId ? "by-menu" : "by-target",
253
- closable: !0
254
- }
255
- } : {
256
- pageType: "external-link",
257
- openMode: "new-window",
258
- hostType: "external-page-host",
259
- title: t.title,
260
- menuId: e.menuId,
261
- target: {
262
- url: e.externalUrl,
263
- moduleAlias: e.moduleAlias
264
- },
265
- entryParamsJson: e.entryParamsJson,
266
- tabPolicy: {
267
- identity: e.menuId ? "by-menu" : "by-target",
268
- closable: !0
269
- }
270
- };
271
- }
272
- function Re(e, t, n = {}) {
273
- if (!Fe(t)) throw Error(`WINDOW menu target cannot be opened as a workbench tab: ${t.menuId}`);
274
- let r = Le(t, {
275
- ...n,
276
- title: n.title ?? e.title
277
- });
278
- return {
279
- key: Be(r),
280
- title: e.title,
281
- target: t,
282
- pageDescriptor: r,
283
- restoreState: r.restoreState,
284
- closable: !0
285
- };
286
- }
287
- function ze(e) {
288
- for (let t of e) {
289
- let e = Pe(t.record);
290
- if (e && Fe(e)) return t.record;
291
- let n = ze(t.children);
292
- if (n) return n;
293
- }
294
- }
295
- function Be(e) {
296
- return e.tabPolicy.identity === "by-menu" && e.menuId ? `menu:${e.menuId}` : e.tabPolicy.identity === "by-params" && e.params ? `${e.menuId ? `menu:${e.menuId}` : `${e.pageType}:${Je(e)}`}:${Xe(e.params)}` : `${e.pageType}:${Je(e)}`;
297
- }
298
- function Ve(e) {
299
- if (e.pageType === "platform-route" || e.pageType === "business-route") return e.target.route ? Ye(e.target.route, {
300
- ...e.target.query ?? e.params,
301
- [Z]: e.entryParamsJson,
302
- [Y]: e.menuId,
303
- [X]: e.title
304
- }) : Ye("/platform/workspace", {
305
- ...e.target.query ?? e.params ?? {},
306
- pageType: e.pageType,
307
- routeName: e.target.routeName,
308
- pageKey: e.target.pageKey,
309
- [Y]: e.menuId,
310
- [X]: e.title
311
- });
312
- if (e.pageType === "dynamic-module") {
313
- let t = e.target.pageMode?.toLowerCase() ?? "list";
314
- return Ye(`/platform/dynamic/${e.target.moduleAlias}/${t}`, {
315
- ...e.params,
316
- [Z]: e.entryParamsJson,
317
- uiConfigId: e.target.defaultUiConfigId,
318
- queryTemplateId: e.target.defaultQueryTemplateId,
319
- [Y]: e.menuId,
320
- [X]: e.title
321
- });
322
- }
323
- return e.pageType === "remote-url" || e.pageType === "external-link" ? Ye("/platform/external", {
324
- url: e.target.url,
325
- mode: e.openMode,
326
- [Y]: e.menuId,
327
- [X]: e.title
328
- }) : at(e);
329
- }
330
- function He(e, t = {}) {
331
- let n = $e(e), r = n.pathname, i = tt(n.searchParams);
332
- if (r === "/platform/dynamic") throw Error(`Invalid dynamic module URL: ${e}`);
333
- if (r.startsWith("/platform/dynamic/")) {
334
- let [, , , n, a] = r.split("/");
335
- if (!n) throw Error(`Invalid dynamic module URL: ${e}`);
336
- let o = et(i, [
337
- ...Ne,
338
- Z,
339
- Y,
340
- X,
341
- "queryTemplateId",
342
- "uiConfigId"
343
- ]), s = $(i, Y, "menuId");
344
- return {
345
- pageType: "dynamic-module",
346
- openMode: "dynamic-runner",
347
- hostType: "dynamic-module-host",
348
- title: $(i, X, "title") ?? t.title,
349
- menuId: s,
350
- target: {
351
- moduleAlias: decodeURIComponent(n ?? ""),
352
- pageMode: it(a),
353
- defaultUiConfigId: nt(i.uiConfigId),
354
- defaultQueryTemplateId: nt(i.queryTemplateId)
355
- },
356
- params: o,
357
- entryParamsJson: $(i, Z, "entryParamsJson"),
358
- tabPolicy: s ? {
359
- identity: "by-menu",
360
- closable: !0,
361
- cacheable: !0
362
- } : {
363
- identity: "by-target",
364
- closable: !0,
365
- cacheable: !0
366
- }
367
- };
368
- }
369
- if (r === "/platform/external") {
370
- let n = nt(i.url) ?? "";
371
- if (!n) throw Error(`Invalid external page URL: ${e}`);
372
- let r = nt(i.mode) === "new-window" ? "new-window" : "iframe", a = $(i, Y, "menuId"), o = a ? {
373
- identity: "by-menu",
374
- closable: !0
375
- } : {
376
- identity: "by-target",
377
- closable: !0
378
- };
379
- return r === "iframe" ? {
380
- pageType: "remote-url",
381
- openMode: r,
382
- hostType: "external-page-host",
383
- title: $(i, X, "title") ?? t.title,
384
- menuId: a,
385
- target: { url: n },
386
- tabPolicy: o
387
- } : {
388
- pageType: "external-link",
389
- openMode: r,
390
- hostType: "external-page-host",
391
- title: $(i, X, "title") ?? t.title,
392
- menuId: a,
393
- target: { url: n },
394
- tabPolicy: o
395
- };
396
- }
397
- if (r === "/platform/workspace" && !i.routeName && !i.pageKey) throw Error(`Invalid workspace URL: ${e}`);
398
- if (r === "/platform/workspace" && (i.routeName || i.pageKey)) {
399
- let e = {
400
- routeName: nt(i.routeName),
401
- pageKey: nt(i.pageKey),
402
- query: et(i, [
403
- ...Ne,
404
- Y,
405
- X,
406
- "pageType",
407
- "routeName",
408
- "pageKey"
409
- ])
410
- }, n = nt(i.pageType) === "business-route" ? "business-route" : "platform-route", r = $(i, Y, "menuId"), a = {
411
- openMode: "workbench-route",
412
- title: $(i, X, "title") ?? t.title,
413
- menuId: r,
414
- target: e,
415
- params: e.query,
416
- tabPolicy: r ? {
417
- identity: "by-menu",
418
- closable: !0,
419
- cacheable: !0
420
- } : {
421
- identity: "by-target",
422
- closable: !0,
423
- cacheable: !0
424
- }
425
- };
426
- return n === "business-route" ? {
427
- ...a,
428
- pageType: "business-route",
429
- hostType: "business-route-host",
430
- layout: Ke(e, t)
431
- } : {
432
- ...a,
433
- pageType: "platform-route",
434
- hostType: "platform-route-host"
435
- };
436
- }
437
- let a = qe(r, t) ? "business-route" : "platform-route", o = $(i, Y), s = et(i, [
438
- Z,
439
- Y,
440
- X
441
- ]), c = {
442
- openMode: "workbench-route",
443
- title: $(i, X) ?? t.title,
444
- menuId: o,
445
- target: {
446
- route: r,
447
- query: s
448
- },
449
- params: s,
450
- entryParamsJson: $(i, Z),
451
- tabPolicy: o ? {
452
- identity: "by-menu",
453
- closable: !0,
454
- cacheable: !0
455
- } : {
456
- identity: "by-target",
457
- closable: !0,
458
- cacheable: !0
459
- }
460
- };
461
- return a === "business-route" ? {
462
- ...c,
463
- pageType: "business-route",
464
- hostType: "business-route-host",
465
- layout: Ke(c.target, t)
466
- } : {
467
- ...c,
468
- pageType: "platform-route",
469
- hostType: "platform-route-host"
470
- };
471
- }
472
- function Ue(e, t = {}) {
473
- try {
474
- return He(e, t);
475
- } catch {
476
- return;
477
- }
478
- }
479
- function We(e, t, n) {
480
- return e.startsWith("/") ? {
481
- route: e,
482
- moduleAlias: n,
483
- query: t
484
- } : e.includes(".") ? {
485
- routeName: e,
486
- moduleAlias: n,
487
- query: t
488
- } : {
489
- pageKey: e,
490
- moduleAlias: n,
491
- query: t
492
- };
493
- }
494
- function Ge(e, t) {
495
- return (e.route ? qe(e.route, t) : !1) || (e.routeName ? t.businessRouteNames?.includes(e.routeName) === !0 : !1) || (e.pageKey ? t.businessPageKeys?.includes(e.pageKey) === !0 : !1);
496
- }
497
- function Ke(e, t) {
498
- return e.route ? t.businessRouteLayouts?.[e.route] : void 0;
499
- }
500
- function qe(e, t) {
501
- let n = Q(e, t.businessRoutePrefixes ?? Me);
502
- if (n < 0) return !1;
503
- let r = Q(e, t.platformRoutePrefixes ?? rt);
504
- return r < 0 || n > r;
505
- }
506
- function Je(e) {
507
- return e.pageType === "platform-route" || e.pageType === "business-route" ? e.target.route ?? e.target.routeName ?? e.target.pageKey ?? "route" : e.pageType === "dynamic-module" ? [e.target.moduleAlias, e.target.pageMode ?? "LIST"].join(":") : e.target.url;
508
- }
509
- function Ye(e, t) {
510
- let n = t ? Xe(t) : "";
511
- return n ? `${e}${e.includes("?") ? "&" : "?"}${n}` : e;
512
- }
513
- function Xe(e) {
514
- let t = new URLSearchParams();
515
- for (let n of Object.keys(e).sort()) {
516
- let r = e[n];
517
- if (Array.isArray(r)) {
518
- for (let e of r) Ze(t, n, e);
519
- continue;
520
- }
521
- Ze(t, n, r);
522
- }
523
- return t.toString();
524
- }
525
- function Ze(e, t, n) {
526
- n != null && e.append(t, String(n));
527
- }
528
- function Qe(e, t) {
529
- let n = t.endsWith("/") ? t.slice(0, -1) : t;
530
- return e === n || e.startsWith(`${n}/`);
531
- }
532
- function Q(e, t) {
533
- let n = -1;
534
- for (let r of t) {
535
- let t = r.endsWith("/") ? r.slice(0, -1) : r;
536
- Qe(e, t) && (n = Math.max(n, t.length));
537
- }
538
- return n;
539
- }
540
- function $e(e) {
541
- return new URL(e, "http://muyun.local");
542
- }
543
- function et(e, t) {
544
- let n = {};
545
- for (let r of Object.keys(e)) t.includes(r) || (n[r] = e[r]);
546
- return Object.keys(n).length > 0 ? n : void 0;
547
- }
548
- function tt(e) {
549
- let t = {};
550
- for (let n of e.keys()) {
551
- let r = e.getAll(n);
552
- t[n] = r.length > 1 ? r : r[0];
553
- }
554
- return t;
555
- }
556
- function nt(e) {
557
- return Array.isArray(e) ? e[0] === null || e[0] === void 0 ? void 0 : String(e[0]) : e == null ? void 0 : String(e);
558
- }
559
- function $(e, t, n) {
560
- return nt(e[t]) ?? (n ? nt(e[n]) : void 0);
561
- }
562
- var rt = ["/platform"];
563
- function it(e) {
564
- let t = e?.toUpperCase();
565
- return t === "LIST" || t === "FORM" || t === "DETAIL" ? t : void 0;
566
- }
567
- function at(e) {
568
- throw Error(`Unsupported page descriptor: ${JSON.stringify(e)}`);
569
- }
570
- //#endregion
571
- //#region src/platform-workbench/menuTreeModel.ts
572
- function ot(e) {
573
- return e.map(gt);
574
- }
575
- function st(e, t) {
576
- let n = t.trim().toLowerCase();
577
- return n ? e.map((e) => {
578
- let t = st(e.children, n);
579
- if (!_t(e, n)) return t.length > 0 ? {
580
- ...e,
581
- children: t
582
- } : void 0;
583
- if (e.navigable) return {
584
- ...e,
585
- children: t
586
- };
587
- let r = ct(e.children);
588
- return r.length > 0 ? {
589
- ...e,
590
- children: r
591
- } : void 0;
592
- }).filter((e) => !!e) : e;
593
- }
594
- function ct(e) {
595
- return e.map((e) => {
596
- let t = ct(e.children);
597
- return e.navigable || t.length > 0 ? {
598
- ...e,
599
- children: t
600
- } : void 0;
601
- }).filter((e) => !!e);
602
- }
603
- function lt(e, t, n = []) {
604
- for (let r of e) {
605
- let e = [...n, r];
606
- if (r.record.id === t) return e;
607
- let i = lt(r.children, t, e);
608
- if (i.length > 0) return i;
609
- }
610
- return [];
611
- }
612
- function ut(e, t) {
613
- for (let n of e) {
614
- if (n.record.id === t) return n;
615
- let e = ut(n.children, t);
616
- if (e) return e;
617
- }
618
- }
619
- function dt(e) {
620
- for (let t of e.children) for (let e of t.children) if (e.hasChildren) return e.record.id;
621
- }
622
- function ft(e, t, n = 3) {
623
- let r = t ? ut(e.children, t) : void 0, i = e.children;
624
- return {
625
- root: e,
626
- groups: i,
627
- columns: pt(i, n),
628
- activeDeepRoot: r?.hasChildren ? r : void 0
629
- };
630
- }
631
- function pt(e, t) {
632
- if (e.length === 0) return [];
633
- let n = Math.max(1, Math.min(Math.floor(t), e.length)), r = Array.from({ length: n }, () => []), i = e.reduce((e, t) => e + mt(t), 0) / n, a = 0, o = 0;
634
- for (let t = 0; t < e.length; t += 1) {
635
- let s = e[t], c = mt(s), l = e.length - t, u = n - a;
636
- r[a].length > 0 && a < n - 1 && (l <= u || o + c > i) && (a += 1, o = 0), r[a].push(s), o += c;
637
- }
638
- return r;
639
- }
640
- function mt(e) {
641
- let t = ht(e.record.title), n = e.children.reduce((e, t) => {
642
- let n = t.hasChildren ? .7 + t.children.length * .25 : 0;
643
- return e + 1 + n + ht(t.record.title) * .4;
644
- }, 0);
645
- return 1.25 + t + n;
646
- }
647
- function ht(e) {
648
- return Math.max(0, Math.ceil(e.length / 10) - 1) * .35;
649
- }
650
- function gt(e) {
651
- let t = ot(e.children), n = Pe(e.record);
652
- return {
653
- record: e.record,
654
- children: t,
655
- target: n,
656
- navigable: !!n,
657
- hasChildren: t.length > 0
658
- };
659
- }
660
- function _t(e, t) {
661
- return e.record.title.toLowerCase().includes(t) || e.record.moduleAlias?.toLowerCase().includes(t) === !0 || e.record.route?.toLowerCase().includes(t) === !0;
662
- }
663
- //#endregion
664
- //#region src/platform-workbench/realtimeStatus.ts
665
- function vt(e) {
666
- if (e === "connected") return {
667
- label: "实时连接正常",
668
- title: "与平台实时服务连接正常",
669
- tone: e
670
- };
671
- if (e === "connecting") return {
672
- label: "实时连接中",
673
- title: "正在连接平台实时服务",
674
- tone: e
675
- };
676
- if (e === "disconnected") return {
677
- label: "实时连接已断开",
678
- title: "与平台实时服务的连接已断开,正在等待恢复",
679
- tone: e
680
- };
681
- }
682
- //#endregion
683
- //#region src/platform-workbench/WorkbenchMenu.vue?vue&type=script&setup=true&lang.ts
684
- var yt = ["id"], bt = {
685
- key: 0,
686
- class: "menu-search"
687
- }, xt = {
688
- class: "root-menu",
689
- "aria-label": "主导航"
690
- }, St = {
691
- key: 0,
692
- class: "root-menu-list"
693
- }, Ct = [
694
- "aria-expanded",
695
- "aria-controls",
696
- "onMouseenter",
697
- "onFocus",
698
- "onClick"
699
- ], wt = {
700
- key: 1,
701
- class: "compact-menu-tools"
702
- }, Tt = { class: "menu-search" }, Et = ["title"], Dt = {
703
- key: 0,
704
- class: "mega-outline",
705
- "aria-hidden": "true"
706
- }, Ot = ["d"], kt = { class: "mega-groups" }, At = [
707
- "disabled",
708
- "aria-current",
709
- "onClick"
710
- ], jt = { class: "mega-entry-list" }, Mt = [
711
- "disabled",
712
- "aria-current",
713
- "onMouseenter",
714
- "onFocus",
715
- "onClick"
716
- ], Nt = {
717
- key: 0,
718
- class: "mega-deep-panel"
719
- }, Pt = { class: "mega-deep-tree" }, Ft = 168, It = 18, Lt = 28, Rt = 280, zt = 1040, Bt = 24, Vt = 620, Ht = 360, Ut = /*#__PURE__*/ c(/* @__PURE__ */ A({
720
- name: "WorkbenchMenu",
721
- __name: "WorkbenchMenu",
722
- props: {
723
- menus: {},
724
- selectedMenuId: { default: void 0 },
725
- tenantLabel: { default: "系统工作区" },
726
- searchPlaceholder: { default: "搜索菜单、模块或路由" },
727
- realtimeStatus: { default: "unavailable" },
728
- presentation: { default: "expanded" },
729
- compactOpen: {
730
- type: Boolean,
731
- default: !1
732
- },
733
- compactTop: { default: 54 }
734
- },
735
- emits: [
736
- "selectMenu",
737
- "invalidMenu",
738
- "compactMenuEnter",
739
- "compactMenuLeave",
740
- "compactMenuClose",
741
- "changePresentation"
742
- ],
743
- setup(e, { emit: t }) {
744
- let n = e, r = t, i = L(), a = L(), s = L(""), c = L(), l = L(), u = L(8), ee = L(0), te = L(0), ne = L(0), re = L(34), d = L(0), ie = L(0), f = L(820), ae = L(3), oe = S(() => ot(n.menus)), p = S(() => st(oe.value, s.value)), se = S(() => n.selectedMenuId ? lt(oe.value, n.selectedMenuId) : []), ce = S(() => se.value[0]?.record.id), m = S(() => se.value.map((e) => e.record.id)), h = S(() => vt(n.realtimeStatus)), g = S(() => c.value ? ut(p.value, c.value) : void 0), le = S(() => g.value ? ft(g.value, l.value, ae.value) : void 0), _ = S(() => le.value?.activeDeepRoot), ue = S(() => le.value?.columns.length ?? 1), de = S(() => {
745
- let e = te.value, t = ne.value, n = t + re.value, r = ee.value, i = u.value, a = r + d.value, o = i + ie.value;
746
- return y.value ? [
747
- `M ${r} ${i}`,
748
- `H ${a - 8}`,
749
- `Q ${a} ${i} ${a} ${i + 8}`,
750
- `V ${o - 8}`,
751
- `Q ${a} ${o} ${a - 8} ${o}`,
752
- `H ${r}`
753
- ].join(" ") : [
754
- `M ${r} ${i}`,
755
- `H ${a - 8}`,
756
- `Q ${a} ${i} ${a} ${i + 8}`,
757
- `V ${o - 8}`,
758
- `Q ${a} ${o} ${a - 8} ${o}`,
759
- `H ${r}`,
760
- `V ${n}`,
761
- `H ${e + 6}`,
762
- `Q ${e} ${n} ${e} ${n - 6}`,
763
- `V ${t + 6}`,
764
- `Q ${e} ${t} ${e + 6} ${t}`,
765
- `H ${r}`,
766
- `V ${i}`
767
- ].join(" ");
768
- }), fe = S(() => n.presentation === "expanded" || n.compactOpen), y = S(() => n.presentation === "compact"), pe, me, ge;
769
- we(() => n.compactOpen, (e) => {
770
- if (!e) {
771
- j();
772
- return;
773
- }
774
- }), ye(() => {
775
- Se();
776
- });
777
- function D(e) {
778
- e.target ? r("selectMenu", e.record, e.target) : r("invalidMenu", e.record);
779
- }
780
- function k(e, t) {
781
- r("selectMenu", e, t);
782
- }
783
- function A(e, t) {
784
- Se(), c.value = e.record.id, l.value = dt(e), U(t?.currentTarget), _e(W);
785
- }
786
- function j() {
787
- Se(), c.value = void 0, l.value = void 0;
788
- }
789
- function M() {
790
- Se(), y.value && r("compactMenuEnter");
791
- }
792
- function ve(e) {
793
- R(e) || I();
794
- }
795
- function I() {
796
- j(), y.value && r("compactMenuLeave");
797
- }
798
- function R(e) {
799
- let t = a.value?.getBoundingClientRect();
800
- return !g.value || !t || e.clientX > t.left + 8 ? !1 : (me = {
801
- x: e.clientX,
802
- y: e.clientY
803
- }, ge = {
804
- left: t.left,
805
- top: t.top,
806
- bottom: t.bottom
807
- }, window.addEventListener("pointermove", xe), pe = window.setTimeout(I, Ht), !0);
808
- }
809
- function xe(e) {
810
- !me || !ge || Ae({
811
- x: e.clientX,
812
- y: e.clientY
813
- }, me, ge) || I();
814
- }
815
- function Se() {
816
- pe !== void 0 && (window.clearTimeout(pe), pe = void 0), window.removeEventListener("pointermove", xe), me = void 0, ge = void 0;
817
- }
818
- function Ce() {
819
- y.value && r("compactMenuEnter");
820
- }
821
- function V(e) {
822
- let t = e.currentTarget;
823
- t instanceof HTMLElement && t.contains(e.relatedTarget) || y.value && r("compactMenuLeave");
824
- }
825
- function Te(e) {
826
- r("changePresentation", e);
827
- }
828
- function Ee(e) {
829
- e.key === "Escape" && (j(), y.value && r("compactMenuClose"));
830
- }
831
- function U(e) {
832
- if (!(e instanceof HTMLElement)) return;
833
- let t = e.getBoundingClientRect(), n = i.value?.getBoundingClientRect(), r = n?.top ?? 0, a = Math.min(window.innerHeight - 16, Vt), o = t.top, s = Math.max(8, window.innerHeight - a - 8), c = Math.min(Math.max(o, 8), s), l = n?.left ?? 0;
834
- u.value = Math.round(c - r), ee.value = Math.round(t.right - l), te.value = Math.round(t.left - l), ne.value = Math.round(t.top - r), re.value = Math.round(t.height), ie.value = a, G();
835
- }
836
- function W() {
837
- let e = a.value?.getBoundingClientRect();
838
- e && (d.value = Math.round(e.width), ie.value = Math.round(e.height));
839
- }
840
- function G() {
841
- let e = Oe(), t = l.value ? Rt : 0, n = Math.max(0, Math.min(e, zt) - t), r = g.value?.children.length ?? 0, i = Math.max(1, Math.min(4, r || 1, Math.floor((n - Lt + It) / 186) || 1)), a = i * Ft + Math.max(0, i - 1) * It + Lt, o = Math.min(e, zt, a + t);
842
- ae.value = i, f.value = Math.max(280, o), d.value = f.value;
843
- }
844
- function Oe() {
845
- let e = (i.value?.getBoundingClientRect().left ?? 0) + ee.value;
846
- return Math.max(280, window.innerWidth - e - Bt);
847
- }
848
- function ke(e) {
849
- l.value = e.hasChildren ? e.record.id : void 0, _e(() => {
850
- G(), W();
851
- });
852
- }
853
- function K(e) {
854
- return ce.value === e.record.id;
855
- }
856
- function J(e) {
857
- return n.selectedMenuId === e.record.id;
858
- }
859
- function je(e) {
860
- return !J(e) && m.value.includes(e.record.id);
861
- }
862
- return (t, n) => (F(), T("div", {
863
- ref_key: "menuShell",
864
- ref: i,
865
- class: N(["workbench-menu", {
866
- "mega-open": g.value,
867
- "workbench-menu--compact": y.value,
868
- "workbench-menu--expanded": !y.value,
869
- "workbench-menu--compact-open": y.value && e.compactOpen
870
- }]),
871
- style: P(y.value ? { "--compact-menu-top": `${e.compactTop}px` } : void 0),
872
- onMouseenter: M,
873
- onMouseleave: ve,
874
- onFocusin: Ce,
875
- onFocusout: V,
876
- onKeydown: Ee
877
- }, [
878
- O(he, { name: "workbench-menu-panel" }, {
879
- default: H(() => [fe.value ? (F(), T("aside", {
880
- key: 0,
881
- id: y.value ? "workbench-compact-menu" : void 0,
882
- class: "menu-sidebar"
883
- }, [
884
- O(he, { name: "workbench-sidebar-brand" }, {
885
- default: H(() => [y.value ? w("v-if", !0) : (F(), C(De, {
886
- key: 0,
887
- presentation: "expanded",
888
- "tenant-label": e.tenantLabel,
889
- onChangePresentation: Te
890
- }, null, 8, ["tenant-label"]))]),
891
- _: 1
892
- }),
893
- y.value ? w("v-if", !0) : (F(), T("div", bt, [O(B(o), { name: "search" }), O(B(b), {
894
- value: s.value,
895
- "onUpdate:value": n[0] ||= (e) => s.value = e,
896
- type: "search",
897
- "allow-clear": "",
898
- placeholder: e.searchPlaceholder,
899
- "aria-label": "搜索菜单"
900
- }, null, 8, ["value", "placeholder"])])),
901
- E("nav", xt, [p.value.length > 0 ? (F(), T("div", St, [(F(!0), T(x, null, be(p.value, (e) => (F(), T("button", {
902
- key: e.record.id,
903
- class: N(["root-menu-item", {
904
- active: g.value?.record.id === e.record.id,
905
- selected: K(e),
906
- navigable: e.navigable
907
- }]),
908
- type: "button",
909
- "aria-expanded": g.value?.record.id === e.record.id,
910
- "aria-controls": g.value?.record.id === e.record.id ? "workbench-mega-panel" : void 0,
911
- onMouseenter: (t) => A(e, t),
912
- onFocus: (t) => A(e, t),
913
- onClick: (t) => e.navigable && D(e)
914
- }, [E("span", null, z(e.record.title), 1)], 42, Ct))), 128))])) : (F(), C(B(v), {
915
- key: 1,
916
- description: "暂无菜单"
917
- }))]),
918
- y.value ? (F(), T("div", wt, [E("div", Tt, [O(B(o), { name: "search" }), O(B(b), {
919
- value: s.value,
920
- "onUpdate:value": n[1] ||= (e) => s.value = e,
921
- type: "search",
922
- "allow-clear": "",
923
- placeholder: y.value ? "" : e.searchPlaceholder,
924
- "aria-label": "搜索菜单"
925
- }, null, 8, ["value", "placeholder"])])])) : w("v-if", !0),
926
- !y.value && h.value ? (F(), T("div", {
927
- key: 2,
928
- class: N(["sidebar-footer", `realtime-${h.value.tone}`]),
929
- title: h.value.title,
930
- role: "status"
931
- }, [n[2] ||= E("div", { class: "status-dot" }, null, -1), E("span", null, z(h.value.label), 1)], 10, Et)) : w("v-if", !0)
932
- ], 8, yt)) : w("v-if", !0)]),
933
- _: 1
934
- }),
935
- g.value ? (F(), T("svg", Dt, [E("path", { d: de.value }, null, 8, Ot)])) : w("v-if", !0),
936
- O(he, { name: "workbench-mega-panel" }, {
937
- default: H(() => [g.value ? (F(), T("section", {
938
- key: 0,
939
- id: "workbench-mega-panel",
940
- ref_key: "megaPanel",
941
- ref: a,
942
- class: "mega-panel",
943
- style: P({
944
- "--mega-panel-top": `${u.value}px`,
945
- "--mega-panel-left": `${ee.value}px`,
946
- "--mega-panel-width": `${f.value}px`,
947
- "--mega-column-count": ue.value
948
- }),
949
- onMouseenter: M
950
- }, [E("div", { class: N(["mega-body", { "has-deep": _.value }]) }, [E("div", kt, [(F(!0), T(x, null, be(le.value?.columns ?? [], (e, t) => (F(), T("div", {
951
- key: `mega-column-${t}`,
952
- class: "mega-column"
953
- }, [(F(!0), T(x, null, be(e, (e) => (F(), T("section", {
954
- key: e.record.id,
955
- class: "mega-group"
956
- }, [E("button", {
957
- class: N(["mega-group-title", {
958
- navigable: e.navigable,
959
- selected: J(e),
960
- "selected-path": je(e)
961
- }]),
962
- type: "button",
963
- disabled: !e.navigable,
964
- "aria-current": J(e) ? "page" : void 0,
965
- onClick: (t) => D(e)
966
- }, [E("span", null, z(e.record.title), 1)], 10, At), E("div", jt, [(F(!0), T(x, null, be(e.children, (e) => (F(), T("button", {
967
- key: e.record.id,
968
- class: N(["mega-entry", {
969
- navigable: e.navigable,
970
- active: _.value?.record.id === e.record.id,
971
- branch: e.hasChildren,
972
- selected: J(e),
973
- "selected-path": je(e)
974
- }]),
975
- type: "button",
976
- disabled: !e.navigable && !e.hasChildren,
977
- "aria-current": J(e) ? "page" : void 0,
978
- onMouseenter: (t) => ke(e),
979
- onFocus: (t) => ke(e),
980
- onClick: (t) => e.navigable && D(e)
981
- }, [E("span", null, z(e.record.title), 1)], 42, Mt))), 128))])]))), 128))]))), 128))]), _.value ? (F(), T("aside", Nt, [E("header", null, [n[3] ||= E("span", null, "深层导航", -1), E("strong", null, z(_.value.record.title), 1)]), E("ul", Pt, [O(q, {
982
- node: _.value,
983
- "selected-menu-id": e.selectedMenuId,
984
- "selected-path-ids": m.value,
985
- onSelectMenu: k
986
- }, null, 8, [
987
- "node",
988
- "selected-menu-id",
989
- "selected-path-ids"
990
- ])])])) : w("v-if", !0)], 2)], 36)) : w("v-if", !0)]),
991
- _: 1
992
- })
993
- ], 38));
994
- }
995
- }), [["__scopeId", "data-v-92a8dc38"]]);
996
- //#endregion
997
- //#region src/platform-workbench/workbenchLayout.ts
998
- function Wt(e, t) {
999
- return Math.max(0, Math.round(e - t));
1000
- }
1001
- //#endregion
1002
- //#region src/platform-workbench/Workbench.vue?vue&type=script&setup=true&lang.ts
1003
- var Gt = { class: "app-main" }, Kt = { class: "topbar-identity" }, qt = {
1004
- key: 0,
1005
- class: "header-title-divider",
1006
- "aria-hidden": "true"
1007
- }, Jt = { class: "topbar-title" }, Yt = {
1008
- class: "topbar-actions",
1009
- "aria-label": "全局工具"
1010
- }, Xt = {
1011
- class: "icon-button wide",
1012
- type: "button",
1013
- "aria-label": "搜索"
1014
- }, Zt = {
1015
- class: "icon-button",
1016
- type: "button",
1017
- "aria-label": "刷新"
1018
- }, Qt = {
1019
- class: "icon-button",
1020
- type: "button",
1021
- "aria-label": "通知"
1022
- }, $t = {
1023
- class: "icon-button",
1024
- type: "button",
1025
- "aria-label": "设置"
1026
- }, en = ["onClick"], tn = { class: "avatar" }, nn = { class: "user-meta" }, rn = { class: "tab-strip" }, an = {
1027
- key: 1,
1028
- class: "empty-tabs"
1029
- }, on = { class: "app-content" }, sn = 220, cn = /*#__PURE__*/ c(/* @__PURE__ */ A({
1030
- name: "Workbench",
1031
- __name: "Workbench",
1032
- props: {
1033
- startup: { default: void 0 },
1034
- loading: {
1035
- type: Boolean,
1036
- default: !1
1037
- },
1038
- error: { default: void 0 },
1039
- activeTabKey: { default: void 0 },
1040
- realtimeStatus: { default: "unavailable" }
1041
- },
1042
- emits: [
1043
- "selectMenu",
1044
- "invalidMenu",
1045
- "changeTab",
1046
- "closeTab",
1047
- "update:activeTabKey",
1048
- "userCommand"
1049
- ],
1050
- setup(e, { emit: t }) {
1051
- let n = e, r = t, i = S(() => n.startup?.tabs ?? []), a = S(() => i.value.map(pe)), s = S(() => n.activeTabKey ?? n.startup?.activeTabKey ?? a.value[0]?.key ?? ""), c = S(() => i.value.find((e) => e.key === s.value)), l = S(() => de(c.value)), u = S(() => n.startup?.session.currentUser), ee = S(() => u.value?.username ?? u.value?.userId ?? "未登录"), te = S(() => ee.value.trim().slice(0, 1).toUpperCase() || "M"), ne = S(() => u.value?.tenantId ?? "系统工作区"), re = S(() => I(l.value?.pageType)), d = S(() => xe(l.value)), ie = [
1052
- {
1053
- key: "changePassword",
1054
- title: "修改密码"
1055
- },
1056
- {
1057
- key: "profile",
1058
- title: "个人信息"
1059
- },
1060
- {
1061
- key: "settings",
1062
- title: "偏好设置"
1063
- },
1064
- {
1065
- key: "logout",
1066
- title: "退出登录",
1067
- danger: !0
1068
- }
1069
- ], f = L("compact"), ae = L(!1), oe = L(!1), se = L(), h = L(), g = L(54), le, ue, v;
1070
- function de(e) {
1071
- if (e) return e?.pageDescriptor ?? (e?.target ? Le(e.target, { title: e.title }) : void 0);
1072
- }
1073
- function y(e) {
1074
- return e.key === s.value || de(e)?.tabPolicy.cacheable !== !1;
1075
- }
1076
- function pe(e) {
1077
- return {
1078
- key: e.key,
1079
- title: e.title,
1080
- closable: e.closable
1081
- };
1082
- }
1083
- function b(e) {
1084
- r("update:activeTabKey", e), r("changeTab", e);
1085
- }
1086
- function me(e) {
1087
- r("userCommand", e);
1088
- }
1089
- function ge(e, t) {
1090
- r("selectMenu", e, t), A();
1091
- }
1092
- function D(e = "pointer") {
1093
- e === "pointer" && oe.value || (j(), ae.value = !0);
1094
- }
1095
- function k() {
1096
- j(), le = window.setTimeout(() => {
1097
- ae.value = !1, le = void 0;
1098
- }, sn);
1099
- }
1100
- function A() {
1101
- j(), ae.value = !1;
1102
- }
1103
- function j() {
1104
- le !== void 0 && (window.clearTimeout(le), le = void 0);
1105
- }
1106
- function M(e) {
1107
- ue !== void 0 && (window.cancelAnimationFrame(ue), ue = void 0), oe.value = e === "compact", f.value = e, A(), e === "compact" && (ue = window.requestAnimationFrame(() => {
1108
- oe.value = !1, ue = void 0;
1109
- }));
1110
- }
1111
- function P() {
1112
- if (!h.value || !se.value) return;
1113
- let e = h.value.getBoundingClientRect(), t = se.value.getBoundingClientRect();
1114
- g.value = Wt(e.bottom, t.top);
1115
- }
1116
- ve(() => {
1117
- _e(() => {
1118
- P(), !(typeof ResizeObserver > "u" || !h.value) && (v = new ResizeObserver(P), v.observe(h.value));
1119
- });
1120
- }), ye(() => {
1121
- j(), ue !== void 0 && window.cancelAnimationFrame(ue), v?.disconnect();
1122
- });
1123
- function I(e) {
1124
- return e === "dynamic-module" ? "动态模块" : e === "business-route" ? "业务页面" : e === "platform-route" ? "平台页面" : e === "remote-url" ? "在线页面" : e === "external-link" ? "外部链接" : "工作区";
1125
- }
1126
- function xe(e) {
1127
- return e ? e.pageType === "dynamic-module" ? e.target.moduleAlias : e.pageType === "platform-route" || e.pageType === "business-route" ? e.target.route ?? e.target.routeName ?? e.target.pageKey ?? "workspace" : e.target.url : "未选择入口";
1128
- }
1129
- return (t, n) => (F(), T("main", {
1130
- ref_key: "workbenchRoot",
1131
- ref: se,
1132
- class: N(["workbench", {
1133
- "workbench--menu-expanded": f.value === "expanded",
1134
- "workbench--compact-menu-open": f.value === "compact" && ae.value
1135
- }])
1136
- }, [O(Ut, {
1137
- menus: e.startup?.menus ?? [],
1138
- "selected-menu-id": c.value?.target?.menuId,
1139
- "tenant-label": ne.value,
1140
- "realtime-status": e.realtimeStatus,
1141
- presentation: f.value,
1142
- "compact-open": ae.value,
1143
- "compact-top": g.value,
1144
- onSelectMenu: ge,
1145
- onInvalidMenu: n[0] ||= (e) => r("invalidMenu", e),
1146
- onCompactMenuEnter: D,
1147
- onCompactMenuLeave: k,
1148
- onCompactMenuClose: A,
1149
- onChangePresentation: M
1150
- }, null, 8, [
1151
- "menus",
1152
- "selected-menu-id",
1153
- "tenant-label",
1154
- "realtime-status",
1155
- "presentation",
1156
- "compact-open",
1157
- "compact-top"
1158
- ]), E("section", Gt, [
1159
- E("header", {
1160
- ref_key: "appTopbar",
1161
- ref: h,
1162
- class: "app-topbar"
1163
- }, [
1164
- E("div", Kt, [
1165
- O(he, { name: "workbench-brand" }, {
1166
- default: H(() => [f.value === "compact" ? (F(), C(De, {
1167
- key: 0,
1168
- presentation: "compact",
1169
- "compact-open": ae.value,
1170
- "tenant-label": ne.value,
1171
- onOpenCompactMenu: D,
1172
- onScheduleCompactMenuClose: k,
1173
- onCloseCompactMenu: A,
1174
- onChangePresentation: M
1175
- }, null, 8, ["compact-open", "tenant-label"])) : w("v-if", !0)]),
1176
- _: 1
1177
- }),
1178
- O(he, { name: "workbench-divider" }, {
1179
- default: H(() => [f.value === "compact" ? (F(), T("span", qt)) : w("v-if", !0)]),
1180
- _: 1
1181
- }),
1182
- E("div", Jt, [E("h1", null, z(c.value?.title ?? "控制台"), 1), E("span", null, z(re.value) + " / " + z(d.value), 1)])
1183
- ]),
1184
- E("div", Yt, [
1185
- E("button", Xt, [O(B(o), { name: "search" }), n[2] ||= E("span", null, "搜索", -1)]),
1186
- E("button", Zt, [O(B(o), { name: "reload" })]),
1187
- E("button", Qt, [O(B(o), { name: "notification" })]),
1188
- E("button", $t, [O(B(o), { name: "settings" })])
1189
- ]),
1190
- O(B(m), {
1191
- items: ie,
1192
- onSelect: me
1193
- }, {
1194
- default: H(({ toggle: e }) => [E("button", {
1195
- class: "user-button",
1196
- type: "button",
1197
- onClick: Ee(e, ["stop"])
1198
- }, [
1199
- E("span", tn, z(te.value), 1),
1200
- E("span", nn, [E("strong", null, z(ee.value), 1), E("small", null, z(u.value?.system ? "系统管理员" : "业务用户"), 1)]),
1201
- O(B(o), {
1202
- class: "user-caret",
1203
- name: "down"
1204
- })
1205
- ], 8, en)]),
1206
- _: 1
1207
- })
1208
- ], 512),
1209
- E("div", rn, [a.value.length > 0 ? (F(), C(B(p), {
1210
- key: 0,
1211
- tabs: a.value,
1212
- "active-key": s.value,
1213
- "onUpdate:activeKey": b,
1214
- onClose: n[1] ||= (e) => r("closeTab", e)
1215
- }, null, 8, ["tabs", "active-key"])) : (F(), T("div", an, "暂无打开页面"))]),
1216
- E("section", on, [e.loading ? (F(), C(B(ce), { key: 0 })) : e.error ? (F(), C(B(fe), {
1217
- key: 1,
1218
- message: e.error
1219
- }, null, 8, ["message"])) : (F(!0), T(x, { key: 2 }, be(i.value, (e) => (F(), T(x, { key: e.key }, [y(e) ? Te((F(), C(B(_), {
1220
- key: 0,
1221
- class: "tab-panel-host"
1222
- }, {
1223
- default: H(() => [E("div", { class: N(["tab-page", { "tab-page--workspace": de(e)?.layout === "workspace" }]) }, [R(t.$slots, "default", {
1224
- activeTab: e,
1225
- target: e.target,
1226
- pageDescriptor: de(e)
1227
- }, void 0, !0)], 2)]),
1228
- _: 2
1229
- }, 1536)), [[V, e.key === s.value]]) : w("v-if", !0)], 64))), 128))])
1230
- ])], 2));
1231
- }
1232
- }), [["__scopeId", "data-v-04e3c7ec"]]);
1233
- //#endregion
1234
- //#region src/dynamic-page-runtime/dynamicModuleDetailStateModel.ts
1235
- function ln(e) {
1236
- return e.activeRequestSequence === e.requestSequence;
1237
- }
1238
- function un(e) {
1239
- return e.hasRecord && !e.saving && !e.loading && !e.loadFailed;
1240
- }
1241
- //#endregion
1242
- //#region src/dynamic-page-runtime/modulePageEnhancements.ts
1243
- function dn(e) {
1244
- let t = /* @__PURE__ */ new Map(), n = [], r = /* @__PURE__ */ new Set();
1245
- for (let i of e) {
1246
- if (r.has(i.id)) throw Error(`重复的模块页面增强:${i.id}`);
1247
- r.add(i.id);
1248
- let e = gn(i.target.moduleAlias, i.target.viewCode);
1249
- if (t.has(e)) throw Error(`模块页面增强目标重复:${e}`);
1250
- _n(i);
1251
- for (let e of i.workspaceViews ?? []) {
1252
- if (e.moduleAlias !== i.target.moduleAlias) throw Error(`模块页面增强 ${i.id} 的工作视图模块不一致:${e.type}`);
1253
- n.push(e);
1254
- }
1255
- t.set(e, i);
1256
- }
1257
- return {
1258
- resolve(e, n) {
1259
- return (n ? t.get(gn(e, n)) : void 0) ?? t.get(gn(e));
1260
- },
1261
- workspaceViews() {
1262
- return n;
1263
- }
1264
- };
1265
- }
1266
- var fn = dn([]);
1267
- function pn(e) {
1268
- fn = dn(e);
1269
- }
1270
- function mn(e, t) {
1271
- return fn.resolve(e, t);
1272
- }
1273
- function hn() {
1274
- return fn.workspaceViews();
1275
- }
1276
- function gn(e, t) {
1277
- return `${e}#${t ?? "*"}`;
1278
- }
1279
- function _n(e) {
1280
- if ([
1281
- e.list?.actions ?? [],
1282
- e.list?.columns ?? [],
1283
- e.list?.cellComponents ?? [],
1284
- e.list?.rowActions ?? [],
1285
- e.list?.batchActions ?? [],
1286
- e.detail?.actions ?? [],
1287
- e.detail?.sections ?? []
1288
- ].some((e) => new Set(e.map((e) => e.key)).size !== e.length)) throw Error(`模块页面增强 ${e.id} 在同一列表区域存在重复的贡献 key`);
1289
- vn(e.id, e.list?.actions ?? [], ["create"]), vn(e.id, e.list?.rowActions ?? [], [
1290
- "view",
1291
- "edit",
1292
- "delete"
1293
- ]), vn(e.id, e.list?.batchActions ?? [], ["create"]), vn(e.id, e.detail?.actions ?? [], [
1294
- "create",
1295
- "update",
1296
- "delete"
1297
- ]);
1298
- }
1299
- function vn(e, t, n) {
1300
- let r = t.find((e) => n.includes(e.key));
1301
- if (r) throw Error(`模块页面增强 ${e} 不能覆盖平台标准动作:${r.key}`);
1302
- }
1303
- //#endregion
1304
- //#region src/dynamic-page-runtime/modulePageNavigation.ts
1305
- var yn = Symbol("module-page-navigation");
1306
- function bn(e) {
1307
- I(yn, e);
1308
- }
1309
- function xn() {
1310
- return j(yn, void 0);
1311
- }
1312
- //#endregion
1313
- //#region src/dynamic-page-runtime/modulePageListRefresh.ts
1314
- function Sn() {
1315
- let e = /* @__PURE__ */ new Map();
1316
- function t(t, n) {
1317
- let r = Tn(t), i = e.get(r) ?? /* @__PURE__ */ new Set();
1318
- return i.add(n), e.set(r, i), () => {
1319
- i.delete(n), i.size === 0 && e.delete(r);
1320
- };
1321
- }
1322
- function n(t) {
1323
- let n = e.get(Tn(t));
1324
- if (!n || n.size === 0) return !1;
1325
- for (let e of [...n]) e();
1326
- return !0;
1327
- }
1328
- return {
1329
- register: t,
1330
- refresh: n
1331
- };
1332
- }
1333
- var Cn = Sn();
1334
- function wn(e) {
1335
- return Cn.refresh(e);
1336
- }
1337
- function Tn(e) {
1338
- let t = e?.trim();
1339
- if (!t) throw Error("Module page list refresh requires a moduleAlias");
1340
- return t;
1341
- }
1342
- //#endregion
1343
- //#region src/dynamic-page-runtime/DynamicModuleHost.vue?vue&type=script&setup=true&lang.ts
1344
- var En = {
1345
- key: 0,
1346
- class: "dynamic-module-unsupported"
1347
- }, Dn = {
1348
- key: 1,
1349
- class: "dynamic-module-unsupported"
1350
- }, On = {
1351
- key: 0,
1352
- class: "dynamic-scope-editor-panel"
1353
- }, kn = { class: "dynamic-scope-editor-header" }, An = { class: "dynamic-scope-editor-actions" }, jn = {
1354
- key: 3,
1355
- class: "dynamic-module-unsupported"
1356
- }, Mn = /*#__PURE__*/ c(/* @__PURE__ */ A({
1357
- name: "DynamicModuleHost",
1358
- __name: "DynamicModuleHost",
1359
- props: { descriptor: {} },
1360
- setup(o, { expose: c }) {
1361
- let d = o, p = ne({ moduleAlias: d.descriptor.target.moduleAlias }), ce = xn(), m = L(), _ = L(), v = L("view"), fe = L(!1), b = L(te(void 0)), k = L([]), A = L(0), j = L(0), M = L(), _e = L(""), P = L(!1), I = L(), R = L(), xe = L(""), Ce = L(0), V = L(!1), we = L(te(void 0)), Te = L(!1), Ee = L("create"), U = L(), W = L(!1), G = L(!1), De = L(0), Oe = L(0), ke = L(!1), K = L(!1), q = L(!1), Ae = L(), J = 0, je, Me = S(() => d.descriptor.title ?? p.runtime.snapshot()?.title ?? p.moduleAlias), Y = S(() => v.value === "create" ? `新建${Me.value}` : Kt(_.value ?? m.value) ?? "记录详情"), X = S(() => `${Ee.value === "create" ? "新建" : "编辑"}${I.value?.scopeTitle ?? "目录"}`), Z = L(), Ne = L(), Pe = S(() => d.descriptor.target.pageMode ?? "LIST"), Fe = S(() => Z.value?.entry.pageMode ?? Pe.value), Ie = S(() => Fe.value === "LIST"), Le = S(() => Ie.value ? d.descriptor.target.defaultUiConfigId : void 0), Re = S(() => Z.value?.entry.defaultUiConfigId ?? Le.value), ze = S(() => Z.value?.entry.defaultQueryTemplateId ?? d.descriptor.target.defaultQueryTemplateId), Be = S(() => {
1362
- let e = k.value.filter((e) => e.viewKind === "LIST");
1363
- return Re.value == null ? e.length === 1 ? e[0] : void 0 : e.find((e) => e.sourceUiConfigId === Re.value);
1364
- }), Ve = S(() => mn(p.moduleAlias, Be.value?.viewCode)), He = S(() => Ve.value?.list?.actions ?? []), Ue = S(() => Ve.value?.list?.columns ?? []), We = S(() => [...Ue.value.map((e) => ({
1365
- key: e.key,
1366
- component: e.cell
1367
- })), ...(Ve.value?.list?.cellComponents ?? []).map((e) => ({
1368
- key: e.key,
1369
- component: e.cell
1370
- }))]), Ge = S(() => Ve.value?.list?.rowActions ?? []);
1371
- function Ke(e) {
1372
- return Ge.value.map(({ state: t, ...n }) => ({
1373
- ...n,
1374
- ...t?.(e)
1375
- }));
1376
- }
1377
- let qe = S(() => Ve.value?.list?.batchActions ?? []), Je = S(() => Ve.value?.detail?.actions ?? []), Ye = S(() => Ve.value?.detail?.sections ?? []), Xe = S(() => !!d.descriptor.menuId), Ze = S(() => !Xe.value || Z.value !== void 0), Qe = S(() => `动态${Fe.value}入口暂未接入运行器`);
1378
- me(S(() => P.value || I.value ? "workspace" : d.descriptor.layout));
1379
- let Q = S(() => {
1380
- let e = I.value;
1381
- return e ? n({
1382
- http: p.http,
1383
- moduleAlias: e.scopeModuleAlias
1384
- }) : void 0;
1385
- }), $e = S(() => I.value?.createPolicy === "REQUIRE_SCOPE"), et = S(() => !$e.value || R.value?.id != null), tt = S(() => {
1386
- let e = I.value, t = R.value?.id;
1387
- return e && t != null ? { [e.queryCriteriaKey]: t } : void 0;
1388
- }), nt = S(() => [{
1389
- key: "create",
1390
- actionCode: "create",
1391
- title: "新建",
1392
- primary: !0,
1393
- disabled: !et.value
1394
- }]), $ = S(() => {
1395
- let e = m.value;
1396
- return !e?.id || v.value !== "view" || K.value || q.value || ke.value ? !1 : p.can(e.enabled === !1 ? "enable" : "disable") === !0;
1397
- }), rt = S(() => !P.value || !b.value.has("parentId") ? {} : { parentId: {
1398
- context: p,
1399
- mode: "tree",
1400
- placeholder: "根标签留空",
1401
- allowClear: !0,
1402
- constraints: pe(_.value?.id == null ? void 0 : String(_.value.id))
1403
- } }), it = S(() => {
1404
- let e = { ...rt.value };
1405
- for (let t of b.value.values()) {
1406
- let r = t.reference;
1407
- r && (e[t.fieldRef.fieldName] = {
1408
- context: n({
1409
- http: p.http,
1410
- moduleAlias: r.targetModuleAlias
1411
- }),
1412
- mode: "tree",
1413
- allowClear: !t.required?.constant
1414
- });
1415
- }
1416
- return e;
1417
- });
1418
- ve(async () => {
1419
- await at(), await ot(), Ie.value && (je = Cn.register(p.moduleAlias, Ht));
1420
- }), ye(() => {
1421
- je?.(), je = void 0;
1422
- });
1423
- async function at() {
1424
- let e = d.descriptor.menuId;
1425
- if (e) try {
1426
- let t = await ae(p.http).byMenu(e);
1427
- if (t.entry.moduleAlias !== p.moduleAlias) throw Error(`Menu ${e} resolves ${t.entry.moduleAlias}, expected ${p.moduleAlias}`);
1428
- Z.value = t, Ne.value = void 0;
1429
- } catch (e) {
1430
- Ne.value = e instanceof Error ? e.message : "页面入口加载失败";
1431
- }
1432
- }
1433
- async function ot() {
1434
- if (!Ie.value) return;
1435
- let e = await p.runtime.ready;
1436
- if (k.value = e.uiDescriptor?.views ?? [], P.value = p.abilities.hasTree() === !0, I.value = ut(k.value), V.value = !1, Q.value) {
1437
- let e = await Q.value.runtime.ready;
1438
- V.value = Q.value.abilities.hasTree() === !0, we.value = te(e.uiDescriptor);
1439
- }
1440
- let t = lt(k.value);
1441
- b.value = te(e.uiDescriptor, t?.viewCode);
1442
- }
1443
- let st = S(() => !Q.value || !V.value || !we.value.has("parentId") ? {} : { parentId: {
1444
- context: Q.value,
1445
- mode: "tree",
1446
- placeholder: `根${I.value?.scopeTitle ?? "目录"}留空`,
1447
- allowClear: !0,
1448
- constraints: pe(U.value?.id == null ? void 0 : String(U.value.id))
1449
- } }), ct = S(() => {
1450
- let e = { ...st.value };
1451
- if (!Q.value) return e;
1452
- for (let t of we.value.values()) {
1453
- let r = t.fieldRef.fieldName, i = t.reference;
1454
- !i || r === "parentId" || (e[r] = {
1455
- context: n({
1456
- http: p.http,
1457
- moduleAlias: i.targetModuleAlias
1458
- }),
1459
- mode: "tree",
1460
- allowClear: !t.required?.constant
1461
- });
1462
- }
1463
- return e;
1464
- });
1465
- function lt(e) {
1466
- return e.find((e) => e.viewKind === "FORM");
1467
- }
1468
- function ut(e) {
1469
- let t = e.filter((e) => e.viewKind === "LIST"), n = Re.value == null ? void 0 : t.find((e) => e.sourceUiConfigId === Re.value);
1470
- return n ? n.scopedListWorkspace : Re.value == null && t.length === 1 ? t[0].scopedListWorkspace : void 0;
1471
- }
1472
- function dt(e) {
1473
- m.value &&= e.find((e) => e.id === m.value?.id) ?? m.value;
1474
- }
1475
- function ft(e) {
1476
- m.value = e;
1477
- }
1478
- function pt(e) {
1479
- if (R.value?.id === e.id) {
1480
- R.value = void 0;
1481
- return;
1482
- }
1483
- R.value = e;
1484
- }
1485
- function mt() {
1486
- if (!I.value?.manageScopeTree || !V.value || !Q.value) return [];
1487
- let e = [];
1488
- return Q.value.can("create") === !0 && e.push({
1489
- key: "create-child",
1490
- title: "新增下级",
1491
- iconName: "plus"
1492
- }), Q.value.can("update") === !0 && e.push({
1493
- key: "edit",
1494
- title: "编辑",
1495
- iconName: "edit"
1496
- }), Q.value.can("delete") === !0 && e.push({
1497
- key: "delete",
1498
- title: "删除",
1499
- iconName: "delete",
1500
- danger: !0
1501
- }), e;
1502
- }
1503
- function ht(e, t) {
1504
- Oe.value += 1, Ee.value = e, U.value = e === "create" ? t?.id == null ? { enabled: !0 } : {
1505
- parentId: t.id,
1506
- enabled: !0
1507
- } : t, Te.value = !0;
1508
- }
1509
- function gt() {
1510
- W.value || (Te.value = !1, Oe.value += 1);
1511
- }
1512
- async function _t(t) {
1513
- if (!(!Q.value?.crud || t.id == null)) try {
1514
- ht("edit", await Q.value.crud.view(String(t.id)));
1515
- } catch (t) {
1516
- e(t, {
1517
- source: "scoped-tree-editor",
1518
- phase: "load"
1519
- });
1520
- }
1521
- }
1522
- async function vt() {
1523
- let t = Q.value, n = U.value;
1524
- if (!(!t || !n || W.value)) {
1525
- W.value = !0;
1526
- try {
1527
- R.value = (Ee.value === "edit" && n.id != null ? await t.crud.update(String(n.id), n) : await t.crud.insert(n)).record, Te.value = !1, Oe.value += 1, Ce.value += 1;
1528
- } catch (t) {
1529
- e(t, {
1530
- source: "scoped-tree-editor",
1531
- phase: "action"
1532
- });
1533
- } finally {
1534
- W.value = !1;
1535
- }
1536
- }
1537
- }
1538
- async function yt(t) {
1539
- let n = Q.value, r = t.id == null ? void 0 : String(t.id), i = typeof t.version == "number" ? t.version : void 0;
1540
- if (!(!n || !r || i === void 0)) try {
1541
- if (!await se({
1542
- title: `删除${I.value?.scopeTitle ?? "目录"}`,
1543
- content: `确认删除「${Kt(t) ?? r}」?`,
1544
- okText: "删除",
1545
- danger: !0
1546
- })) return;
1547
- await n.crud.delete(r, { version: i }), R.value?.id === r && (R.value = void 0), Ce.value += 1;
1548
- } catch (t) {
1549
- e(t, {
1550
- source: "scoped-tree-editor",
1551
- phase: "action"
1552
- });
1553
- }
1554
- }
1555
- function bt(e, t) {
1556
- let n = t;
1557
- pt(n), e.key === "create-child" && ht("create", n), e.key === "edit" && _t(n), e.key === "delete" && yt(n);
1558
- }
1559
- function xt(e, t) {
1560
- U.value &&= {
1561
- ...U.value,
1562
- [e]: t
1563
- };
1564
- }
1565
- function St(e) {
1566
- M.value = e, wt(M.value, "view");
1567
- }
1568
- function Ct(e) {
1569
- if (M.value || v.value !== "view") return;
1570
- let t = e.at(0);
1571
- t && St(t);
1572
- }
1573
- async function wt(e, t) {
1574
- let n = e.id == null ? void 0 : String(e.id);
1575
- if (!n) return;
1576
- let r = ++J;
1577
- De.value += 1, m.value = e, _.value = void 0, v.value = t, fe.value = !0, K.value = !0, q.value = !1;
1578
- try {
1579
- let e = await p.crud.view(n);
1580
- if (!ln({
1581
- activeRequestSequence: J,
1582
- requestSequence: r
1583
- })) return;
1584
- _.value = e, m.value = e;
1585
- } catch {
1586
- if (!ln({
1587
- activeRequestSequence: J,
1588
- requestSequence: r
1589
- })) return;
1590
- _.value = void 0, q.value = !0;
1591
- } finally {
1592
- ln({
1593
- activeRequestSequence: J,
1594
- requestSequence: r
1595
- }) && (K.value = !1);
1596
- }
1597
- }
1598
- function Tt(e, t) {
1599
- _.value &&= {
1600
- ..._.value,
1601
- [e]: t
1602
- };
1603
- }
1604
- function Et(e) {
1605
- if ($e.value && R.value?.id == null) return;
1606
- J += 1, K.value = !1, q.value = !1, De.value += 1;
1607
- let t = I.value;
1608
- _.value = e ? { parentId: e } : t && R.value?.id != null ? { [t.scopeField]: R.value.id } : {}, v.value = "create", fe.value = !0;
1609
- }
1610
- function Dt() {
1611
- Et();
1612
- }
1613
- function Ot() {
1614
- let e = m.value?.id == null ? void 0 : String(m.value.id);
1615
- e && Et(e);
1616
- }
1617
- async function kt(e) {
1618
- await wt(e, "edit");
1619
- }
1620
- async function At() {
1621
- let e = _.value;
1622
- if (e && un({
1623
- hasRecord: !0,
1624
- saving: G.value,
1625
- loading: K.value,
1626
- loadFailed: q.value
1627
- })) {
1628
- G.value = !0;
1629
- try {
1630
- let t = e.id == null ? void 0 : String(e.id), n = v.value === "edit" && t ? await p.crud.update(t, e) : await p.crud.insert(e);
1631
- m.value = n.record, P.value && (M.value = n.record), _.value = n.record, v.value = "view", A.value += 1, j.value += 1, De.value += 1;
1632
- } finally {
1633
- G.value = !1;
1634
- }
1635
- }
1636
- }
1637
- async function jt(e) {
1638
- let t = e.id == null ? void 0 : String(e.id), n = typeof e.version == "number" ? e.version : void 0;
1639
- !t || n === void 0 || await se({
1640
- title: "删除记录",
1641
- content: `确认删除「${Kt(e) ?? t}」?`,
1642
- okText: "删除",
1643
- danger: !0
1644
- }) && (await p.crud.delete(t, { version: n }), m.value?.id === t && (m.value = void 0, _.value = void 0, M.value = void 0), A.value += 1, j.value += 1);
1645
- }
1646
- async function Mt() {
1647
- let e = m.value, t = e?.id == null ? void 0 : String(e.id), n = typeof e?.version == "number" ? e.version : void 0;
1648
- if (!(!e || !t || n === void 0 || !$.value)) {
1649
- ke.value = !0;
1650
- try {
1651
- e.enabled === !1 ? await p.crud.enable(t, { version: n }) : await p.crud.disable(t, { version: n });
1652
- let r = await p.crud.view(t);
1653
- m.value = r, _.value = r, A.value += 1, j.value += 1;
1654
- } finally {
1655
- ke.value = !1;
1656
- }
1657
- }
1658
- }
1659
- function Nt(e) {
1660
- if (e.key === "create") {
1661
- Et();
1662
- return;
1663
- }
1664
- let t = He.value.find((t) => t.key === e.key);
1665
- t && Lt(t, zt());
1666
- }
1667
- function Pt(e, t) {
1668
- if (e.key === "view") {
1669
- wt(t, "view");
1670
- return;
1671
- }
1672
- if (e.key === "edit") {
1673
- kt(t);
1674
- return;
1675
- }
1676
- if (e.key === "delete") {
1677
- jt(t);
1678
- return;
1679
- }
1680
- let n = Ge.value.find((t) => t.key === e.key);
1681
- n && Lt(n, {
1682
- ...zt(t),
1683
- record: t
1684
- });
1685
- }
1686
- function Ft(e) {
1687
- let t = m.value, n = Je.value.find((t) => t.key === e.key);
1688
- t && n && Lt(n, {
1689
- ...zt(t),
1690
- record: t
1691
- });
1692
- }
1693
- function It(e, t, n) {
1694
- let r = qe.value.find((t) => t.key === e.key);
1695
- r && Lt(r, {
1696
- ...zt(),
1697
- records: t,
1698
- clearSelection: n
1699
- });
1700
- }
1701
- async function Lt(t, n) {
1702
- try {
1703
- await t.run(n);
1704
- } catch (n) {
1705
- e(n, {
1706
- source: `module-page-enhancement:${t.key}`,
1707
- phase: "action"
1708
- });
1709
- }
1710
- }
1711
- function Rt(e) {
1712
- return {
1713
- module: p,
1714
- record: e,
1715
- refreshList: Ht,
1716
- reload: Vt
1717
- };
1718
- }
1719
- function zt(e) {
1720
- return {
1721
- module: p,
1722
- refreshList: Ht,
1723
- reload: Vt,
1724
- openDrawer: (t) => {
1725
- Ae.value = {
1726
- definition: t,
1727
- context: {
1728
- module: p,
1729
- record: e,
1730
- refreshList: Ht,
1731
- close: Bt,
1732
- reload: Vt
1733
- }
1734
- };
1735
- },
1736
- openWorkspaceTab: (e, t) => {
1737
- if (!ce) throw Error("模块页面工作视图需要 Workbench 导航承载");
1738
- ce.openWorkspaceTab(e, t);
1739
- }
1740
- };
1741
- }
1742
- function Bt() {
1743
- Ae.value = void 0;
1744
- }
1745
- function Vt() {
1746
- Ht(), P.value || (j.value += 1);
1747
- }
1748
- function Ht() {
1749
- if (P.value) {
1750
- j.value += 1;
1751
- return;
1752
- }
1753
- A.value += 1;
1754
- }
1755
- c({ refreshList: Ht });
1756
- function Ut() {
1757
- G.value || (J += 1, K.value = !1, q.value = !1, De.value += 1, fe.value = !1, v.value = "view", _.value = m.value);
1758
- }
1759
- function Wt() {
1760
- G.value || (J += 1, K.value = !1, q.value = !1, De.value += 1, fe.value = !1, v.value = "view", _.value = m.value);
1761
- }
1762
- function Gt() {
1763
- let e = m.value;
1764
- !e || v.value === "create" || wt(e, v.value);
1765
- }
1766
- function Kt(e) {
1767
- let t = e?.title ?? e?.name ?? e?.code ?? e?.id;
1768
- return t == null ? void 0 : String(t);
1769
- }
1770
- return (e, n) => Ne.value ? (F(), T("section", En, [O(B(s), {
1771
- class: "dynamic-module-bootstrap-error",
1772
- description: Ne.value
1773
- }, null, 8, ["description"])])) : Ze.value ? Ie.value ? (F(), T("section", {
1774
- key: 2,
1775
- class: N(["dynamic-module-workspace", { "dynamic-module-workspace--tree": P.value }])
1776
- }, [
1777
- I.value && Q.value ? (F(), C(B(ie), {
1778
- key: 0,
1779
- class: "dynamic-tree-workspace"
1780
- }, {
1781
- default: H(() => [O(B(ee), null, {
1782
- default: H(() => [O(B(i), {
1783
- title: I.value.scopeTitle,
1784
- "refresh-title": `刷新${I.value.scopeTitle}${V.value ? "树" : "列表"}`,
1785
- "search-keyword": xe.value,
1786
- "search-placeholder": I.value.scopeSearchPlaceholder,
1787
- "onUpdate:searchKeyword": n[2] ||= (e) => xe.value = e,
1788
- onRefresh: n[3] ||= (e) => Ce.value += 1
1789
- }, ge({
1790
- editor: H(() => [O(he, { name: "dynamic-scope-editor-drawer" }, {
1791
- default: H(() => [I.value.manageScopeTree && V.value && U.value && Te.value ? (F(), T("section", On, [E("header", kn, [E("h3", null, z(X.value), 1), E("div", An, [
1792
- O(B(f), {
1793
- enabled: U.value.enabled !== !1,
1794
- disabled: W.value,
1795
- "show-label": !1,
1796
- onChange: n[1] ||= (e) => xt("enabled", e)
1797
- }, null, 8, ["enabled", "disabled"]),
1798
- O(B(a), {
1799
- disabled: W.value,
1800
- onClick: gt
1801
- }, {
1802
- default: H(() => [...n[13] ||= [D(" 取消 ", -1)]]),
1803
- _: 1
1804
- }, 8, ["disabled"]),
1805
- O(B(a), {
1806
- type: "primary",
1807
- loading: W.value,
1808
- onClick: vt
1809
- }, {
1810
- default: H(() => [D(z(W.value ? "保存中" : "保存"), 1)]),
1811
- _: 1
1812
- }, 8, ["loading"])
1813
- ])]), O(B(y), {
1814
- class: "dynamic-scope-editor-form",
1815
- record: U.value,
1816
- fields: we.value,
1817
- "file-transfer-context": Q.value,
1818
- "form-session-key": Oe.value,
1819
- "picker-configs": ct.value,
1820
- disabled: W.value,
1821
- "exclude-field-names": ["enabled"],
1822
- "onUpdate:field": xt
1823
- }, null, 8, [
1824
- "record",
1825
- "fields",
1826
- "file-transfer-context",
1827
- "form-session-key",
1828
- "picker-configs",
1829
- "disabled"
1830
- ])])) : w("v-if", !0)]),
1831
- _: 1
1832
- })]),
1833
- default: H(() => [V.value ? (F(), C(B(le), {
1834
- key: 0,
1835
- context: Q.value,
1836
- "selected-id": R.value?.id == null ? void 0 : String(R.value.id),
1837
- "reload-key": Ce.value,
1838
- keyword: xe.value,
1839
- "search-mode": "none",
1840
- "empty-description": `暂无${I.value.scopeTitle}`,
1841
- "secondary-of": I.value.showScopeItemSubtitle ? void 0 : () => void 0,
1842
- "actions-of": mt,
1843
- onSelect: pt,
1844
- onAction: bt
1845
- }, null, 8, [
1846
- "context",
1847
- "selected-id",
1848
- "reload-key",
1849
- "keyword",
1850
- "empty-description",
1851
- "secondary-of"
1852
- ])) : (F(), C(B(de), {
1853
- key: 1,
1854
- context: Q.value,
1855
- "selected-id": R.value?.id == null ? void 0 : String(R.value.id),
1856
- "reload-key": Ce.value,
1857
- keyword: xe.value,
1858
- "empty-description": `暂无${I.value.scopeTitle}`,
1859
- "subtitle-of": I.value.showScopeItemSubtitle ? void 0 : () => void 0,
1860
- onSelect: pt
1861
- }, null, 8, [
1862
- "context",
1863
- "selected-id",
1864
- "reload-key",
1865
- "keyword",
1866
- "empty-description",
1867
- "subtitle-of"
1868
- ]))]),
1869
- _: 2
1870
- }, [I.value.manageScopeTree && V.value ? {
1871
- name: "actions",
1872
- fn: H(() => [O(B(r), {
1873
- class: "record-panel-create-button",
1874
- context: Q.value,
1875
- "action-code": "create",
1876
- "icon-only": "",
1877
- title: `新增${I.value.scopeTitle}`,
1878
- onClick: n[0] ||= (e) => ht("create")
1879
- }, null, 8, ["context", "title"])]),
1880
- key: "0"
1881
- } : void 0]), 1032, [
1882
- "title",
1883
- "refresh-title",
1884
- "search-keyword",
1885
- "search-placeholder"
1886
- ])]),
1887
- _: 1
1888
- }), O(B(ue), {
1889
- class: "dynamic-list",
1890
- context: B(p),
1891
- title: Me.value,
1892
- "selected-key": m.value?.id,
1893
- "reload-key": A.value,
1894
- actions: nt.value,
1895
- "standard-crud-row-actions": !0,
1896
- "extra-actions": He.value,
1897
- "additional-columns": Ue.value,
1898
- "cell-components": We.value,
1899
- "extra-row-actions-of": Ke,
1900
- "action-column-width": Ve.value?.list?.actionColumnWidth,
1901
- "batch-actions": qe.value,
1902
- "ui-config-id": Re.value,
1903
- "query-template-id": ze.value,
1904
- ready: Ze.value,
1905
- "external-query-values": tt.value,
1906
- "required-external-criteria-keys": [I.value.queryCriteriaKey],
1907
- "quick-search-placeholder": "搜索动态记录",
1908
- "empty-description": "暂无动态记录",
1909
- onLoaded: dt,
1910
- onSelect: ft,
1911
- onRowDblclick: n[4] ||= (e) => wt(e, "view"),
1912
- onAction: Nt,
1913
- onRowAction: Pt,
1914
- onBatchAction: n[5] ||= (e, t, n, r) => It(e, t, r)
1915
- }, null, 8, [
1916
- "context",
1917
- "title",
1918
- "selected-key",
1919
- "reload-key",
1920
- "actions",
1921
- "extra-actions",
1922
- "additional-columns",
1923
- "cell-components",
1924
- "action-column-width",
1925
- "batch-actions",
1926
- "ui-config-id",
1927
- "query-template-id",
1928
- "ready",
1929
- "external-query-values",
1930
- "required-external-criteria-keys"
1931
- ])]),
1932
- _: 1
1933
- })) : P.value ? (F(), C(B(ie), {
1934
- key: 1,
1935
- class: "dynamic-tree-workspace"
1936
- }, {
1937
- default: H(() => [O(B(ee), null, {
1938
- default: H(() => [O(B(i), {
1939
- title: `${Me.value}树`,
1940
- "refresh-title": `刷新${Me.value}树`,
1941
- "search-keyword": _e.value,
1942
- "search-placeholder": "搜索树节点",
1943
- "onUpdate:searchKeyword": n[6] ||= (e) => _e.value = e,
1944
- onRefresh: n[7] ||= (e) => j.value += 1
1945
- }, {
1946
- actions: H(() => [O(B(r), {
1947
- class: "record-panel-create-button",
1948
- context: B(p),
1949
- "action-code": "create",
1950
- "icon-only": "",
1951
- title: "新建根节点",
1952
- onClick: Dt
1953
- }, null, 8, ["context"])]),
1954
- default: H(() => [O(B(le), {
1955
- context: B(p),
1956
- "selected-id": M.value?.id == null ? void 0 : String(M.value.id),
1957
- "reload-key": j.value,
1958
- keyword: _e.value,
1959
- "search-mode": "none",
1960
- "search-trigger": "external",
1961
- "empty-description": "暂无记录",
1962
- onSelect: St,
1963
- onLoaded: Ct
1964
- }, null, 8, [
1965
- "context",
1966
- "selected-id",
1967
- "reload-key",
1968
- "keyword"
1969
- ])]),
1970
- _: 1
1971
- }, 8, [
1972
- "title",
1973
- "refresh-title",
1974
- "search-keyword"
1975
- ])]),
1976
- _: 1
1977
- }), O(B(re), {
1978
- class: "dynamic-tree-card",
1979
- title: Y.value
1980
- }, {
1981
- actions: H(() => [v.value === "view" ? (F(), T(x, { key: 1 }, [
1982
- m.value?.id != null && Je.value.length > 0 ? (F(), C(B(u), {
1983
- key: 0,
1984
- context: B(p),
1985
- "record-id": String(m.value.id),
1986
- actions: Je.value,
1987
- onAction: Ft
1988
- }, null, 8, [
1989
- "context",
1990
- "record-id",
1991
- "actions"
1992
- ])) : w("v-if", !0),
1993
- O(B(r), {
1994
- context: B(p),
1995
- "action-code": "create",
1996
- disabled: !m.value,
1997
- onClick: Ot
1998
- }, {
1999
- default: H(() => [...n[15] ||= [D(" 新建子项 ", -1)]]),
2000
- _: 1
2001
- }, 8, ["context", "disabled"]),
2002
- O(B(r), {
2003
- context: B(p),
2004
- "action-code": "update",
2005
- disabled: !m.value,
2006
- onClick: n[8] ||= (e) => m.value && kt(m.value)
2007
- }, {
2008
- default: H(() => [...n[16] ||= [D(" 编辑 ", -1)]]),
2009
- _: 1
2010
- }, 8, ["context", "disabled"]),
2011
- O(B(r), {
2012
- context: B(p),
2013
- "action-code": "delete",
2014
- loading: G.value,
2015
- danger: "",
2016
- disabled: !m.value,
2017
- onClick: n[9] ||= (e) => m.value && jt(m.value)
2018
- }, {
2019
- default: H(() => [...n[17] ||= [D(" 删除 ", -1)]]),
2020
- _: 1
2021
- }, 8, [
2022
- "context",
2023
- "loading",
2024
- "disabled"
2025
- ])
2026
- ], 64)) : (F(), T(x, { key: 0 }, [O(B(a), {
2027
- disabled: G.value,
2028
- onClick: Wt
2029
- }, {
2030
- default: H(() => [...n[14] ||= [D("取消", -1)]]),
2031
- _: 1
2032
- }, 8, ["disabled"]), O(B(a), {
2033
- type: "primary",
2034
- loading: G.value,
2035
- disabled: K.value || q.value || B(p).can(v.value === "create" ? "create" : "update") !== !0,
2036
- onClick: At
2037
- }, {
2038
- default: H(() => [D(z(G.value ? "保存中" : "保存"), 1)]),
2039
- _: 1
2040
- }, 8, ["loading", "disabled"])], 64))]),
2041
- status: H(() => [v.value === "view" && m.value ? (F(), C(B(f), {
2042
- key: 0,
2043
- enabled: m.value.enabled !== !1,
2044
- disabled: !$.value,
2045
- loading: ke.value,
2046
- "show-label": !1,
2047
- onChange: Mt
2048
- }, null, 8, [
2049
- "enabled",
2050
- "disabled",
2051
- "loading"
2052
- ])) : w("v-if", !0)]),
2053
- default: H(() => [!m.value && v.value === "view" ? (F(), C(B(s), {
2054
- key: 0,
2055
- description: "请选择标签,或新建根标签"
2056
- })) : K.value ? (F(), C(B(s), {
2057
- key: 1,
2058
- loading: "",
2059
- "loading-tip": "加载记录详情",
2060
- description: ""
2061
- })) : q.value ? (F(), C(B(s), {
2062
- key: 2,
2063
- description: "详情加载失败,请重新选择标签"
2064
- })) : _.value ? (F(), T(x, { key: 3 }, [v.value === "view" ? (F(), T(x, { key: 0 }, [O(B(t), {
2065
- record: _.value,
2066
- fields: b.value,
2067
- "exclude-field-names": ["enabled"]
2068
- }, null, 8, ["record", "fields"]), (F(!0), T(x, null, be(Ye.value, (e) => (F(), C(B(g), {
2069
- key: e.key,
2070
- title: e.title
2071
- }, {
2072
- default: H(() => [(F(), C(Se(e.component), { context: Rt(_.value) }, null, 8, ["context"]))]),
2073
- _: 2
2074
- }, 1032, ["title"]))), 128))], 64)) : (F(), C(B(y), {
2075
- key: 1,
2076
- class: "dynamic-form",
2077
- record: _.value,
2078
- fields: b.value,
2079
- "form-session-key": De.value,
2080
- "option-context": B(p),
2081
- "picker-configs": it.value,
2082
- "exclude-field-names": ["enabled"],
2083
- "onUpdate:field": Tt
2084
- }, null, 8, [
2085
- "record",
2086
- "fields",
2087
- "form-session-key",
2088
- "option-context",
2089
- "picker-configs"
2090
- ])), v.value === "create" ? w("v-if", !0) : (F(), C(B(oe), {
2091
- key: 2,
2092
- record: _.value,
2093
- "show-sort-order": ""
2094
- }, null, 8, ["record"]))], 64)) : w("v-if", !0)]),
2095
- _: 1
2096
- }, 8, ["title"])]),
2097
- _: 1
2098
- })) : (F(), C(B(ue), {
2099
- key: 2,
2100
- class: "dynamic-list",
2101
- context: B(p),
2102
- title: Me.value,
2103
- "selected-key": m.value?.id,
2104
- "reload-key": A.value,
2105
- "standard-crud-actions": !0,
2106
- "standard-crud-row-actions": !0,
2107
- "extra-actions": He.value,
2108
- "additional-columns": Ue.value,
2109
- "cell-components": We.value,
2110
- "extra-row-actions-of": Ke,
2111
- "action-column-width": Ve.value?.list?.actionColumnWidth,
2112
- "batch-actions": qe.value,
2113
- "ui-config-id": Re.value,
2114
- "query-template-id": ze.value,
2115
- ready: Ze.value,
2116
- "quick-search-placeholder": "搜索动态记录",
2117
- "empty-description": "暂无动态记录",
2118
- onLoaded: dt,
2119
- onSelect: ft,
2120
- onRowDblclick: n[10] ||= (e) => wt(e, "view"),
2121
- onAction: Nt,
2122
- onRowAction: Pt,
2123
- onBatchAction: n[11] ||= (e, t, n, r) => It(e, t, r)
2124
- }, null, 8, [
2125
- "context",
2126
- "title",
2127
- "selected-key",
2128
- "reload-key",
2129
- "extra-actions",
2130
- "additional-columns",
2131
- "cell-components",
2132
- "action-column-width",
2133
- "batch-actions",
2134
- "ui-config-id",
2135
- "query-template-id",
2136
- "ready"
2137
- ])),
2138
- P.value ? w("v-if", !0) : (F(), C(B(h), {
2139
- key: 3,
2140
- open: fe.value,
2141
- title: Y.value,
2142
- mode: v.value,
2143
- loading: K.value,
2144
- "load-failed": q.value,
2145
- "edit-available": !!m.value && !K.value && !q.value && v.value === "view",
2146
- "save-available": !K.value && !q.value && v.value !== "view",
2147
- saving: G.value,
2148
- onClose: Ut,
2149
- onRetry: Gt,
2150
- onEdit: n[12] ||= (e) => m.value && kt(m.value),
2151
- onSave: At
2152
- }, {
2153
- status: H(() => [v.value === "view" && m.value ? (F(), C(B(f), {
2154
- key: 0,
2155
- enabled: m.value.enabled !== !1,
2156
- disabled: !$.value,
2157
- loading: ke.value,
2158
- "show-label": !1,
2159
- onChange: Mt
2160
- }, null, 8, [
2161
- "enabled",
2162
- "disabled",
2163
- "loading"
2164
- ])) : w("v-if", !0)]),
2165
- viewOperation: H(() => [m.value?.id != null && Je.value.length > 0 ? (F(), C(B(u), {
2166
- key: 0,
2167
- context: B(p),
2168
- "record-id": String(m.value.id),
2169
- actions: Je.value,
2170
- onAction: Ft
2171
- }, null, 8, [
2172
- "context",
2173
- "record-id",
2174
- "actions"
2175
- ])) : w("v-if", !0)]),
2176
- view: H(() => [_.value ? (F(), T(x, { key: 0 }, [O(B(t), {
2177
- record: _.value,
2178
- fields: b.value,
2179
- "exclude-field-names": ["enabled"]
2180
- }, null, 8, ["record", "fields"]), (F(!0), T(x, null, be(Ye.value, (e) => (F(), C(B(g), {
2181
- key: e.key,
2182
- title: e.title
2183
- }, {
2184
- default: H(() => [(F(), C(Se(e.component), { context: Rt(_.value) }, null, 8, ["context"]))]),
2185
- _: 2
2186
- }, 1032, ["title"]))), 128))], 64)) : w("v-if", !0)]),
2187
- form: H(() => [_.value ? (F(), C(B(y), {
2188
- key: 0,
2189
- class: "dynamic-form",
2190
- record: _.value,
2191
- fields: b.value,
2192
- "form-session-key": De.value,
2193
- "option-context": B(p),
2194
- "picker-configs": it.value,
2195
- "exclude-field-names": ["enabled"],
2196
- "onUpdate:field": Tt
2197
- }, null, 8, [
2198
- "record",
2199
- "fields",
2200
- "form-session-key",
2201
- "option-context",
2202
- "picker-configs"
2203
- ])) : w("v-if", !0)]),
2204
- _: 1
2205
- }, 8, [
2206
- "open",
2207
- "title",
2208
- "mode",
2209
- "loading",
2210
- "load-failed",
2211
- "edit-available",
2212
- "save-available",
2213
- "saving"
2214
- ])),
2215
- Ae.value ? (F(), C(B(l), {
2216
- key: 4,
2217
- open: !0,
2218
- title: Ae.value.definition.title,
2219
- width: Ae.value.definition.width,
2220
- onClose: Bt
2221
- }, {
2222
- default: H(() => [(F(), C(Se(Ae.value.definition.component), { context: Ae.value.context }, null, 8, ["context"]))]),
2223
- _: 1
2224
- }, 8, ["title", "width"])) : w("v-if", !0)
2225
- ], 2)) : (F(), T("section", jn, [E("h2", null, z(Me.value), 1), E("p", null, z(Qe.value), 1)])) : (F(), T("section", Dn, [O(B(s), {
2226
- loading: "",
2227
- "loading-tip": "加载页面入口",
2228
- description: ""
2229
- })]));
2230
- }
2231
- }), [["__scopeId", "data-v-9e825177"]]), Nn = Symbol("workbench-navigation");
2232
- function Pn(e) {
2233
- I(Nn, e);
2234
- }
2235
- function Fn() {
2236
- return j(Nn);
2237
- }
2238
- //#endregion
2239
- //#region src/platform-workbench/workspaceViewHost.ts
2240
- var In = Symbol("workspace-view-host");
2241
- function Ln(e) {
2242
- I(In, e);
2243
- }
2244
- function Rn() {
2245
- return j(In, void 0);
2246
- }
2247
- //#endregion
2248
- //#region src/platform-workbench/workspaceViewContract.ts
2249
- function zn(e) {
2250
- return e;
2251
- }
2252
- //#endregion
2253
- //#region src/platform-workbench/workspaceViews.ts
2254
- var Bn = /* @__PURE__ */ new Map(), Vn = Un([]);
2255
- function Hn(e, t) {
2256
- Bn.set(e, t), Vn = Un([...Bn.values()].flat());
2257
- }
2258
- function Un(e) {
2259
- let t = /* @__PURE__ */ new Map();
2260
- for (let n of e) {
2261
- if (t.has(n.type)) throw Error(`重复的工作视图类型:${n.type}`);
2262
- t.set(n.type, n);
2263
- }
2264
- return {
2265
- definitions: [...t.values()],
2266
- resolve(e) {
2267
- let n = e.target.query ?? {}, r = String(n.workspaceView ?? ""), i = n.workspacePresentation;
2268
- if (i !== "drawer" && i !== "tab") return;
2269
- let a = t.get(r), o = a?.parse(n);
2270
- return a && o && a.presentations.includes(i) ? {
2271
- view: a,
2272
- input: o,
2273
- presentation: i
2274
- } : void 0;
2275
- }
2276
- };
2277
- }
2278
- function Wn(e, t, n = "tab", r = e.titleOf(t)) {
2279
- if (!e.presentations.includes(n)) throw Error(`工作视图 ${e.type} 不支持 ${n} 承载`);
2280
- let i = {
2281
- workspaceView: e.type,
2282
- workspacePresentation: n,
2283
- ...t
2284
- };
2285
- return {
2286
- pageType: "business-route",
2287
- openMode: "workbench-route",
2288
- hostType: "business-route-host",
2289
- title: r,
2290
- layout: e.layout,
2291
- target: {
2292
- route: e.route,
2293
- moduleAlias: e.moduleAlias,
2294
- query: i
2295
- },
2296
- params: i,
2297
- tabPolicy: { identity: "by-params" }
2298
- };
2299
- }
2300
- function Gn(e, t) {
2301
- let n = t.parse(e.target.query ?? {}), r = new Set([
2302
- "workspaceView",
2303
- "workspacePresentation",
2304
- ...Object.keys(n ?? {})
2305
- ]), i = n ? t.parentRouteQueryOf?.(n) ?? {} : {}, a = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => !r.has(e))), o = {
2306
- ...a(e.target.query ?? {}),
2307
- ...i
2308
- };
2309
- return {
2310
- ...e,
2311
- title: t.routeTitle ?? e.title,
2312
- target: {
2313
- ...e.target,
2314
- query: o
2315
- },
2316
- params: {
2317
- ...a(e.params ?? {}),
2318
- ...i
2319
- },
2320
- tabPolicy: { identity: "by-params" }
2321
- };
2322
- }
2323
- function Kn(e) {
2324
- return Vn.resolve(e);
2325
- }
2326
- //#endregion
2327
- //#region src/platform-workbench/WorkspaceViewOutlet.vue
2328
- var qn = /* @__PURE__ */ A({
2329
- __name: "WorkspaceViewOutlet",
2330
- props: { descriptor: {} },
2331
- setup(e) {
2332
- let t = e, n = S(() => Kn(t.descriptor)), r = S(() => Be(t.descriptor)), i = Fn();
2333
- return Ln({
2334
- get presentation() {
2335
- return n.value?.presentation ?? "tab";
2336
- },
2337
- setTitle(e) {
2338
- let n = e.trim();
2339
- !n || !i || t.descriptor.title === n || i.replacePage(r.value, {
2340
- ...t.descriptor,
2341
- title: n
2342
- });
2343
- },
2344
- dismiss() {
2345
- let e = n.value;
2346
- e && i && i.replacePage(r.value, Gn(t.descriptor, e.view));
2347
- }
2348
- }), (t, r) => n.value ? (F(), C(Se(n.value.view.component), M({ key: 0 }, n.value.input, { title: e.descriptor.title ?? n.value.view.titleOf(n.value.input) }), null, 16, ["title"])) : (F(), C(B(v), {
2349
- key: 1,
2350
- description: "无法恢复该工作视图"
2351
- }));
2352
- }
2353
- }), Jn = {
2354
- key: 1,
2355
- class: "page-host"
2356
- }, Yn = /*#__PURE__*/ c(/* @__PURE__ */ A({
2357
- name: "BusinessRouteHost",
2358
- __name: "BusinessRouteHost",
2359
- props: { descriptor: {} },
2360
- setup(e) {
2361
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey), r = S(() => Kn(t.descriptor));
2362
- return (t, i) => r.value ? (F(), C(B(d), {
2363
- key: 0,
2364
- "module-alias": r.value.view.moduleAlias
2365
- }, {
2366
- default: H(() => [O(qn, { descriptor: e.descriptor }, null, 8, ["descriptor"])]),
2367
- _: 1
2368
- }, 8, ["module-alias"])) : (F(), T("section", Jn, [E("header", null, [i[0] ||= E("span", { class: "host-badge" }, "业务页面", -1), E("h2", null, z(n.value), 1)]), E("p", null, z(e.descriptor.target.route ?? e.descriptor.target.routeName ?? e.descriptor.target.pageKey), 1)]));
2369
- }
2370
- }), [["__scopeId", "data-v-859e3801"]]), Xn = ["src", "title"], Zn = {
2371
- key: 1,
2372
- class: "page-host"
2373
- }, Qn = { class: "host-badge" }, $n = ["href"], er = /*#__PURE__*/ c(/* @__PURE__ */ A({
2374
- name: "ExternalPageHost",
2375
- __name: "ExternalPageHost",
2376
- props: { descriptor: {} },
2377
- setup(e) {
2378
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.url);
2379
- return (t, r) => e.descriptor.openMode === "iframe" ? (F(), T("iframe", {
2380
- key: 0,
2381
- class: "external-frame",
2382
- src: e.descriptor.target.url,
2383
- title: n.value
2384
- }, null, 8, Xn)) : (F(), T("section", Zn, [
2385
- E("span", Qn, z(e.descriptor.openMode), 1),
2386
- E("h2", null, z(n.value), 1),
2387
- E("a", {
2388
- class: "external-link",
2389
- href: e.descriptor.target.url,
2390
- target: "_blank",
2391
- rel: "noopener noreferrer"
2392
- }, " 打开页面 ", 8, $n)
2393
- ]));
2394
- }
2395
- }), [["__scopeId", "data-v-212f730c"]]), tr = {
2396
- key: 1,
2397
- class: "page-host"
2398
- }, nr = /*#__PURE__*/ c(/* @__PURE__ */ A({
2399
- name: "PlatformRouteHost",
2400
- __name: "PlatformRouteHost",
2401
- props: { descriptor: {} },
2402
- setup(e) {
2403
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey);
2404
- return (e, r) => {
2405
- let i = xe("RouterView");
2406
- return t.descriptor.target.route === "/" ? (F(), C(i, { key: 0 })) : (F(), T("section", tr, [E("header", null, [r[0] ||= E("span", { class: "host-badge" }, "平台页面", -1), E("h2", null, z(n.value), 1)]), E("p", null, z(t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey), 1)]));
2407
- };
2408
- }
2409
- }), [["__scopeId", "data-v-38e3167a"]]);
2410
- //#endregion
2411
- //#region src/platform-workbench/pageHostRegistry.ts
2412
- function rr(e) {
2413
- switch (e) {
2414
- case "platform-route-host": return "PlatformRouteHost";
2415
- case "business-route-host": return "BusinessRouteHost";
2416
- case "dynamic-module-host": return "DynamicModuleHost";
2417
- case "external-page-host": return "ExternalPageHost";
2418
- default: return ir(e);
2419
- }
2420
- }
2421
- function ir(e) {
2422
- throw Error(`Unsupported page host type: ${e}`);
2423
- }
2424
- //#endregion
2425
- //#region src/platform-workbench/WorkbenchOutlet.vue
2426
- var ar = /* @__PURE__ */ A({
2427
- name: "WorkbenchOutlet",
2428
- __name: "WorkbenchOutlet",
2429
- props: { descriptor: {} },
2430
- setup(e) {
2431
- let t = e, n = Fn();
2432
- Hn("module-page-enhancements", hn().map(r)), bn(n && {
2433
- openPage: n.openPage,
2434
- openWorkspaceTab(e, t) {
2435
- n.openPage(Wn(r(e), t));
2436
- }
2437
- });
2438
- function r(e) {
2439
- return {
2440
- ...e,
2441
- route: e.route ?? `/_workspace/${encodeURIComponent(e.type)}`,
2442
- presentations: ["tab"]
2443
- };
2444
- }
2445
- let i = S(() => t.descriptor ? rr(t.descriptor.hostType) : void 0), a = S(() => i.value === "PlatformRouteHost" ? t.descriptor : void 0), o = S(() => i.value === "BusinessRouteHost" ? t.descriptor : void 0), s = S(() => i.value === "DynamicModuleHost" ? t.descriptor : void 0), c = S(() => i.value === "ExternalPageHost" ? t.descriptor : void 0);
2446
- return (e, t) => a.value ? (F(), C(nr, {
2447
- key: 0,
2448
- descriptor: a.value
2449
- }, null, 8, ["descriptor"])) : o.value ? (F(), C(Yn, {
2450
- key: 1,
2451
- descriptor: o.value
2452
- }, null, 8, ["descriptor"])) : s.value ? (F(), C(B(Mn), {
2453
- key: 2,
2454
- descriptor: s.value
2455
- }, null, 8, ["descriptor"])) : c.value ? (F(), C(er, {
2456
- key: 3,
2457
- descriptor: c.value
2458
- }, null, 8, ["descriptor"])) : (F(), C(B(v), {
2459
- key: 4,
2460
- description: "暂无页面"
2461
- }));
2462
- }
2463
- }), or = zn({
2464
- type: "iam.user.detail",
2465
- route: "/iam/users",
2466
- moduleAlias: "iam.user",
2467
- component: k(() => import("./UserDetailWorkspaceView-BCSCLNSz.js")),
2468
- layout: "workspace",
2469
- routeTitle: "用户管理",
2470
- presentations: ["drawer", "tab"],
2471
- titleOf: () => "用户详情",
2472
- parse(e) {
2473
- let t = e.recordId;
2474
- if (!(typeof t != "string" || !t)) return { recordId: t };
2475
- }
2476
- }), sr = zn({
2477
- type: "iam.employee.detail",
2478
- route: "/iam/employees",
2479
- moduleAlias: "iam.employee",
2480
- component: k(() => import("./EmployeeDetailWorkspaceView-DHZ4arBj.js")),
2481
- layout: "workspace",
2482
- routeTitle: "职员管理",
2483
- presentations: ["drawer", "tab"],
2484
- titleOf: () => "职员详情",
2485
- parse(e) {
2486
- let t = e.recordId;
2487
- if (!(typeof t != "string" || !t)) return { recordId: t };
2488
- }
2489
- }), cr = new Set([
2490
- "platform",
2491
- "tenant",
2492
- "organization"
2493
- ]), lr = zn({
2494
- type: "iam.role.detail",
2495
- route: "/iam/roles",
2496
- moduleAlias: "iam.role",
2497
- component: k(() => import("./RoleDetailWorkspaceView-Dfdigf04.js")),
2498
- layout: "workspace",
2499
- routeTitle: "角色管理",
2500
- presentations: ["drawer", "tab"],
2501
- titleOf: () => "角色详情",
2502
- parentRouteQueryOf(e) {
2503
- return e.scopeKind === "platform" ? { scopeKind: e.scopeKind } : {
2504
- scopeKind: e.scopeKind,
2505
- scopeId: e.scopeId
2506
- };
2507
- },
2508
- parse(e) {
2509
- let t = e.recordId, n = e.scopeKind, r = e.scopeId;
2510
- if (!(typeof t != "string" || !t || typeof n != "string" || !cr.has(n) || (n === "platform" ? r !== void 0 : typeof r != "string" || !r))) return {
2511
- recordId: t,
2512
- scopeKind: n,
2513
- ...typeof r == "string" ? { scopeId: r } : {}
2514
- };
2515
- }
2516
- }), ur = zn({
2517
- type: "iam.system-user.detail",
2518
- route: "/iam/system-users",
2519
- moduleAlias: "iam.system_user",
2520
- component: k(() => import("./SystemUserDetailWorkspaceView-D-UPhCmD.js")),
2521
- layout: "workspace",
2522
- routeTitle: "系统账号管理",
2523
- presentations: ["drawer", "tab"],
2524
- titleOf: () => "系统账号详情",
2525
- parse(e) {
2526
- let t = e.recordId;
2527
- return typeof t == "string" && t ? { recordId: t } : void 0;
2528
- }
2529
- }), dr = zn({
2530
- type: "iam.role.authorization",
2531
- route: "/iam/role-authorization",
2532
- moduleAlias: "iam.role",
2533
- component: k(() => import("./RoleAuthorizationView-DJSWY3fu.js").then((e) => e.n)),
2534
- layout: "workspace",
2535
- routeTitle: "角色授权",
2536
- drawerProfile: "wide-work",
2537
- presentations: ["drawer", "tab"],
2538
- titleOf: () => "角色授权",
2539
- parse(e) {
2540
- let t = e.roleId;
2541
- return typeof t == "string" && t ? { roleId: t } : void 0;
2542
- }
2543
- }), fr = zn({
2544
- type: "platform.module.actions",
2545
- route: "/config/modules",
2546
- moduleAlias: "platform.module",
2547
- component: k(() => import("./ModuleActionManagementView-ByJzNkQs.js")),
2548
- layout: "workspace",
2549
- routeTitle: "模块管理",
2550
- presentations: ["tab"],
2551
- titleOf: (e) => `动作:${e.moduleTitle ?? e.moduleAlias}`,
2552
- parentRouteQueryOf: () => ({}),
2553
- parse(e) {
2554
- let t = e.moduleAlias, n = e.moduleTitle;
2555
- if (!(typeof t != "string" || !t)) return {
2556
- moduleAlias: t,
2557
- ...typeof n == "string" && n ? { moduleTitle: n } : {},
2558
- ...e.moduleKind === "static" || e.moduleKind === "dynamic" ? { moduleKind: e.moduleKind } : {}
2559
- };
2560
- }
2561
- }), pr = zn({
2562
- type: "platform.module.metadata-orchestration",
2563
- route: "/config/modules",
2564
- moduleAlias: "platform.module",
2565
- component: k(() => import("./MetadataOrchestrationView-BLxigKBh.js")),
2566
- layout: "workspace",
2567
- routeTitle: "模块管理",
2568
- presentations: ["tab"],
2569
- titleOf: (e) => `元数据:${e.moduleTitle ?? e.moduleAlias}`,
2570
- parentRouteQueryOf: () => ({}),
2571
- parse(e) {
2572
- let t = e.moduleAlias, n = e.moduleTitle;
2573
- if (!(typeof t != "string" || !t)) return {
2574
- moduleAlias: t,
2575
- ...typeof n == "string" && n ? { moduleTitle: n } : {}
2576
- };
2577
- }
2578
- });
2579
- //#endregion
2580
- //#region src/platform-admin-runtime/workspaceViews.ts
2581
- Hn("platform-admin-runtime", [
2582
- or,
2583
- sr,
2584
- lr,
2585
- ur,
2586
- dr,
2587
- fr,
2588
- pr
2589
- ]);
2590
- //#endregion
2591
- //#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
2592
- function mr(e) {
2593
- return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
2594
- }
2595
- function hr(e) {
2596
- let t = Fn();
2597
- return S(() => {
2598
- let n = Ce(e.input);
2599
- if (!(!n || !mr(Ce(e.eligibility)) || !t)) return {
2600
- title: "固定为页签",
2601
- promote: async () => {
2602
- if (await e.beforePromote?.(n) === !1) {
2603
- e.onPromotionRejected?.();
2604
- return;
2605
- }
2606
- let r = t.openPage(Wn(e.view, n, "tab", Ce(e.title)));
2607
- e.onPromoted?.(r);
2608
- }
2609
- };
2610
- });
2611
- }
2612
- //#endregion
2613
- //#region src/platform-admin-runtime/workspaceViewSessions.ts
2614
- var gr = /* @__PURE__ */ new Map(), _r = /* @__PURE__ */ new Map();
2615
- function vr(e, t) {
2616
- return `${e.type}:${Sr(t)}`;
2617
- }
2618
- async function yr(e, t, n) {
2619
- let r = vr(e, t), i = _r.get(r), a = i && [...i].at(-1);
2620
- return a ? await a(Cr(n)) ? "accepted" : "rejected" : (gr.set(r, Cr(n)), "accepted");
2621
- }
2622
- function br(e, t, n) {
2623
- let r = vr(e, t), i = _r.get(r) ?? /* @__PURE__ */ new Set();
2624
- return i.add(n), _r.set(r, i), () => {
2625
- i.delete(n), i.size === 0 && _r.delete(r);
2626
- };
2627
- }
2628
- function xr(e, t) {
2629
- let n = vr(e, t), r = gr.get(n);
2630
- return gr.delete(n), r;
2631
- }
2632
- function Sr(e) {
2633
- return Array.isArray(e) ? `[${e.map(Sr).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${Sr(t)}`).join(",")}}` : JSON.stringify(e);
2634
- }
2635
- function Cr(e) {
2636
- return JSON.parse(JSON.stringify(e));
2637
- }
2638
- //#endregion
2639
- export { vt as A, Fe as B, Fn as C, hn as D, dn as E, lt as F, Be as G, He as H, dt as I, Ue as K, Re as L, ot as M, st as N, cn as O, ut as P, ze as R, Pn as S, pn as T, Ve as U, Ie as V, Le as W, Gn as _, pr as a, Ln as b, ur as c, or as d, ar as f, Un as g, Wn as h, hr as i, ft as j, Ut as k, lr as l, Hn as m, br as n, fr as o, qn as p, xr as r, dr as s, yr as t, sr as u, Kn as v, wn as w, Rn as x, zn as y, Pe as z };