@ximatai/muyun-web-app 0.26.7 → 0.26.9

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 (198) hide show
  1. package/dist/DictionaryManagementView-CtIQpqVA.js +1035 -0
  2. package/dist/MenuManagementView-DJhkN2sG.js +837 -0
  3. package/dist/{MetadataOrchestrationView-B-CPudJl.js → MetadataOrchestrationView-CzhAgEdX.js} +210 -204
  4. package/dist/{ModuleActionManagementView-CmVj0e0C.js → ModuleActionManagementView-CM2d8jPO.js} +69 -69
  5. package/dist/RoleAuthorizationView-jn_WUCeg.js +599 -0
  6. package/dist/{RoleDetailWorkspaceView-DmJlJgAj.js → RoleDetailWorkspaceView-CzaQ3Dz1.js} +1 -1
  7. package/dist/RoleManagementView-nY7qu4GF.js +1951 -0
  8. package/dist/{SystemUserDetailWorkspaceView-U6Ij0US1.js → SystemUserDetailWorkspaceView-CBvqmWvP.js} +1 -1
  9. package/dist/SystemUserManagementView-AEomKvK7.js +887 -0
  10. package/dist/index.css +1 -1
  11. package/dist/index.js +651 -6970
  12. package/dist/{platform-components-DKKWbNrz.js → platform-components-CIi6GdC9.js} +5292 -3634
  13. package/dist/types/App.vue.d.ts +1 -0
  14. package/dist/types/app/StaticRoutePageHost.vue.d.ts +11 -0
  15. package/dist/types/app/loginTenant.d.ts +1 -1
  16. package/dist/types/app/menuRouteCompiler.d.ts +45 -0
  17. package/dist/types/app/menuRouteRuntime.d.ts +24 -0
  18. package/dist/types/app/pageRouteContext.d.ts +24 -0
  19. package/dist/types/app/routeDiagnosticsStore.d.ts +10 -0
  20. package/dist/types/app/router.d.ts +15 -0
  21. package/dist/types/app/staticRouteDefinitions.d.ts +25 -0
  22. package/dist/types/app/workbenchRouteSync.d.ts +1 -1
  23. package/dist/types/app/workbenchStartup.d.ts +9 -5
  24. package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +2 -2
  25. package/dist/types/consumer/index.d.ts +7 -4
  26. package/dist/types/dynamic-page-runtime/DynamicModuleHost.vue.d.ts +3 -10
  27. package/dist/types/{views/EmployeeEmploymentDrawer.vue.d.ts → dynamic-page-runtime/DynamicModuleWorkspaceDetailView.vue.d.ts} +3 -7
  28. package/dist/types/dynamic-page-runtime/DynamicRecordDetailActions.vue.d.ts +39 -0
  29. package/dist/types/dynamic-page-runtime/ManagedDetailRelationInlineSurface.vue.d.ts +40 -0
  30. package/dist/types/dynamic-page-runtime/ManagedDetailRelationSurface.vue.d.ts +14 -0
  31. package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +26 -0
  32. package/dist/types/dynamic-page-runtime/ModulePageFormContributionRenderer.vue.d.ts +12 -0
  33. package/dist/types/dynamic-page-runtime/ModulePageHost.vue.d.ts +14 -0
  34. package/dist/types/dynamic-page-runtime/ModulePageListExpansionSurface.vue.d.ts +19 -0
  35. package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansion.vue.d.ts +13 -0
  36. package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansions.vue.d.ts +16 -0
  37. package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +42 -0
  38. package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +41 -0
  39. package/dist/types/dynamic-page-runtime/NavigatorManagementEditor.vue.d.ts +44 -0
  40. package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +50 -0
  41. package/dist/types/dynamic-page-runtime/RecordFormSurface.vue.d.ts +31 -0
  42. package/dist/types/dynamic-page-runtime/composables/useManagedDetailRelationRuntime.d.ts +30 -0
  43. package/dist/types/dynamic-page-runtime/composables/useModulePageActions.d.ts +13 -0
  44. package/dist/types/dynamic-page-runtime/composables/useModulePageBootstrap.d.ts +17 -0
  45. package/dist/types/dynamic-page-runtime/composables/useModulePageDetailActionRuntime.d.ts +48 -0
  46. package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +26 -0
  47. package/dist/types/dynamic-page-runtime/composables/useModulePageFormContributionRuntime.d.ts +22 -0
  48. package/dist/types/dynamic-page-runtime/composables/useModulePageListSession.d.ts +41 -0
  49. package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +1324 -0
  50. package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +22 -0
  51. package/dist/types/dynamic-page-runtime/detailSurfacePreference.d.ts +10 -0
  52. package/dist/types/dynamic-page-runtime/dynamicModuleDetailStateModel.d.ts +5 -12
  53. package/dist/types/dynamic-page-runtime/formComputeCoordinator.d.ts +18 -0
  54. package/dist/types/dynamic-page-runtime/index.d.ts +4 -2
  55. package/dist/types/dynamic-page-runtime/listPageSizePreference.d.ts +10 -0
  56. package/dist/types/dynamic-page-runtime/moduleDetailStateModel.d.ts +12 -0
  57. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +218 -6
  58. package/dist/types/dynamic-page-runtime/modulePageNavigation.d.ts +1 -1
  59. package/dist/types/dynamic-page-runtime/navigatorVisibility.d.ts +6 -0
  60. package/dist/types/dynamic-page-runtime/pageContextRuntime.d.ts +6 -0
  61. package/dist/types/dynamic-page-runtime/recordDetailController.d.ts +35 -0
  62. package/dist/types/dynamic-page-runtime/relationFormComputeCoordinator.d.ts +9 -0
  63. package/dist/types/formula/FormulaRuntime.d.ts +29 -0
  64. package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +1 -0
  65. package/dist/types/{views/EmployeeDetailWorkspaceView.vue.d.ts → platform-admin-runtime/employee/EmployeeAccountDrawer.vue.d.ts} +2 -1
  66. package/dist/types/platform-admin-runtime/employeeModulePageEnhancement.d.ts +3 -0
  67. package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +2 -0
  68. package/dist/types/platform-admin-runtime/passwordPolicyPageEnhancement.d.ts +6 -0
  69. package/dist/types/platform-admin-runtime/platformAdminRoutes.d.ts +1 -1
  70. package/dist/types/platform-admin-runtime/platformModulePageEnhancement.d.ts +9 -0
  71. package/dist/types/platform-admin-runtime/realtime.d.ts +2 -1
  72. package/dist/types/platform-admin-runtime/tenant/TenantApplicationConfigurationDrawer.vue.d.ts +7 -0
  73. package/dist/types/platform-admin-runtime/tenant/TenantApplicationsDetailSection.vue.d.ts +7 -0
  74. package/dist/types/platform-admin-runtime/tenantModulePageEnhancement.d.ts +7 -0
  75. package/dist/types/platform-admin-runtime/user/UserOnlineStatusCell.vue.d.ts +8 -0
  76. package/dist/types/platform-admin-runtime/user/UserPasswordDrawer.vue.d.ts +7 -0
  77. package/dist/types/platform-admin-runtime/user/UserSessionListExpansion.vue.d.ts +7 -0
  78. package/dist/types/platform-admin-runtime/user/useUserSessionRows.d.ts +23 -0
  79. package/dist/types/platform-admin-runtime/user/userOnlineStatusStore.d.ts +11 -0
  80. package/dist/types/platform-admin-runtime/userModulePageEnhancement.d.ts +7 -0
  81. package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +12 -0
  82. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +10 -2
  83. package/dist/types/platform-components/DetailRelationListPanel.vue.d.ts +13 -0
  84. package/dist/types/{views/EmployeeManagementView.vue.d.ts → platform-components/DrawerTitleActions.vue.d.ts} +2 -2
  85. package/dist/types/platform-components/FileTransferUploader.vue.d.ts +7 -0
  86. package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +5 -3
  87. package/dist/types/platform-components/ManagementWorkspace.vue.d.ts +8 -2
  88. package/dist/types/platform-components/ModuleActionButton.vue.d.ts +5 -2
  89. package/dist/types/platform-components/RecordActionBar.vue.d.ts +1 -1
  90. package/dist/types/platform-components/RecordContentSectionHeading.vue.d.ts +17 -0
  91. package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +7 -1
  92. package/dist/types/platform-components/RecordDetailExtensionSection.vue.d.ts +8 -3
  93. package/dist/types/platform-components/RecordDetailFields.vue.d.ts +5 -0
  94. package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +17 -7
  95. package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +15 -5
  96. package/dist/types/platform-components/RecordExpandedSubtable.vue.d.ts +3 -0
  97. package/dist/types/platform-components/RecordFileReferenceTransfer.vue.d.ts +4 -0
  98. package/dist/types/platform-components/RecordFormFields.vue.d.ts +29 -1
  99. package/dist/types/platform-components/RecordImageFileReferencePreview.vue.d.ts +11 -0
  100. package/dist/types/platform-components/RecordListExpansionSurface.vue.d.ts +13 -0
  101. package/dist/types/platform-components/RecordListExplorer.vue.d.ts +4 -2
  102. package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +6 -2
  103. package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +12 -2
  104. package/dist/types/platform-components/RecordPanelButton.vue.d.ts +2 -0
  105. package/dist/types/platform-components/RecordPicker.vue.d.ts +10 -2
  106. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +42 -7
  107. package/dist/types/platform-components/RecordRelationTabs.vue.d.ts +14 -0
  108. package/dist/types/platform-components/RecordSelectionCheckbox.vue.d.ts +13 -0
  109. package/dist/types/platform-components/RecordStatusSwitch.vue.d.ts +3 -0
  110. package/dist/types/platform-components/StaticManagementLayout.vue.d.ts +21 -7
  111. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +7 -2
  112. package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +2 -0
  113. package/dist/types/platform-components/drawerTitleActions.d.ts +11 -0
  114. package/dist/types/platform-components/index.d.ts +15 -5
  115. package/dist/types/platform-components/managementWorkspaceLayout.d.ts +14 -0
  116. package/dist/types/platform-components/optionFieldOptionCache.d.ts +3 -0
  117. package/dist/types/platform-components/recordDetailFieldModel.d.ts +2 -0
  118. package/dist/types/platform-components/recordFormFieldModel.d.ts +69 -6
  119. package/dist/types/platform-components/recordPickerConstraints.d.ts +2 -0
  120. package/dist/types/platform-components/recordPickerModel.d.ts +6 -2
  121. package/dist/types/platform-components/recycleBinState.d.ts +2 -0
  122. package/dist/types/platform-components/scopedTreeModuleContext.d.ts +11 -0
  123. package/dist/types/platform-workbench/Workbench.vue.d.ts +2 -2
  124. package/dist/types/platform-workbench/index.d.ts +4 -2
  125. package/dist/types/platform-workbench/legacyPageHostTypeCompatibility.d.ts +6 -0
  126. package/dist/types/platform-workbench/menuNavigation.d.ts +26 -1
  127. package/dist/types/platform-workbench/modulePageWorkspaceViews.d.ts +7 -0
  128. package/dist/types/platform-workbench/pageCacheKey.d.ts +2 -0
  129. package/dist/types/platform-workbench/pageHostRegistry.d.ts +1 -1
  130. package/dist/types/platform-workbench/workbenchLayout.d.ts +36 -0
  131. package/dist/types/platform-workbench/workbenchNavigation.d.ts +16 -1
  132. package/dist/types/platform-workbench/workspaceViewHost.d.ts +2 -0
  133. package/dist/types/views/PasswordPolicyPreview.vue.d.ts +7 -0
  134. package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +1 -0
  135. package/dist/types/views/RoleAuthorizationView.vue.d.ts +2 -0
  136. package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +1 -0
  137. package/dist/types/views/{UserDetailWorkspaceView.vue.d.ts → UserDetailRouteView.vue.d.ts} +3 -2
  138. package/dist/types/views/UserManagementView.vue.d.ts +1 -6
  139. package/dist/types/views/menuManagementState.d.ts +2 -0
  140. package/dist/types/views/userDetailStateModel.d.ts +1 -3
  141. package/dist/types/views/userManagementRouteState.d.ts +11 -0
  142. package/dist/types/vue-ui-antdv/components/UiButton.vue.d.ts +4 -1
  143. package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +1 -1
  144. package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
  145. package/dist/types/vue-ui-antdv/components/UiInput.vue.d.ts +2 -1
  146. package/dist/types/vue-ui-antdv/components/UiModal.vue.d.ts +1 -1
  147. package/dist/types/vue-ui-antdv/components/UiRadioGroup.vue.d.ts +18 -0
  148. package/dist/types/vue-ui-antdv/components/UiRecordExplorerItem.vue.d.ts +2 -2
  149. package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +1 -1
  150. package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +4 -2
  151. package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +7 -1
  152. package/dist/types/vue-ui-antdv/index.d.ts +5 -2
  153. package/dist/types/web-contracts/index.d.ts +408 -24
  154. package/dist/types/web-core/businessNotifications.d.ts +4 -0
  155. package/dist/types/web-core/index.d.ts +2 -0
  156. package/dist/types/web-core/module/abilities.d.ts +7 -7
  157. package/dist/types/web-core/module/moduleContext.d.ts +6 -3
  158. package/dist/types/web-core/module/runtimeContext.d.ts +5 -1
  159. package/dist/types/web-core/module/staticModuleClient.d.ts +42 -9
  160. package/dist/types/web-core/realtime.d.ts +5 -1
  161. package/dist/types/web-core/referenceResolveClient.d.ts +11 -0
  162. package/dist/workspaceViewSessions-B5g4M0rT.js +51 -0
  163. package/dist/workspaceViews-CkERhK0K.js +8748 -0
  164. package/package.json +1 -1
  165. package/dist/EmployeeDetailWorkspaceView-DYJLlkSz.js +0 -14
  166. package/dist/EmployeeManagementView-taxWUa7g.js +0 -1778
  167. package/dist/RoleAuthorizationView-q_6CsBYq.js +0 -592
  168. package/dist/RoleManagementView-HCa9rH0f.js +0 -1927
  169. package/dist/SystemUserManagementView-C1CkKivH.js +0 -758
  170. package/dist/UserDetailWorkspaceView-OPYvD6mH.js +0 -17
  171. package/dist/UserManagementView-gbCL9SnC.js +0 -965
  172. package/dist/pageRealtime-CzJlr9hs.js +0 -225
  173. package/dist/types/views/EmployeeDetailContent.vue.d.ts +0 -64
  174. package/dist/types/views/PositionManagementView.vue.d.ts +0 -3
  175. package/dist/types/views/TenantManagementView.vue.d.ts +0 -3
  176. package/dist/types/views/applicationManagementState.d.ts +0 -64
  177. package/dist/types/views/departmentManagementState.d.ts +0 -137
  178. package/dist/types/views/employeeDetailStateModel.d.ts +0 -39
  179. package/dist/types/views/employeeDetailWorkspaceSession.d.ts +0 -16
  180. package/dist/types/views/employeeDetailWorkspaceView.d.ts +0 -4
  181. package/dist/types/views/fieldSpecManagementState.d.ts +0 -80
  182. package/dist/types/views/fieldUiControlManagementState.d.ts +0 -76
  183. package/dist/types/views/moduleManagementState.d.ts +0 -76
  184. package/dist/types/views/organizationManagementState.d.ts +0 -64
  185. package/dist/types/views/positionManagementState.d.ts +0 -218
  186. package/dist/types/views/tenantManagementState.d.ts +0 -74
  187. package/dist/types/views/useEmployeeEmploymentRows.d.ts +0 -20
  188. package/dist/types/views/userDetailWorkspaceSession.d.ts +0 -14
  189. package/dist/types/views/userDetailWorkspaceView.d.ts +0 -4
  190. package/dist/useUserSessionRows-CBHEzRFQ.js +0 -128
  191. package/dist/workspaceViewSessions-DkB9myrq.js +0 -3252
  192. /package/dist/types/views/{ApplicationManagementView.vue.d.ts → DynamicModuleRouteView.vue.d.ts} +0 -0
  193. /package/dist/types/views/{DepartmentManagementView.vue.d.ts → ExternalRouteView.vue.d.ts} +0 -0
  194. /package/dist/types/views/{FieldSpecManagementView.vue.d.ts → ModuleOpenApiRouteView.vue.d.ts} +0 -0
  195. /package/dist/types/views/{FieldUiControlManagementView.vue.d.ts → OpenApiCatalogRouteView.vue.d.ts} +0 -0
  196. /package/dist/types/views/{ModuleManagementView.vue.d.ts → RouteDiagnosticsView.vue.d.ts} +0 -0
  197. /package/dist/types/views/{OrganizationManagementView.vue.d.ts → UserManagementListView.vue.d.ts} +0 -0
  198. /package/dist/types/views/{PasswordManagementView.vue.d.ts → WorkspaceRouteView.vue.d.ts} +0 -0
