@ximatai/muyun-web-app 0.26.3

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