@ximatai/muyun-web-app 0.26.4 → 0.26.5

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 (25) hide show
  1. package/dist/{EmployeeDetailWorkspaceView-BySbWjCV.js → EmployeeDetailWorkspaceView-rm9ujeiQ.js} +1 -1
  2. package/dist/{EmployeeManagementView-DvmDPxzN.js → EmployeeManagementView-DyYMWQ64.js} +486 -486
  3. package/dist/{MetadataOrchestrationView-2JxJkFEC.js → MetadataOrchestrationView-DaPNQML7.js} +203 -203
  4. package/dist/ModuleActionManagementView-BFoPGqzC.js +597 -0
  5. package/dist/{RoleAuthorizationView-CK6Vfdup.js → RoleAuthorizationView-qQvn7M75.js} +68 -68
  6. package/dist/{RoleDetailWorkspaceView-BPZcZy-r.js → RoleDetailWorkspaceView-C-vaKeZM.js} +1 -1
  7. package/dist/{RoleManagementView-B7TzzVOm.js → RoleManagementView-C3nxfub2.js} +486 -486
  8. package/dist/{SystemUserDetailWorkspaceView-BtEDyU-k.js → SystemUserDetailWorkspaceView-FIbfff00.js} +1 -1
  9. package/dist/SystemUserManagementView-m6vwJDxI.js +761 -0
  10. package/dist/{UserDetailWorkspaceView-B6fGrnQ7.js → UserDetailWorkspaceView-M--ndn6x.js} +1 -1
  11. package/dist/{UserManagementView-4IJeDSQS.js → UserManagementView-MSXf4fno.js} +302 -302
  12. package/dist/index.css +1 -1
  13. package/dist/index.js +2237 -2237
  14. package/dist/{pageRealtime-CJriNmzP.js → pageRealtime-4LXXvVW7.js} +14 -14
  15. package/dist/{platform-components-CgMBopmF.js → platform-components-_3KlZZf5.js} +1166 -1168
  16. package/dist/types/consumer/index.d.ts +1 -2
  17. package/dist/types/dynamic-page-runtime/dynamicModuleDetailStateModel.d.ts +12 -0
  18. package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +14 -0
  19. package/dist/types/platform-components/recordFormFieldModel.d.ts +1 -1
  20. package/dist/{useUserSessionRows-DHsyr2Vy.js → useUserSessionRows-iAqK_cUy.js} +2 -2
  21. package/dist/workspaceViewSessions-DW0wbyQ_.js +1448 -0
  22. package/package.json +1 -1
  23. package/dist/ModuleActionManagementView-DRtYMXOK.js +0 -597
  24. package/dist/SystemUserManagementView-TKqj92zG.js +0 -761
  25. package/dist/workspaceViewSessions-BMbyO9O4.js +0 -1571