@@ -1,3252 +0,0 @@
1
- import { $t as e, A as t, B as n, C as r, D as i, Dt as a, E as o, F as s, I as c, It as l, L as u, Mt as d, N as f, Nt as p, O as ee, Pt as m, R as te, S as ne, Y as re, Yt as ie, _ as ae, dt as h, g as oe, gt as g, jt as _, k as se, l as ce, lt as le, m as ue, mt as v, st as de, tt as y, ut as fe, v as pe, x as me, yt as b, z as he, zt as ge } from "./platform-components-DKKWbNrz.js";
2
- import { Fragment as x, Transition as _e, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createSlots as ve, createTextVNode as D, createVNode as O, defineAsyncComponent as k, defineComponent as A, getCurrentInstance as j, h as M, inject as N, mergeProps as P, nextTick as ye, normalizeClass as F, normalizeStyle as be, onMounted as xe, onUnmounted as Se, openBlock as I, provide as L, ref as R, renderList as z, renderSlot as Ce, resolveComponent as we, resolveDynamicComponent as Te, toDisplayString as B, toValue as Ee, unref as V, vShow as De, watch as H, withCtx as U, withDirectives as W, withKeys as Oe, withModifiers as ke } from "vue";
3
- //#region src/platform-workbench/WorkbenchBrandControl.vue?vue&type=script&setup=true&lang.ts
4
- var G = ["src", "alt"], K = {
5
- key: 1,
6
- class: "workbench-brand-mark"
7
- }, q = {
8
- key: 2,
9
- class: "workbench-brand-copy"
10
- }, J = { key: 0 }, Ae = { class: "workbench-brand-actions" }, je = {
11
- key: 0,
12
- class: "workbench-menu-depth",
13
- role: "group",
14
- "aria-label": "侧栏菜单层级"
15
- }, Me = [
16
- "aria-pressed",
17
- "title",
18
- "onClick"
19
- ], Ne = ["aria-label", "title"], Pe = /*#__PURE__*/ d(/* @__PURE__ */ A({
20
- name: "WorkbenchBrandControl",
21
- __name: "WorkbenchBrandControl",
22
- props: {
23
- presentation: {},
24
- compactOpen: {
25
- type: Boolean,
26
- default: !1
27
- },
28
- tenantLabel: { default: "系统工作区" },
29
- logoSrc: { default: void 0 },
30
- showTitleArea: {
31
- type: Boolean,
32
- default: !0
33
- },
34
- brandTitle: { default: "MuYun" },
35
- brandSubtitle: { default: void 0 },
36
- expandedMenuDepth: { default: 1 },
37
- presentationToggleVisible: {
38
- type: Boolean,
39
- default: !0
40
- }
41
- },
42
- emits: [
43
- "openCompactMenu",
44
- "scheduleCompactMenuClose",
45
- "closeCompactMenu",
46
- "changePresentation",
47
- "changeExpandedMenuDepth"
48
- ],
49
- setup(e, { emit: t }) {
50
- let n = e, r = t;
51
- function i(e, t) {
52
- if (n.presentation !== "compact" || !(t.currentTarget instanceof HTMLElement)) return;
53
- let i = t.currentTarget.getBoundingClientRect();
54
- r("openCompactMenu", e, {
55
- left: i.left,
56
- top: i.top,
57
- right: i.right,
58
- bottom: i.bottom
59
- });
60
- }
61
- function a() {
62
- n.presentation === "compact" && r("scheduleCompactMenuClose");
63
- }
64
- function o(e) {
65
- n.presentation === "compact" && e.key === "Escape" && r("closeCompactMenu");
66
- }
67
- function s() {
68
- r("changePresentation", n.presentation === "compact" ? "expanded" : "compact");
69
- }
70
- function c(e) {
71
- r("changeExpandedMenuDepth", e);
72
- }
73
- return (t, n) => (I(), T("div", { class: F(["workbench-brand-control", [`workbench-brand-control--${e.presentation}`, { "workbench-brand-control--with-title": e.showTitleArea }]]) }, [(I(), C(Te(e.presentation === "compact" ? "button" : "div"), {
74
- class: F(["workbench-brand-identity", {
75
- "workbench-brand-identity--open": e.compactOpen,
76
- "workbench-brand-identity--with-title": e.showTitleArea
77
- }]),
78
- type: e.presentation === "compact" ? "button" : void 0,
79
- "aria-label": e.presentation === "compact" ? "系统菜单" : void 0,
80
- "aria-expanded": e.presentation === "compact" ? e.compactOpen : void 0,
81
- "aria-controls": e.presentation === "compact" ? "workbench-compact-menu" : void 0,
82
- onMouseenter: n[0] ||= (e) => i("pointer", e),
83
- onMouseleave: a,
84
- onFocus: n[1] ||= (e) => i("focus", e),
85
- onFocusout: a,
86
- onClick: n[2] ||= (e) => i("click", e),
87
- onKeydown: o
88
- }, {
89
- default: U(() => [e.logoSrc ? (I(), T("img", {
90
- key: 0,
91
- class: "workbench-brand-logo",
92
- src: e.logoSrc,
93
- alt: `${e.tenantLabel} 标志`
94
- }, null, 8, G)) : (I(), T("span", K, [O(V(p), { name: "app" })])), e.showTitleArea ? (I(), T("span", q, [E("strong", null, B(e.brandTitle), 1), e.presentation === "expanded" ? (I(), T("small", J, B(e.brandSubtitle ?? e.tenantLabel), 1)) : w("v-if", !0)])) : w("v-if", !0)]),
95
- _: 1
96
- }, 40, [
97
- "class",
98
- "type",
99
- "aria-label",
100
- "aria-expanded",
101
- "aria-controls"
102
- ])), E("div", Ae, [e.presentation === "expanded" ? (I(), T("div", je, [(I(), T(x, null, z([
103
- 1,
104
- 2,
105
- 3
106
- ], (t) => E("button", {
107
- key: t,
108
- class: F(["workbench-menu-depth-option", { selected: e.expandedMenuDepth === t }]),
109
- type: "button",
110
- "aria-pressed": e.expandedMenuDepth === t,
111
- title: `侧栏显示至第 ${t} 级菜单`,
112
- onClick: (e) => c(t)
113
- }, B(t), 11, Me)), 64))])) : w("v-if", !0), e.presentationToggleVisible ? (I(), T("button", {
114
- key: 1,
115
- class: "workbench-brand-presentation-toggle",
116
- type: "button",
117
- "aria-label": e.presentation === "compact" ? "展开侧栏菜单" : "收敛侧栏菜单",
118
- title: e.presentation === "compact" ? "展开侧栏菜单" : "收敛侧栏菜单",
119
- onClick: s
120
- }, [O(V(p), { name: e.presentation === "compact" ? "menu-expand" : "menu-collapse" }, null, 8, ["name"])], 8, Ne)) : w("v-if", !0)])], 2));
121
- }
122
- }), [["__scopeId", "data-v-28048337"]]), Fe = {
123
- key: 0,
124
- class: "deep-children"
125
- }, Ie = /*#__PURE__*/ d(/* @__PURE__ */ A({
126
- name: "WorkbenchMenuTree",
127
- __name: "WorkbenchMenuTree",
128
- props: {
129
- node: {},
130
- level: {},
131
- selectedMenuId: {},
132
- selectedPathIds: {}
133
- },
134
- emits: ["selectMenu"],
135
- setup(e, { emit: t }) {
136
- let n = e, r = t, i = S(() => n.level ?? 0), a = S(() => n.node.record.id === n.selectedMenuId), o = S(() => !a.value && n.selectedPathIds?.includes(n.node.record.id) === !0);
137
- function s() {
138
- n.node.target && r("selectMenu", n.node.record, n.node.target);
139
- }
140
- function c(e, t) {
141
- r("selectMenu", e, t);
142
- }
143
- return (t, n) => {
144
- let r = we("WorkbenchMenuTree", !0);
145
- return I(), T("li", {
146
- class: "deep-node",
147
- style: be({ "--depth": i.value })
148
- }, [(I(), C(Te(e.node.navigable ? "button" : "div"), {
149
- class: F(["deep-node-button", {
150
- navigable: e.node.navigable,
151
- branch: e.node.hasChildren,
152
- selected: a.value,
153
- "selected-path": o.value
154
- }]),
155
- type: e.node.navigable ? "button" : void 0,
156
- "aria-current": e.node.navigable && a.value ? "page" : void 0,
157
- onClick: n[0] ||= (t) => e.node.navigable && s()
158
- }, {
159
- default: U(() => [E("span", null, B(e.node.record.title), 1)]),
160
- _: 1
161
- }, 8, [
162
- "class",
163
- "type",
164
- "aria-current"
165
- ])), e.node.hasChildren ? (I(), T("ul", Fe, [(I(!0), T(x, null, z(e.node.children, (t) => (I(), C(r, {
166
- key: t.record.id,
167
- node: t,
168
- level: i.value + 1,
169
- "selected-menu-id": e.selectedMenuId,
170
- "selected-path-ids": e.selectedPathIds,
171
- onSelectMenu: c
172
- }, null, 8, [
173
- "node",
174
- "level",
175
- "selected-menu-id",
176
- "selected-path-ids"
177
- ]))), 128))])) : w("v-if", !0)], 4);
178
- };
179
- }
180
- }), [["__scopeId", "data-v-118b89e0"]]), Le = ["aria-current"], Re = ["aria-label", "aria-expanded"], ze = [
181
- "disabled",
182
- "aria-current",
183
- "aria-expanded",
184
- "aria-controls"
185
- ], Be = /*#__PURE__*/ d(/* @__PURE__ */ A({
186
- name: "WorkbenchSidebarMenuEntry",
187
- __name: "WorkbenchSidebarMenuEntry",
188
- props: {
189
- node: {},
190
- mode: {},
191
- selected: { type: Boolean },
192
- selectedPath: { type: Boolean },
193
- active: { type: Boolean }
194
- },
195
- emits: [
196
- "select",
197
- "openChildren",
198
- "toggleChildren"
199
- ],
200
- setup(e, { emit: t }) {
201
- let n = e, r = t, i = R(), a = S(() => n.mode === "flyout" && n.node.hasChildren), o = S(() => a.value && n.node.navigable), s = S(() => n.mode === "inline" && !n.node.navigable);
202
- function c(e) {
203
- a.value && i.value && r("openChildren", n.node, e, i.value);
204
- }
205
- function l() {
206
- a.value && i.value && r("toggleChildren", n.node, i.value);
207
- }
208
- function u() {
209
- n.node.navigable ? r("select", n.node) : l();
210
- }
211
- return (t, n) => s.value ? (I(), T("div", {
212
- key: 0,
213
- ref_key: "entryRoot",
214
- ref: i,
215
- class: F(["sidebar-menu-entry sidebar-menu-entry--group", { "selected-path": e.selectedPath }])
216
- }, [E("span", null, B(e.node.record.title), 1)], 2)) : o.value ? (I(), T("div", {
217
- key: 1,
218
- ref_key: "entryRoot",
219
- ref: i,
220
- class: F(["sidebar-menu-entry sidebar-menu-entry--split navigable branch", {
221
- selected: e.selected,
222
- "selected-path": e.selectedPath,
223
- active: e.active
224
- }]),
225
- onMouseenter: c
226
- }, [E("button", {
227
- class: "sidebar-menu-entry-main navigable",
228
- type: "button",
229
- "aria-current": e.selected ? "page" : void 0,
230
- onClick: n[0] ||= (t) => r("select", e.node)
231
- }, [E("span", null, B(e.node.record.title), 1)], 8, Le), E("button", {
232
- class: "sidebar-menu-entry-trigger",
233
- type: "button",
234
- "aria-label": `${e.active ? "收起" : "展开"}${e.node.record.title}下级菜单`,
235
- "aria-expanded": e.active,
236
- "aria-controls": "workbench-sidebar-submenu-panel",
237
- onClick: ke(l, ["stop"])
238
- }, [...n[1] ||= [E("i", {
239
- class: "sidebar-menu-entry-indicator",
240
- "aria-hidden": "true"
241
- }, null, -1)]], 8, Re)], 34)) : (I(), T("button", {
242
- key: 2,
243
- ref_key: "entryRoot",
244
- ref: i,
245
- class: F(["sidebar-menu-entry", {
246
- navigable: e.node.navigable,
247
- selected: e.selected,
248
- "selected-path": e.selectedPath,
249
- branch: a.value,
250
- active: e.active
251
- }]),
252
- type: "button",
253
- disabled: !e.node.navigable && !a.value,
254
- "aria-current": e.selected ? "page" : void 0,
255
- "aria-expanded": a.value ? e.active : void 0,
256
- "aria-controls": a.value ? "workbench-sidebar-submenu-panel" : void 0,
257
- onMouseenter: c,
258
- onClick: u
259
- }, [E("span", null, B(e.node.record.title), 1)], 42, ze));
260
- }
261
- }), [["__scopeId", "data-v-c41764d0"]]);
262
- //#endregion
263
- //#region src/platform-workbench/menuHoverClickIntent.ts
264
- function Ve(e, t = Date.now) {
265
- let n;
266
- return {
267
- markHoverActivation(e) {
268
- n = {
269
- menuId: e,
270
- at: t()
271
- };
272
- },
273
- consumeImmediateClick(r) {
274
- let i = n;
275
- if (n = void 0, !i || i.menuId !== r) return !1;
276
- let a = t() - i.at;
277
- return a >= 0 && a <= e;
278
- },
279
- clear() {
280
- n = void 0;
281
- }
282
- };
283
- }
284
- //#endregion
285
- //#region src/platform-workbench/menuPointerAim.ts
286
- function He(e, t, n) {
287
- return e.x < t.x ? !1 : Ue(e, t, {
288
- x: n.left + 12,
289
- y: n.top - 8
290
- }, {
291
- x: n.left + 12,
292
- y: n.bottom + 8
293
- });
294
- }
295
- function Ue(e, t, n, r) {
296
- let i = Y(e, t, n), a = Y(e, n, r), o = Y(e, r, t);
297
- return !((i < 0 || a < 0 || o < 0) && (i > 0 || a > 0 || o > 0));
298
- }
299
- function Y(e, t, n) {
300
- return (e.y - t.y) * (n.x - t.x) - (e.x - t.x) * (n.y - t.y);
301
- }
302
- //#endregion
303
- //#region src/platform-workbench/workbenchLayout.ts
304
- function We(e, t) {
305
- return Math.max(0, Math.round(e - t));
306
- }
307
- function Ge(e, t, n, r, i = 8) {
308
- let a = i, o = Math.max(a, n - t - i);
309
- return Math.round(Math.min(Math.max(e, a), o) - r);
310
- }
311
- function Ke(e, t) {
312
- return t ? "compact" : e;
313
- }
314
- //#endregion
315
- //#region src/platform-workbench/menuNavigation.ts
316
- var qe = ["/_workspace"], X = "_muyunMenuId", Z = "_muyunTitle", Je = "_muyunEntryParams", Ye = [
317
- "entryParamsJson",
318
- "menuId",
319
- "title"
320
- ];
321
- function Xe(e) {
322
- if (e.enabled !== !1 && !(!e.openMode || !e.moduleAlias)) return e.externalUrl ? {
323
- menuId: e.id,
324
- menuType: "link",
325
- openMode: e.openMode,
326
- externalUrl: e.externalUrl,
327
- moduleAlias: e.moduleAlias,
328
- entryParamsJson: e.entryParamsJson
329
- } : e.route ? {
330
- menuId: e.id,
331
- menuType: "route",
332
- openMode: e.openMode,
333
- route: e.route,
334
- moduleAlias: e.moduleAlias,
335
- entryParamsJson: e.entryParamsJson
336
- } : {
337
- menuId: e.id,
338
- menuType: "module",
339
- openMode: e.openMode,
340
- moduleAlias: e.moduleAlias,
341
- pageMode: e.pageMode,
342
- defaultUiConfigId: e.defaultUiConfigId,
343
- defaultQueryTemplateId: e.defaultQueryTemplateId,
344
- entryParamsJson: e.entryParamsJson
345
- };
346
- }
347
- function Ze(e) {
348
- return e.openMode === "tab";
349
- }
350
- function Qe(e) {
351
- return e.openMode === "window";
352
- }
353
- function $e(e, t = {}) {
354
- if (e.menuType === "module") {
355
- let n = t.businessModuleRoutes?.[e.moduleAlias];
356
- return n ? {
357
- pageType: "business-route",
358
- openMode: "workbench-route",
359
- hostType: "business-route-host",
360
- title: t.title,
361
- layout: ot({ route: n }, t),
362
- menuId: e.menuId,
363
- target: {
364
- route: n,
365
- moduleAlias: e.moduleAlias
366
- },
367
- entryParamsJson: e.entryParamsJson,
368
- tabPolicy: {
369
- identity: "by-menu",
370
- closable: !0,
371
- cacheable: !0
372
- }
373
- } : {
374
- pageType: "dynamic-module",
375
- openMode: "dynamic-runner",
376
- hostType: "dynamic-module-host",
377
- title: t.title,
378
- menuId: e.menuId,
379
- target: {
380
- moduleAlias: e.moduleAlias,
381
- pageMode: e.pageMode,
382
- defaultUiConfigId: e.defaultUiConfigId,
383
- defaultQueryTemplateId: e.defaultQueryTemplateId
384
- },
385
- params: e.query,
386
- entryParamsJson: e.entryParamsJson,
387
- tabPolicy: {
388
- identity: "by-menu",
389
- closable: !0,
390
- cacheable: !0
391
- }
392
- };
393
- }
394
- if (e.menuType === "route") {
395
- let n = it(e.route, e.query, e.moduleAlias), r = at(n, t) ? "business-route" : "platform-route", i = {
396
- openMode: "workbench-route",
397
- title: t.title,
398
- menuId: e.menuId,
399
- target: n,
400
- params: e.query,
401
- entryParamsJson: e.entryParamsJson,
402
- tabPolicy: {
403
- identity: e.menuId ? "by-menu" : "by-target",
404
- closable: !0,
405
- cacheable: !0
406
- }
407
- };
408
- return r === "business-route" ? {
409
- ...i,
410
- pageType: r,
411
- hostType: "business-route-host",
412
- layout: ot(n, t)
413
- } : {
414
- ...i,
415
- pageType: r,
416
- hostType: "platform-route-host"
417
- };
418
- }
419
- return e.openMode === "tab" ? {
420
- pageType: "remote-url",
421
- openMode: "iframe",
422
- hostType: "external-page-host",
423
- title: t.title,
424
- menuId: e.menuId,
425
- target: {
426
- url: e.externalUrl,
427
- moduleAlias: e.moduleAlias
428
- },
429
- entryParamsJson: e.entryParamsJson,
430
- tabPolicy: {
431
- identity: e.menuId ? "by-menu" : "by-target",
432
- closable: !0
433
- }
434
- } : {
435
- pageType: "external-link",
436
- openMode: "new-window",
437
- hostType: "external-page-host",
438
- title: t.title,
439
- menuId: e.menuId,
440
- target: {
441
- url: e.externalUrl,
442
- moduleAlias: e.moduleAlias
443
- },
444
- entryParamsJson: e.entryParamsJson,
445
- tabPolicy: {
446
- identity: e.menuId ? "by-menu" : "by-target",
447
- closable: !0
448
- }
449
- };
450
- }
451
- function Q(e, t, n = {}) {
452
- if (!Ze(t)) throw Error(`WINDOW menu target cannot be opened as a workbench tab: ${t.menuId}`);
453
- let r = $e(t, {
454
- ...n,
455
- title: n.title ?? e.title
456
- });
457
- return {
458
- key: tt(r),
459
- title: e.title,
460
- target: t,
461
- pageDescriptor: r,
462
- restoreState: r.restoreState,
463
- closable: !0
464
- };
465
- }
466
- function et(e) {
467
- for (let t of e) {
468
- let e = Xe(t.record);
469
- if (e && Ze(e)) return t.record;
470
- let n = et(t.children);
471
- if (n) return n;
472
- }
473
- }
474
- function tt(e) {
475
- 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}:${ct(e)}`}:${ut(e.params)}` : `${e.pageType}:${ct(e)}`;
476
- }
477
- function nt(e) {
478
- if (e.pageType === "platform-route" || e.pageType === "business-route") return e.target.route ? lt(e.target.route, {
479
- ...e.target.query ?? e.params,
480
- [Je]: e.entryParamsJson,
481
- [X]: e.menuId,
482
- [Z]: e.title
483
- }) : lt("/platform/workspace", {
484
- ...e.target.query ?? e.params ?? {},
485
- pageType: e.pageType,
486
- routeName: e.target.routeName,
487
- pageKey: e.target.pageKey,
488
- [X]: e.menuId,
489
- [Z]: e.title
490
- });
491
- if (e.pageType === "dynamic-module") {
492
- let t = e.target.pageMode?.toLowerCase() ?? "list";
493
- return lt(`/platform/dynamic/${e.target.moduleAlias}/${t}`, {
494
- ...e.params,
495
- [Je]: e.entryParamsJson,
496
- uiConfigId: e.target.defaultUiConfigId,
497
- queryTemplateId: e.target.defaultQueryTemplateId,
498
- [X]: e.menuId,
499
- [Z]: e.title
500
- });
501
- }
502
- return e.pageType === "remote-url" || e.pageType === "external-link" ? lt("/platform/external", {
503
- url: e.target.url,
504
- mode: e.openMode,
505
- [X]: e.menuId,
506
- [Z]: e.title
507
- }) : xt(e);
508
- }
509
- function $(e, t = {}) {
510
- let n = mt(e), r = n.pathname, i = gt(n.searchParams);
511
- if (r === "/platform/dynamic") throw Error(`Invalid dynamic module URL: ${e}`);
512
- if (r.startsWith("/platform/dynamic/")) {
513
- let [, , , n, a] = r.split("/");
514
- if (!n) throw Error(`Invalid dynamic module URL: ${e}`);
515
- let o = ht(i, [
516
- ...Ye,
517
- Je,
518
- X,
519
- Z,
520
- "queryTemplateId",
521
- "uiConfigId"
522
- ]), s = vt(i, X, "menuId");
523
- return {
524
- pageType: "dynamic-module",
525
- openMode: "dynamic-runner",
526
- hostType: "dynamic-module-host",
527
- title: vt(i, Z, "title") ?? t.title,
528
- menuId: s,
529
- target: {
530
- moduleAlias: decodeURIComponent(n ?? ""),
531
- pageMode: bt(a),
532
- defaultUiConfigId: _t(i.uiConfigId),
533
- defaultQueryTemplateId: _t(i.queryTemplateId)
534
- },
535
- params: o,
536
- entryParamsJson: vt(i, Je, "entryParamsJson"),
537
- tabPolicy: s ? {
538
- identity: "by-menu",
539
- closable: !0,
540
- cacheable: !0
541
- } : {
542
- identity: "by-target",
543
- closable: !0,
544
- cacheable: !0
545
- }
546
- };
547
- }
548
- if (r === "/platform/external") {
549
- let n = _t(i.url) ?? "";
550
- if (!n) throw Error(`Invalid external page URL: ${e}`);
551
- let r = _t(i.mode) === "new-window" ? "new-window" : "iframe", a = vt(i, X, "menuId"), o = a ? {
552
- identity: "by-menu",
553
- closable: !0
554
- } : {
555
- identity: "by-target",
556
- closable: !0
557
- };
558
- return r === "iframe" ? {
559
- pageType: "remote-url",
560
- openMode: r,
561
- hostType: "external-page-host",
562
- title: vt(i, Z, "title") ?? t.title,
563
- menuId: a,
564
- target: { url: n },
565
- tabPolicy: o
566
- } : {
567
- pageType: "external-link",
568
- openMode: r,
569
- hostType: "external-page-host",
570
- title: vt(i, Z, "title") ?? t.title,
571
- menuId: a,
572
- target: { url: n },
573
- tabPolicy: o
574
- };
575
- }
576
- if (r === "/platform/workspace" && !i.routeName && !i.pageKey) throw Error(`Invalid workspace URL: ${e}`);
577
- if (r === "/platform/workspace" && (i.routeName || i.pageKey)) {
578
- let e = {
579
- routeName: _t(i.routeName),
580
- pageKey: _t(i.pageKey),
581
- query: ht(i, [
582
- ...Ye,
583
- X,
584
- Z,
585
- "pageType",
586
- "routeName",
587
- "pageKey"
588
- ])
589
- }, n = _t(i.pageType) === "business-route" ? "business-route" : "platform-route", r = vt(i, X, "menuId"), a = {
590
- openMode: "workbench-route",
591
- title: vt(i, Z, "title") ?? t.title,
592
- menuId: r,
593
- target: e,
594
- params: e.query,
595
- tabPolicy: r ? {
596
- identity: "by-menu",
597
- closable: !0,
598
- cacheable: !0
599
- } : {
600
- identity: "by-target",
601
- closable: !0,
602
- cacheable: !0
603
- }
604
- };
605
- return n === "business-route" ? {
606
- ...a,
607
- pageType: "business-route",
608
- hostType: "business-route-host",
609
- layout: ot(e, t)
610
- } : {
611
- ...a,
612
- pageType: "platform-route",
613
- hostType: "platform-route-host"
614
- };
615
- }
616
- let a = st(r, t) ? "business-route" : "platform-route", o = vt(i, X), s = ht(i, [
617
- Je,
618
- X,
619
- Z
620
- ]), c = {
621
- openMode: "workbench-route",
622
- title: vt(i, Z) ?? t.title,
623
- menuId: o,
624
- target: {
625
- route: r,
626
- query: s
627
- },
628
- params: s,
629
- entryParamsJson: vt(i, Je),
630
- tabPolicy: o ? {
631
- identity: "by-menu",
632
- closable: !0,
633
- cacheable: !0
634
- } : {
635
- identity: "by-target",
636
- closable: !0,
637
- cacheable: !0
638
- }
639
- };
640
- return a === "business-route" ? {
641
- ...c,
642
- pageType: "business-route",
643
- hostType: "business-route-host",
644
- layout: ot(c.target, t)
645
- } : {
646
- ...c,
647
- pageType: "platform-route",
648
- hostType: "platform-route-host"
649
- };
650
- }
651
- function rt(e, t = {}) {
652
- try {
653
- return $(e, t);
654
- } catch {
655
- return;
656
- }
657
- }
658
- function it(e, t, n) {
659
- return e.startsWith("/") ? {
660
- route: e,
661
- moduleAlias: n,
662
- query: t
663
- } : e.includes(".") ? {
664
- routeName: e,
665
- moduleAlias: n,
666
- query: t
667
- } : {
668
- pageKey: e,
669
- moduleAlias: n,
670
- query: t
671
- };
672
- }
673
- function at(e, t) {
674
- return (e.route ? st(e.route, t) : !1) || (e.routeName ? t.businessRouteNames?.includes(e.routeName) === !0 : !1) || (e.pageKey ? t.businessPageKeys?.includes(e.pageKey) === !0 : !1);
675
- }
676
- function ot(e, t) {
677
- return e.route ? t.businessRouteLayouts?.[e.route] : void 0;
678
- }
679
- function st(e, t) {
680
- let n = pt(e, t.businessRoutePrefixes ?? qe);
681
- if (n < 0) return !1;
682
- let r = pt(e, t.platformRoutePrefixes ?? yt);
683
- return r < 0 || n > r;
684
- }
685
- function ct(e) {
686
- 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;
687
- }
688
- function lt(e, t) {
689
- let n = t ? ut(t) : "";
690
- return n ? `${e}${e.includes("?") ? "&" : "?"}${n}` : e;
691
- }
692
- function ut(e) {
693
- let t = new URLSearchParams();
694
- for (let n of Object.keys(e).sort()) {
695
- let r = e[n];
696
- if (Array.isArray(r)) {
697
- for (let e of r) dt(t, n, e);
698
- continue;
699
- }
700
- dt(t, n, r);
701
- }
702
- return t.toString();
703
- }
704
- function dt(e, t, n) {
705
- n != null && e.append(t, String(n));
706
- }
707
- function ft(e, t) {
708
- let n = t.endsWith("/") ? t.slice(0, -1) : t;
709
- return e === n || e.startsWith(`${n}/`);
710
- }
711
- function pt(e, t) {
712
- let n = -1;
713
- for (let r of t) {
714
- let t = r.endsWith("/") ? r.slice(0, -1) : r;
715
- ft(e, t) && (n = Math.max(n, t.length));
716
- }
717
- return n;
718
- }
719
- function mt(e) {
720
- return new URL(e, "http://muyun.local");
721
- }
722
- function ht(e, t) {
723
- let n = {};
724
- for (let r of Object.keys(e)) t.includes(r) || (n[r] = e[r]);
725
- return Object.keys(n).length > 0 ? n : void 0;
726
- }
727
- function gt(e) {
728
- let t = {};
729
- for (let n of e.keys()) {
730
- let r = e.getAll(n);
731
- t[n] = r.length > 1 ? r : r[0];
732
- }
733
- return t;
734
- }
735
- function _t(e) {
736
- return Array.isArray(e) ? e[0] === null || e[0] === void 0 ? void 0 : String(e[0]) : e == null ? void 0 : String(e);
737
- }
738
- function vt(e, t, n) {
739
- return _t(e[t]) ?? (n ? _t(e[n]) : void 0);
740
- }
741
- var yt = ["/platform"];
742
- function bt(e) {
743
- let t = e?.toUpperCase();
744
- return t === "LIST" || t === "FORM" || t === "DETAIL" ? t : void 0;
745
- }
746
- function xt(e) {
747
- throw Error(`Unsupported page descriptor: ${JSON.stringify(e)}`);
748
- }
749
- //#endregion
750
- //#region src/platform-workbench/menuTreeModel.ts
751
- function St(e) {
752
- return e.map(Mt);
753
- }
754
- function Ct(e, t) {
755
- let n = t.trim().toLowerCase();
756
- return n ? e.map((e) => {
757
- let t = Ct(e.children, n);
758
- if (!Nt(e, n)) return t.length > 0 ? {
759
- ...e,
760
- children: t
761
- } : void 0;
762
- if (e.navigable) return {
763
- ...e,
764
- children: t
765
- };
766
- let r = wt(e.children);
767
- return r.length > 0 ? {
768
- ...e,
769
- children: r
770
- } : void 0;
771
- }).filter((e) => !!e) : e;
772
- }
773
- function wt(e) {
774
- return e.map((e) => {
775
- let t = wt(e.children);
776
- return e.navigable || t.length > 0 ? {
777
- ...e,
778
- children: t
779
- } : void 0;
780
- }).filter((e) => !!e);
781
- }
782
- function Tt(e, t, n = []) {
783
- for (let r of e) {
784
- let e = [...n, r];
785
- if (r.record.id === t) return e;
786
- let i = Tt(r.children, t, e);
787
- if (i.length > 0) return i;
788
- }
789
- return [];
790
- }
791
- function Et(e, t) {
792
- for (let n of e) {
793
- if (n.record.id === t) return n;
794
- let e = Et(n.children, t);
795
- if (e) return e;
796
- }
797
- }
798
- function Dt(e) {
799
- for (let t of e.children) for (let e of t.children) if (e.hasChildren) return e.record.id;
800
- }
801
- function Ot(e, t, n = 3) {
802
- let r = t ? Et(e.children, t) : void 0, i = e.children;
803
- return {
804
- root: e,
805
- groups: i,
806
- columns: kt(i, n),
807
- activeDeepRoot: r?.hasChildren ? r : void 0
808
- };
809
- }
810
- function kt(e, t) {
811
- if (e.length === 0) return [];
812
- let n = Math.max(1, Math.min(Math.floor(t), e.length)), r = Array.from({ length: n }, () => []), i = e.reduce((e, t) => e + At(t), 0) / n, a = 0, o = 0;
813
- for (let t = 0; t < e.length; t += 1) {
814
- let s = e[t], c = At(s), l = e.length - t, u = n - a;
815
- r[a].length > 0 && a < n - 1 && (l <= u || o + c > i) && (a += 1, o = 0), r[a].push(s), o += c;
816
- }
817
- return r;
818
- }
819
- function At(e) {
820
- let t = jt(e.record.title), n = e.children.reduce((e, t) => {
821
- let n = t.hasChildren ? .7 + t.children.length * .25 : 0;
822
- return e + 1 + n + jt(t.record.title) * .4;
823
- }, 0);
824
- return 1.25 + t + n;
825
- }
826
- function jt(e) {
827
- return Math.max(0, Math.ceil(e.length / 10) - 1) * .35;
828
- }
829
- function Mt(e) {
830
- let t = St(e.children), n = Xe(e.record);
831
- return {
832
- record: e.record,
833
- children: t,
834
- target: n,
835
- navigable: !!n,
836
- hasChildren: t.length > 0
837
- };
838
- }
839
- function Nt(e, t) {
840
- return e.record.title.toLowerCase().includes(t) || e.record.moduleAlias?.toLowerCase().includes(t) === !0 || e.record.route?.toLowerCase().includes(t) === !0;
841
- }
842
- //#endregion
843
- //#region src/platform-workbench/realtimeStatus.ts
844
- function Pt(e) {
845
- if (e === "connected") return {
846
- label: "实时连接正常",
847
- title: "与平台实时服务连接正常",
848
- tone: e
849
- };
850
- if (e === "connecting") return {
851
- label: "实时连接中",
852
- title: "正在连接平台实时服务",
853
- tone: e
854
- };
855
- if (e === "disconnected") return {
856
- label: "实时连接已断开",
857
- title: "与平台实时服务的连接已断开,正在等待恢复",
858
- tone: e
859
- };
860
- }
861
- //#endregion
862
- //#region src/platform-workbench/WorkbenchMenu.vue?vue&type=script&setup=true&lang.ts
863
- var Ft = ["id"], It = {
864
- key: 0,
865
- class: "menu-search"
866
- }, Lt = {
867
- class: "root-menu",
868
- "aria-label": "主导航"
869
- }, Rt = {
870
- key: 0,
871
- class: "root-menu-list"
872
- }, zt = ["onMouseenter"], Bt = ["aria-current", "onClick"], Vt = [
873
- "aria-label",
874
- "aria-expanded",
875
- "onClick"
876
- ], Ht = {
877
- key: 0,
878
- class: "root-menu-branch-indicator",
879
- "aria-hidden": "true"
880
- }, Ut = {
881
- key: 2,
882
- class: "sidebar-menu-level sidebar-menu-level--2"
883
- }, Wt = {
884
- key: 0,
885
- class: "sidebar-menu-level sidebar-menu-level--3"
886
- }, Gt = {
887
- key: 1,
888
- class: "compact-menu-tools"
889
- }, Kt = { class: "menu-search" }, qt = ["title"], Jt = { class: "mega-body" }, Yt = { class: "mega-groups" }, Xt = [
890
- "disabled",
891
- "aria-current",
892
- "onClick"
893
- ], Zt = { class: "mega-entry-list" }, Qt = ["onKeydown"], $t = [
894
- "disabled",
895
- "aria-current",
896
- "aria-label",
897
- "aria-expanded",
898
- "aria-controls",
899
- "onClick"
900
- ], en = {
901
- key: 0,
902
- class: "mega-entry-indicator",
903
- "aria-hidden": "true"
904
- }, tn = [
905
- "aria-label",
906
- "aria-expanded",
907
- "onClick",
908
- "onKeydown"
909
- ], nn = ["onKeydown"], rn = ["aria-label"], an = { class: "sidebar-submenu-tree" }, on = 168, sn = 18, cn = 28, ln = 1040, un = 24, dn = 620, fn = 360, pn = 320, mn = 140, hn = 240, gn = /*#__PURE__*/ d(/* @__PURE__ */ A({
910
- name: "WorkbenchMenu",
911
- __name: "WorkbenchMenu",
912
- props: {
913
- menus: {},
914
- selectedMenuId: { default: void 0 },
915
- tenantLabel: { default: "系统工作区" },
916
- logoSrc: { default: void 0 },
917
- showTitleArea: {
918
- type: Boolean,
919
- default: !0
920
- },
921
- brandTitle: { default: "MuYun" },
922
- brandSubtitle: { default: void 0 },
923
- searchPlaceholder: { default: "" },
924
- realtimeStatus: { default: "unavailable" },
925
- presentation: { default: "expanded" },
926
- expandedMenuDepth: { default: 1 },
927
- compactOpen: {
928
- type: Boolean,
929
- default: !1
930
- },
931
- compactTop: { default: 54 },
932
- compactAnchor: { default: void 0 }
933
- },
934
- emits: [
935
- "selectMenu",
936
- "invalidMenu",
937
- "compactMenuEnter",
938
- "compactMenuLeave",
939
- "compactMenuClose",
940
- "changePresentation",
941
- "changeExpandedMenuDepth"
942
- ],
943
- setup(e, { emit: t }) {
944
- let n = e, r = t, i = R(), o = R(), s = R(), c = R(""), l = R(), u = R(), d = R(), f = R(8), ee = R(0), m = R(0), te = R(820), ne = R(3), re = R(0), ie = R(0), ae = R(0), h = Ve(hn), oe = S(() => St(n.menus)), _ = S(() => Ct(oe.value, c.value)), se = S(() => n.selectedMenuId ? Tt(oe.value, n.selectedMenuId) : []), ce = S(() => se.value[0]?.record.id), le = S(() => se.value.map((e) => e.record.id)), ue = S(() => Pt(n.realtimeStatus)), v = S(() => {
945
- let e = l.value ? Et(_.value, l.value) : void 0;
946
- return e?.hasChildren ? e : void 0;
947
- }), de = S(() => v.value ? Ot(v.value, u.value, ne.value) : void 0), y = S(() => de.value?.activeDeepRoot), fe = S(() => d.value ? Et(_.value, d.value) : void 0), pe = S(() => de.value?.columns.length ?? 1), me = S(() => n.presentation === "expanded" || n.compactOpen), b = S(() => n.presentation === "compact"), he = S(() => b.value || n.expandedMenuDepth === 1), ge, ve, D, k, A = [];
948
- H(() => n.compactOpen, (e) => {
949
- if (!e) {
950
- q();
951
- return;
952
- }
953
- }), H(() => n.expandedMenuDepth, () => q()), H(() => n.presentation, () => q()), Se(() => {
954
- We(), G();
955
- });
956
- function j(e) {
957
- q(), e.target ? r("selectMenu", e.record, e.target) : r("invalidMenu", e.record);
958
- }
959
- function M(e, t) {
960
- if (d.value === e.record.id) {
961
- if (h.consumeImmediateClick(e.record.id)) return;
962
- J();
963
- return;
964
- }
965
- h.clear(), Me(e, t);
966
- }
967
- function N(e, t) {
968
- q(), r("selectMenu", e, t);
969
- }
970
- function P(e, t) {
971
- if (!xe()) return;
972
- let n = t.currentTarget;
973
- if (Ee(d.value, e.record.id, t, s.value)) {
974
- W(() => L(e, n));
975
- return;
976
- }
977
- if (l.value === e.record.id) {
978
- G();
979
- return;
980
- }
981
- if (Ee(l.value, e.record.id, t, o.value)) {
982
- W(() => L(e, n));
983
- return;
984
- }
985
- L(e, n);
986
- }
987
- function xe() {
988
- return typeof window.matchMedia != "function" || window.matchMedia("(hover: hover)").matches;
989
- }
990
- function L(e, t) {
991
- Ce(e, t), l.value === e.record.id && h.markHoverActivation(e.record.id);
992
- }
993
- function Ce(e, t) {
994
- if (G(), !e.hasChildren) {
995
- q();
996
- return;
997
- }
998
- if (!b.value && n.expandedMenuDepth > 1) {
999
- J();
1000
- return;
1001
- }
1002
- We(), d.value = void 0, l.value = e.record.id, u.value = void 0, Ye(t), ye(Xe);
1003
- }
1004
- function we(e, t) {
1005
- if (l.value === e.record.id) {
1006
- if (h.consumeImmediateClick(e.record.id)) return;
1007
- q();
1008
- return;
1009
- }
1010
- h.clear(), Ce(e, t.currentTarget instanceof HTMLElement ? t.currentTarget.closest(".root-menu-item") : null);
1011
- }
1012
- function Ee(e, t, n, r) {
1013
- let i = r?.getBoundingClientRect();
1014
- if (!e || e === t || !i) return !1;
1015
- let a = {
1016
- x: n.clientX,
1017
- y: n.clientY
1018
- }, o = n.timeStamp - mn, s = A.at(-1);
1019
- if (s && s.x > a.x) return !1;
1020
- let c = De(a, o);
1021
- return !!(c && He(a, c, {
1022
- left: i.left,
1023
- top: i.top,
1024
- bottom: i.bottom
1025
- }));
1026
- }
1027
- function De(e, t) {
1028
- for (let n = A.length - 1; n >= 0; --n) {
1029
- let r = A[n];
1030
- if (r.at < t) break;
1031
- if (r.x <= e.x - 4) return r;
1032
- }
1033
- }
1034
- function W(e) {
1035
- G(), k = window.setTimeout(() => {
1036
- k = void 0, e();
1037
- }, pn);
1038
- }
1039
- function G() {
1040
- k !== void 0 && (window.clearTimeout(k), k = void 0);
1041
- }
1042
- function K(e) {
1043
- let t = e.timeStamp - mn;
1044
- A = A.filter((e) => e.at >= t);
1045
- let n = A.at(-1);
1046
- (!n || Math.hypot(e.clientX - n.x, e.clientY - n.y) >= 2) && A.push({
1047
- x: e.clientX,
1048
- y: e.clientY,
1049
- at: e.timeStamp
1050
- });
1051
- }
1052
- function q() {
1053
- We(), G(), A = [], h.clear(), l.value = void 0, u.value = void 0, J();
1054
- }
1055
- function J() {
1056
- G(), d.value = void 0;
1057
- }
1058
- function Ae(e, t, n = t.currentTarget) {
1059
- if (xe()) {
1060
- if (d.value === e.record.id) {
1061
- G();
1062
- return;
1063
- }
1064
- if (Ee(d.value, e.record.id, t, s.value)) {
1065
- W(() => je(e, n));
1066
- return;
1067
- }
1068
- je(e, n);
1069
- }
1070
- }
1071
- function je(e, t) {
1072
- Me(e, t), d.value === e.record.id && h.markHoverActivation(e.record.id);
1073
- }
1074
- function Me(e, t) {
1075
- if (G(), !e.hasChildren) {
1076
- J();
1077
- return;
1078
- }
1079
- We(), l.value = void 0, u.value = void 0, d.value = e.record.id, Ne(t), ye(Fe);
1080
- }
1081
- function Ne(e) {
1082
- if (!(e instanceof HTMLElement)) return;
1083
- let t = e.getBoundingClientRect(), n = i.value?.getBoundingClientRect(), r = n?.top ?? 0, a = n?.left ?? 0, o = Math.min(window.innerHeight - 16, dn);
1084
- re.value = Ge(t.top, o, window.innerHeight, r), ie.value = Math.round(t.right - a), ae.value = Math.round(t.top - r);
1085
- }
1086
- function Fe() {
1087
- let e = s.value;
1088
- if (!e) return;
1089
- let t = i.value?.getBoundingClientRect().top ?? 0, n = e.offsetHeight;
1090
- re.value = Ge(t + ae.value, n, window.innerHeight, t);
1091
- }
1092
- function Le() {
1093
- We(), G(), b.value && r("compactMenuEnter");
1094
- }
1095
- function Re(e) {
1096
- if (b.value) {
1097
- r("compactMenuLeave");
1098
- return;
1099
- }
1100
- Ue(e) || ze();
1101
- }
1102
- function ze() {
1103
- q(), b.value && r("compactMenuLeave");
1104
- }
1105
- function Ue(e) {
1106
- let t = o.value?.getBoundingClientRect();
1107
- return !v.value || !t || e.clientX > t.left + 8 ? !1 : (ve = {
1108
- x: e.clientX,
1109
- y: e.clientY
1110
- }, D = {
1111
- left: t.left,
1112
- top: t.top,
1113
- bottom: t.bottom
1114
- }, window.addEventListener("pointermove", Y), ge = window.setTimeout(ze, fn), !0);
1115
- }
1116
- function Y(e) {
1117
- !ve || !D || He({
1118
- x: e.clientX,
1119
- y: e.clientY
1120
- }, ve, D) || ze();
1121
- }
1122
- function We() {
1123
- ge !== void 0 && (window.clearTimeout(ge), ge = void 0), window.removeEventListener("pointermove", Y), ve = void 0, D = void 0;
1124
- }
1125
- function Ke() {
1126
- b.value && r("compactMenuEnter");
1127
- }
1128
- function qe(e) {
1129
- let t = e.currentTarget;
1130
- t instanceof HTMLElement && t.contains(e.relatedTarget) || b.value && r("compactMenuLeave");
1131
- }
1132
- function X(e) {
1133
- r("changePresentation", e);
1134
- }
1135
- function Z(e) {
1136
- r("changeExpandedMenuDepth", e);
1137
- }
1138
- function Je(e) {
1139
- if (e.key === "Escape") {
1140
- if (u.value) {
1141
- et(), e.stopPropagation();
1142
- return;
1143
- }
1144
- q(), b.value && r("compactMenuClose");
1145
- }
1146
- }
1147
- function Ye(e) {
1148
- if (!(e instanceof HTMLElement)) return;
1149
- let t = e.getBoundingClientRect(), n = i.value?.getBoundingClientRect(), r = n?.top ?? 0, a = Math.min(window.innerHeight - 16, dn), o = n?.left ?? 0;
1150
- f.value = Ge(t.top, a, window.innerHeight, r), ee.value = Math.round(t.right - o), m.value = Math.round(t.top - r), Ze();
1151
- }
1152
- function Xe() {
1153
- let e = o.value;
1154
- if (!e) return;
1155
- let t = i.value?.getBoundingClientRect().top ?? 0;
1156
- f.value = Ge(t + m.value, e.offsetHeight, window.innerHeight, t);
1157
- }
1158
- function Ze() {
1159
- let e = Qe(), t = Math.max(0, Math.min(e, ln)), n = v.value?.children.length ?? 0, r = Math.max(1, Math.min(4, n || 1, Math.floor((t - cn + sn) / 186) || 1)), i = r * on + Math.max(0, r - 1) * sn + cn, a = Math.min(e, ln, i);
1160
- ne.value = r, te.value = Math.max(280, a);
1161
- }
1162
- function Qe() {
1163
- let e = (i.value?.getBoundingClientRect().left ?? 0) + ee.value;
1164
- return Math.max(280, window.innerWidth - e - un);
1165
- }
1166
- function $e(e) {
1167
- e.hasChildren && (u.value = u.value === e.record.id ? void 0 : e.record.id, ye(Xe));
1168
- }
1169
- function Q(e) {
1170
- e.navigable ? j(e) : $e(e);
1171
- }
1172
- function et() {
1173
- u.value = void 0, ye(Xe);
1174
- }
1175
- function tt(e, t) {
1176
- e.hasChildren && (t.key === "ArrowRight" && u.value !== e.record.id ? (t.preventDefault(), u.value = e.record.id, ye(Xe)) : t.key === "ArrowLeft" && u.value === e.record.id && (t.preventDefault(), u.value = void 0, ye(Xe)));
1177
- }
1178
- function nt(e) {
1179
- return ce.value === e.record.id;
1180
- }
1181
- function $(e) {
1182
- return n.selectedMenuId === e.record.id;
1183
- }
1184
- function rt(e) {
1185
- return !$(e) && le.value.includes(e.record.id);
1186
- }
1187
- return (t, n) => (I(), T("div", {
1188
- ref_key: "menuShell",
1189
- ref: i,
1190
- class: F(["workbench-menu", {
1191
- "mega-open": v.value,
1192
- "workbench-menu--compact": b.value,
1193
- "workbench-menu--expanded": !b.value,
1194
- "workbench-menu--compact-open": b.value && e.compactOpen
1195
- }]),
1196
- style: be(b.value ? { "--compact-menu-top": `${e.compactTop}px` } : void 0),
1197
- onMouseenter: Le,
1198
- onMouseleave: Re,
1199
- onPointermove: K,
1200
- onFocusin: Ke,
1201
- onFocusout: qe,
1202
- onKeydown: Je
1203
- }, [
1204
- O(_e, { name: "workbench-menu-panel" }, {
1205
- default: U(() => [me.value ? (I(), T("aside", {
1206
- key: 0,
1207
- id: b.value ? "workbench-compact-menu" : void 0,
1208
- class: "menu-sidebar"
1209
- }, [
1210
- O(_e, { name: "workbench-sidebar-brand" }, {
1211
- default: U(() => [b.value ? w("v-if", !0) : (I(), C(Pe, {
1212
- key: 0,
1213
- presentation: "expanded",
1214
- "tenant-label": e.tenantLabel,
1215
- "logo-src": e.logoSrc,
1216
- "show-title-area": e.showTitleArea,
1217
- "brand-title": e.brandTitle,
1218
- "brand-subtitle": e.brandSubtitle,
1219
- "expanded-menu-depth": e.expandedMenuDepth,
1220
- onChangePresentation: X,
1221
- onChangeExpandedMenuDepth: Z
1222
- }, null, 8, [
1223
- "tenant-label",
1224
- "logo-src",
1225
- "show-title-area",
1226
- "brand-title",
1227
- "brand-subtitle",
1228
- "expanded-menu-depth"
1229
- ]))]),
1230
- _: 1
1231
- }),
1232
- b.value ? w("v-if", !0) : (I(), T("div", It, [O(V(p), { name: "search" }), O(V(a), {
1233
- value: c.value,
1234
- "onUpdate:value": n[0] ||= (e) => c.value = e,
1235
- type: "search",
1236
- "allow-clear": "",
1237
- placeholder: e.searchPlaceholder,
1238
- "aria-label": "搜索菜单"
1239
- }, null, 8, ["value", "placeholder"])])),
1240
- E("nav", Lt, [_.value.length > 0 ? (I(), T("div", Rt, [(I(!0), T(x, null, z(_.value, (t) => (I(), T(x, { key: t.record.id }, [t.navigable && t.hasChildren && he.value ? (I(), T("div", {
1241
- key: 0,
1242
- class: F(["root-menu-item root-menu-item--split navigable branch", {
1243
- active: v.value?.record.id === t.record.id,
1244
- selected: $(t),
1245
- "selected-path": nt(t) && !$(t)
1246
- }]),
1247
- onMouseenter: (e) => P(t, e)
1248
- }, [E("button", {
1249
- class: "root-menu-item-main navigable",
1250
- type: "button",
1251
- "aria-current": nt(t) ? "page" : void 0,
1252
- onClick: (e) => j(t)
1253
- }, [E("span", null, B(t.record.title), 1)], 8, Bt), E("button", {
1254
- class: "root-menu-item-trigger",
1255
- type: "button",
1256
- "aria-label": `${v.value?.record.id === t.record.id ? "收起" : "展开"}${t.record.title}下级菜单`,
1257
- "aria-expanded": v.value?.record.id === t.record.id,
1258
- "aria-controls": "workbench-mega-panel",
1259
- onClick: ke((e) => we(t, e), ["stop"])
1260
- }, [...n[2] ||= [E("i", {
1261
- class: "root-menu-branch-indicator",
1262
- "aria-hidden": "true"
1263
- }, null, -1)]], 8, Vt)], 42, zt)) : (I(), C(Te(t.navigable || he.value ? "button" : "div"), {
1264
- key: 1,
1265
- class: F(["root-menu-item", {
1266
- active: v.value?.record.id === t.record.id,
1267
- selected: $(t),
1268
- "selected-path": nt(t) && !$(t),
1269
- navigable: t.navigable,
1270
- branch: t.hasChildren
1271
- }]),
1272
- type: t.navigable || he.value ? "button" : void 0,
1273
- "aria-expanded": t.hasChildren && he.value ? v.value?.record.id === t.record.id : void 0,
1274
- "aria-controls": t.hasChildren && he.value && v.value?.record.id === t.record.id ? "workbench-mega-panel" : void 0,
1275
- onMouseenter: (e) => he.value && P(t, e),
1276
- onClick: (e) => t.navigable ? j(t) : he.value && we(t, e)
1277
- }, {
1278
- default: U(() => [E("span", null, B(t.record.title), 1), t.hasChildren && he.value ? (I(), T("i", Ht)) : w("v-if", !0)]),
1279
- _: 2
1280
- }, 1064, [
1281
- "class",
1282
- "type",
1283
- "aria-expanded",
1284
- "aria-controls",
1285
- "onMouseenter",
1286
- "onClick"
1287
- ])), !b.value && e.expandedMenuDepth >= 2 ? (I(), T("div", Ut, [(I(!0), T(x, null, z(t.children, (t) => (I(), T(x, { key: t.record.id }, [O(Be, {
1288
- node: t,
1289
- mode: e.expandedMenuDepth === 2 ? "flyout" : "inline",
1290
- selected: $(t),
1291
- "selected-path": rt(t),
1292
- active: fe.value?.record.id === t.record.id,
1293
- onSelect: j,
1294
- onOpenChildren: Ae,
1295
- onToggleChildren: M
1296
- }, null, 8, [
1297
- "node",
1298
- "mode",
1299
- "selected",
1300
- "selected-path",
1301
- "active"
1302
- ]), e.expandedMenuDepth >= 3 ? (I(), T("div", Wt, [(I(!0), T(x, null, z(t.children, (e) => (I(), C(Be, {
1303
- key: e.record.id,
1304
- node: e,
1305
- mode: "flyout",
1306
- selected: $(e),
1307
- "selected-path": rt(e),
1308
- active: fe.value?.record.id === e.record.id,
1309
- onSelect: j,
1310
- onOpenChildren: Ae,
1311
- onToggleChildren: M
1312
- }, null, 8, [
1313
- "node",
1314
- "selected",
1315
- "selected-path",
1316
- "active"
1317
- ]))), 128))])) : w("v-if", !0)], 64))), 128))])) : w("v-if", !0)], 64))), 128))])) : (I(), C(V(g), {
1318
- key: 1,
1319
- description: "暂无菜单"
1320
- }))]),
1321
- b.value ? (I(), T("div", Gt, [E("div", Kt, [O(V(p), { name: "search" }), O(V(a), {
1322
- value: c.value,
1323
- "onUpdate:value": n[1] ||= (e) => c.value = e,
1324
- type: "search",
1325
- "allow-clear": "",
1326
- placeholder: e.searchPlaceholder,
1327
- "aria-label": "搜索菜单"
1328
- }, null, 8, ["value", "placeholder"])])])) : w("v-if", !0),
1329
- !b.value && ue.value ? (I(), T("div", {
1330
- key: 2,
1331
- class: F(["sidebar-footer", `realtime-${ue.value.tone}`]),
1332
- title: ue.value.title,
1333
- role: "status"
1334
- }, [n[3] ||= E("div", { class: "status-dot" }, null, -1), E("span", null, B(ue.value.label), 1)], 10, qt)) : w("v-if", !0)
1335
- ], 8, Ft)) : w("v-if", !0)]),
1336
- _: 1
1337
- }),
1338
- O(_e, { name: "workbench-mega-panel" }, {
1339
- default: U(() => [v.value ? (I(), T("section", {
1340
- key: 0,
1341
- id: "workbench-mega-panel",
1342
- ref_key: "megaPanel",
1343
- ref: o,
1344
- class: "mega-panel",
1345
- style: be({
1346
- "--mega-panel-top": `${f.value}px`,
1347
- "--mega-panel-left": `${ee.value}px`,
1348
- "--mega-panel-width": `${te.value}px`,
1349
- "--mega-column-count": pe.value
1350
- }),
1351
- onMouseenter: Le
1352
- }, [E("div", Jt, [E("div", Yt, [(I(!0), T(x, null, z(de.value?.columns ?? [], (e, t) => (I(), T("div", {
1353
- key: `mega-column-${t}`,
1354
- class: "mega-column"
1355
- }, [(I(!0), T(x, null, z(e, (e) => (I(), T("section", {
1356
- key: e.record.id,
1357
- class: "mega-group"
1358
- }, [E("button", {
1359
- class: F(["mega-group-title", {
1360
- navigable: e.navigable,
1361
- selected: $(e),
1362
- "selected-path": rt(e)
1363
- }]),
1364
- type: "button",
1365
- disabled: !e.navigable,
1366
- "aria-current": $(e) ? "page" : void 0,
1367
- onClick: (t) => j(e)
1368
- }, [E("span", null, B(e.record.title), 1)], 10, Xt), E("div", Zt, [(I(!0), T(x, null, z(e.children, (e) => (I(), T("div", {
1369
- key: e.record.id,
1370
- class: F(["mega-entry", {
1371
- navigable: e.navigable,
1372
- active: y.value?.record.id === e.record.id,
1373
- selected: $(e),
1374
- "selected-path": rt(e)
1375
- }]),
1376
- onKeydown: (t) => tt(e, t)
1377
- }, [E("button", {
1378
- class: "mega-entry-main",
1379
- type: "button",
1380
- disabled: !e.navigable && !e.hasChildren,
1381
- "aria-current": $(e) ? "page" : void 0,
1382
- "aria-label": !e.navigable && e.hasChildren ? `${y.value?.record.id === e.record.id ? "收起" : "展开"}${e.record.title}下级菜单` : void 0,
1383
- "aria-expanded": !e.navigable && e.hasChildren ? y.value?.record.id === e.record.id : void 0,
1384
- "aria-controls": !e.navigable && e.hasChildren ? "workbench-mega-deep-panel" : void 0,
1385
- onClick: (t) => Q(e)
1386
- }, [E("span", null, B(e.record.title), 1), e.hasChildren && !e.navigable ? (I(), T("i", en)) : w("v-if", !0)], 8, $t), e.hasChildren && e.navigable ? (I(), T("button", {
1387
- key: 0,
1388
- class: "mega-entry-trigger",
1389
- type: "button",
1390
- "aria-label": `${y.value?.record.id === e.record.id ? "收起" : "展开"}${e.record.title}下级菜单`,
1391
- "aria-expanded": y.value?.record.id === e.record.id,
1392
- "aria-controls": "workbench-mega-deep-panel",
1393
- onClick: ke((t) => $e(e), ["stop"]),
1394
- onKeydown: Oe(ke(et, ["stop"]), ["esc"])
1395
- }, [...n[4] ||= [E("i", {
1396
- class: "mega-entry-indicator",
1397
- "aria-hidden": "true"
1398
- }, null, -1)]], 40, tn)) : w("v-if", !0)], 42, Qt))), 128))])]))), 128))]))), 128))]), O(_e, {
1399
- name: "mega-deep-dock",
1400
- duration: {
1401
- enter: 160,
1402
- leave: 0
1403
- },
1404
- onAfterEnter: Xe,
1405
- onAfterLeave: Xe
1406
- }, {
1407
- default: U(() => [y.value ? (I(), T("aside", {
1408
- key: 0,
1409
- id: "workbench-mega-deep-panel",
1410
- class: "mega-deep-panel",
1411
- onMouseenter: Le,
1412
- onKeydown: Oe(ke(et, ["stop"]), ["esc"])
1413
- }, [E("ul", {
1414
- class: "mega-deep-tree",
1415
- "aria-label": `${y.value.record.title}下级菜单`
1416
- }, [(I(!0), T(x, null, z(y.value.children, (t) => (I(), C(Ie, {
1417
- key: t.record.id,
1418
- node: t,
1419
- "selected-menu-id": e.selectedMenuId,
1420
- "selected-path-ids": le.value,
1421
- onSelectMenu: N
1422
- }, null, 8, [
1423
- "node",
1424
- "selected-menu-id",
1425
- "selected-path-ids"
1426
- ]))), 128))], 8, rn)], 40, nn)) : w("v-if", !0)]),
1427
- _: 1
1428
- })])], 36)) : w("v-if", !0)]),
1429
- _: 1
1430
- }),
1431
- O(_e, { name: "workbench-mega-panel" }, {
1432
- default: U(() => [fe.value ? (I(), T("aside", {
1433
- key: 0,
1434
- id: "workbench-sidebar-submenu-panel",
1435
- ref_key: "sidebarSubmenuPanel",
1436
- ref: s,
1437
- class: "sidebar-submenu-panel",
1438
- "aria-label": "下级菜单",
1439
- style: be({
1440
- "--sidebar-submenu-top": `${re.value}px`,
1441
- "--sidebar-submenu-left": `${ie.value}px`
1442
- }),
1443
- onMouseenter: Le
1444
- }, [E("ul", an, [(I(!0), T(x, null, z(fe.value.children, (t) => (I(), C(Ie, {
1445
- key: t.record.id,
1446
- node: t,
1447
- "selected-menu-id": e.selectedMenuId,
1448
- "selected-path-ids": le.value,
1449
- onSelectMenu: N
1450
- }, null, 8, [
1451
- "node",
1452
- "selected-menu-id",
1453
- "selected-path-ids"
1454
- ]))), 128))])], 36)) : w("v-if", !0)]),
1455
- _: 1
1456
- })
1457
- ], 38));
1458
- }
1459
- }), [["__scopeId", "data-v-50badb38"]]), _n = { class: "app-main" }, vn = { class: "topbar-identity" }, yn = {
1460
- key: 0,
1461
- class: "header-title-divider",
1462
- "aria-hidden": "true"
1463
- }, bn = { class: "topbar-title" }, xn = { class: "topbar-title-heading" }, Sn = {
1464
- class: "topbar-actions",
1465
- "aria-label": "全局工具"
1466
- }, Cn = ["onClick"], wn = { class: "avatar" }, Tn = { class: "user-meta" }, En = { class: "workbench-mega-surface" }, Dn = { class: "tab-strip" }, On = {
1467
- key: 1,
1468
- class: "empty-tabs"
1469
- }, kn = { class: "app-content" }, An = 220, jn = "(max-width: 980px)", Mn = /*#__PURE__*/ d(/* @__PURE__ */ A({
1470
- name: "Workbench",
1471
- __name: "Workbench",
1472
- props: {
1473
- startup: { default: void 0 },
1474
- loading: {
1475
- type: Boolean,
1476
- default: !1
1477
- },
1478
- error: { default: void 0 },
1479
- activeTabKey: { default: void 0 },
1480
- lockedTabKeys: { default: () => [] },
1481
- realtimeStatus: { default: "unavailable" },
1482
- themeAppearance: { default: "light" }
1483
- },
1484
- emits: [
1485
- "selectMenu",
1486
- "invalidMenu",
1487
- "changeTab",
1488
- "closeTab",
1489
- "closeTabs",
1490
- "toggleTabLock",
1491
- "reorderTabs",
1492
- "update:activeTabKey",
1493
- "userCommand"
1494
- ],
1495
- setup(e, { emit: t }) {
1496
- let n = e, r = t, i = S(() => n.startup?.tabs ?? []), a = S(() => i.value.map(be)), o = S(() => n.activeTabKey ?? n.startup?.activeTabKey ?? a.value[0]?.key ?? ""), s = S(() => i.value.find((e) => e.key === o.value)), c = S(() => N(s.value)), l = R(0), u = S(() => n.startup?.session.currentUser), d = S(() => u.value?.username ?? u.value?.userId ?? "未登录"), f = S(() => d.value.trim().slice(0, 1).toUpperCase() || "M"), ee = S(() => u.value?.tenantId ?? "系统工作区"), m = S(() => {
1497
- let e = n.startup?.session.tenantBranding;
1498
- return n.themeAppearance === "dark" && e?.darkLogo || e?.lightLogo;
1499
- }), te = S(() => n.startup?.session.tenantBranding?.mode !== "logoOnly"), ne = S(() => n.startup?.session.tenantBranding?.title?.trim() || "MuYun"), re = S(() => n.startup?.session.tenantBranding?.subtitle?.trim() || ee.value), ae = S(() => Le(c.value?.pageType)), oe = S(() => Re(c.value)), g = [
1500
- {
1501
- key: "changePassword",
1502
- title: "修改密码"
1503
- },
1504
- {
1505
- key: "profile",
1506
- title: "个人信息"
1507
- },
1508
- {
1509
- key: "logout",
1510
- title: "退出登录",
1511
- danger: !0
1512
- }
1513
- ], se = R(Fe(ie.get("workbench.menu-presentation", "compact"))), ce = R(!1), ue = S(() => Ke(se.value, ce.value)), de = R(Ne(ie.get("workbench.expanded-menu-depth", 1))), y = R(!1), pe = R(!1), me = R(), he = R(!1), ge = R(), ve = R(), D = R(54), k, A, j, M;
1514
- function N(e) {
1515
- if (e) return e?.pageDescriptor ?? (e?.target ? $e(e.target, { title: e.title }) : void 0);
1516
- }
1517
- function P(e) {
1518
- return e.key === o.value || N(e)?.tabPolicy.cacheable !== !1;
1519
- }
1520
- function be(e) {
1521
- return {
1522
- key: e.key,
1523
- title: e.title,
1524
- closable: e.closable,
1525
- pinned: n.lockedTabKeys.includes(e.key)
1526
- };
1527
- }
1528
- function L(e) {
1529
- r("update:activeTabKey", e), r("changeTab", e);
1530
- }
1531
- function we() {
1532
- s.value && (l.value += 1);
1533
- }
1534
- function Te(e) {
1535
- return e.key === o.value ? `${e.key}:refresh:${l.value}` : e.key;
1536
- }
1537
- function Ee(e) {
1538
- r("userCommand", e);
1539
- }
1540
- function H(e, t) {
1541
- r("selectMenu", e, t), K();
1542
- }
1543
- function Oe(e = "pointer", t) {
1544
- if (e === "click") {
1545
- if (y.value && pe.value) {
1546
- K();
1547
- return;
1548
- }
1549
- pe.value = !0;
1550
- }
1551
- e === "pointer" && he.value || (t && (me.value = t), q(), y.value = !0);
1552
- }
1553
- function G() {
1554
- pe.value || (q(), k = window.setTimeout(() => {
1555
- y.value = !1, k = void 0;
1556
- }, An));
1557
- }
1558
- function K() {
1559
- q(), y.value = !1, pe.value = !1, me.value = void 0;
1560
- }
1561
- function q() {
1562
- k !== void 0 && (window.clearTimeout(k), k = void 0);
1563
- }
1564
- function J(e) {
1565
- !y.value || !pe.value || e.composedPath().some((e) => e instanceof Element && (e.matches(".workbench-brand-identity") || e.matches(".workbench-menu"))) || K();
1566
- }
1567
- function Ae(e) {
1568
- A !== void 0 && (window.cancelAnimationFrame(A), A = void 0), he.value = e === "compact", se.value = e, ie.set("workbench.menu-presentation", e), K(), e === "compact" && (A = window.requestAnimationFrame(() => {
1569
- he.value = !1, A = void 0;
1570
- }));
1571
- }
1572
- function je(e) {
1573
- ce.value = e.matches, K();
1574
- }
1575
- function Me(e) {
1576
- de.value = e, ie.set("workbench.expanded-menu-depth", e);
1577
- }
1578
- function Ne(e) {
1579
- return e === 2 || e === 3 ? e : 1;
1580
- }
1581
- function Fe(e) {
1582
- return e === "expanded" ? e : "compact";
1583
- }
1584
- function Ie() {
1585
- if (!ve.value || !ge.value) return;
1586
- let e = ve.value.getBoundingClientRect(), t = ge.value.getBoundingClientRect();
1587
- D.value = We(e.bottom, t.top);
1588
- }
1589
- xe(() => {
1590
- document.addEventListener("pointerdown", J), document.addEventListener("focusin", J), typeof window.matchMedia == "function" && (M = window.matchMedia(jn), ce.value = M.matches, M.addEventListener("change", je)), ye(() => {
1591
- Ie(), !(typeof ResizeObserver > "u" || !ve.value) && (j = new ResizeObserver(Ie), j.observe(ve.value));
1592
- });
1593
- }), Se(() => {
1594
- document.removeEventListener("pointerdown", J), document.removeEventListener("focusin", J), q(), A !== void 0 && window.cancelAnimationFrame(A), j?.disconnect(), M?.removeEventListener("change", je);
1595
- });
1596
- function Le(e) {
1597
- return e === "dynamic-module" ? "动态模块" : e === "business-route" ? "业务页面" : e === "platform-route" ? "平台页面" : e === "remote-url" ? "在线页面" : e === "external-link" ? "外部链接" : "工作区";
1598
- }
1599
- function Re(e) {
1600
- 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 : "未选择入口";
1601
- }
1602
- return (t, n) => (I(), T("main", {
1603
- ref_key: "workbenchRoot",
1604
- ref: ge,
1605
- class: F(["workbench", {
1606
- "workbench--menu-expanded": ue.value === "expanded",
1607
- "workbench--compact-menu-open": ue.value === "compact" && y.value
1608
- }])
1609
- }, [O(gn, {
1610
- menus: e.startup?.menus ?? [],
1611
- "selected-menu-id": s.value?.target?.menuId,
1612
- "tenant-label": ee.value,
1613
- "logo-src": m.value,
1614
- "show-title-area": te.value,
1615
- "brand-title": ne.value,
1616
- "brand-subtitle": re.value,
1617
- "realtime-status": e.realtimeStatus,
1618
- presentation: ue.value,
1619
- "expanded-menu-depth": de.value,
1620
- "compact-open": y.value,
1621
- "compact-top": D.value,
1622
- "compact-anchor": me.value,
1623
- onSelectMenu: H,
1624
- onInvalidMenu: n[0] ||= (e) => r("invalidMenu", e),
1625
- onCompactMenuEnter: Oe,
1626
- onCompactMenuLeave: G,
1627
- onCompactMenuClose: K,
1628
- onChangePresentation: Ae,
1629
- onChangeExpandedMenuDepth: Me
1630
- }, null, 8, [
1631
- "menus",
1632
- "selected-menu-id",
1633
- "tenant-label",
1634
- "logo-src",
1635
- "show-title-area",
1636
- "brand-title",
1637
- "brand-subtitle",
1638
- "realtime-status",
1639
- "presentation",
1640
- "expanded-menu-depth",
1641
- "compact-open",
1642
- "compact-top",
1643
- "compact-anchor"
1644
- ]), E("section", _n, [E("header", {
1645
- ref_key: "appTopbar",
1646
- ref: ve,
1647
- class: "app-topbar"
1648
- }, [
1649
- E("div", vn, [
1650
- O(_e, { name: "workbench-brand" }, {
1651
- default: U(() => [ue.value === "compact" ? (I(), C(Pe, {
1652
- key: 0,
1653
- presentation: "compact",
1654
- "compact-open": y.value,
1655
- "tenant-label": ee.value,
1656
- "logo-src": m.value,
1657
- "show-title-area": te.value,
1658
- "brand-title": ne.value,
1659
- "brand-subtitle": re.value,
1660
- "presentation-toggle-visible": !ce.value,
1661
- onOpenCompactMenu: Oe,
1662
- onScheduleCompactMenuClose: G,
1663
- onCloseCompactMenu: K,
1664
- onChangePresentation: Ae
1665
- }, null, 8, [
1666
- "compact-open",
1667
- "tenant-label",
1668
- "logo-src",
1669
- "show-title-area",
1670
- "brand-title",
1671
- "brand-subtitle",
1672
- "presentation-toggle-visible"
1673
- ])) : w("v-if", !0)]),
1674
- _: 1
1675
- }),
1676
- O(_e, { name: "workbench-divider" }, {
1677
- default: U(() => [ue.value === "compact" ? (I(), T("span", yn)) : w("v-if", !0)]),
1678
- _: 1
1679
- }),
1680
- E("div", bn, [E("div", xn, [E("h1", null, B(s.value?.title ?? "控制台"), 1), O(V(_), {
1681
- class: "title-refresh-action",
1682
- "aria-label": "刷新当前页",
1683
- "icon-name": "reload",
1684
- type: "text",
1685
- title: `刷新${s.value?.title ?? "当前页"}`,
1686
- disabled: !s.value,
1687
- onClick: we
1688
- }, null, 8, ["title", "disabled"])]), E("span", null, B(ae.value) + " / " + B(oe.value), 1)])
1689
- ]),
1690
- E("div", Sn, [E("button", {
1691
- class: "icon-button skin-button",
1692
- type: "button",
1693
- "aria-label": "皮肤切换",
1694
- title: "切换皮肤",
1695
- onClick: n[1] ||= (e) => r("userCommand", "themeSkin")
1696
- }, [O(V(p), { name: "skin" })])]),
1697
- O(V(v), {
1698
- items: g,
1699
- onSelect: Ee
1700
- }, {
1701
- default: U(({ toggle: e }) => [E("button", {
1702
- class: "user-button",
1703
- type: "button",
1704
- onClick: ke(e, ["stop"])
1705
- }, [
1706
- E("span", wn, B(f.value), 1),
1707
- E("span", Tn, [E("strong", null, B(d.value), 1), E("small", null, B(u.value?.system ? "系统管理员" : "业务用户"), 1)]),
1708
- O(V(p), {
1709
- class: "user-caret",
1710
- name: "down"
1711
- })
1712
- ], 8, Cn)]),
1713
- _: 1
1714
- })
1715
- ], 512), E("section", En, [E("div", Dn, [a.value.length > 0 ? (I(), C(V(b), {
1716
- key: 0,
1717
- tabs: a.value,
1718
- "active-key": o.value,
1719
- onTogglePin: n[2] ||= (e) => r("toggleTabLock", e),
1720
- "onUpdate:activeKey": L,
1721
- onClose: n[3] ||= (e) => r("closeTab", e),
1722
- onCloseTabs: n[4] ||= (e) => r("closeTabs", e),
1723
- onReorder: n[5] ||= (e) => r("reorderTabs", e)
1724
- }, null, 8, ["tabs", "active-key"])) : (I(), T("div", On, "暂无打开页面"))]), E("section", kn, [e.loading ? (I(), C(V(fe), { key: 0 })) : e.error ? (I(), C(V(le), {
1725
- key: 1,
1726
- message: e.error
1727
- }, null, 8, ["message"])) : (I(!0), T(x, { key: 2 }, z(i.value, (e) => (I(), T(x, { key: e.key }, [P(e) ? W((I(), C(V(h), {
1728
- key: Te(e),
1729
- class: "tab-panel-host"
1730
- }, {
1731
- default: U(() => [E("div", { class: F(["tab-page", { "tab-page--workspace": N(e)?.layout === "workspace" }]) }, [Ce(t.$slots, "default", {
1732
- activeTab: e,
1733
- target: e.target,
1734
- pageDescriptor: N(e)
1735
- }, void 0, !0)], 2)]),
1736
- _: 2
1737
- }, 1024)), [[De, e.key === o.value]]) : w("v-if", !0)], 64))), 128))])])])], 2));
1738
- }
1739
- }), [["__scopeId", "data-v-a6dbe7fe"]]);
1740
- //#endregion
1741
- //#region src/dynamic-page-runtime/dynamicModuleDetailStateModel.ts
1742
- function Nn(e) {
1743
- return e.activeRequestSequence === e.requestSequence;
1744
- }
1745
- function Pn(e) {
1746
- return e.hasRecord && !e.saving && !e.loading && !e.loadFailed;
1747
- }
1748
- //#endregion
1749
- //#region src/dynamic-page-runtime/modulePageEnhancements.ts
1750
- function Fn(e) {
1751
- let t = /* @__PURE__ */ new Map(), n = [], r = /* @__PURE__ */ new Set();
1752
- for (let i of e) {
1753
- if (r.has(i.id)) throw Error(`重复的模块页面增强:${i.id}`);
1754
- r.add(i.id);
1755
- let e = Bn(i.target.moduleAlias, i.target.viewCode);
1756
- if (t.has(e)) throw Error(`模块页面增强目标重复:${e}`);
1757
- Vn(i);
1758
- for (let e of i.workspaceViews ?? []) {
1759
- if (e.moduleAlias !== i.target.moduleAlias) throw Error(`模块页面增强 ${i.id} 的工作视图模块不一致:${e.type}`);
1760
- n.push(e);
1761
- }
1762
- t.set(e, i);
1763
- }
1764
- return {
1765
- resolve(e, n) {
1766
- return (n ? t.get(Bn(e, n)) : void 0) ?? t.get(Bn(e));
1767
- },
1768
- workspaceViews() {
1769
- return n;
1770
- }
1771
- };
1772
- }
1773
- var In = Fn([]);
1774
- function Ln(e) {
1775
- In = Fn(e);
1776
- }
1777
- function Rn(e, t) {
1778
- return In.resolve(e, t);
1779
- }
1780
- function zn() {
1781
- return In.workspaceViews();
1782
- }
1783
- function Bn(e, t) {
1784
- return `${e}#${t ?? "*"}`;
1785
- }
1786
- function Vn(e) {
1787
- if ([
1788
- e.list?.actions ?? [],
1789
- e.list?.columns ?? [],
1790
- e.list?.cellComponents ?? [],
1791
- e.list?.rowActions ?? [],
1792
- e.list?.batchActions ?? [],
1793
- e.detail?.actions ?? [],
1794
- e.detail?.sections ?? []
1795
- ].some((e) => new Set(e.map((e) => e.key)).size !== e.length)) throw Error(`模块页面增强 ${e.id} 在同一列表区域存在重复的贡献 key`);
1796
- Hn(e.id, e.list?.actions ?? [], ["create"]), Hn(e.id, e.list?.rowActions ?? [], [
1797
- "view",
1798
- "edit",
1799
- "delete"
1800
- ]), Hn(e.id, e.list?.batchActions ?? [], ["create"]), Hn(e.id, e.detail?.actions ?? [], [
1801
- "create",
1802
- "update",
1803
- "delete"
1804
- ]);
1805
- }
1806
- function Hn(e, t, n) {
1807
- let r = t.find((e) => n.includes(e.key));
1808
- if (r) throw Error(`模块页面增强 ${e} 不能覆盖平台标准动作:${r.key}`);
1809
- }
1810
- //#endregion
1811
- //#region src/dynamic-page-runtime/modulePageNavigation.ts
1812
- var Un = Symbol("module-page-navigation");
1813
- function Wn(e) {
1814
- L(Un, e);
1815
- }
1816
- function Gn() {
1817
- return N(Un, void 0);
1818
- }
1819
- //#endregion
1820
- //#region src/dynamic-page-runtime/modulePageListRefresh.ts
1821
- function Kn() {
1822
- let e = /* @__PURE__ */ new Map();
1823
- function t(t, n) {
1824
- let r = Yn(t), i = e.get(r) ?? /* @__PURE__ */ new Set();
1825
- return i.add(n), e.set(r, i), () => {
1826
- i.delete(n), i.size === 0 && e.delete(r);
1827
- };
1828
- }
1829
- function n(t) {
1830
- let n = e.get(Yn(t));
1831
- if (!n || n.size === 0) return !1;
1832
- for (let e of [...n]) e();
1833
- return !0;
1834
- }
1835
- return {
1836
- register: t,
1837
- refresh: n
1838
- };
1839
- }
1840
- var qn = Kn();
1841
- function Jn(e) {
1842
- return qn.refresh(e);
1843
- }
1844
- function Yn(e) {
1845
- let t = e?.trim();
1846
- if (!t) throw Error("Module page list refresh requires a moduleAlias");
1847
- return t;
1848
- }
1849
- //#endregion
1850
- //#region src/dynamic-page-runtime/DynamicModuleHost.vue?vue&type=script&setup=true&lang.ts
1851
- var Xn = {
1852
- key: 0,
1853
- class: "dynamic-module-unsupported"
1854
- }, Zn = {
1855
- key: 1,
1856
- class: "dynamic-module-unsupported"
1857
- }, Qn = {
1858
- key: 0,
1859
- class: "dynamic-scope-editor-panel"
1860
- }, $n = { class: "dynamic-scope-editor-header" }, er = { class: "dynamic-scope-editor-actions" }, tr = {
1861
- key: 3,
1862
- class: "dynamic-module-unsupported"
1863
- }, nr = /*#__PURE__*/ d(/* @__PURE__ */ A({
1864
- name: "DynamicModuleHost",
1865
- __name: "DynamicModuleHost",
1866
- props: { descriptor: {} },
1867
- setup(a, { expose: d }) {
1868
- let p = a, m = ge({ moduleAlias: p.descriptor.target.moduleAlias }), ie = Gn(), h = R(), g = R(), _ = R("view"), le = R(!1), v = R(f(void 0)), fe = R([]), b = R(0), k = R(0), A = R(), j = R(""), M = R(!1), N = R(), P = R(), ye = R(""), be = R(0), L = R(!1), Ce = R(f(void 0)), we = R(!1), Ee = R("create"), De = R(), H = R(!1), W = R(!1), Oe = R(0), ke = R(0), G = R(!1), K = R(!1), q = R(!1), J = R(), Ae = 0, je, Me = S(() => p.descriptor.title ?? m.runtime.snapshot()?.title ?? m.moduleAlias), Ne = S(() => _.value === "create" ? `新建${Me.value}` : Jt(g.value ?? h.value) ?? "记录详情"), Pe = S(() => `${Ee.value === "create" ? "新建" : "编辑"}${N.value?.scopeTitle ?? "目录"}`), Fe = R(), Ie = R(), Le = S(() => p.descriptor.target.pageMode ?? "LIST"), Re = S(() => Fe.value?.entry.pageMode ?? Le.value), ze = S(() => Re.value === "LIST"), Be = S(() => ze.value ? p.descriptor.target.defaultUiConfigId : void 0), Ve = S(() => Fe.value?.entry.defaultUiConfigId ?? Be.value), He = S(() => Fe.value?.entry.defaultQueryTemplateId ?? p.descriptor.target.defaultQueryTemplateId), Ue = S(() => {
1869
- let e = fe.value.filter((e) => e.viewKind === "LIST");
1870
- return Ve.value == null ? e.length === 1 ? e[0] : void 0 : e.find((e) => e.sourceUiConfigId === Ve.value);
1871
- }), Y = S(() => Rn(m.moduleAlias, Ue.value?.viewCode)), We = S(() => Y.value?.list?.actions ?? []), Ge = S(() => We.value.map(({ state: e, authorization: t, ...n }) => {
1872
- let r = Vt(), i = r.scope?.record?.id;
1873
- return {
1874
- ...n,
1875
- ...e?.(r),
1876
- ...t === "scope-record" && Q.value ? {
1877
- authorizationContext: Q.value,
1878
- authorizationRecordId: i == null ? void 0 : String(i)
1879
- } : {}
1880
- };
1881
- })), Ke = S(() => Y.value?.list?.columns ?? []), qe = S(() => [...Ke.value.map((e) => ({
1882
- key: e.key,
1883
- component: e.cell
1884
- })), ...(Y.value?.list?.cellComponents ?? []).map((e) => ({
1885
- key: e.key,
1886
- component: e.cell
1887
- }))]), X = S(() => Y.value?.list?.rowActions ?? []);
1888
- function Z(e) {
1889
- return X.value.map(({ state: t, ...n }) => ({
1890
- ...n,
1891
- ...t?.(e)
1892
- }));
1893
- }
1894
- let Je = S(() => Y.value?.list?.batchActions ?? []), Ye = S(() => Y.value?.detail?.actions ?? []), Xe = S(() => Y.value?.detail?.sections ?? []), Ze = S(() => !!p.descriptor.menuId), Qe = S(() => !Ze.value || Fe.value !== void 0), $e = S(() => `动态${Re.value}入口暂未接入运行器`);
1895
- he(S(() => M.value || N.value ? "workspace" : p.descriptor.layout));
1896
- let Q = S(() => {
1897
- let e = N.value;
1898
- return e ? l({
1899
- http: m.http,
1900
- moduleAlias: e.scopeModuleAlias
1901
- }) : void 0;
1902
- }), et = S(() => N.value?.createPolicy === "REQUIRE_SCOPE"), tt = S(() => !et.value || P.value?.id != null), nt = S(() => {
1903
- let e = N.value, t = P.value?.id;
1904
- return e && t != null ? { [e.queryCriteriaKey]: t } : void 0;
1905
- }), $ = S(() => [{
1906
- key: "create",
1907
- actionCode: "create",
1908
- title: "新建",
1909
- primary: !0,
1910
- disabled: !tt.value
1911
- }]), rt = S(() => {
1912
- let e = h.value;
1913
- return !e?.id || _.value !== "view" || K.value || q.value || G.value ? !1 : m.can(e.enabled === !1 ? "enable" : "disable") === !0;
1914
- }), it = S(() => !M.value || !v.value.has("parentId") ? {} : { parentId: {
1915
- context: m,
1916
- mode: "tree",
1917
- placeholder: "根标签留空",
1918
- allowClear: !0,
1919
- constraints: me(g.value?.id == null ? void 0 : String(g.value.id))
1920
- } }), at = S(() => {
1921
- let e = { ...it.value };
1922
- for (let t of v.value.values()) {
1923
- let n = t.reference;
1924
- n && (e[t.fieldRef.fieldName] = {
1925
- context: l({
1926
- http: m.http,
1927
- moduleAlias: n.targetModuleAlias
1928
- }),
1929
- mode: "tree",
1930
- allowClear: !t.required?.constant
1931
- });
1932
- }
1933
- return e;
1934
- });
1935
- xe(async () => {
1936
- await ot(), await st(), ze.value && (je = qn.register(m.moduleAlias, Wt));
1937
- }), Se(() => {
1938
- je?.(), je = void 0;
1939
- });
1940
- async function ot() {
1941
- let t = p.descriptor.menuId;
1942
- if (t) try {
1943
- let n = await e(m.http).byMenu(t);
1944
- if (n.entry.moduleAlias !== m.moduleAlias) throw Error(`Menu ${t} resolves ${n.entry.moduleAlias}, expected ${m.moduleAlias}`);
1945
- Fe.value = n, Ie.value = void 0;
1946
- } catch (e) {
1947
- Ie.value = e instanceof Error ? e.message : "页面入口加载失败";
1948
- }
1949
- }
1950
- async function st() {
1951
- if (!ze.value) return;
1952
- let e = await m.runtime.ready;
1953
- if (fe.value = e.uiDescriptor?.views ?? [], M.value = m.abilities.hasTree() === !0, N.value = dt(fe.value), L.value = !1, Q.value) {
1954
- let e = await Q.value.runtime.ready;
1955
- L.value = Q.value.abilities.hasTree() === !0, Ce.value = f(e.uiDescriptor);
1956
- }
1957
- let t = ut(fe.value);
1958
- v.value = f(e.uiDescriptor, t?.viewCode);
1959
- }
1960
- let ct = S(() => !Q.value || !L.value || !Ce.value.has("parentId") ? {} : { parentId: {
1961
- context: Q.value,
1962
- mode: "tree",
1963
- placeholder: `根${N.value?.scopeTitle ?? "目录"}留空`,
1964
- allowClear: !0,
1965
- constraints: me(De.value?.id == null ? void 0 : String(De.value.id))
1966
- } }), lt = S(() => {
1967
- let e = { ...ct.value };
1968
- if (!Q.value) return e;
1969
- for (let t of Ce.value.values()) {
1970
- let n = t.fieldRef.fieldName, r = t.reference;
1971
- !r || n === "parentId" || (e[n] = {
1972
- context: l({
1973
- http: m.http,
1974
- moduleAlias: r.targetModuleAlias
1975
- }),
1976
- mode: "tree",
1977
- allowClear: !t.required?.constant
1978
- });
1979
- }
1980
- return e;
1981
- });
1982
- function ut(e) {
1983
- return e.find((e) => e.viewKind === "FORM");
1984
- }
1985
- function dt(e) {
1986
- let t = e.filter((e) => e.viewKind === "LIST"), n = Ve.value == null ? void 0 : t.find((e) => e.sourceUiConfigId === Ve.value);
1987
- return n ? n.scopedListWorkspace : Ve.value == null && t.length === 1 ? t[0].scopedListWorkspace : void 0;
1988
- }
1989
- function ft(e) {
1990
- h.value &&= e.find((e) => e.id === h.value?.id) ?? h.value;
1991
- }
1992
- function pt(e) {
1993
- h.value = e;
1994
- }
1995
- function mt(e) {
1996
- if (P.value?.id === e.id) {
1997
- P.value = void 0;
1998
- return;
1999
- }
2000
- P.value = e;
2001
- }
2002
- function ht() {
2003
- if (!N.value?.manageScopeTree || !L.value || !Q.value) return [];
2004
- let e = [];
2005
- return Q.value.can("create") === !0 && e.push({
2006
- key: "create-child",
2007
- title: "新增下级",
2008
- iconName: "plus"
2009
- }), Q.value.can("update") === !0 && e.push({
2010
- key: "edit",
2011
- title: "编辑",
2012
- iconName: "edit"
2013
- }), Q.value.can("delete") === !0 && e.push({
2014
- key: "delete",
2015
- title: "删除",
2016
- iconName: "delete",
2017
- danger: !0
2018
- }), e;
2019
- }
2020
- function gt(e, t) {
2021
- ke.value += 1, Ee.value = e, De.value = e === "create" ? t?.id == null ? { enabled: !0 } : {
2022
- parentId: t.id,
2023
- enabled: !0
2024
- } : t, we.value = !0;
2025
- }
2026
- function _t() {
2027
- H.value || (we.value = !1, ke.value += 1);
2028
- }
2029
- async function vt(e) {
2030
- if (!(!Q.value?.crud || e.id == null)) try {
2031
- gt("edit", await Q.value.crud.view(String(e.id)));
2032
- } catch (e) {
2033
- y(e, {
2034
- source: "scoped-tree-editor",
2035
- phase: "load"
2036
- });
2037
- }
2038
- }
2039
- async function yt() {
2040
- let e = Q.value, t = De.value;
2041
- if (!(!e || !t || H.value)) {
2042
- H.value = !0;
2043
- try {
2044
- P.value = (Ee.value === "edit" && t.id != null ? await e.crud.update(String(t.id), t) : await e.crud.insert(t)).record, we.value = !1, ke.value += 1, be.value += 1;
2045
- } catch (e) {
2046
- y(e, {
2047
- source: "scoped-tree-editor",
2048
- phase: "action"
2049
- });
2050
- } finally {
2051
- H.value = !1;
2052
- }
2053
- }
2054
- }
2055
- async function bt(e) {
2056
- let t = Q.value, n = e.id == null ? void 0 : String(e.id), r = typeof e.version == "number" ? e.version : void 0;
2057
- if (!(!t || !n || r === void 0)) try {
2058
- if (!await de({
2059
- title: `删除${N.value?.scopeTitle ?? "目录"}`,
2060
- content: `确认删除「${Jt(e) ?? n}」?`,
2061
- okText: "删除",
2062
- danger: !0
2063
- })) return;
2064
- await t.crud.delete(n, { version: r }), P.value?.id === n && (P.value = void 0), be.value += 1;
2065
- } catch (e) {
2066
- y(e, {
2067
- source: "scoped-tree-editor",
2068
- phase: "action"
2069
- });
2070
- }
2071
- }
2072
- function xt(e, t) {
2073
- let n = t;
2074
- mt(n), e.key === "create-child" && gt("create", n), e.key === "edit" && vt(n), e.key === "delete" && bt(n);
2075
- }
2076
- function St(e, t) {
2077
- De.value &&= {
2078
- ...De.value,
2079
- [e]: t
2080
- };
2081
- }
2082
- function Ct(e) {
2083
- A.value = e, Tt(A.value, "view");
2084
- }
2085
- function wt(e) {
2086
- if (A.value || _.value !== "view") return;
2087
- let t = e.at(0);
2088
- t && Ct(t);
2089
- }
2090
- async function Tt(e, t) {
2091
- let n = e.id == null ? void 0 : String(e.id);
2092
- if (!n) return;
2093
- let r = ++Ae;
2094
- Oe.value += 1, h.value = e, g.value = void 0, _.value = t, le.value = !0, K.value = !0, q.value = !1;
2095
- try {
2096
- let e = await m.crud.view(n);
2097
- if (!Nn({
2098
- activeRequestSequence: Ae,
2099
- requestSequence: r
2100
- })) return;
2101
- g.value = e, h.value = e;
2102
- } catch {
2103
- if (!Nn({
2104
- activeRequestSequence: Ae,
2105
- requestSequence: r
2106
- })) return;
2107
- g.value = void 0, q.value = !0;
2108
- } finally {
2109
- Nn({
2110
- activeRequestSequence: Ae,
2111
- requestSequence: r
2112
- }) && (K.value = !1);
2113
- }
2114
- }
2115
- function Et(e, t) {
2116
- g.value &&= {
2117
- ...g.value,
2118
- [e]: t
2119
- };
2120
- }
2121
- function Dt(e) {
2122
- if (et.value && P.value?.id == null) return;
2123
- Ae += 1, K.value = !1, q.value = !1, Oe.value += 1;
2124
- let t = N.value;
2125
- g.value = e ? { parentId: e } : t && P.value?.id != null ? { [t.scopeField]: P.value.id } : {}, _.value = "create", le.value = !0;
2126
- }
2127
- function Ot() {
2128
- Dt();
2129
- }
2130
- function kt() {
2131
- let e = h.value?.id == null ? void 0 : String(h.value.id);
2132
- e && Dt(e);
2133
- }
2134
- async function At(e) {
2135
- await Tt(e, "edit");
2136
- }
2137
- async function jt() {
2138
- let e = g.value;
2139
- if (e && Pn({
2140
- hasRecord: !0,
2141
- saving: W.value,
2142
- loading: K.value,
2143
- loadFailed: q.value
2144
- })) {
2145
- W.value = !0;
2146
- try {
2147
- let t = e.id == null ? void 0 : String(e.id), n = _.value === "edit" && t ? await m.crud.update(t, e) : await m.crud.insert(e);
2148
- h.value = n.record, M.value && (A.value = n.record), g.value = n.record, _.value = "view", b.value += 1, k.value += 1, Oe.value += 1;
2149
- } finally {
2150
- W.value = !1;
2151
- }
2152
- }
2153
- }
2154
- async function Mt(e) {
2155
- let t = e.id == null ? void 0 : String(e.id), n = typeof e.version == "number" ? e.version : void 0;
2156
- !t || n === void 0 || await de({
2157
- title: "删除记录",
2158
- content: `确认删除「${Jt(e) ?? t}」?`,
2159
- okText: "删除",
2160
- danger: !0
2161
- }) && (await m.crud.delete(t, { version: n }), h.value?.id === t && (h.value = void 0, g.value = void 0, A.value = void 0), b.value += 1, k.value += 1);
2162
- }
2163
- async function Nt() {
2164
- let e = h.value, t = e?.id == null ? void 0 : String(e.id), n = typeof e?.version == "number" ? e.version : void 0;
2165
- if (!(!e || !t || n === void 0 || !rt.value)) {
2166
- G.value = !0;
2167
- try {
2168
- e.enabled === !1 ? await m.crud.enable(t, { version: n }) : await m.crud.disable(t, { version: n });
2169
- let r = await m.crud.view(t);
2170
- h.value = r, g.value = r, b.value += 1, k.value += 1;
2171
- } finally {
2172
- G.value = !1;
2173
- }
2174
- }
2175
- }
2176
- function Pt(e) {
2177
- if (e.key === "create") {
2178
- Dt();
2179
- return;
2180
- }
2181
- let t = We.value.find((t) => t.key === e.key);
2182
- t && Rt(t, Bt());
2183
- }
2184
- function Ft(e, t) {
2185
- if (e.key === "view") {
2186
- Tt(t, "view");
2187
- return;
2188
- }
2189
- if (e.key === "edit") {
2190
- At(t);
2191
- return;
2192
- }
2193
- if (e.key === "delete") {
2194
- Mt(t);
2195
- return;
2196
- }
2197
- let n = X.value.find((t) => t.key === e.key);
2198
- n && Rt(n, {
2199
- ...Bt(t),
2200
- record: t
2201
- });
2202
- }
2203
- function It(e) {
2204
- let t = h.value, n = Ye.value.find((t) => t.key === e.key);
2205
- t && n && Rt(n, {
2206
- ...Bt(t),
2207
- record: t
2208
- });
2209
- }
2210
- function Lt(e, t, n) {
2211
- let r = Je.value.find((t) => t.key === e.key);
2212
- r && Rt(r, {
2213
- ...Bt(),
2214
- records: t,
2215
- clearSelection: n
2216
- });
2217
- }
2218
- async function Rt(e, t) {
2219
- try {
2220
- await e.run(t);
2221
- } catch (t) {
2222
- y(t, {
2223
- source: `module-page-enhancement:${e.key}`,
2224
- phase: "action"
2225
- });
2226
- }
2227
- }
2228
- function zt(e) {
2229
- return {
2230
- module: m,
2231
- record: e,
2232
- refreshList: Wt,
2233
- reload: Ut
2234
- };
2235
- }
2236
- function Bt(e) {
2237
- return {
2238
- module: m,
2239
- scope: Vt().scope,
2240
- refreshList: Wt,
2241
- reload: Ut,
2242
- openDrawer: (t) => {
2243
- J.value = {
2244
- definition: t,
2245
- context: {
2246
- module: m,
2247
- record: e,
2248
- scope: Vt().scope,
2249
- refreshList: Wt,
2250
- close: Ht,
2251
- reload: Ut
2252
- }
2253
- };
2254
- },
2255
- openWorkspaceTab: (e, t) => {
2256
- if (!ie) throw Error("模块页面工作视图需要 Workbench 导航承载");
2257
- ie.openWorkspaceTab(e, t);
2258
- }
2259
- };
2260
- }
2261
- function Vt() {
2262
- let e = N.value;
2263
- return e ? {
2264
- module: m,
2265
- scope: {
2266
- moduleAlias: e.scopeModuleAlias,
2267
- record: P.value
2268
- }
2269
- } : { module: m };
2270
- }
2271
- function Ht() {
2272
- J.value = void 0;
2273
- }
2274
- function Ut() {
2275
- Wt(), M.value || (k.value += 1);
2276
- }
2277
- function Wt() {
2278
- if (M.value) {
2279
- k.value += 1;
2280
- return;
2281
- }
2282
- b.value += 1;
2283
- }
2284
- d({ refreshList: Wt });
2285
- function Gt() {
2286
- W.value || (Ae += 1, K.value = !1, q.value = !1, Oe.value += 1, le.value = !1, _.value = "view", g.value = h.value);
2287
- }
2288
- function Kt() {
2289
- W.value || (Ae += 1, K.value = !1, q.value = !1, Oe.value += 1, le.value = !1, _.value = "view", g.value = h.value);
2290
- }
2291
- function qt() {
2292
- let e = h.value;
2293
- !e || _.value === "create" || Tt(e, _.value);
2294
- }
2295
- function Jt(e) {
2296
- let t = e?.title ?? e?.name ?? e?.code ?? e?.id;
2297
- return t == null ? void 0 : String(t);
2298
- }
2299
- return (e, a) => Ie.value ? (I(), T("section", Xn, [O(V(o), {
2300
- class: "dynamic-module-bootstrap-error",
2301
- description: Ie.value
2302
- }, null, 8, ["description"])])) : Qe.value ? ze.value ? (I(), T("section", {
2303
- key: 2,
2304
- class: F(["dynamic-module-workspace", { "dynamic-module-workspace--tree": M.value }])
2305
- }, [
2306
- N.value && Q.value ? (I(), C(V(te), {
2307
- key: 0,
2308
- class: "dynamic-tree-workspace"
2309
- }, {
2310
- default: U(() => [O(V(u), null, {
2311
- default: U(() => [O(V(r), {
2312
- title: N.value.scopeTitle,
2313
- "refresh-title": `刷新${N.value.scopeTitle}${L.value ? "树" : "列表"}`,
2314
- "search-keyword": ye.value,
2315
- "search-placeholder": N.value.scopeSearchPlaceholder,
2316
- "onUpdate:searchKeyword": a[2] ||= (e) => ye.value = e,
2317
- onRefresh: a[3] ||= (e) => be.value += 1
2318
- }, ve({
2319
- editor: U(() => [O(_e, { name: "dynamic-scope-editor-drawer" }, {
2320
- default: U(() => [N.value.manageScopeTree && L.value && De.value && we.value ? (I(), T("section", Qn, [E("header", $n, [E("h3", null, B(Pe.value), 1), E("div", er, [
2321
- O(V(ne), {
2322
- enabled: De.value.enabled !== !1,
2323
- disabled: H.value,
2324
- "show-label": !1,
2325
- onChange: a[1] ||= (e) => St("enabled", e)
2326
- }, null, 8, ["enabled", "disabled"]),
2327
- O(V(i), {
2328
- disabled: H.value,
2329
- onClick: _t
2330
- }, {
2331
- default: U(() => [...a[13] ||= [D(" 取消 ", -1)]]),
2332
- _: 1
2333
- }, 8, ["disabled"]),
2334
- O(V(i), {
2335
- type: "primary",
2336
- loading: H.value,
2337
- onClick: yt
2338
- }, {
2339
- default: U(() => [D(B(H.value ? "保存中" : "保存"), 1)]),
2340
- _: 1
2341
- }, 8, ["loading"])
2342
- ])]), O(V(pe), {
2343
- class: "dynamic-scope-editor-form",
2344
- record: De.value,
2345
- fields: Ce.value,
2346
- "file-transfer-context": Q.value,
2347
- "form-session-key": ke.value,
2348
- "picker-configs": lt.value,
2349
- disabled: H.value,
2350
- "exclude-field-names": ["enabled"],
2351
- "onUpdate:field": St
2352
- }, null, 8, [
2353
- "record",
2354
- "fields",
2355
- "file-transfer-context",
2356
- "form-session-key",
2357
- "picker-configs",
2358
- "disabled"
2359
- ])])) : w("v-if", !0)]),
2360
- _: 1
2361
- })]),
2362
- default: U(() => [L.value ? (I(), C(V(ce), {
2363
- key: 0,
2364
- context: Q.value,
2365
- "selected-id": P.value?.id == null ? void 0 : String(P.value.id),
2366
- "reload-key": be.value,
2367
- keyword: ye.value,
2368
- "search-mode": "none",
2369
- "empty-description": `暂无${N.value.scopeTitle}`,
2370
- "secondary-of": N.value.showScopeItemSubtitle ? void 0 : () => void 0,
2371
- "actions-of": ht,
2372
- onSelect: mt,
2373
- onAction: xt
2374
- }, null, 8, [
2375
- "context",
2376
- "selected-id",
2377
- "reload-key",
2378
- "keyword",
2379
- "empty-description",
2380
- "secondary-of"
2381
- ])) : (I(), C(V(re), {
2382
- key: 1,
2383
- context: Q.value,
2384
- "selected-id": P.value?.id == null ? void 0 : String(P.value.id),
2385
- "reload-key": be.value,
2386
- keyword: ye.value,
2387
- "empty-description": `暂无${N.value.scopeTitle}`,
2388
- "subtitle-of": N.value.showScopeItemSubtitle ? void 0 : () => void 0,
2389
- onSelect: mt
2390
- }, null, 8, [
2391
- "context",
2392
- "selected-id",
2393
- "reload-key",
2394
- "keyword",
2395
- "empty-description",
2396
- "subtitle-of"
2397
- ]))]),
2398
- _: 2
2399
- }, [N.value.manageScopeTree && L.value ? {
2400
- name: "actions",
2401
- fn: U(() => [O(V(n), {
2402
- class: "record-panel-create-button",
2403
- context: Q.value,
2404
- "action-code": "create",
2405
- "icon-only": "",
2406
- title: `新增${N.value.scopeTitle}`,
2407
- onClick: a[0] ||= (e) => gt("create")
2408
- }, null, 8, ["context", "title"])]),
2409
- key: "0"
2410
- } : void 0]), 1032, [
2411
- "title",
2412
- "refresh-title",
2413
- "search-keyword",
2414
- "search-placeholder"
2415
- ])]),
2416
- _: 1
2417
- }), O(V(ue), {
2418
- class: "dynamic-list",
2419
- context: V(m),
2420
- title: Me.value,
2421
- "selected-key": h.value?.id,
2422
- "reload-key": b.value,
2423
- actions: $.value,
2424
- "standard-crud-row-actions": !0,
2425
- "extra-actions": Ge.value,
2426
- "additional-columns": Ke.value,
2427
- "cell-components": qe.value,
2428
- "extra-row-actions-of": Z,
2429
- "action-column-width": Y.value?.list?.actionColumnWidth,
2430
- "batch-actions": Je.value,
2431
- "ui-config-id": Ve.value,
2432
- "query-template-id": He.value,
2433
- ready: Qe.value,
2434
- "external-query-values": nt.value,
2435
- "required-external-criteria-keys": [N.value.queryCriteriaKey],
2436
- "quick-search-placeholder": "搜索动态记录",
2437
- "empty-description": "暂无动态记录",
2438
- onLoaded: ft,
2439
- onSelect: pt,
2440
- onRowDblclick: a[4] ||= (e) => Tt(e, "view"),
2441
- onAction: Pt,
2442
- onRowAction: Ft,
2443
- onBatchAction: a[5] ||= (e, t, n, r) => Lt(e, t, r)
2444
- }, null, 8, [
2445
- "context",
2446
- "title",
2447
- "selected-key",
2448
- "reload-key",
2449
- "actions",
2450
- "extra-actions",
2451
- "additional-columns",
2452
- "cell-components",
2453
- "action-column-width",
2454
- "batch-actions",
2455
- "ui-config-id",
2456
- "query-template-id",
2457
- "ready",
2458
- "external-query-values",
2459
- "required-external-criteria-keys"
2460
- ])]),
2461
- _: 1
2462
- })) : M.value ? (I(), C(V(te), {
2463
- key: 1,
2464
- class: "dynamic-tree-workspace"
2465
- }, {
2466
- default: U(() => [O(V(u), null, {
2467
- default: U(() => [O(V(r), {
2468
- title: `${Me.value}树`,
2469
- "refresh-title": `刷新${Me.value}树`,
2470
- "search-keyword": j.value,
2471
- "search-placeholder": "搜索树节点",
2472
- "onUpdate:searchKeyword": a[6] ||= (e) => j.value = e,
2473
- onRefresh: a[7] ||= (e) => k.value += 1
2474
- }, {
2475
- actions: U(() => [O(V(n), {
2476
- class: "record-panel-create-button",
2477
- context: V(m),
2478
- "action-code": "create",
2479
- "icon-only": "",
2480
- title: "新建根节点",
2481
- onClick: Ot
2482
- }, null, 8, ["context"])]),
2483
- default: U(() => [O(V(ce), {
2484
- context: V(m),
2485
- "selected-id": A.value?.id == null ? void 0 : String(A.value.id),
2486
- "reload-key": k.value,
2487
- keyword: j.value,
2488
- "search-mode": "none",
2489
- "search-trigger": "external",
2490
- "empty-description": "暂无记录",
2491
- onSelect: Ct,
2492
- onLoaded: wt
2493
- }, null, 8, [
2494
- "context",
2495
- "selected-id",
2496
- "reload-key",
2497
- "keyword"
2498
- ])]),
2499
- _: 1
2500
- }, 8, [
2501
- "title",
2502
- "refresh-title",
2503
- "search-keyword"
2504
- ])]),
2505
- _: 1
2506
- }), O(V(ee), {
2507
- class: "dynamic-tree-card",
2508
- title: Ne.value
2509
- }, {
2510
- actions: U(() => [_.value === "view" ? (I(), T(x, { key: 1 }, [
2511
- h.value?.id != null && Ye.value.length > 0 ? (I(), C(V(c), {
2512
- key: 0,
2513
- context: V(m),
2514
- "record-id": String(h.value.id),
2515
- actions: Ye.value,
2516
- onAction: It
2517
- }, null, 8, [
2518
- "context",
2519
- "record-id",
2520
- "actions"
2521
- ])) : w("v-if", !0),
2522
- O(V(n), {
2523
- context: V(m),
2524
- "action-code": "create",
2525
- disabled: !h.value,
2526
- onClick: kt
2527
- }, {
2528
- default: U(() => [...a[15] ||= [D(" 新建子项 ", -1)]]),
2529
- _: 1
2530
- }, 8, ["context", "disabled"]),
2531
- O(V(n), {
2532
- context: V(m),
2533
- "action-code": "update",
2534
- disabled: !h.value,
2535
- onClick: a[8] ||= (e) => h.value && At(h.value)
2536
- }, {
2537
- default: U(() => [...a[16] ||= [D(" 编辑 ", -1)]]),
2538
- _: 1
2539
- }, 8, ["context", "disabled"]),
2540
- O(V(n), {
2541
- context: V(m),
2542
- "action-code": "delete",
2543
- loading: W.value,
2544
- danger: "",
2545
- disabled: !h.value,
2546
- onClick: a[9] ||= (e) => h.value && Mt(h.value)
2547
- }, {
2548
- default: U(() => [...a[17] ||= [D(" 删除 ", -1)]]),
2549
- _: 1
2550
- }, 8, [
2551
- "context",
2552
- "loading",
2553
- "disabled"
2554
- ])
2555
- ], 64)) : (I(), T(x, { key: 0 }, [O(V(i), {
2556
- disabled: W.value,
2557
- onClick: Kt
2558
- }, {
2559
- default: U(() => [...a[14] ||= [D("取消", -1)]]),
2560
- _: 1
2561
- }, 8, ["disabled"]), O(V(i), {
2562
- type: "primary",
2563
- loading: W.value,
2564
- disabled: K.value || q.value || V(m).can(_.value === "create" ? "create" : "update") !== !0,
2565
- onClick: jt
2566
- }, {
2567
- default: U(() => [D(B(W.value ? "保存中" : "保存"), 1)]),
2568
- _: 1
2569
- }, 8, ["loading", "disabled"])], 64))]),
2570
- status: U(() => [_.value === "view" && h.value ? (I(), C(V(ne), {
2571
- key: 0,
2572
- enabled: h.value.enabled !== !1,
2573
- disabled: !rt.value,
2574
- loading: G.value,
2575
- "show-label": !1,
2576
- onChange: Nt
2577
- }, null, 8, [
2578
- "enabled",
2579
- "disabled",
2580
- "loading"
2581
- ])) : w("v-if", !0)]),
2582
- default: U(() => [!h.value && _.value === "view" ? (I(), C(V(o), {
2583
- key: 0,
2584
- description: "请选择标签,或新建根标签"
2585
- })) : K.value ? (I(), C(V(o), {
2586
- key: 1,
2587
- loading: "",
2588
- "loading-tip": "加载记录详情",
2589
- description: ""
2590
- })) : q.value ? (I(), C(V(o), {
2591
- key: 2,
2592
- description: "详情加载失败,请重新选择标签"
2593
- })) : g.value ? (I(), T(x, { key: 3 }, [_.value === "view" ? (I(), T(x, { key: 0 }, [O(V(t), {
2594
- record: g.value,
2595
- fields: v.value,
2596
- "exclude-field-names": ["enabled"]
2597
- }, null, 8, ["record", "fields"]), (I(!0), T(x, null, z(Xe.value, (e) => (I(), C(V(se), {
2598
- key: e.key,
2599
- title: e.title
2600
- }, {
2601
- default: U(() => [(I(), C(Te(e.component), { context: zt(g.value) }, null, 8, ["context"]))]),
2602
- _: 2
2603
- }, 1032, ["title"]))), 128))], 64)) : (I(), C(V(pe), {
2604
- key: 1,
2605
- class: "dynamic-form",
2606
- record: g.value,
2607
- fields: v.value,
2608
- "form-session-key": Oe.value,
2609
- "option-context": V(m),
2610
- "picker-configs": at.value,
2611
- "exclude-field-names": ["enabled"],
2612
- "onUpdate:field": Et
2613
- }, null, 8, [
2614
- "record",
2615
- "fields",
2616
- "form-session-key",
2617
- "option-context",
2618
- "picker-configs"
2619
- ])), _.value === "create" ? w("v-if", !0) : (I(), C(V(ae), {
2620
- key: 2,
2621
- record: g.value,
2622
- "show-sort-order": ""
2623
- }, null, 8, ["record"]))], 64)) : w("v-if", !0)]),
2624
- _: 1
2625
- }, 8, ["title"])]),
2626
- _: 1
2627
- })) : (I(), C(V(ue), {
2628
- key: 2,
2629
- class: "dynamic-list",
2630
- context: V(m),
2631
- title: Me.value,
2632
- "selected-key": h.value?.id,
2633
- "reload-key": b.value,
2634
- "standard-crud-actions": !0,
2635
- "standard-crud-row-actions": !0,
2636
- "extra-actions": Ge.value,
2637
- "additional-columns": Ke.value,
2638
- "cell-components": qe.value,
2639
- "extra-row-actions-of": Z,
2640
- "action-column-width": Y.value?.list?.actionColumnWidth,
2641
- "batch-actions": Je.value,
2642
- "ui-config-id": Ve.value,
2643
- "query-template-id": He.value,
2644
- ready: Qe.value,
2645
- "quick-search-placeholder": "搜索动态记录",
2646
- "empty-description": "暂无动态记录",
2647
- onLoaded: ft,
2648
- onSelect: pt,
2649
- onRowDblclick: a[10] ||= (e) => Tt(e, "view"),
2650
- onAction: Pt,
2651
- onRowAction: Ft,
2652
- onBatchAction: a[11] ||= (e, t, n, r) => Lt(e, t, r)
2653
- }, null, 8, [
2654
- "context",
2655
- "title",
2656
- "selected-key",
2657
- "reload-key",
2658
- "extra-actions",
2659
- "additional-columns",
2660
- "cell-components",
2661
- "action-column-width",
2662
- "batch-actions",
2663
- "ui-config-id",
2664
- "query-template-id",
2665
- "ready"
2666
- ])),
2667
- M.value ? w("v-if", !0) : (I(), C(V(oe), {
2668
- key: 3,
2669
- open: le.value,
2670
- title: Ne.value,
2671
- mode: _.value,
2672
- loading: K.value,
2673
- "load-failed": q.value,
2674
- "edit-available": !!h.value && !K.value && !q.value && _.value === "view",
2675
- "save-available": !K.value && !q.value && _.value !== "view",
2676
- saving: W.value,
2677
- onClose: Gt,
2678
- onRetry: qt,
2679
- onEdit: a[12] ||= (e) => h.value && At(h.value),
2680
- onSave: jt
2681
- }, {
2682
- status: U(() => [_.value === "view" && h.value ? (I(), C(V(ne), {
2683
- key: 0,
2684
- enabled: h.value.enabled !== !1,
2685
- disabled: !rt.value,
2686
- loading: G.value,
2687
- "show-label": !1,
2688
- onChange: Nt
2689
- }, null, 8, [
2690
- "enabled",
2691
- "disabled",
2692
- "loading"
2693
- ])) : w("v-if", !0)]),
2694
- viewOperation: U(() => [h.value?.id != null && Ye.value.length > 0 ? (I(), C(V(c), {
2695
- key: 0,
2696
- context: V(m),
2697
- "record-id": String(h.value.id),
2698
- actions: Ye.value,
2699
- onAction: It
2700
- }, null, 8, [
2701
- "context",
2702
- "record-id",
2703
- "actions"
2704
- ])) : w("v-if", !0)]),
2705
- view: U(() => [g.value ? (I(), T(x, { key: 0 }, [O(V(t), {
2706
- record: g.value,
2707
- fields: v.value,
2708
- "exclude-field-names": ["enabled"]
2709
- }, null, 8, ["record", "fields"]), (I(!0), T(x, null, z(Xe.value, (e) => (I(), C(V(se), {
2710
- key: e.key,
2711
- title: e.title
2712
- }, {
2713
- default: U(() => [(I(), C(Te(e.component), { context: zt(g.value) }, null, 8, ["context"]))]),
2714
- _: 2
2715
- }, 1032, ["title"]))), 128))], 64)) : w("v-if", !0)]),
2716
- form: U(() => [g.value ? (I(), C(V(pe), {
2717
- key: 0,
2718
- class: "dynamic-form",
2719
- record: g.value,
2720
- fields: v.value,
2721
- "form-session-key": Oe.value,
2722
- "option-context": V(m),
2723
- "picker-configs": at.value,
2724
- "exclude-field-names": ["enabled"],
2725
- "onUpdate:field": Et
2726
- }, null, 8, [
2727
- "record",
2728
- "fields",
2729
- "form-session-key",
2730
- "option-context",
2731
- "picker-configs"
2732
- ])) : w("v-if", !0)]),
2733
- _: 1
2734
- }, 8, [
2735
- "open",
2736
- "title",
2737
- "mode",
2738
- "loading",
2739
- "load-failed",
2740
- "edit-available",
2741
- "save-available",
2742
- "saving"
2743
- ])),
2744
- J.value ? (I(), C(V(s), {
2745
- key: 4,
2746
- open: !0,
2747
- title: J.value.definition.title,
2748
- width: J.value.definition.width,
2749
- onClose: Ht
2750
- }, {
2751
- default: U(() => [(I(), C(Te(J.value.definition.component), { context: J.value.context }, null, 8, ["context"]))]),
2752
- _: 1
2753
- }, 8, ["title", "width"])) : w("v-if", !0)
2754
- ], 2)) : (I(), T("section", tr, [E("h2", null, B(Me.value), 1), E("p", null, B($e.value), 1)])) : (I(), T("section", Zn, [O(V(o), {
2755
- loading: "",
2756
- "loading-tip": "加载页面入口",
2757
- description: ""
2758
- })]));
2759
- }
2760
- }), [["__scopeId", "data-v-fa0d29ed"]]), rr = Symbol("workbench-navigation");
2761
- function ir(e) {
2762
- L(rr, e);
2763
- }
2764
- function ar() {
2765
- return N(rr);
2766
- }
2767
- //#endregion
2768
- //#region src/platform-workbench/workspaceViewHost.ts
2769
- var or = Symbol("workspace-view-host");
2770
- function sr(e) {
2771
- L(or, e);
2772
- }
2773
- function cr() {
2774
- return N(or, void 0);
2775
- }
2776
- //#endregion
2777
- //#region src/platform-workbench/workspaceViewContract.ts
2778
- function lr(e) {
2779
- return e;
2780
- }
2781
- //#endregion
2782
- //#region src/platform-workbench/workspaceViews.ts
2783
- var ur = /* @__PURE__ */ new Map(), dr = pr([]);
2784
- function fr(e, t) {
2785
- ur.set(e, t), dr = pr([...ur.values()].flat());
2786
- }
2787
- function pr(e) {
2788
- let t = /* @__PURE__ */ new Map();
2789
- for (let n of e) {
2790
- if (t.has(n.type)) throw Error(`重复的工作视图类型:${n.type}`);
2791
- t.set(n.type, n);
2792
- }
2793
- return {
2794
- definitions: [...t.values()],
2795
- resolve(e) {
2796
- let n = e.target.query ?? {}, r = String(n.workspaceView ?? ""), i = n.workspacePresentation;
2797
- if (i !== "drawer" && i !== "tab") return;
2798
- let a = t.get(r), o = a?.parse(n);
2799
- return a && o && a.presentations.includes(i) ? {
2800
- view: a,
2801
- input: o,
2802
- presentation: i
2803
- } : void 0;
2804
- }
2805
- };
2806
- }
2807
- function mr(e, t, n = "tab", r = e.titleOf(t)) {
2808
- if (!e.presentations.includes(n)) throw Error(`工作视图 ${e.type} 不支持 ${n} 承载`);
2809
- let i = {
2810
- workspaceView: e.type,
2811
- workspacePresentation: n,
2812
- ...t
2813
- };
2814
- return {
2815
- pageType: "business-route",
2816
- openMode: "workbench-route",
2817
- hostType: "business-route-host",
2818
- title: r,
2819
- layout: e.layout,
2820
- target: {
2821
- route: e.route,
2822
- moduleAlias: e.moduleAlias,
2823
- query: i
2824
- },
2825
- params: i,
2826
- tabPolicy: { identity: "by-params" }
2827
- };
2828
- }
2829
- function hr(e, t) {
2830
- let n = t.parse(e.target.query ?? {}), r = new Set([
2831
- "workspaceView",
2832
- "workspacePresentation",
2833
- ...Object.keys(n ?? {})
2834
- ]), i = n ? t.parentRouteQueryOf?.(n) ?? {} : {}, a = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => !r.has(e))), o = {
2835
- ...a(e.target.query ?? {}),
2836
- ...i
2837
- };
2838
- return {
2839
- ...e,
2840
- title: t.routeTitle ?? e.title,
2841
- target: {
2842
- ...e.target,
2843
- query: o
2844
- },
2845
- params: {
2846
- ...a(e.params ?? {}),
2847
- ...i
2848
- },
2849
- tabPolicy: { identity: "by-params" }
2850
- };
2851
- }
2852
- function gr(e) {
2853
- return dr.resolve(e);
2854
- }
2855
- //#endregion
2856
- //#region src/platform-workbench/WorkspaceViewOutlet.vue
2857
- var _r = /* @__PURE__ */ A({
2858
- __name: "WorkspaceViewOutlet",
2859
- props: { descriptor: {} },
2860
- setup(e) {
2861
- let t = e, n = S(() => gr(t.descriptor)), r = S(() => tt(t.descriptor)), i = ar();
2862
- return sr({
2863
- get presentation() {
2864
- return n.value?.presentation ?? "tab";
2865
- },
2866
- setTitle(e) {
2867
- let n = e.trim();
2868
- !n || !i || t.descriptor.title === n || i.replacePage(r.value, {
2869
- ...t.descriptor,
2870
- title: n
2871
- });
2872
- },
2873
- dismiss() {
2874
- let e = n.value;
2875
- e && i && i.replacePage(r.value, hr(t.descriptor, e.view));
2876
- }
2877
- }), (t, r) => n.value ? (I(), C(Te(n.value.view.component), P({ key: 0 }, n.value.input, { title: e.descriptor.title ?? n.value.view.titleOf(n.value.input) }), null, 16, ["title"])) : (I(), C(V(g), {
2878
- key: 1,
2879
- description: "无法恢复该工作视图"
2880
- }));
2881
- }
2882
- }), vr = {
2883
- key: 1,
2884
- class: "page-host"
2885
- }, yr = /*#__PURE__*/ d(/* @__PURE__ */ A({
2886
- name: "BusinessRouteHost",
2887
- __name: "BusinessRouteHost",
2888
- props: { descriptor: {} },
2889
- setup(e) {
2890
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey), r = S(() => gr(t.descriptor));
2891
- return (t, i) => r.value ? (I(), C(V(m), {
2892
- key: 0,
2893
- "module-alias": r.value.view.moduleAlias
2894
- }, {
2895
- default: U(() => [O(_r, { descriptor: e.descriptor }, null, 8, ["descriptor"])]),
2896
- _: 1
2897
- }, 8, ["module-alias"])) : (I(), T("section", vr, [E("header", null, [i[0] ||= E("span", { class: "host-badge" }, "业务页面", -1), E("h2", null, B(n.value), 1)]), E("p", null, B(e.descriptor.target.route ?? e.descriptor.target.routeName ?? e.descriptor.target.pageKey), 1)]));
2898
- }
2899
- }), [["__scopeId", "data-v-663290d5"]]), br = ["src", "title"], xr = {
2900
- key: 1,
2901
- class: "page-host"
2902
- }, Sr = { class: "host-badge" }, Cr = ["href"], wr = /*#__PURE__*/ d(/* @__PURE__ */ A({
2903
- name: "ExternalPageHost",
2904
- __name: "ExternalPageHost",
2905
- props: { descriptor: {} },
2906
- setup(e) {
2907
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.url);
2908
- return (t, r) => e.descriptor.openMode === "iframe" ? (I(), T("iframe", {
2909
- key: 0,
2910
- class: "external-frame",
2911
- src: e.descriptor.target.url,
2912
- title: n.value
2913
- }, null, 8, br)) : (I(), T("section", xr, [
2914
- E("span", Sr, B(e.descriptor.openMode), 1),
2915
- E("h2", null, B(n.value), 1),
2916
- E("a", {
2917
- class: "external-link",
2918
- href: e.descriptor.target.url,
2919
- target: "_blank",
2920
- rel: "noopener noreferrer"
2921
- }, " 打开页面 ", 8, Cr)
2922
- ]));
2923
- }
2924
- }), [["__scopeId", "data-v-c45ef7f8"]]), Tr = typeof document < "u", Er = Object.assign, Dr = Array.isArray;
2925
- Symbol(process.env.NODE_ENV === "production" ? "" : "navigation failure");
2926
- var Or = Symbol(process.env.NODE_ENV === "production" ? "" : "router view location matched"), kr = Symbol(process.env.NODE_ENV === "production" ? "" : "router view depth");
2927
- Symbol(process.env.NODE_ENV === "production" ? "" : "router"), Symbol(process.env.NODE_ENV === "production" ? "" : "route location");
2928
- var Ar = Symbol(process.env.NODE_ENV === "production" ? "" : "router view location");
2929
- //#endregion
2930
- //#region node_modules/vue-router/dist/devtools-DCoWQoU_.js
2931
- function jr(e) {
2932
- let t = Array.from(arguments).slice(1);
2933
- console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
2934
- }
2935
- function Mr(e, t) {
2936
- return (e.aliasOf || e) === (t.aliasOf || t);
2937
- }
2938
- //#endregion
2939
- //#region node_modules/vue-router/dist/vue-router.js
2940
- var Nr = /* @__PURE__ */ A({
2941
- name: "RouterView",
2942
- inheritAttrs: !1,
2943
- props: {
2944
- name: {
2945
- type: String,
2946
- default: "default"
2947
- },
2948
- route: Object
2949
- },
2950
- compatConfig: { MODE: 3 },
2951
- setup(e, { attrs: t, slots: n }) {
2952
- process.env.NODE_ENV !== "production" && Ir();
2953
- let r = N(Ar), i = S(() => e.route || r.value), a = N(kr, 0), o = S(() => {
2954
- let e = V(a), { matched: t } = i.value, n;
2955
- for (; (n = t[e]) && !n.components;) e++;
2956
- return e;
2957
- }), s = S(() => i.value.matched[o.value]);
2958
- L(kr, S(() => o.value + 1)), L(Or, s), L(Ar, i);
2959
- let c = R();
2960
- return H(() => [
2961
- c.value,
2962
- s.value,
2963
- e.name
2964
- ], ([e, t, n], [r, i, a]) => {
2965
- t && (t.instances[n] = e, i && i !== t && e && e === r && (t.leaveGuards.size || (t.leaveGuards = i.leaveGuards), t.updateGuards.size || (t.updateGuards = i.updateGuards))), e && t && (!i || !Mr(t, i) || !r) && (t.enterCallbacks[n] || []).forEach((t) => t(e));
2966
- }, { flush: "post" }), () => {
2967
- let r = i.value, a = e.name, l = s.value, u = l && l.components[a];
2968
- if (!u) return Pr(n.default, {
2969
- Component: u,
2970
- route: r
2971
- });
2972
- let d = l.props[a], f = M(u, Er({}, d ? d === !0 ? r.params : typeof d == "function" ? d(r) : d : null, t, {
2973
- onVnodeUnmounted: (e) => {
2974
- e.component.isUnmounted && (l.instances[a] = null);
2975
- },
2976
- ref: c
2977
- }));
2978
- if (process.env.NODE_ENV !== "production" && Tr && f.ref) {
2979
- let e = {
2980
- depth: o.value,
2981
- name: l.name,
2982
- path: l.path,
2983
- meta: l.meta
2984
- };
2985
- (Dr(f.ref) ? f.ref.map((e) => e.i) : [f.ref.i]).forEach((t) => {
2986
- t.__vrv_devtools = e;
2987
- });
2988
- }
2989
- return Pr(n.default, {
2990
- Component: f,
2991
- route: r
2992
- }) || f;
2993
- };
2994
- }
2995
- });
2996
- function Pr(e, t) {
2997
- if (!e) return null;
2998
- let n = e(t);
2999
- return n.length === 1 ? n[0] : n;
3000
- }
3001
- var Fr = Nr;
3002
- function Ir() {
3003
- let e = j(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
3004
- if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
3005
- let e = t === "KeepAlive" ? "keep-alive" : "transition";
3006
- jr(`<router-view> can no longer be used directly inside <${e}>.\nUse slot props instead:\n\n<router-view v-slot="{ Component }">\n <${e}>\n <component :is="Component" />\n </${e}>\n</router-view>`);
3007
- }
3008
- }
3009
- //#endregion
3010
- //#region src/platform-workbench/hosts/PlatformRouteHost.vue?vue&type=script&setup=true&lang.ts
3011
- var Lr = {
3012
- key: 1,
3013
- class: "page-host"
3014
- }, Rr = /*#__PURE__*/ d(/* @__PURE__ */ A({
3015
- name: "PlatformRouteHost",
3016
- __name: "PlatformRouteHost",
3017
- props: { descriptor: {} },
3018
- setup(e) {
3019
- let t = e, n = S(() => t.descriptor.title ?? t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey);
3020
- return (e, r) => t.descriptor.target.route === "/" ? (I(), C(V(Fr), { key: 0 })) : (I(), T("section", Lr, [E("header", null, [r[0] ||= E("span", { class: "host-badge" }, "平台页面", -1), E("h2", null, B(n.value), 1)]), E("p", null, B(t.descriptor.target.route ?? t.descriptor.target.routeName ?? t.descriptor.target.pageKey), 1)]));
3021
- }
3022
- }), [["__scopeId", "data-v-5d6a0366"]]);
3023
- //#endregion
3024
- //#region src/platform-workbench/pageHostRegistry.ts
3025
- function zr(e) {
3026
- switch (e) {
3027
- case "platform-route-host": return "PlatformRouteHost";
3028
- case "business-route-host": return "BusinessRouteHost";
3029
- case "dynamic-module-host": return "DynamicModuleHost";
3030
- case "external-page-host": return "ExternalPageHost";
3031
- default: return Br(e);
3032
- }
3033
- }
3034
- function Br(e) {
3035
- throw Error(`Unsupported page host type: ${e}`);
3036
- }
3037
- //#endregion
3038
- //#region src/platform-workbench/WorkbenchOutlet.vue
3039
- var Vr = /* @__PURE__ */ A({
3040
- name: "WorkbenchOutlet",
3041
- __name: "WorkbenchOutlet",
3042
- props: { descriptor: {} },
3043
- setup(e) {
3044
- let t = e, n = ar();
3045
- fr("module-page-enhancements", zn().map(r)), Wn(n && {
3046
- openPage: n.openPage,
3047
- openWorkspaceTab(e, t) {
3048
- n.openPage(mr(r(e), t));
3049
- }
3050
- });
3051
- function r(e) {
3052
- return {
3053
- ...e,
3054
- route: e.route ?? `/_workspace/${encodeURIComponent(e.type)}`,
3055
- presentations: ["tab"]
3056
- };
3057
- }
3058
- let i = S(() => t.descriptor ? zr(t.descriptor.hostType) : void 0), a = S(() => i.value === "PlatformRouteHost" ? t.descriptor : void 0), o = S(() => i.value === "BusinessRouteHost" ? t.descriptor : void 0), s = S(() => i.value === "DynamicModuleHost" ? t.descriptor : void 0), c = S(() => i.value === "ExternalPageHost" ? t.descriptor : void 0);
3059
- return (e, t) => a.value ? (I(), C(Rr, {
3060
- key: 0,
3061
- descriptor: a.value
3062
- }, null, 8, ["descriptor"])) : o.value ? (I(), C(yr, {
3063
- key: 1,
3064
- descriptor: o.value
3065
- }, null, 8, ["descriptor"])) : s.value ? (I(), C(V(nr), {
3066
- key: 2,
3067
- descriptor: s.value
3068
- }, null, 8, ["descriptor"])) : c.value ? (I(), C(wr, {
3069
- key: 3,
3070
- descriptor: c.value
3071
- }, null, 8, ["descriptor"])) : (I(), C(V(g), {
3072
- key: 4,
3073
- description: "暂无页面"
3074
- }));
3075
- }
3076
- }), Hr = lr({
3077
- type: "iam.user.detail",
3078
- route: "/iam/users",
3079
- moduleAlias: "iam.user",
3080
- component: k(() => import("./UserDetailWorkspaceView-OPYvD6mH.js")),
3081
- layout: "workspace",
3082
- routeTitle: "用户管理",
3083
- presentations: ["drawer", "tab"],
3084
- titleOf: () => "用户详情",
3085
- parse(e) {
3086
- let t = e.recordId;
3087
- if (!(typeof t != "string" || !t)) return { recordId: t };
3088
- }
3089
- }), Ur = lr({
3090
- type: "iam.employee.detail",
3091
- route: "/iam/employees",
3092
- moduleAlias: "iam.employee",
3093
- component: k(() => import("./EmployeeDetailWorkspaceView-DYJLlkSz.js")),
3094
- layout: "workspace",
3095
- routeTitle: "职员管理",
3096
- presentations: ["drawer", "tab"],
3097
- titleOf: () => "职员详情",
3098
- parse(e) {
3099
- let t = e.recordId;
3100
- if (!(typeof t != "string" || !t)) return { recordId: t };
3101
- }
3102
- }), Wr = new Set([
3103
- "platform",
3104
- "tenant",
3105
- "organization"
3106
- ]), Gr = lr({
3107
- type: "iam.role.detail",
3108
- route: "/iam/roles",
3109
- moduleAlias: "iam.role",
3110
- component: k(() => import("./RoleDetailWorkspaceView-DmJlJgAj.js")),
3111
- layout: "workspace",
3112
- routeTitle: "角色管理",
3113
- presentations: ["drawer", "tab"],
3114
- titleOf: () => "角色详情",
3115
- parentRouteQueryOf(e) {
3116
- return e.scopeKind === "platform" ? { scopeKind: e.scopeKind } : {
3117
- scopeKind: e.scopeKind,
3118
- scopeId: e.scopeId
3119
- };
3120
- },
3121
- parse(e) {
3122
- let t = e.recordId, n = e.scopeKind, r = e.scopeId;
3123
- if (!(typeof t != "string" || !t || typeof n != "string" || !Wr.has(n) || (n === "platform" ? r !== void 0 : typeof r != "string" || !r))) return {
3124
- recordId: t,
3125
- scopeKind: n,
3126
- ...typeof r == "string" ? { scopeId: r } : {}
3127
- };
3128
- }
3129
- }), Kr = lr({
3130
- type: "iam.system-user.detail",
3131
- route: "/iam/system-users",
3132
- moduleAlias: "iam.system_user",
3133
- component: k(() => import("./SystemUserDetailWorkspaceView-U6Ij0US1.js")),
3134
- layout: "workspace",
3135
- routeTitle: "系统账号管理",
3136
- presentations: ["drawer", "tab"],
3137
- titleOf: () => "系统账号详情",
3138
- parse(e) {
3139
- let t = e.recordId;
3140
- return typeof t == "string" && t ? { recordId: t } : void 0;
3141
- }
3142
- }), qr = lr({
3143
- type: "iam.role.authorization",
3144
- route: "/iam/role-authorization",
3145
- moduleAlias: "iam.role",
3146
- component: k(() => import("./RoleAuthorizationView-q_6CsBYq.js").then((e) => e.n)),
3147
- layout: "workspace",
3148
- routeTitle: "角色授权",
3149
- drawerProfile: "wide-work",
3150
- presentations: ["drawer", "tab"],
3151
- titleOf: () => "角色授权",
3152
- parse(e) {
3153
- let t = e.roleId;
3154
- return typeof t == "string" && t ? { roleId: t } : void 0;
3155
- }
3156
- }), Jr = lr({
3157
- type: "platform.module.actions",
3158
- route: "/config/modules",
3159
- moduleAlias: "platform.module",
3160
- component: k(() => import("./ModuleActionManagementView-CmVj0e0C.js")),
3161
- layout: "workspace",
3162
- routeTitle: "模块管理",
3163
- presentations: ["tab"],
3164
- titleOf: (e) => `动作:${e.moduleTitle ?? e.moduleAlias}`,
3165
- parentRouteQueryOf: () => ({}),
3166
- parse(e) {
3167
- let t = e.moduleAlias, n = e.moduleTitle;
3168
- if (!(typeof t != "string" || !t)) return {
3169
- moduleAlias: t,
3170
- ...typeof n == "string" && n ? { moduleTitle: n } : {},
3171
- ...e.moduleKind === "static" || e.moduleKind === "dynamic" ? { moduleKind: e.moduleKind } : {}
3172
- };
3173
- }
3174
- }), Yr = lr({
3175
- type: "platform.module.metadata-orchestration",
3176
- route: "/config/modules",
3177
- moduleAlias: "platform.module",
3178
- component: k(() => import("./MetadataOrchestrationView-B-CPudJl.js")),
3179
- layout: "workspace",
3180
- routeTitle: "模块管理",
3181
- presentations: ["tab"],
3182
- titleOf: (e) => `元数据:${e.moduleTitle ?? e.moduleAlias}`,
3183
- parentRouteQueryOf: () => ({}),
3184
- parse(e) {
3185
- let t = e.moduleAlias, n = e.moduleTitle;
3186
- if (!(typeof t != "string" || !t)) return {
3187
- moduleAlias: t,
3188
- ...typeof n == "string" && n ? { moduleTitle: n } : {}
3189
- };
3190
- }
3191
- });
3192
- //#endregion
3193
- //#region src/platform-admin-runtime/workspaceViews.ts
3194
- fr("platform-admin-runtime", [
3195
- Hr,
3196
- Ur,
3197
- Gr,
3198
- Kr,
3199
- qr,
3200
- Jr,
3201
- Yr
3202
- ]);
3203
- //#endregion
3204
- //#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
3205
- function Xr(e) {
3206
- return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
3207
- }
3208
- function Zr(e) {
3209
- let t = ar();
3210
- return S(() => {
3211
- let n = Ee(e.input);
3212
- if (!(!n || !Xr(Ee(e.eligibility)) || !t)) return {
3213
- title: "固定为页签",
3214
- promote: async () => {
3215
- if (await e.beforePromote?.(n) === !1) {
3216
- e.onPromotionRejected?.();
3217
- return;
3218
- }
3219
- let r = t.openPage(mr(e.view, n, "tab", Ee(e.title)));
3220
- e.onPromoted?.(r);
3221
- }
3222
- };
3223
- });
3224
- }
3225
- //#endregion
3226
- //#region src/platform-admin-runtime/workspaceViewSessions.ts
3227
- var Qr = /* @__PURE__ */ new Map(), $r = /* @__PURE__ */ new Map();
3228
- function ei(e, t) {
3229
- return `${e.type}:${ii(t)}`;
3230
- }
3231
- async function ti(e, t, n) {
3232
- let r = ei(e, t), i = $r.get(r), a = i && [...i].at(-1);
3233
- return a ? await a(ai(n)) ? "accepted" : "rejected" : (Qr.set(r, ai(n)), "accepted");
3234
- }
3235
- function ni(e, t, n) {
3236
- let r = ei(e, t), i = $r.get(r) ?? /* @__PURE__ */ new Set();
3237
- return i.add(n), $r.set(r, i), () => {
3238
- i.delete(n), i.size === 0 && $r.delete(r);
3239
- };
3240
- }
3241
- function ri(e, t) {
3242
- let n = ei(e, t), r = Qr.get(n);
3243
- return Qr.delete(n), r;
3244
- }
3245
- function ii(e) {
3246
- return Array.isArray(e) ? `[${e.map(ii).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${ii(t)}`).join(",")}}` : JSON.stringify(e);
3247
- }
3248
- function ai(e) {
3249
- return JSON.parse(JSON.stringify(e));
3250
- }
3251
- //#endregion
3252
- export { Pt as A, Ze as B, ar as C, zn as D, Fn as E, Tt as F, tt as G, $ as H, Dt as I, rt as K, Q as L, St as M, Ct as N, Mn as O, Et as P, et as R, ir as S, Ln as T, nt as U, Qe as V, $e as W, hr as _, Yr as a, sr as b, Kr as c, Hr as d, Vr as f, pr as g, mr as h, Zr as i, Ot as j, gn as k, Gr as l, fr as m, ni as n, Jr as o, _r as p, ri as r, qr as s, ti as t, Ur as u, gr as v, Jn as w, cr as x, lr as y, Xe as z };