@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,655 @@
1
+ import { $t as e, Dt as t, Et as n, G as r, Gt as i, Ht as a, Lt as o, Mt as s, Pt as c, R as l, S as u, Vt as d, Xt as f, Yt as p, Zt as m, _t as h, cn as g, en as _, fn as v, it as y, mt as b, rt as x, tn as S, x as C } from "./platform-components-bC1gwhic.js";
2
+ import { Fragment as ee, computed as w, createBlock as T, createCommentVNode as te, createElementBlock as E, createElementVNode as D, createTextVNode as O, createVNode as k, defineComponent as A, onMounted as ne, openBlock as j, ref as M, toDisplayString as N, unref as P, watch as F, withCtx as I, withModifiers as L } from "vue";
3
+ //#region src/views/metadataOrchestrationState.ts
4
+ function re() {
5
+ let e = M([]), t = M({}), n = M(), r = M([]), i = M([]), a = M("view"), o = M(R()), s = M(z()), c = w(() => e.value.find((e) => e.id === n.value)), l = w(() => c.value?.metadataId ? t.value[c.value.metadataId] : void 0), u = w(() => e.value.some((e) => e.relationRole === "MAIN")), d = w(() => a.value === "create-main"), f = w(() => a.value === "create-field" || a.value === "edit-field"), p = w(() => H(i.value));
6
+ function m(t) {
7
+ e.value = t;
8
+ let r = new Set(t.map((e) => e.id).filter(Boolean));
9
+ (!n.value || !r.has(n.value)) && (n.value = t[0]?.id);
10
+ }
11
+ function h(e) {
12
+ e.id && (t.value = {
13
+ ...t.value,
14
+ [e.id]: e
15
+ });
16
+ }
17
+ function g(e) {
18
+ r.value = V(e);
19
+ }
20
+ function _(e) {
21
+ i.value = e;
22
+ }
23
+ function v(e) {
24
+ return a.value = "view", !e.id || e.id === n.value ? !1 : (n.value = e.id, r.value = [], !0);
25
+ }
26
+ function y(e) {
27
+ e && (n.value = e, a.value = "view", r.value = []);
28
+ }
29
+ function b() {
30
+ o.value = R(), a.value = "create-main";
31
+ }
32
+ function x() {
33
+ l.value?.id && (s.value = z(), a.value = "create-field");
34
+ }
35
+ function S(e) {
36
+ l.value?.id && (s.value = B(e), a.value = "edit-field");
37
+ }
38
+ function C() {
39
+ a.value = "view";
40
+ }
41
+ return {
42
+ relations: e,
43
+ metadataById: t,
44
+ selectedRelationId: n,
45
+ fields: r,
46
+ fieldSpecs: i,
47
+ mode: a,
48
+ mainMetadataDraft: o,
49
+ fieldDraft: s,
50
+ selectedRelation: c,
51
+ selectedMetadata: l,
52
+ hasMainMetadata: u,
53
+ mainEditorOpen: d,
54
+ fieldEditorOpen: f,
55
+ fieldSpecOptions: p,
56
+ handleRelationsLoaded: m,
57
+ handleMetadataLoaded: h,
58
+ handleFieldsLoaded: g,
59
+ handleFieldSpecsLoaded: _,
60
+ selectRelation: v,
61
+ focusRelation: y,
62
+ startCreateMain: b,
63
+ startCreateField: x,
64
+ startEditField: S,
65
+ cancelEditor: C
66
+ };
67
+ }
68
+ function R() {
69
+ return {
70
+ alias: "",
71
+ title: "",
72
+ schemaName: "",
73
+ tableName: "",
74
+ dataScopeEnabled: !1
75
+ };
76
+ }
77
+ function ie(e) {
78
+ return {
79
+ ...e,
80
+ alias: e.alias.trim(),
81
+ title: e.title.trim(),
82
+ schemaName: e.schemaName.trim(),
83
+ tableName: e.tableName.trim()
84
+ };
85
+ }
86
+ function ae(e) {
87
+ return !!(e.alias.trim() && e.title.trim());
88
+ }
89
+ function z() {
90
+ return {
91
+ fieldName: "",
92
+ columnName: "",
93
+ title: "",
94
+ fieldSpecAlias: void 0,
95
+ fieldOwnership: "BUSINESS",
96
+ fieldForm: "PHYSICAL",
97
+ required: !1,
98
+ uniqueField: !1,
99
+ indexed: !1,
100
+ sortableField: !1,
101
+ titleField: !1,
102
+ enabled: !0
103
+ };
104
+ }
105
+ function B(e) {
106
+ return { ...e };
107
+ }
108
+ function oe(e) {
109
+ return !!(e.fieldName?.trim() && e.columnName?.trim() && e.fieldSpecAlias);
110
+ }
111
+ function se(e) {
112
+ return {
113
+ ...e,
114
+ fieldName: e.fieldName?.trim(),
115
+ columnName: e.columnName?.trim(),
116
+ title: e.title?.trim()
117
+ };
118
+ }
119
+ function V(e) {
120
+ return e.filter((e) => e.fieldOwnership === "BUSINESS" && e.fieldForm === "PHYSICAL" && e.systemManaged !== !0);
121
+ }
122
+ function H(e) {
123
+ return e.filter((e) => e.enabled !== !1).map((e) => ({
124
+ value: e.alias ?? e.id ?? "",
125
+ label: e.title ?? e.alias ?? e.id ?? "未命名字段规格"
126
+ })).filter((e) => e.value);
127
+ }
128
+ function U(e, t) {
129
+ return t?.title ?? e.relationAlias ?? "未命名实体";
130
+ }
131
+ function W(e) {
132
+ if (e === "MAIN") return "主实体";
133
+ if (e === "CHILD") return "子实体";
134
+ }
135
+ function G(e, t) {
136
+ let n = U(e, t), r = t?.alias ?? e.relationAlias;
137
+ return {
138
+ title: n,
139
+ secondary: r && r !== n ? r : void 0,
140
+ tag: W(e.relationRole),
141
+ muted: t?.enabled === !1 ? !0 : void 0
142
+ };
143
+ }
144
+ function ce(e) {
145
+ if (!e) return;
146
+ let t = e.tableName ? `${e.schemaName ?? "public"}.${e.tableName}` : void 0;
147
+ return [e.alias, t].filter(Boolean).join(" · ") || void 0;
148
+ }
149
+ //#endregion
150
+ //#region src/views/MetadataOrchestrationView.vue?vue&type=script&setup=true&lang.ts
151
+ var le = { class: "entity-overview" }, ue = { class: "field-section" }, de = { class: "orchestration-form-flags" }, K = 200, q = /*#__PURE__*/ S(/* @__PURE__ */ A({
152
+ name: "MetadataOrchestrationView",
153
+ __name: "MetadataOrchestrationView",
154
+ props: {
155
+ moduleAlias: {},
156
+ moduleTitle: {},
157
+ title: {}
158
+ },
159
+ setup(S) {
160
+ let w = S, A = g({ moduleAlias: "platform.module" }), R = v(A.http, "/platform.metadata"), z = re(), B = M(!1), V = M(!1), H = M(""), W = [
161
+ {
162
+ key: "title",
163
+ title: "字段"
164
+ },
165
+ {
166
+ key: "fieldName",
167
+ title: "字段名",
168
+ width: 150
169
+ },
170
+ {
171
+ key: "fieldSpecAlias",
172
+ title: "字段规格",
173
+ width: 140
174
+ },
175
+ {
176
+ key: "required",
177
+ title: "必填",
178
+ width: 70
179
+ },
180
+ {
181
+ key: "enabled",
182
+ title: "状态",
183
+ width: 70
184
+ }
185
+ ];
186
+ F(() => w.moduleAlias, () => void q(), { immediate: !0 }), ne(() => void fe());
187
+ async function q() {
188
+ B.value = !0;
189
+ try {
190
+ z.handleRelationsLoaded(await $(Q("/query"))), await J();
191
+ } catch (e) {
192
+ n(e, {
193
+ source: "metadata-orchestration",
194
+ phase: "load"
195
+ });
196
+ } finally {
197
+ B.value = !1;
198
+ }
199
+ }
200
+ async function fe() {
201
+ try {
202
+ z.handleFieldSpecsLoaded(await $("/platform.field_spec/query"));
203
+ } catch (e) {
204
+ n(e, {
205
+ source: "metadata-orchestration",
206
+ phase: "load"
207
+ });
208
+ }
209
+ }
210
+ async function pe(e) {
211
+ z.selectRelation(e) && await J();
212
+ }
213
+ async function J() {
214
+ let e = z.selectedRelation.value?.metadataId;
215
+ if (z.handleFieldsLoaded([]), e) try {
216
+ let t = await R.view(e);
217
+ z.handleMetadataLoaded(t), z.handleFieldsLoaded(await $(`/platform.metadata/${encodeURIComponent(e)}/fields/query`));
218
+ } catch (e) {
219
+ n(e, {
220
+ source: "metadata-orchestration",
221
+ phase: "load"
222
+ });
223
+ }
224
+ }
225
+ async function Y() {
226
+ let e = ie(z.mainMetadataDraft.value);
227
+ if (!ae(e)) {
228
+ t("请填写实体 alias 和名称", {
229
+ source: "metadata-orchestration",
230
+ phase: "validation"
231
+ });
232
+ return;
233
+ }
234
+ V.value = !0;
235
+ try {
236
+ let t = await A.http.request({
237
+ method: "POST",
238
+ path: Q("/create-main-metadata"),
239
+ body: e
240
+ });
241
+ z.cancelEditor(), await q(), z.focusRelation(t.relation.id), await J(), await h({
242
+ success: !0,
243
+ message: "主实体已创建"
244
+ }, { source: "metadata-orchestration" });
245
+ } catch (e) {
246
+ n(e, {
247
+ source: "metadata-orchestration",
248
+ phase: "action"
249
+ });
250
+ } finally {
251
+ V.value = !1;
252
+ }
253
+ }
254
+ async function X() {
255
+ let e = z.selectedMetadata.value?.id;
256
+ if (!e) return;
257
+ let r = se(z.fieldDraft.value);
258
+ if (!oe(r)) {
259
+ t("请填写字段名、物理列名和字段规格", {
260
+ source: "metadata-orchestration",
261
+ phase: "validation"
262
+ });
263
+ return;
264
+ }
265
+ V.value = !0;
266
+ try {
267
+ let t = {
268
+ ...r,
269
+ metadataId: e,
270
+ fieldOwnership: "BUSINESS",
271
+ fieldForm: "PHYSICAL"
272
+ };
273
+ t.id ? await A.http.request({
274
+ method: "POST",
275
+ path: `/platform.metadata/${encodeURIComponent(e)}/fields/update/${encodeURIComponent(t.id)}`,
276
+ body: t
277
+ }) : await A.http.request({
278
+ method: "POST",
279
+ path: `/platform.metadata/${encodeURIComponent(e)}/fields/insert`,
280
+ body: t
281
+ }), z.cancelEditor(), await J(), await h({
282
+ success: !0,
283
+ message: "字段已保存"
284
+ }, { source: "metadata-orchestration" });
285
+ } catch (e) {
286
+ n(e, {
287
+ source: "metadata-orchestration",
288
+ phase: "action"
289
+ });
290
+ } finally {
291
+ V.value = !1;
292
+ }
293
+ }
294
+ async function Z(e) {
295
+ let t = z.selectedMetadata.value?.id;
296
+ if (!(!t || !e.id || !await c({
297
+ title: "删除字段",
298
+ content: `确认删除字段“${e.title ?? e.fieldName}”?`,
299
+ okText: "删除",
300
+ danger: !0
301
+ }))) {
302
+ V.value = !0;
303
+ try {
304
+ await A.http.request({
305
+ method: "POST",
306
+ path: `/platform.metadata/${encodeURIComponent(t)}/fields/delete/${encodeURIComponent(e.id)}`,
307
+ body: { version: e.version }
308
+ }), await J();
309
+ } catch (e) {
310
+ n(e, {
311
+ source: "metadata-orchestration",
312
+ phase: "action"
313
+ });
314
+ } finally {
315
+ V.value = !1;
316
+ }
317
+ }
318
+ }
319
+ async function me() {
320
+ let e = z.selectedRelation.value;
321
+ if (e?.id) {
322
+ V.value = !0;
323
+ try {
324
+ await A.http.request({
325
+ method: "POST",
326
+ path: Q(`/${encodeURIComponent(e.id)}/fields/ensure`)
327
+ }), await h({
328
+ success: !0,
329
+ message: "模块字段配置已同步"
330
+ }, { source: "metadata-orchestration" });
331
+ } catch (e) {
332
+ n(e, {
333
+ source: "metadata-orchestration",
334
+ phase: "action"
335
+ });
336
+ } finally {
337
+ V.value = !1;
338
+ }
339
+ }
340
+ }
341
+ function Q(e) {
342
+ return `/platform.module/${encodeURIComponent(w.moduleAlias)}/metadata-relations${e}`;
343
+ }
344
+ async function $(e) {
345
+ let t = [];
346
+ for (let n = 1;; n += 1) {
347
+ let r = await A.http.request({
348
+ method: "POST",
349
+ path: e,
350
+ body: { page: {
351
+ pageNum: n,
352
+ pageSize: K
353
+ } }
354
+ });
355
+ if (t.push(...r.records), r.totalKnown ? n >= r.pages : r.records.length < K) return t;
356
+ }
357
+ }
358
+ function he(e) {
359
+ return e.metadataId ? z.metadataById.value[e.metadataId] : void 0;
360
+ }
361
+ function ge(e) {
362
+ let t = e;
363
+ return G(t, he(t));
364
+ }
365
+ function _e(e, t) {
366
+ let n = t;
367
+ return e.key === "required" ? n.required ? "是" : "否" : e.key === "enabled" ? n.enabled === !1 ? "停用" : "启用" : String(n[e.key] ?? "");
368
+ }
369
+ return (t, n) => (j(), E(ee, null, [
370
+ k(P(y), {
371
+ class: "metadata-orchestration-workspace",
372
+ "explorer-count": 1
373
+ }, {
374
+ default: I(() => [k(P(x), null, {
375
+ default: I(() => [k(P(l), {
376
+ "search-keyword": H.value,
377
+ "onUpdate:searchKeyword": n[0] ||= (e) => H.value = e,
378
+ title: "实体",
379
+ "search-placeholder": "搜索实体名称或 alias",
380
+ onRefresh: q
381
+ }, {
382
+ actions: I(() => [P(z).hasMainMetadata.value ? te("v-if", !0) : (j(), T(P(_), {
383
+ key: 0,
384
+ class: "record-panel-create-button",
385
+ type: "primary",
386
+ "icon-name": "plus",
387
+ title: "新建主实体",
388
+ disabled: B.value || V.value,
389
+ onClick: P(z).startCreateMain
390
+ }, null, 8, ["disabled", "onClick"]))]),
391
+ default: I(() => [B.value ? (j(), T(P(o), {
392
+ key: 0,
393
+ tip: "加载实体"
394
+ })) : P(z).relations.value.length ? (j(), T(P(s), {
395
+ key: 2,
396
+ records: P(z).relations.value,
397
+ "selected-id": P(z).selectedRelationId.value,
398
+ keyword: H.value,
399
+ "empty-description": "暂无实体",
400
+ "item-of": ge,
401
+ onSelect: pe
402
+ }, null, 8, [
403
+ "records",
404
+ "selected-id",
405
+ "keyword"
406
+ ])) : (j(), T(P(a), {
407
+ key: 1,
408
+ description: "请先创建动态模块的主实体"
409
+ }))]),
410
+ _: 1
411
+ }, 8, ["search-keyword"])]),
412
+ _: 1
413
+ }), P(z).selectedMetadata.value && P(z).selectedRelation.value ? (j(), T(P(r), {
414
+ key: 0,
415
+ title: P(U)(P(z).selectedRelation.value, P(z).selectedMetadata.value),
416
+ subtitle: P(ce)(P(z).selectedMetadata.value)
417
+ }, {
418
+ actions: I(() => [k(P(e), {
419
+ emphasis: "quiet",
420
+ disabled: V.value || B.value,
421
+ onClick: me
422
+ }, {
423
+ default: I(() => [...n[16] ||= [O(" 同步模块字段配置 ", -1)]]),
424
+ _: 1
425
+ }, 8, ["disabled"]), k(P(e), {
426
+ emphasis: "primary",
427
+ disabled: V.value || B.value,
428
+ onClick: P(z).startCreateField
429
+ }, {
430
+ default: I(() => [...n[17] ||= [O(" 新增字段 ", -1)]]),
431
+ _: 1
432
+ }, 8, ["disabled", "onClick"])]),
433
+ default: I(() => [
434
+ D("dl", le, [
435
+ D("div", null, [n[18] ||= D("dt", null, "实体 alias", -1), D("dd", null, N(P(z).selectedMetadata.value.alias ?? "-"), 1)]),
436
+ D("div", null, [n[19] ||= D("dt", null, "物理表", -1), D("dd", null, N(P(z).selectedMetadata.value.tableName ? `${P(z).selectedMetadata.value.schemaName ?? "public"}.${P(z).selectedMetadata.value.tableName}` : "-"), 1)]),
437
+ D("div", null, [n[20] ||= D("dt", null, "数据权限范围", -1), D("dd", null, N(P(z).selectedMetadata.value.dataScopeEnabled ? "已启用" : "未启用"), 1)])
438
+ ]),
439
+ D("section", ue, [n[23] ||= D("header", { class: "field-section-header" }, [D("h3", null, "业务字段")], -1), B.value ? (j(), T(P(o), {
440
+ key: 0,
441
+ tip: "加载字段"
442
+ })) : P(z).fields.value.length ? (j(), T(P(d), {
443
+ key: 2,
444
+ columns: W,
445
+ rows: P(z).fields.value,
446
+ "show-action-column": "",
447
+ "action-column-title": "操作"
448
+ }, {
449
+ cell: I(({ column: e, record: t }) => [O(N(_e(e, t)), 1)]),
450
+ rowActions: I(({ record: t }) => [k(P(e), {
451
+ emphasis: "quiet",
452
+ density: "compact",
453
+ onClick: (e) => P(z).startEditField(t)
454
+ }, {
455
+ default: I(() => [...n[21] ||= [O(" 编辑 ", -1)]]),
456
+ _: 1
457
+ }, 8, ["onClick"]), k(P(e), {
458
+ emphasis: "quiet",
459
+ density: "compact",
460
+ intent: "danger",
461
+ disabled: V.value,
462
+ onClick: (e) => Z(t)
463
+ }, {
464
+ default: I(() => [...n[22] ||= [O(" 删除 ", -1)]]),
465
+ _: 1
466
+ }, 8, ["disabled", "onClick"])]),
467
+ _: 1
468
+ }, 8, ["rows"])) : (j(), T(P(a), {
469
+ key: 1,
470
+ description: "暂无业务字段,点击右上角新增字段"
471
+ }))]),
472
+ k(P(u), { record: P(z).selectedMetadata.value }, null, 8, ["record"])
473
+ ]),
474
+ _: 1
475
+ }, 8, ["title", "subtitle"])) : (j(), T(P(r), {
476
+ key: 1,
477
+ title: "字段编排"
478
+ }, {
479
+ default: I(() => [k(P(a), { description: "从左侧选择实体后开始字段编排" })]),
480
+ _: 1
481
+ }))]),
482
+ _: 1
483
+ }),
484
+ k(P(C), {
485
+ open: P(z).mainEditorOpen.value,
486
+ title: "新建主实体",
487
+ subtitle: S.moduleTitle ?? S.moduleAlias,
488
+ mode: "create",
489
+ onClose: P(z).cancelEditor
490
+ }, {
491
+ form: I(() => [D("form", {
492
+ class: "orchestration-form",
493
+ onSubmit: L(Y, ["prevent"])
494
+ }, [
495
+ D("label", null, [n[24] ||= D("span", null, "实体 alias", -1), k(P(p), {
496
+ value: P(z).mainMetadataDraft.value.alias,
497
+ "onUpdate:value": n[1] ||= (e) => P(z).mainMetadataDraft.value.alias = e,
498
+ placeholder: "例如 customer"
499
+ }, null, 8, ["value"])]),
500
+ D("label", null, [n[25] ||= D("span", null, "实体名称", -1), k(P(p), {
501
+ value: P(z).mainMetadataDraft.value.title,
502
+ "onUpdate:value": n[2] ||= (e) => P(z).mainMetadataDraft.value.title = e,
503
+ placeholder: "例如 客户"
504
+ }, null, 8, ["value"])]),
505
+ D("label", null, [n[26] ||= D("span", null, "Schema(可选)", -1), k(P(p), {
506
+ value: P(z).mainMetadataDraft.value.schemaName,
507
+ "onUpdate:value": n[3] ||= (e) => P(z).mainMetadataDraft.value.schemaName = e,
508
+ placeholder: "默认 public"
509
+ }, null, 8, ["value"])]),
510
+ D("label", null, [n[27] ||= D("span", null, "物理表名(可选)", -1), k(P(p), {
511
+ value: P(z).mainMetadataDraft.value.tableName,
512
+ "onUpdate:value": n[4] ||= (e) => P(z).mainMetadataDraft.value.tableName = e,
513
+ placeholder: "默认按应用和 alias 生成"
514
+ }, null, 8, ["value"])]),
515
+ k(P(m), {
516
+ checked: P(z).mainMetadataDraft.value.dataScopeEnabled,
517
+ "onUpdate:checked": n[5] ||= (e) => P(z).mainMetadataDraft.value.dataScopeEnabled = e
518
+ }, {
519
+ default: I(() => [...n[28] ||= [O(" 启用数据权限范围 ", -1)]]),
520
+ _: 1
521
+ }, 8, ["checked"])
522
+ ], 32)]),
523
+ operation: I(() => [k(P(b), null, {
524
+ default: I(() => [k(P(e), {
525
+ disabled: V.value,
526
+ onClick: P(z).cancelEditor
527
+ }, {
528
+ default: I(() => [...n[29] ||= [O("取消", -1)]]),
529
+ _: 1
530
+ }, 8, ["disabled", "onClick"]), k(P(e), {
531
+ emphasis: "primary",
532
+ submit: "",
533
+ loading: V.value,
534
+ onClick: Y
535
+ }, {
536
+ default: I(() => [...n[30] ||= [O(" 创建 ", -1)]]),
537
+ _: 1
538
+ }, 8, ["loading"])]),
539
+ _: 1
540
+ })]),
541
+ _: 1
542
+ }, 8, [
543
+ "open",
544
+ "subtitle",
545
+ "onClose"
546
+ ]),
547
+ k(P(C), {
548
+ open: P(z).fieldEditorOpen.value,
549
+ title: P(z).mode.value === "edit-field" ? "编辑字段" : "新增字段",
550
+ subtitle: P(z).selectedMetadata.value?.title,
551
+ mode: "create",
552
+ onClose: P(z).cancelEditor
553
+ }, {
554
+ form: I(() => [D("form", {
555
+ class: "orchestration-form",
556
+ onSubmit: L(X, ["prevent"])
557
+ }, [
558
+ D("label", null, [n[31] ||= D("span", null, "字段名称", -1), k(P(p), {
559
+ value: P(z).fieldDraft.value.fieldName,
560
+ "onUpdate:value": n[6] ||= (e) => P(z).fieldDraft.value.fieldName = e,
561
+ disabled: !!P(z).fieldDraft.value.id,
562
+ placeholder: "例如 customerName"
563
+ }, null, 8, ["value", "disabled"])]),
564
+ D("label", null, [n[32] ||= D("span", null, "物理列名", -1), k(P(p), {
565
+ value: P(z).fieldDraft.value.columnName,
566
+ "onUpdate:value": n[7] ||= (e) => P(z).fieldDraft.value.columnName = e,
567
+ disabled: !!P(z).fieldDraft.value.id,
568
+ placeholder: "例如 customer_name"
569
+ }, null, 8, ["value", "disabled"])]),
570
+ D("label", null, [n[33] ||= D("span", null, "显示名称", -1), k(P(p), {
571
+ value: P(z).fieldDraft.value.title,
572
+ "onUpdate:value": n[8] ||= (e) => P(z).fieldDraft.value.title = e,
573
+ placeholder: "例如 客户名称"
574
+ }, null, 8, ["value"])]),
575
+ D("label", null, [n[34] ||= D("span", null, "字段规格", -1), k(P(f), {
576
+ value: P(z).fieldDraft.value.fieldSpecAlias,
577
+ "onUpdate:value": n[9] ||= (e) => P(z).fieldDraft.value.fieldSpecAlias = e,
578
+ options: P(z).fieldSpecOptions.value,
579
+ placeholder: "选择字段规格",
580
+ style: { width: "100%" }
581
+ }, null, 8, ["value", "options"])]),
582
+ D("div", de, [
583
+ k(P(m), {
584
+ checked: P(z).fieldDraft.value.required,
585
+ "onUpdate:checked": n[10] ||= (e) => P(z).fieldDraft.value.required = e
586
+ }, {
587
+ default: I(() => [...n[35] ||= [O("必填", -1)]]),
588
+ _: 1
589
+ }, 8, ["checked"]),
590
+ k(P(m), {
591
+ checked: P(z).fieldDraft.value.uniqueField,
592
+ "onUpdate:checked": n[11] ||= (e) => P(z).fieldDraft.value.uniqueField = e
593
+ }, {
594
+ default: I(() => [...n[36] ||= [O("唯一", -1)]]),
595
+ _: 1
596
+ }, 8, ["checked"]),
597
+ k(P(m), {
598
+ checked: P(z).fieldDraft.value.indexed,
599
+ "onUpdate:checked": n[12] ||= (e) => P(z).fieldDraft.value.indexed = e
600
+ }, {
601
+ default: I(() => [...n[37] ||= [O("建立索引", -1)]]),
602
+ _: 1
603
+ }, 8, ["checked"]),
604
+ k(P(m), {
605
+ checked: P(z).fieldDraft.value.sortableField,
606
+ "onUpdate:checked": n[13] ||= (e) => P(z).fieldDraft.value.sortableField = e
607
+ }, {
608
+ default: I(() => [...n[38] ||= [O("排序字段", -1)]]),
609
+ _: 1
610
+ }, 8, ["checked"]),
611
+ k(P(m), {
612
+ checked: P(z).fieldDraft.value.titleField,
613
+ "onUpdate:checked": n[14] ||= (e) => P(z).fieldDraft.value.titleField = e
614
+ }, {
615
+ default: I(() => [...n[39] ||= [O("标题字段", -1)]]),
616
+ _: 1
617
+ }, 8, ["checked"]),
618
+ k(P(i), {
619
+ checked: P(z).fieldDraft.value.enabled,
620
+ "onUpdate:checked": n[15] ||= (e) => P(z).fieldDraft.value.enabled = e,
621
+ "checked-children": "启用",
622
+ "un-checked-children": "停用"
623
+ }, null, 8, ["checked"])
624
+ ])
625
+ ], 32)]),
626
+ operation: I(() => [k(P(b), null, {
627
+ default: I(() => [k(P(e), {
628
+ disabled: V.value,
629
+ onClick: P(z).cancelEditor
630
+ }, {
631
+ default: I(() => [...n[40] ||= [O("取消", -1)]]),
632
+ _: 1
633
+ }, 8, ["disabled", "onClick"]), k(P(e), {
634
+ emphasis: "primary",
635
+ submit: "",
636
+ loading: V.value,
637
+ onClick: X
638
+ }, {
639
+ default: I(() => [...n[41] ||= [O("保存", -1)]]),
640
+ _: 1
641
+ }, 8, ["loading"])]),
642
+ _: 1
643
+ })]),
644
+ _: 1
645
+ }, 8, [
646
+ "open",
647
+ "title",
648
+ "subtitle",
649
+ "onClose"
650
+ ])
651
+ ], 64));
652
+ }
653
+ }), [["__scopeId", "data-v-2746e768"]]);
654
+ //#endregion
655
+ export { q as default };