@@ -0,0 +1,1448 @@
1
+ import { $ as e, A as t, D as n, Q as r, St as i, X as a, et as o, g as s, gt as c, ht as l, it as u, m as d, nt as f, ot as p, ut as m, v as h } from "./platform-components-_3KlZZf5.js";
2
+ import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createVNode as S, defineAsyncComponent as C, defineComponent as w, inject as T, nextTick as E, normalizeClass as D, normalizeStyle as O, onMounted as k, openBlock as A, provide as j, ref as M, renderList as N, renderSlot as ee, resolveComponent as P, toDisplayString as F, toValue as I, unref as L, vShow as te, withCtx as R, withDirectives as z, withModifiers as B } from "vue";
3
+ //#region src/platform-workbench/WorkbenchMenuTree.vue?vue&type=script&setup=true&lang.ts
4
+ var V = ["disabled"], ne = { key: 0 }, H = {
5
+ key: 0,
6
+ class: "deep-children"
7
+ }, U = /*#__PURE__*/ l(/* @__PURE__ */ w({
8
+ name: "WorkbenchMenuTree",
9
+ __name: "WorkbenchMenuTree",
10
+ props: {
11
+ node: {},
12
+ level: {}
13
+ },
14
+ emits: ["selectMenu"],
15
+ setup(e, { emit: t }) {
16
+ let n = e, r = t, i = _(() => n.level ?? 0);
17
+ function a() {
18
+ n.node.target && r("selectMenu", n.node.record, n.node.target);
19
+ }
20
+ function o(e, t) {
21
+ r("selectMenu", e, t);
22
+ }
23
+ return (t, n) => {
24
+ let r = P("WorkbenchMenuTree", !0);
25
+ return A(), b("li", {
26
+ class: "deep-node",
27
+ style: O({ "--depth": i.value })
28
+ }, [x("button", {
29
+ class: D(["deep-node-button", {
30
+ navigable: e.node.navigable,
31
+ branch: e.node.hasChildren
32
+ }]),
33
+ type: "button",
34
+ disabled: !e.node.navigable && !e.node.hasChildren,
35
+ onClick: a
36
+ }, [x("span", null, F(e.node.record.title), 1), e.node.navigable ? (A(), b("small", ne, "打开")) : y("v-if", !0)], 10, V), e.node.hasChildren ? (A(), b("ul", H, [(A(!0), b(g, null, N(e.node.children, (e) => (A(), v(r, {
37
+ key: e.record.id,
38
+ node: e,
39
+ level: i.value + 1,
40
+ onSelectMenu: o
41
+ }, null, 8, ["node", "level"]))), 128))])) : y("v-if", !0)], 4);
42
+ };
43
+ }
44
+ }), [["__scopeId", "data-v-e4338872"]]), W = [], G = "_muyunMenuId", K = "_muyunTitle", q = "_muyunEntryParams", J = [
45
+ "entryParamsJson",
46
+ "menuId",
47
+ "title"
48
+ ];
49
+ function Y(e) {
50
+ if (e.enabled !== !1 && !(!e.openMode || !e.moduleAlias)) return e.externalUrl ? {
51
+ menuId: e.id,
52
+ menuType: "link",
53
+ openMode: e.openMode,
54
+ externalUrl: e.externalUrl,
55
+ moduleAlias: e.moduleAlias,
56
+ entryParamsJson: e.entryParamsJson
57
+ } : e.route ? {
58
+ menuId: e.id,
59
+ menuType: "route",
60
+ openMode: e.openMode,
61
+ route: e.route,
62
+ moduleAlias: e.moduleAlias,
63
+ entryParamsJson: e.entryParamsJson
64
+ } : {
65
+ menuId: e.id,
66
+ menuType: "module",
67
+ openMode: e.openMode,
68
+ moduleAlias: e.moduleAlias,
69
+ pageMode: e.pageMode,
70
+ defaultUiConfigId: e.defaultUiConfigId,
71
+ defaultQueryTemplateId: e.defaultQueryTemplateId,
72
+ entryParamsJson: e.entryParamsJson
73
+ };
74
+ }
75
+ function X(e) {
76
+ return e.openMode === "tab";
77
+ }
78
+ function re(e) {
79
+ return e.openMode === "window";
80
+ }
81
+ function ie(e, t = {}) {
82
+ if (e.menuType === "module") {
83
+ let n = t.businessModuleRoutes?.[e.moduleAlias];
84
+ return n ? {
85
+ pageType: "business-route",
86
+ openMode: "workbench-route",
87
+ hostType: "business-route-host",
88
+ title: t.title,
89
+ layout: pe({ route: n }, t),
90
+ menuId: e.menuId,
91
+ target: {
92
+ route: n,
93
+ moduleAlias: e.moduleAlias
94
+ },
95
+ entryParamsJson: e.entryParamsJson,
96
+ tabPolicy: {
97
+ identity: "by-menu",
98
+ closable: !0,
99
+ cacheable: !0
100
+ }
101
+ } : {
102
+ pageType: "dynamic-module",
103
+ openMode: "dynamic-runner",
104
+ hostType: "dynamic-module-host",
105
+ title: t.title,
106
+ menuId: e.menuId,
107
+ target: {
108
+ moduleAlias: e.moduleAlias,
109
+ pageMode: e.pageMode,
110
+ defaultUiConfigId: e.defaultUiConfigId,
111
+ defaultQueryTemplateId: e.defaultQueryTemplateId
112
+ },
113
+ params: e.query,
114
+ entryParamsJson: e.entryParamsJson,
115
+ tabPolicy: {
116
+ identity: "by-menu",
117
+ closable: !0,
118
+ cacheable: !0
119
+ }
120
+ };
121
+ }
122
+ if (e.menuType === "route") {
123
+ let n = de(e.route, e.query, e.moduleAlias), r = fe(n, t) ? "business-route" : "platform-route", i = {
124
+ openMode: "workbench-route",
125
+ title: t.title,
126
+ menuId: e.menuId,
127
+ target: n,
128
+ params: e.query,
129
+ entryParamsJson: e.entryParamsJson,
130
+ tabPolicy: {
131
+ identity: e.menuId ? "by-menu" : "by-target",
132
+ closable: !0,
133
+ cacheable: !0
134
+ }
135
+ };
136
+ return r === "business-route" ? {
137
+ ...i,
138
+ pageType: r,
139
+ hostType: "business-route-host",
140
+ layout: pe(n, t)
141
+ } : {
142
+ ...i,
143
+ pageType: r,
144
+ hostType: "platform-route-host"
145
+ };
146
+ }
147
+ return e.openMode === "tab" ? {
148
+ pageType: "remote-url",
149
+ openMode: "iframe",
150
+ hostType: "external-page-host",
151
+ title: t.title,
152
+ menuId: e.menuId,
153
+ target: {
154
+ url: e.externalUrl,
155
+ moduleAlias: e.moduleAlias
156
+ },
157
+ entryParamsJson: e.entryParamsJson,
158
+ tabPolicy: {
159
+ identity: e.menuId ? "by-menu" : "by-target",
160
+ closable: !0
161
+ }
162
+ } : {
163
+ pageType: "external-link",
164
+ openMode: "new-window",
165
+ hostType: "external-page-host",
166
+ title: t.title,
167
+ menuId: e.menuId,
168
+ target: {
169
+ url: e.externalUrl,
170
+ moduleAlias: e.moduleAlias
171
+ },
172
+ entryParamsJson: e.entryParamsJson,
173
+ tabPolicy: {
174
+ identity: e.menuId ? "by-menu" : "by-target",
175
+ closable: !0
176
+ }
177
+ };
178
+ }
179
+ function ae(e, t, n = {}) {
180
+ if (!X(t)) throw Error(`WINDOW menu target cannot be opened as a workbench tab: ${t.menuId}`);
181
+ let r = ie(t, {
182
+ ...n,
183
+ title: n.title ?? e.title
184
+ });
185
+ return {
186
+ key: se(r),
187
+ title: e.title,
188
+ target: t,
189
+ pageDescriptor: r,
190
+ restoreState: r.restoreState,
191
+ closable: !0
192
+ };
193
+ }
194
+ function oe(e) {
195
+ for (let t of e) {
196
+ let e = Y(t.record);
197
+ if (e && X(e)) return t.record;
198
+ let n = oe(t.children);
199
+ if (n) return n;
200
+ }
201
+ }
202
+ function se(e) {
203
+ 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}:${he(e)}`}:${_e(e.params)}` : `${e.pageType}:${he(e)}`;
204
+ }
205
+ function ce(e) {
206
+ if (e.pageType === "platform-route" || e.pageType === "business-route") return e.target.route ? ge(e.target.route, {
207
+ ...e.target.query ?? e.params,
208
+ [q]: e.entryParamsJson,
209
+ [G]: e.menuId,
210
+ [K]: e.title
211
+ }) : ge("/platform/workspace", {
212
+ ...e.target.query ?? e.params ?? {},
213
+ pageType: e.pageType,
214
+ routeName: e.target.routeName,
215
+ pageKey: e.target.pageKey,
216
+ [G]: e.menuId,
217
+ [K]: e.title
218
+ });
219
+ if (e.pageType === "dynamic-module") {
220
+ let t = e.target.pageMode?.toLowerCase() ?? "list";
221
+ return ge(`/platform/dynamic/${e.target.moduleAlias}/${t}`, {
222
+ ...e.params,
223
+ [q]: e.entryParamsJson,
224
+ uiConfigId: e.target.defaultUiConfigId,
225
+ queryTemplateId: e.target.defaultQueryTemplateId,
226
+ [G]: e.menuId,
227
+ [K]: e.title
228
+ });
229
+ }
230
+ return e.pageType === "remote-url" || e.pageType === "external-link" ? ge("/platform/external", {
231
+ url: e.target.url,
232
+ mode: e.openMode,
233
+ [G]: e.menuId,
234
+ [K]: e.title
235
+ }) : Ee(e);
236
+ }
237
+ function le(e, t = {}) {
238
+ let n = xe(e), r = n.pathname, i = Ce(n.searchParams);
239
+ if (r === "/platform/dynamic") throw Error(`Invalid dynamic module URL: ${e}`);
240
+ if (r.startsWith("/platform/dynamic/")) {
241
+ let [, , , n, a] = r.split("/");
242
+ if (!n) throw Error(`Invalid dynamic module URL: ${e}`);
243
+ let o = Se(i, [
244
+ ...J,
245
+ q,
246
+ G,
247
+ K,
248
+ "queryTemplateId",
249
+ "uiConfigId"
250
+ ]), s = Q(i, G, "menuId");
251
+ return {
252
+ pageType: "dynamic-module",
253
+ openMode: "dynamic-runner",
254
+ hostType: "dynamic-module-host",
255
+ title: Q(i, K, "title") ?? t.title,
256
+ menuId: s,
257
+ target: {
258
+ moduleAlias: decodeURIComponent(n ?? ""),
259
+ pageMode: Te(a),
260
+ defaultUiConfigId: Z(i.uiConfigId),
261
+ defaultQueryTemplateId: Z(i.queryTemplateId)
262
+ },
263
+ params: o,
264
+ entryParamsJson: Q(i, q, "entryParamsJson"),
265
+ tabPolicy: s ? {
266
+ identity: "by-menu",
267
+ closable: !0,
268
+ cacheable: !0
269
+ } : {
270
+ identity: "by-target",
271
+ closable: !0,
272
+ cacheable: !0
273
+ }
274
+ };
275
+ }
276
+ if (r === "/platform/external") {
277
+ let n = Z(i.url) ?? "";
278
+ if (!n) throw Error(`Invalid external page URL: ${e}`);
279
+ let r = Z(i.mode) === "new-window" ? "new-window" : "iframe", a = Q(i, G, "menuId"), o = a ? {
280
+ identity: "by-menu",
281
+ closable: !0
282
+ } : {
283
+ identity: "by-target",
284
+ closable: !0
285
+ };
286
+ return r === "iframe" ? {
287
+ pageType: "remote-url",
288
+ openMode: r,
289
+ hostType: "external-page-host",
290
+ title: Q(i, K, "title") ?? t.title,
291
+ menuId: a,
292
+ target: { url: n },
293
+ tabPolicy: o
294
+ } : {
295
+ pageType: "external-link",
296
+ openMode: r,
297
+ hostType: "external-page-host",
298
+ title: Q(i, K, "title") ?? t.title,
299
+ menuId: a,
300
+ target: { url: n },
301
+ tabPolicy: o
302
+ };
303
+ }
304
+ if (r === "/platform/workspace" && !i.routeName && !i.pageKey) throw Error(`Invalid workspace URL: ${e}`);
305
+ if (r === "/platform/workspace" && (i.routeName || i.pageKey)) {
306
+ let e = {
307
+ routeName: Z(i.routeName),
308
+ pageKey: Z(i.pageKey),
309
+ query: Se(i, [
310
+ ...J,
311
+ G,
312
+ K,
313
+ "pageType",
314
+ "routeName",
315
+ "pageKey"
316
+ ])
317
+ }, n = Z(i.pageType) === "business-route" ? "business-route" : "platform-route", r = Q(i, G, "menuId"), a = {
318
+ openMode: "workbench-route",
319
+ title: Q(i, K, "title") ?? t.title,
320
+ menuId: r,
321
+ target: e,
322
+ params: e.query,
323
+ tabPolicy: r ? {
324
+ identity: "by-menu",
325
+ closable: !0,
326
+ cacheable: !0
327
+ } : {
328
+ identity: "by-target",
329
+ closable: !0,
330
+ cacheable: !0
331
+ }
332
+ };
333
+ return n === "business-route" ? {
334
+ ...a,
335
+ pageType: "business-route",
336
+ hostType: "business-route-host",
337
+ layout: pe(e, t)
338
+ } : {
339
+ ...a,
340
+ pageType: "platform-route",
341
+ hostType: "platform-route-host"
342
+ };
343
+ }
344
+ let a = me(r, t) ? "business-route" : "platform-route", o = Q(i, G), s = Se(i, [
345
+ q,
346
+ G,
347
+ K
348
+ ]), c = {
349
+ openMode: "workbench-route",
350
+ title: Q(i, K) ?? t.title,
351
+ menuId: o,
352
+ target: {
353
+ route: r,
354
+ query: s
355
+ },
356
+ params: s,
357
+ entryParamsJson: Q(i, q),
358
+ tabPolicy: o ? {
359
+ identity: "by-menu",
360
+ closable: !0,
361
+ cacheable: !0
362
+ } : {
363
+ identity: "by-target",
364
+ closable: !0,
365
+ cacheable: !0
366
+ }
367
+ };
368
+ return a === "business-route" ? {
369
+ ...c,
370
+ pageType: "business-route",
371
+ hostType: "business-route-host",
372
+ layout: pe(c.target, t)
373
+ } : {
374
+ ...c,
375
+ pageType: "platform-route",
376
+ hostType: "platform-route-host"
377
+ };
378
+ }
379
+ function ue(e, t = {}) {
380
+ try {
381
+ return le(e, t);
382
+ } catch {
383
+ return;
384
+ }
385
+ }
386
+ function de(e, t, n) {
387
+ return e.startsWith("/") ? {
388
+ route: e,
389
+ moduleAlias: n,
390
+ query: t
391
+ } : e.includes(".") ? {
392
+ routeName: e,
393
+ moduleAlias: n,
394
+ query: t
395
+ } : {
396
+ pageKey: e,
397
+ moduleAlias: n,
398
+ query: t
399
+ };
400
+ }
401
+ function fe(e, t) {
402
+ return (e.route ? me(e.route, t) : !1) || (e.routeName ? t.businessRouteNames?.includes(e.routeName) === !0 : !1) || (e.pageKey ? t.businessPageKeys?.includes(e.pageKey) === !0 : !1);
403
+ }
404
+ function pe(e, t) {
405
+ return e.route ? t.businessRouteLayouts?.[e.route] : void 0;
406
+ }
407
+ function me(e, t) {
408
+ let n = be(e, t.businessRoutePrefixes ?? W);
409
+ if (n < 0) return !1;
410
+ let r = be(e, t.platformRoutePrefixes ?? we);
411
+ return r < 0 || n > r;
412
+ }
413
+ function he(e) {
414
+ 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;
415
+ }
416
+ function ge(e, t) {
417
+ let n = t ? _e(t) : "";
418
+ return n ? `${e}${e.includes("?") ? "&" : "?"}${n}` : e;
419
+ }
420
+ function _e(e) {
421
+ let t = new URLSearchParams();
422
+ for (let n of Object.keys(e).sort()) {
423
+ let r = e[n];
424
+ if (Array.isArray(r)) {
425
+ for (let e of r) ve(t, n, e);
426
+ continue;
427
+ }
428
+ ve(t, n, r);
429
+ }
430
+ return t.toString();
431
+ }
432
+ function ve(e, t, n) {
433
+ n != null && e.append(t, String(n));
434
+ }
435
+ function ye(e, t) {
436
+ let n = t.endsWith("/") ? t.slice(0, -1) : t;
437
+ return e === n || e.startsWith(`${n}/`);
438
+ }
439
+ function be(e, t) {
440
+ let n = -1;
441
+ for (let r of t) {
442
+ let t = r.endsWith("/") ? r.slice(0, -1) : r;
443
+ ye(e, t) && (n = Math.max(n, t.length));
444
+ }
445
+ return n;
446
+ }
447
+ function xe(e) {
448
+ return new URL(e, "http://muyun.local");
449
+ }
450
+ function Se(e, t) {
451
+ let n = {};
452
+ for (let r of Object.keys(e)) t.includes(r) || (n[r] = e[r]);
453
+ return Object.keys(n).length > 0 ? n : void 0;
454
+ }
455
+ function Ce(e) {
456
+ let t = {};
457
+ for (let n of e.keys()) {
458
+ let r = e.getAll(n);
459
+ t[n] = r.length > 1 ? r : r[0];
460
+ }
461
+ return t;
462
+ }
463
+ function Z(e) {
464
+ return Array.isArray(e) ? e[0] === null || e[0] === void 0 ? void 0 : String(e[0]) : e == null ? void 0 : String(e);
465
+ }
466
+ function Q(e, t, n) {
467
+ return Z(e[t]) ?? (n ? Z(e[n]) : void 0);
468
+ }
469
+ var we = ["/platform"];
470
+ function Te(e) {
471
+ let t = e?.toUpperCase();
472
+ return t === "LIST" || t === "FORM" || t === "DETAIL" ? t : void 0;
473
+ }
474
+ function Ee(e) {
475
+ throw Error(`Unsupported page descriptor: ${JSON.stringify(e)}`);
476
+ }
477
+ //#endregion
478
+ //#region src/platform-workbench/menuTreeModel.ts
479
+ function De(e) {
480
+ return e.map(Ie);
481
+ }
482
+ function Oe(e, t) {
483
+ let n = t.trim().toLowerCase();
484
+ return n ? e.map((e) => {
485
+ let t = Oe(e.children, n);
486
+ return Le(e, n) || t.length > 0 ? {
487
+ ...e,
488
+ children: t
489
+ } : void 0;
490
+ }).filter((e) => !!e) : e;
491
+ }
492
+ function ke(e, t, n = []) {
493
+ for (let r of e) {
494
+ let e = [...n, r];
495
+ if (r.record.id === t) return e;
496
+ let i = ke(r.children, t, e);
497
+ if (i.length > 0) return i;
498
+ }
499
+ return [];
500
+ }
501
+ function Ae(e, t) {
502
+ for (let n of e) {
503
+ if (n.record.id === t) return n;
504
+ let e = Ae(n.children, t);
505
+ if (e) return e;
506
+ }
507
+ }
508
+ function je(e) {
509
+ for (let t of e.children) for (let e of t.children) if (e.hasChildren) return e.record.id;
510
+ }
511
+ function Me(e, t, n = 3) {
512
+ let r = t ? Ae(e.children, t) : void 0, i = e.children;
513
+ return {
514
+ root: e,
515
+ groups: i,
516
+ columns: Ne(i, n),
517
+ activeDeepRoot: r?.hasChildren ? r : void 0
518
+ };
519
+ }
520
+ function Ne(e, t) {
521
+ if (e.length === 0) return [];
522
+ let n = Math.max(1, Math.min(Math.floor(t), e.length)), r = Array.from({ length: n }, () => []), i = e.reduce((e, t) => e + Pe(t), 0) / n, a = 0, o = 0;
523
+ for (let t = 0; t < e.length; t += 1) {
524
+ let s = e[t], c = Pe(s), l = e.length - t, u = n - a;
525
+ r[a].length > 0 && a < n - 1 && (l <= u || o + c > i) && (a += 1, o = 0), r[a].push(s), o += c;
526
+ }
527
+ return r;
528
+ }
529
+ function Pe(e) {
530
+ let t = Fe(e.record.title), n = e.children.reduce((e, t) => {
531
+ let n = t.hasChildren ? .7 + t.children.length * .25 : 0;
532
+ return e + 1 + n + Fe(t.record.title) * .4;
533
+ }, 0);
534
+ return 1.25 + t + n;
535
+ }
536
+ function Fe(e) {
537
+ return Math.max(0, Math.ceil(e.length / 10) - 1) * .35;
538
+ }
539
+ function Ie(e) {
540
+ let t = De(e.children), n = Y(e.record);
541
+ return {
542
+ record: e.record,
543
+ children: t,
544
+ target: n,
545
+ navigable: !!n,
546
+ hasChildren: t.length > 0
547
+ };
548
+ }
549
+ function Le(e, t) {
550
+ return e.record.title.toLowerCase().includes(t) || e.record.moduleAlias?.toLowerCase().includes(t) === !0 || e.record.route?.toLowerCase().includes(t) === !0;
551
+ }
552
+ //#endregion
553
+ //#region src/platform-workbench/realtimeStatus.ts
554
+ function Re(e) {
555
+ if (e === "connected") return {
556
+ label: "实时连接正常",
557
+ title: "与平台实时服务连接正常",
558
+ tone: e
559
+ };
560
+ if (e === "connecting") return {
561
+ label: "实时连接中",
562
+ title: "正在连接平台实时服务",
563
+ tone: e
564
+ };
565
+ if (e === "disconnected") return {
566
+ label: "实时连接已断开",
567
+ title: "与平台实时服务的连接已断开,正在等待恢复",
568
+ tone: e
569
+ };
570
+ }
571
+ //#endregion
572
+ //#region src/platform-workbench/WorkbenchMenu.vue?vue&type=script&setup=true&lang.ts
573
+ var ze = { class: "menu-sidebar" }, Be = { class: "brand-area" }, Ve = { class: "brand-mark" }, He = { class: "brand-copy" }, Ue = { class: "menu-search" }, We = {
574
+ class: "root-menu",
575
+ "aria-label": "主导航"
576
+ }, Ge = {
577
+ key: 0,
578
+ class: "root-menu-list"
579
+ }, Ke = [
580
+ "aria-expanded",
581
+ "aria-controls",
582
+ "onMouseenter",
583
+ "onFocus",
584
+ "onClick"
585
+ ], qe = ["title"], Je = {
586
+ key: 0,
587
+ class: "mega-outline",
588
+ "aria-hidden": "true"
589
+ }, Ye = ["d"], Xe = { class: "mega-groups" }, Ze = ["disabled", "onClick"], Qe = { class: "mega-entry-list" }, $e = [
590
+ "disabled",
591
+ "onMouseenter",
592
+ "onFocus",
593
+ "onClick"
594
+ ], et = {
595
+ key: 0,
596
+ class: "mega-deep-panel"
597
+ }, tt = { class: "mega-deep-tree" }, nt = 168, rt = 18, it = 28, at = 280, ot = 1040, st = 24, ct = 620, lt = /*#__PURE__*/ l(/* @__PURE__ */ w({
598
+ name: "WorkbenchMenu",
599
+ __name: "WorkbenchMenu",
600
+ props: {
601
+ menus: {},
602
+ selectedMenuId: { default: void 0 },
603
+ tenantLabel: { default: "系统工作区" },
604
+ searchPlaceholder: { default: "搜索菜单、模块或路由" },
605
+ realtimeStatus: { default: "unavailable" }
606
+ },
607
+ emits: ["selectMenu", "invalidMenu"],
608
+ setup(e, { emit: t }) {
609
+ let n = e, r = t, i = M(), a = M(), o = M(""), s = M(), l = M(), d = M(8), f = M(0), p = M(0), h = M(0), C = M(34), w = M(0), T = M(0), k = M(820), j = M(3), ee = _(() => De(n.menus)), P = _(() => Oe(ee.value, o.value)), I = _(() => n.selectedMenuId ? ke(ee.value, n.selectedMenuId) : []), te = _(() => I.value[0]?.record.id), R = _(() => Re(n.realtimeStatus)), z = _(() => s.value ? Ae(P.value, s.value) : void 0), B = _(() => z.value ? Me(z.value, l.value, j.value) : void 0), V = _(() => B.value?.activeDeepRoot), ne = _(() => B.value?.columns.length ?? 1), H = _(() => {
610
+ let e = p.value, t = h.value, n = t + C.value, r = f.value, i = d.value, a = r + w.value, o = i + T.value;
611
+ return [
612
+ `M ${r} ${i}`,
613
+ `H ${a - 8}`,
614
+ `Q ${a} ${i} ${a} ${i + 8}`,
615
+ `V ${o - 8}`,
616
+ `Q ${a} ${o} ${a - 8} ${o}`,
617
+ `H ${r}`,
618
+ `V ${n}`,
619
+ `H ${e + 6}`,
620
+ `Q ${e} ${n} ${e} ${n - 6}`,
621
+ `V ${t + 6}`,
622
+ `Q ${e} ${t} ${e + 6} ${t}`,
623
+ `H ${r}`,
624
+ `V ${i}`
625
+ ].join(" ");
626
+ });
627
+ function W(e) {
628
+ e.target ? r("selectMenu", e.record, e.target) : r("invalidMenu", e.record);
629
+ }
630
+ function G(e, t) {
631
+ r("selectMenu", e, t);
632
+ }
633
+ function K(e, t) {
634
+ s.value = e.record.id, l.value = je(e), Y(t?.currentTarget), E(X);
635
+ }
636
+ function q() {
637
+ s.value = void 0, l.value = void 0;
638
+ }
639
+ function J(e) {
640
+ e.key === "Escape" && q();
641
+ }
642
+ function Y(e) {
643
+ if (!(e instanceof HTMLElement)) return;
644
+ let t = e.getBoundingClientRect(), n = i.value?.getBoundingClientRect(), r = n?.top ?? 0, a = Math.min(window.innerHeight - 16, ct), o = t.top, s = Math.max(8, window.innerHeight - a - 8), c = Math.min(Math.max(o, 8), s), l = n?.left ?? 0;
645
+ d.value = Math.round(c - r), f.value = Math.round(t.right - l), p.value = Math.round(t.left - l), h.value = Math.round(t.top - r), C.value = Math.round(t.height), T.value = a, re();
646
+ }
647
+ function X() {
648
+ let e = a.value?.getBoundingClientRect();
649
+ e && (w.value = Math.round(e.width), T.value = Math.round(e.height));
650
+ }
651
+ function re() {
652
+ let e = ie(), t = l.value ? at : 0, n = Math.max(0, Math.min(e, ot) - t), r = z.value?.children.length ?? 0, i = Math.max(1, Math.min(4, r || 1, Math.floor((n - it + rt) / 186) || 1)), a = i * nt + Math.max(0, i - 1) * rt + it, o = Math.min(e, ot, a + t);
653
+ j.value = i, k.value = Math.max(280, o), w.value = k.value;
654
+ }
655
+ function ie() {
656
+ let e = (i.value?.getBoundingClientRect().left ?? 0) + f.value;
657
+ return Math.max(280, window.innerWidth - e - st);
658
+ }
659
+ function ae(e) {
660
+ l.value = e.hasChildren ? e.record.id : void 0, E(() => {
661
+ re(), X();
662
+ });
663
+ }
664
+ function oe(e) {
665
+ return te.value === e.record.id;
666
+ }
667
+ return (t, n) => (A(), b("div", {
668
+ ref_key: "menuShell",
669
+ ref: i,
670
+ class: D(["workbench-menu", { "mega-open": z.value }]),
671
+ onMouseleave: q,
672
+ onKeydown: J
673
+ }, [
674
+ x("aside", ze, [
675
+ x("div", Be, [x("div", Ve, [S(L(c), { name: "app" })]), x("div", He, [n[1] ||= x("strong", null, "MuYun", -1), x("span", null, F(e.tenantLabel), 1)])]),
676
+ x("div", Ue, [S(L(c), { name: "search" }), S(L(m), {
677
+ value: o.value,
678
+ "onUpdate:value": n[0] ||= (e) => o.value = e,
679
+ type: "search",
680
+ "allow-clear": "",
681
+ placeholder: e.searchPlaceholder,
682
+ "aria-label": "搜索菜单"
683
+ }, null, 8, ["value", "placeholder"])]),
684
+ x("nav", We, [P.value.length > 0 ? (A(), b("div", Ge, [(A(!0), b(g, null, N(P.value, (e) => (A(), b("button", {
685
+ key: e.record.id,
686
+ class: D(["root-menu-item", {
687
+ active: z.value?.record.id === e.record.id,
688
+ selected: oe(e),
689
+ navigable: e.navigable
690
+ }]),
691
+ type: "button",
692
+ "aria-expanded": z.value?.record.id === e.record.id,
693
+ "aria-controls": z.value?.record.id === e.record.id ? "workbench-mega-panel" : void 0,
694
+ onMouseenter: (t) => K(e, t),
695
+ onFocus: (t) => K(e, t),
696
+ onClick: (t) => e.navigable && W(e)
697
+ }, [x("span", null, F(e.record.title), 1)], 42, Ke))), 128))])) : (A(), v(L(u), {
698
+ key: 1,
699
+ description: "暂无菜单"
700
+ }))]),
701
+ R.value ? (A(), b("div", {
702
+ key: 0,
703
+ class: D(["sidebar-footer", `realtime-${R.value.tone}`]),
704
+ title: R.value.title,
705
+ role: "status"
706
+ }, [n[2] ||= x("div", { class: "status-dot" }, null, -1), x("span", null, F(R.value.label), 1)], 10, qe)) : y("v-if", !0)
707
+ ]),
708
+ z.value ? (A(), b("svg", Je, [x("path", { d: H.value }, null, 8, Ye)])) : y("v-if", !0),
709
+ z.value ? (A(), b("section", {
710
+ key: 1,
711
+ id: "workbench-mega-panel",
712
+ ref_key: "megaPanel",
713
+ ref: a,
714
+ class: "mega-panel",
715
+ style: O({
716
+ "--mega-panel-top": `${d.value}px`,
717
+ "--mega-panel-left": `${f.value}px`,
718
+ "--mega-panel-width": `${k.value}px`,
719
+ "--mega-column-count": ne.value
720
+ })
721
+ }, [x("div", { class: D(["mega-body", { "has-deep": V.value }]) }, [x("div", Xe, [(A(!0), b(g, null, N(B.value?.columns ?? [], (e, t) => (A(), b("div", {
722
+ key: `mega-column-${t}`,
723
+ class: "mega-column"
724
+ }, [(A(!0), b(g, null, N(e, (e) => (A(), b("section", {
725
+ key: e.record.id,
726
+ class: "mega-group"
727
+ }, [x("button", {
728
+ class: D(["mega-group-title", { navigable: e.navigable }]),
729
+ type: "button",
730
+ disabled: !e.navigable,
731
+ onClick: (t) => W(e)
732
+ }, [x("span", null, F(e.record.title), 1)], 10, Ze), x("div", Qe, [(A(!0), b(g, null, N(e.children, (e) => (A(), b("button", {
733
+ key: e.record.id,
734
+ class: D(["mega-entry", {
735
+ navigable: e.navigable,
736
+ active: V.value?.record.id === e.record.id,
737
+ branch: e.hasChildren
738
+ }]),
739
+ type: "button",
740
+ disabled: !e.navigable && !e.hasChildren,
741
+ onMouseenter: (t) => ae(e),
742
+ onFocus: (t) => ae(e),
743
+ onClick: (t) => e.navigable && W(e)
744
+ }, [x("span", null, F(e.record.title), 1)], 42, $e))), 128))])]))), 128))]))), 128))]), V.value ? (A(), b("aside", et, [x("header", null, [n[3] ||= x("span", null, "深层导航", -1), x("strong", null, F(V.value.record.title), 1)]), x("ul", tt, [S(U, {
745
+ node: V.value,
746
+ onSelectMenu: G
747
+ }, null, 8, ["node"])])])) : y("v-if", !0)], 2)], 4)) : y("v-if", !0)
748
+ ], 34));
749
+ }
750
+ }), [["__scopeId", "data-v-5a8e4d51"]]), ut = { class: "workbench" }, dt = { class: "app-main" }, ft = { class: "app-topbar" }, pt = { class: "topbar-title" }, mt = {
751
+ class: "topbar-actions",
752
+ "aria-label": "全局工具"
753
+ }, ht = {
754
+ class: "icon-button wide",
755
+ type: "button",
756
+ "aria-label": "搜索"
757
+ }, gt = {
758
+ class: "icon-button",
759
+ type: "button",
760
+ "aria-label": "刷新"
761
+ }, _t = {
762
+ class: "icon-button",
763
+ type: "button",
764
+ "aria-label": "通知"
765
+ }, vt = {
766
+ class: "icon-button",
767
+ type: "button",
768
+ "aria-label": "设置"
769
+ }, yt = ["onClick"], bt = { class: "avatar" }, xt = { class: "user-meta" }, St = { class: "tab-strip" }, Ct = {
770
+ key: 1,
771
+ class: "empty-tabs"
772
+ }, wt = { class: "app-content" }, Tt = /*#__PURE__*/ l(/* @__PURE__ */ w({
773
+ name: "Workbench",
774
+ __name: "Workbench",
775
+ props: {
776
+ startup: { default: void 0 },
777
+ loading: {
778
+ type: Boolean,
779
+ default: !1
780
+ },
781
+ error: { default: void 0 },
782
+ activeTabKey: { default: void 0 },
783
+ realtimeStatus: { default: "unavailable" }
784
+ },
785
+ emits: [
786
+ "selectMenu",
787
+ "invalidMenu",
788
+ "changeTab",
789
+ "closeTab",
790
+ "update:activeTabKey",
791
+ "userCommand"
792
+ ],
793
+ setup(t, { emit: n }) {
794
+ let i = t, a = n, s = _(() => i.startup?.tabs ?? []), l = _(() => s.value.map(P)), u = _(() => i.activeTabKey ?? i.startup?.activeTabKey ?? l.value[0]?.key ?? ""), d = _(() => s.value.find((e) => e.key === u.value)), m = _(() => j(d.value)), h = _(() => i.startup?.session.currentUser), C = _(() => h.value?.username ?? h.value?.userId ?? "未登录"), w = _(() => C.value.trim().slice(0, 1).toUpperCase() || "M"), T = _(() => h.value?.tenantId ?? "系统工作区"), E = _(() => H(m.value?.pageType)), O = _(() => U(m.value)), k = [
795
+ {
796
+ key: "changePassword",
797
+ title: "修改密码"
798
+ },
799
+ {
800
+ key: "profile",
801
+ title: "个人信息"
802
+ },
803
+ {
804
+ key: "settings",
805
+ title: "偏好设置"
806
+ },
807
+ {
808
+ key: "logout",
809
+ title: "退出登录",
810
+ danger: !0
811
+ }
812
+ ];
813
+ function j(e) {
814
+ if (e) return e?.pageDescriptor ?? (e?.target ? ie(e.target, { title: e.title }) : void 0);
815
+ }
816
+ function M(e) {
817
+ return e.key === u.value || j(e)?.tabPolicy.cacheable !== !1;
818
+ }
819
+ function P(e) {
820
+ return {
821
+ key: e.key,
822
+ title: e.title,
823
+ closable: e.closable
824
+ };
825
+ }
826
+ function I(e) {
827
+ a("update:activeTabKey", e), a("changeTab", e);
828
+ }
829
+ function V(e) {
830
+ a("userCommand", e);
831
+ }
832
+ function ne(e, t) {
833
+ a("selectMenu", e, t);
834
+ }
835
+ function H(e) {
836
+ return e === "dynamic-module" ? "动态模块" : e === "business-route" ? "业务页面" : e === "platform-route" ? "平台页面" : e === "remote-url" ? "在线页面" : e === "external-link" ? "外部链接" : "工作区";
837
+ }
838
+ function U(e) {
839
+ 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 : "未选择入口";
840
+ }
841
+ return (n, i) => (A(), b("main", ut, [S(lt, {
842
+ menus: t.startup?.menus ?? [],
843
+ "selected-menu-id": d.value?.target?.menuId,
844
+ "tenant-label": T.value,
845
+ "realtime-status": t.realtimeStatus,
846
+ onSelectMenu: ne,
847
+ onInvalidMenu: i[0] ||= (e) => a("invalidMenu", e)
848
+ }, null, 8, [
849
+ "menus",
850
+ "selected-menu-id",
851
+ "tenant-label",
852
+ "realtime-status"
853
+ ]), x("section", dt, [
854
+ x("header", ft, [
855
+ x("div", pt, [x("h1", null, F(d.value?.title ?? "控制台"), 1), x("span", null, F(E.value) + " / " + F(O.value), 1)]),
856
+ x("div", mt, [
857
+ x("button", ht, [S(L(c), { name: "search" }), i[2] ||= x("span", null, "搜索", -1)]),
858
+ x("button", gt, [S(L(c), { name: "reload" })]),
859
+ x("button", _t, [S(L(c), { name: "notification" })]),
860
+ x("button", vt, [S(L(c), { name: "settings" })])
861
+ ]),
862
+ S(L(f), {
863
+ items: k,
864
+ onSelect: V
865
+ }, {
866
+ default: R(({ toggle: e }) => [x("button", {
867
+ class: "user-button",
868
+ type: "button",
869
+ onClick: B(e, ["stop"])
870
+ }, [
871
+ x("span", bt, F(w.value), 1),
872
+ x("span", xt, [x("strong", null, F(C.value), 1), x("small", null, F(h.value?.system ? "系统管理员" : "业务用户"), 1)]),
873
+ S(L(c), {
874
+ class: "user-caret",
875
+ name: "down"
876
+ })
877
+ ], 8, yt)]),
878
+ _: 1
879
+ })
880
+ ]),
881
+ x("div", St, [l.value.length > 0 ? (A(), v(L(p), {
882
+ key: 0,
883
+ tabs: l.value,
884
+ "active-key": u.value,
885
+ "onUpdate:activeKey": I,
886
+ onClose: i[1] ||= (e) => a("closeTab", e)
887
+ }, null, 8, ["tabs", "active-key"])) : (A(), b("div", Ct, "暂无打开页面"))]),
888
+ x("section", wt, [t.loading ? (A(), v(L(e), { key: 0 })) : t.error ? (A(), v(L(r), {
889
+ key: 1,
890
+ message: t.error
891
+ }, null, 8, ["message"])) : (A(!0), b(g, { key: 2 }, N(s.value, (e) => (A(), b(g, { key: e.key }, [M(e) ? z((A(), v(L(o), {
892
+ key: 0,
893
+ class: "tab-panel-host"
894
+ }, {
895
+ default: R(() => [x("div", { class: D(["tab-page", { "tab-page--workspace": j(e)?.layout === "workspace" }]) }, [ee(n.$slots, "default", {
896
+ activeTab: e,
897
+ target: e.target,
898
+ pageDescriptor: j(e)
899
+ }, void 0, !0)], 2)]),
900
+ _: 2
901
+ }, 1536)), [[te, e.key === u.value]]) : y("v-if", !0)], 64))), 128))])
902
+ ])]));
903
+ }
904
+ }), [["__scopeId", "data-v-6418272d"]]);
905
+ //#endregion
906
+ //#region src/dynamic-page-runtime/dynamicModuleDetailStateModel.ts
907
+ function Et(e) {
908
+ return e.activeRequestSequence === e.requestSequence;
909
+ }
910
+ function Dt(e) {
911
+ return e.hasRecord && !e.saving && !e.loading && !e.loadFailed;
912
+ }
913
+ //#endregion
914
+ //#region src/dynamic-page-runtime/DynamicModuleHost.vue?vue&type=script&setup=true&lang.ts
915
+ var Ot = {
916
+ key: 0,
917
+ class: "dynamic-module-workspace"
918
+ }, kt = {
919
+ key: 1,
920
+ class: "dynamic-module-unsupported"
921
+ }, At = /*#__PURE__*/ l(/* @__PURE__ */ w({
922
+ name: "DynamicModuleHost",
923
+ __name: "DynamicModuleHost",
924
+ props: { descriptor: {} },
925
+ setup(e) {
926
+ let r = e, o = i({ moduleAlias: r.descriptor.target.moduleAlias }), c = M(), l = M(), u = M("view"), f = M(!1), p = M(), m = M(t(void 0)), g = M(0), C = M(!1), w = M(!1), T = M(!1), E = 0, D = _(() => r.descriptor.title ?? o.runtime.snapshot()?.title ?? o.moduleAlias), O = _(() => u.value === "create" ? `新建${D.value}` : X(l.value ?? c.value) ?? "记录详情"), j = _(() => r.descriptor.target.pageMode ?? "LIST"), N = _(() => j.value === "LIST"), ee = _(() => N.value ? r.descriptor.target.defaultUiConfigId : void 0), P = _(() => `动态${j.value}入口暂未接入运行器`);
927
+ k(I);
928
+ async function I() {
929
+ if (!N.value) return;
930
+ let e = await o.runtime.ready, n = te(e.uiDescriptor?.views ?? []);
931
+ p.value = n?.viewCode, m.value = t(e.uiDescriptor, n?.viewCode);
932
+ }
933
+ function te(e) {
934
+ return e.find((e) => e.viewKind === "FORM");
935
+ }
936
+ function z(e) {
937
+ c.value && (c.value = e.find((e) => e.id === c.value?.id) ?? c.value, f.value && !w.value && u.value === "view" && (l.value = c.value));
938
+ }
939
+ function B(e) {
940
+ c.value = e;
941
+ }
942
+ async function V(e, t) {
943
+ let n = e.id == null ? void 0 : String(e.id);
944
+ if (!n) return;
945
+ let r = ++E;
946
+ c.value = e, l.value = void 0, u.value = t, f.value = !0, w.value = !0, T.value = !1;
947
+ try {
948
+ let e = await o.crud.view(n);
949
+ if (!Et({
950
+ activeRequestSequence: E,
951
+ requestSequence: r
952
+ })) return;
953
+ l.value = e, c.value = e;
954
+ } catch {
955
+ if (!Et({
956
+ activeRequestSequence: E,
957
+ requestSequence: r
958
+ })) return;
959
+ l.value = void 0, T.value = !0;
960
+ } finally {
961
+ Et({
962
+ activeRequestSequence: E,
963
+ requestSequence: r
964
+ }) && (w.value = !1);
965
+ }
966
+ }
967
+ function ne(e, t) {
968
+ l.value &&= {
969
+ ...l.value,
970
+ [e]: t
971
+ };
972
+ }
973
+ function H() {
974
+ E += 1, w.value = !1, T.value = !1, l.value = {}, u.value = "create", f.value = !0;
975
+ }
976
+ async function U(e) {
977
+ await V(e, "edit");
978
+ }
979
+ async function W() {
980
+ let e = l.value;
981
+ if (e && Dt({
982
+ hasRecord: !0,
983
+ saving: C.value,
984
+ loading: w.value,
985
+ loadFailed: T.value
986
+ })) {
987
+ C.value = !0;
988
+ try {
989
+ let t = e.id == null ? void 0 : String(e.id), n = u.value === "edit" && t ? await o.crud.update(t, e) : await o.crud.insert(e);
990
+ c.value = n.record, l.value = n.record, u.value = "view", g.value += 1;
991
+ } finally {
992
+ C.value = !1;
993
+ }
994
+ }
995
+ }
996
+ async function G(e) {
997
+ let t = e.id == null ? void 0 : String(e.id), n = typeof e.version == "number" ? e.version : void 0;
998
+ !t || n === void 0 || await a({
999
+ title: "删除记录",
1000
+ content: `确认删除「${X(e) ?? t}」?`,
1001
+ okText: "删除",
1002
+ danger: !0
1003
+ }) && (await o.crud.delete(t, { version: n }), c.value?.id === t && (c.value = void 0, l.value = void 0), g.value += 1);
1004
+ }
1005
+ function K(e) {
1006
+ e.key === "create" && H();
1007
+ }
1008
+ function q(e, t) {
1009
+ e.key === "view" && V(t, "view"), e.key === "edit" && U(t), e.key === "delete" && G(t);
1010
+ }
1011
+ function J() {
1012
+ C.value || (E += 1, w.value = !1, T.value = !1, f.value = !1, u.value = "view", l.value = c.value);
1013
+ }
1014
+ function Y() {
1015
+ let e = c.value;
1016
+ !e || u.value === "create" || V(e, u.value);
1017
+ }
1018
+ function X(e) {
1019
+ let t = e?.title ?? e?.name ?? e?.code ?? e?.id;
1020
+ return t == null ? void 0 : String(t);
1021
+ }
1022
+ return (t, r) => N.value ? (A(), b("section", Ot, [S(L(d), {
1023
+ class: "dynamic-list",
1024
+ context: L(o),
1025
+ title: D.value,
1026
+ "selected-key": c.value?.id,
1027
+ "reload-key": g.value,
1028
+ "standard-crud-actions": !0,
1029
+ "standard-crud-row-actions": !0,
1030
+ "ui-config-id": ee.value,
1031
+ "query-template-id": e.descriptor.target.defaultQueryTemplateId,
1032
+ "quick-search-placeholder": "搜索动态记录",
1033
+ "empty-description": "暂无动态记录",
1034
+ onLoaded: z,
1035
+ onSelect: B,
1036
+ onRowDblclick: r[0] ||= (e) => V(e, "view"),
1037
+ onAction: K,
1038
+ onRowAction: q
1039
+ }, null, 8, [
1040
+ "context",
1041
+ "title",
1042
+ "selected-key",
1043
+ "reload-key",
1044
+ "ui-config-id",
1045
+ "query-template-id"
1046
+ ]), S(L(s), {
1047
+ open: f.value,
1048
+ title: O.value,
1049
+ subtitle: p.value,
1050
+ mode: u.value,
1051
+ loading: w.value,
1052
+ "load-failed": T.value,
1053
+ "edit-available": !!c.value && !w.value && !T.value && u.value === "view",
1054
+ "save-available": !w.value && !T.value && u.value !== "view",
1055
+ saving: C.value,
1056
+ onClose: J,
1057
+ onRetry: Y,
1058
+ onEdit: r[1] ||= (e) => c.value && U(c.value),
1059
+ onSave: W
1060
+ }, {
1061
+ view: R(() => [l.value ? (A(), v(L(n), {
1062
+ key: 0,
1063
+ record: l.value,
1064
+ fields: m.value
1065
+ }, null, 8, ["record", "fields"])) : y("v-if", !0)]),
1066
+ form: R(() => [l.value ? (A(), v(L(h), {
1067
+ key: 0,
1068
+ class: "dynamic-form",
1069
+ record: l.value,
1070
+ fields: m.value,
1071
+ "option-context": L(o),
1072
+ "onUpdate:field": ne
1073
+ }, null, 8, [
1074
+ "record",
1075
+ "fields",
1076
+ "option-context"
1077
+ ])) : y("v-if", !0)]),
1078
+ _: 1
1079
+ }, 8, [
1080
+ "open",
1081
+ "title",
1082
+ "subtitle",
1083
+ "mode",
1084
+ "loading",
1085
+ "load-failed",
1086
+ "edit-available",
1087
+ "save-available",
1088
+ "saving"
1089
+ ])])) : (A(), b("section", kt, [x("h2", null, F(D.value), 1), x("p", null, F(P.value), 1)]));
1090
+ }
1091
+ }), [["__scopeId", "data-v-cd971132"]]), jt = { class: "page-host" }, Mt = /*#__PURE__*/ l(/* @__PURE__ */ w({
1092
+ name: "BusinessRouteHost",
1093
+ __name: "BusinessRouteHost",
1094
+ props: { descriptor: {} },
1095
+ setup(e) {
1096
+ let t = e, n = _(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey);
1097
+ return (t, r) => (A(), b("section", jt, [x("header", null, [r[0] ||= x("span", { class: "host-badge" }, "业务页面", -1), x("h2", null, F(n.value), 1)]), x("p", null, F(e.descriptor.target.route ?? e.descriptor.target.routeName ?? e.descriptor.target.pageKey), 1)]));
1098
+ }
1099
+ }), [["__scopeId", "data-v-7c4a6776"]]), Nt = ["src", "title"], Pt = {
1100
+ key: 1,
1101
+ class: "page-host"
1102
+ }, Ft = { class: "host-badge" }, It = ["href"], Lt = /*#__PURE__*/ l(/* @__PURE__ */ w({
1103
+ name: "ExternalPageHost",
1104
+ __name: "ExternalPageHost",
1105
+ props: { descriptor: {} },
1106
+ setup(e) {
1107
+ let t = e, n = _(() => t.descriptor.title ?? t.descriptor.target.url);
1108
+ return (t, r) => e.descriptor.openMode === "iframe" ? (A(), b("iframe", {
1109
+ key: 0,
1110
+ class: "external-frame",
1111
+ src: e.descriptor.target.url,
1112
+ title: n.value
1113
+ }, null, 8, Nt)) : (A(), b("section", Pt, [
1114
+ x("span", Ft, F(e.descriptor.openMode), 1),
1115
+ x("h2", null, F(n.value), 1),
1116
+ x("a", {
1117
+ class: "external-link",
1118
+ href: e.descriptor.target.url,
1119
+ target: "_blank",
1120
+ rel: "noopener noreferrer"
1121
+ }, " 打开页面 ", 8, It)
1122
+ ]));
1123
+ }
1124
+ }), [["__scopeId", "data-v-212f730c"]]), Rt = {
1125
+ key: 1,
1126
+ class: "page-host"
1127
+ }, zt = /*#__PURE__*/ l(/* @__PURE__ */ w({
1128
+ name: "PlatformRouteHost",
1129
+ __name: "PlatformRouteHost",
1130
+ props: { descriptor: {} },
1131
+ setup(e) {
1132
+ let t = e, n = _(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey);
1133
+ return (e, r) => {
1134
+ let i = P("RouterView");
1135
+ return t.descriptor.target.route === "/" ? (A(), v(i, { key: 0 })) : (A(), b("section", Rt, [x("header", null, [r[0] ||= x("span", { class: "host-badge" }, "平台页面", -1), x("h2", null, F(n.value), 1)]), x("p", null, F(t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey), 1)]));
1136
+ };
1137
+ }
1138
+ }), [["__scopeId", "data-v-38e3167a"]]);
1139
+ //#endregion
1140
+ //#region src/platform-workbench/pageHostRegistry.ts
1141
+ function Bt(e) {
1142
+ switch (e) {
1143
+ case "platform-route-host": return "PlatformRouteHost";
1144
+ case "business-route-host": return "BusinessRouteHost";
1145
+ case "dynamic-module-host": return "DynamicModuleHost";
1146
+ case "external-page-host": return "ExternalPageHost";
1147
+ default: return Vt(e);
1148
+ }
1149
+ }
1150
+ function Vt(e) {
1151
+ throw Error(`Unsupported page host type: ${e}`);
1152
+ }
1153
+ //#endregion
1154
+ //#region src/platform-workbench/WorkbenchOutlet.vue
1155
+ var Ht = /* @__PURE__ */ w({
1156
+ name: "WorkbenchOutlet",
1157
+ __name: "WorkbenchOutlet",
1158
+ props: { descriptor: {} },
1159
+ setup(e) {
1160
+ let t = e, n = _(() => t.descriptor ? Bt(t.descriptor.hostType) : void 0), r = _(() => n.value === "PlatformRouteHost" ? t.descriptor : void 0), i = _(() => n.value === "BusinessRouteHost" ? t.descriptor : void 0), a = _(() => n.value === "DynamicModuleHost" ? t.descriptor : void 0), o = _(() => n.value === "ExternalPageHost" ? t.descriptor : void 0);
1161
+ return (e, t) => r.value ? (A(), v(zt, {
1162
+ key: 0,
1163
+ descriptor: r.value
1164
+ }, null, 8, ["descriptor"])) : i.value ? (A(), v(Mt, {
1165
+ key: 1,
1166
+ descriptor: i.value
1167
+ }, null, 8, ["descriptor"])) : a.value ? (A(), v(L(At), {
1168
+ key: 2,
1169
+ descriptor: a.value
1170
+ }, null, 8, ["descriptor"])) : o.value ? (A(), v(Lt, {
1171
+ key: 3,
1172
+ descriptor: o.value
1173
+ }, null, 8, ["descriptor"])) : (A(), v(L(u), {
1174
+ key: 4,
1175
+ description: "暂无页面"
1176
+ }));
1177
+ }
1178
+ }), Ut = Symbol("workbench-navigation");
1179
+ function Wt(e) {
1180
+ j(Ut, e);
1181
+ }
1182
+ function Gt() {
1183
+ return T(Ut);
1184
+ }
1185
+ //#endregion
1186
+ //#region src/platform-admin-runtime/workspaceViewHost.ts
1187
+ var Kt = Symbol("workspace-view-host");
1188
+ function qt(e) {
1189
+ j(Kt, e);
1190
+ }
1191
+ function Jt() {
1192
+ return T(Kt, void 0);
1193
+ }
1194
+ //#endregion
1195
+ //#region src/platform-admin-runtime/workspaceViewContract.ts
1196
+ function $(e) {
1197
+ return e;
1198
+ }
1199
+ //#endregion
1200
+ //#region src/views/userDetailWorkspaceView.ts
1201
+ var Yt = $({
1202
+ type: "iam.user.detail",
1203
+ route: "/iam/users",
1204
+ moduleAlias: "iam.user",
1205
+ component: C(() => import("./UserDetailWorkspaceView-M--ndn6x.js")),
1206
+ layout: "workspace",
1207
+ routeTitle: "用户管理",
1208
+ presentations: ["drawer", "tab"],
1209
+ titleOf: () => "用户详情",
1210
+ parse(e) {
1211
+ let t = e.recordId;
1212
+ if (!(typeof t != "string" || !t)) return { recordId: t };
1213
+ }
1214
+ }), Xt = $({
1215
+ type: "iam.employee.detail",
1216
+ route: "/iam/employees",
1217
+ moduleAlias: "iam.employee",
1218
+ component: C(() => import("./EmployeeDetailWorkspaceView-rm9ujeiQ.js")),
1219
+ layout: "workspace",
1220
+ routeTitle: "职员管理",
1221
+ presentations: ["drawer", "tab"],
1222
+ titleOf: () => "职员详情",
1223
+ parse(e) {
1224
+ let t = e.recordId;
1225
+ if (!(typeof t != "string" || !t)) return { recordId: t };
1226
+ }
1227
+ }), Zt = new Set([
1228
+ "platform",
1229
+ "tenant",
1230
+ "organization"
1231
+ ]), Qt = $({
1232
+ type: "iam.role.detail",
1233
+ route: "/iam/roles",
1234
+ moduleAlias: "iam.role",
1235
+ component: C(() => import("./RoleDetailWorkspaceView-C-vaKeZM.js")),
1236
+ layout: "workspace",
1237
+ routeTitle: "角色管理",
1238
+ presentations: ["drawer", "tab"],
1239
+ titleOf: () => "角色详情",
1240
+ parentRouteQueryOf(e) {
1241
+ return e.scopeKind === "platform" ? { scopeKind: e.scopeKind } : {
1242
+ scopeKind: e.scopeKind,
1243
+ scopeId: e.scopeId
1244
+ };
1245
+ },
1246
+ parse(e) {
1247
+ let t = e.recordId, n = e.scopeKind, r = e.scopeId;
1248
+ if (!(typeof t != "string" || !t || typeof n != "string" || !Zt.has(n) || (n === "platform" ? r !== void 0 : typeof r != "string" || !r))) return {
1249
+ recordId: t,
1250
+ scopeKind: n,
1251
+ ...typeof r == "string" ? { scopeId: r } : {}
1252
+ };
1253
+ }
1254
+ }), $t = $({
1255
+ type: "iam.system-user.detail",
1256
+ route: "/iam/system-users",
1257
+ moduleAlias: "iam.system_user",
1258
+ component: C(() => import("./SystemUserDetailWorkspaceView-FIbfff00.js")),
1259
+ layout: "workspace",
1260
+ routeTitle: "系统账号管理",
1261
+ presentations: ["drawer", "tab"],
1262
+ titleOf: () => "系统账号详情",
1263
+ parse(e) {
1264
+ let t = e.recordId;
1265
+ return typeof t == "string" && t ? { recordId: t } : void 0;
1266
+ }
1267
+ }), en = $({
1268
+ type: "iam.role.authorization",
1269
+ route: "/iam/role-authorization",
1270
+ moduleAlias: "iam.role",
1271
+ component: C(() => import("./RoleAuthorizationView-qQvn7M75.js").then((e) => e.n)),
1272
+ layout: "workspace",
1273
+ routeTitle: "角色授权",
1274
+ drawerProfile: "wide-work",
1275
+ presentations: ["drawer", "tab"],
1276
+ titleOf: () => "角色授权",
1277
+ parse(e) {
1278
+ let t = e.roleId;
1279
+ return typeof t == "string" && t ? { roleId: t } : void 0;
1280
+ }
1281
+ }), tn = $({
1282
+ type: "platform.module.actions",
1283
+ route: "/config/modules",
1284
+ moduleAlias: "platform.module",
1285
+ component: C(() => import("./ModuleActionManagementView-BFoPGqzC.js")),
1286
+ layout: "workspace",
1287
+ routeTitle: "模块管理",
1288
+ presentations: ["tab"],
1289
+ titleOf: (e) => `动作:${e.moduleTitle ?? e.moduleAlias}`,
1290
+ parentRouteQueryOf: () => ({}),
1291
+ parse(e) {
1292
+ let t = e.moduleAlias, n = e.moduleTitle;
1293
+ if (!(typeof t != "string" || !t)) return {
1294
+ moduleAlias: t,
1295
+ ...typeof n == "string" && n ? { moduleTitle: n } : {},
1296
+ ...e.moduleKind === "static" || e.moduleKind === "dynamic" ? { moduleKind: e.moduleKind } : {}
1297
+ };
1298
+ }
1299
+ }), nn = $({
1300
+ type: "platform.module.metadata-orchestration",
1301
+ route: "/config/modules",
1302
+ moduleAlias: "platform.module",
1303
+ component: C(() => import("./MetadataOrchestrationView-DaPNQML7.js")),
1304
+ layout: "workspace",
1305
+ routeTitle: "模块管理",
1306
+ presentations: ["tab"],
1307
+ titleOf: (e) => `元数据:${e.moduleTitle ?? e.moduleAlias}`,
1308
+ parentRouteQueryOf: () => ({}),
1309
+ parse(e) {
1310
+ let t = e.moduleAlias, n = e.moduleTitle;
1311
+ if (!(typeof t != "string" || !t)) return {
1312
+ moduleAlias: t,
1313
+ ...typeof n == "string" && n ? { moduleTitle: n } : {}
1314
+ };
1315
+ }
1316
+ }), rn = [
1317
+ Yt,
1318
+ Xt,
1319
+ Qt,
1320
+ $t,
1321
+ en,
1322
+ tn,
1323
+ nn
1324
+ ];
1325
+ //#endregion
1326
+ //#region src/platform-admin-runtime/workspaceViews.ts
1327
+ function an(e) {
1328
+ let t = /* @__PURE__ */ new Map();
1329
+ for (let n of e) {
1330
+ if (t.has(n.type)) throw Error(`重复的工作视图类型:${n.type}`);
1331
+ t.set(n.type, n);
1332
+ }
1333
+ return {
1334
+ definitions: [...t.values()],
1335
+ resolve(e) {
1336
+ let n = e.target.query ?? {}, r = String(n.workspaceView ?? ""), i = n.workspacePresentation;
1337
+ if (i !== "drawer" && i !== "tab") return;
1338
+ let a = t.get(r), o = a?.parse(n);
1339
+ return a && o && a.presentations.includes(i) ? {
1340
+ view: a,
1341
+ input: o,
1342
+ presentation: i
1343
+ } : void 0;
1344
+ }
1345
+ };
1346
+ }
1347
+ var on = an(rn);
1348
+ function sn(e, t, n = "tab", r = e.titleOf(t)) {
1349
+ if (!e.presentations.includes(n)) throw Error(`工作视图 ${e.type} 不支持 ${n} 承载`);
1350
+ let i = {
1351
+ workspaceView: e.type,
1352
+ workspacePresentation: n,
1353
+ ...t
1354
+ };
1355
+ return {
1356
+ pageType: "business-route",
1357
+ openMode: "workbench-route",
1358
+ hostType: "business-route-host",
1359
+ title: r,
1360
+ layout: e.layout,
1361
+ target: {
1362
+ route: e.route,
1363
+ moduleAlias: e.moduleAlias,
1364
+ query: i
1365
+ },
1366
+ params: i,
1367
+ tabPolicy: { identity: "by-params" }
1368
+ };
1369
+ }
1370
+ function cn(e, t) {
1371
+ let n = t.parse(e.target.query ?? {}), r = new Set([
1372
+ "workspaceView",
1373
+ "workspacePresentation",
1374
+ ...Object.keys(n ?? {})
1375
+ ]), i = n ? t.parentRouteQueryOf?.(n) ?? {} : {}, a = {
1376
+ ...un(e.target.query ?? {}, r),
1377
+ ...i
1378
+ }, o = {
1379
+ ...un(e.params ?? {}, r),
1380
+ ...i
1381
+ };
1382
+ return {
1383
+ ...e,
1384
+ title: t.routeTitle ?? e.title,
1385
+ target: {
1386
+ ...e.target,
1387
+ query: a
1388
+ },
1389
+ params: o,
1390
+ tabPolicy: { identity: "by-params" }
1391
+ };
1392
+ }
1393
+ function ln(e) {
1394
+ return on.resolve(e);
1395
+ }
1396
+ function un(e, t) {
1397
+ return Object.fromEntries(Object.entries(e).filter(([e]) => !t.has(e)));
1398
+ }
1399
+ //#endregion
1400
+ //#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
1401
+ function dn(e) {
1402
+ return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
1403
+ }
1404
+ function fn(e) {
1405
+ let t = Gt();
1406
+ return _(() => {
1407
+ let n = I(e.input);
1408
+ if (!(!n || !dn(I(e.eligibility)) || !t)) return {
1409
+ title: "固定为页签",
1410
+ promote: async () => {
1411
+ if (await e.beforePromote?.(n) === !1) {
1412
+ e.onPromotionRejected?.();
1413
+ return;
1414
+ }
1415
+ let r = t.openPage(sn(e.view, n, "tab", I(e.title)));
1416
+ e.onPromoted?.(r);
1417
+ }
1418
+ };
1419
+ });
1420
+ }
1421
+ //#endregion
1422
+ //#region src/platform-admin-runtime/workspaceViewSessions.ts
1423
+ var pn = /* @__PURE__ */ new Map(), mn = /* @__PURE__ */ new Map();
1424
+ function hn(e, t) {
1425
+ return `${e.type}:${yn(t)}`;
1426
+ }
1427
+ async function gn(e, t, n) {
1428
+ let r = hn(e, t), i = mn.get(r), a = i && [...i].at(-1);
1429
+ return a ? await a(bn(n)) ? "accepted" : "rejected" : (pn.set(r, bn(n)), "accepted");
1430
+ }
1431
+ function _n(e, t, n) {
1432
+ let r = hn(e, t), i = mn.get(r) ?? /* @__PURE__ */ new Set();
1433
+ return i.add(n), mn.set(r, i), () => {
1434
+ i.delete(n), i.size === 0 && mn.delete(r);
1435
+ };
1436
+ }
1437
+ function vn(e, t) {
1438
+ let n = hn(e, t), r = pn.get(n);
1439
+ return pn.delete(n), r;
1440
+ }
1441
+ function yn(e) {
1442
+ return Array.isArray(e) ? `[${e.map(yn).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${yn(t)}`).join(",")}}` : JSON.stringify(e);
1443
+ }
1444
+ function bn(e) {
1445
+ return JSON.parse(JSON.stringify(e));
1446
+ }
1447
+ //#endregion
1448
+ export { oe as A, Me as C, ke as D, Ae as E, ce as F, ie as I, se as L, X as M, re as N, je as O, le as P, ue as R, Re as S, Oe as T, Wt as _, sn as a, Tt as b, nn as c, $t as d, Qt as f, Jt as g, qt as h, fn as i, Y as j, ae as k, tn as l, Yt as m, _n as n, cn as o, Xt as p, vn as r, ln as s, gn as t, en as u, Gt as v, De as w, lt as x, Ht as y };