@ximatai/muyun-web-app 0.26.4 → 0.26.6

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