@jzg223/design-runtime 0.0.0-stage → 0.0.1

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 (229) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/README.md +275 -2
  3. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  4. package/dist/api.js +149 -0
  5. package/dist/comb/design-comb.vue.js +7 -0
  6. package/dist/comb/design-comb2.vue.js +591 -0
  7. package/dist/compat.js +74 -0
  8. package/dist/components/ApiSwitch.vue.js +7 -0
  9. package/dist/components/ApiSwitch2.vue.js +98 -0
  10. package/dist/components/design-debug/dev-mode-toggle.vue.js +7 -0
  11. package/dist/components/design-debug/dev-mode-toggle2.vue.js +41 -0
  12. package/dist/components/design-debug/dev-mode.js +45 -0
  13. package/dist/components/design-debug/dev-state-button.vue.js +7 -0
  14. package/dist/components/design-debug/dev-state-button2.vue.js +447 -0
  15. package/dist/components/design-debug/expr-eval.js +81 -0
  16. package/dist/components/design-shared/host-api.js +47 -0
  17. package/dist/components/design-shared/popup-host.js +11 -0
  18. package/dist/components/design-table/design-table-inner.vue.js +7 -0
  19. package/dist/components/design-table/design-table-inner2.vue.js +39 -0
  20. package/dist/components/design-table/design-table.vue.js +7 -0
  21. package/dist/components/design-table/design-table2.vue.js +937 -0
  22. package/dist/components/design-table/row-actions/delete-action.vue.js +4 -0
  23. package/dist/components/design-table/row-actions/delete-action2.vue.js +42 -0
  24. package/dist/components/design-table/row-actions/edit-action.vue.js +4 -0
  25. package/dist/components/design-table/row-actions/edit-action2.vue.js +145 -0
  26. package/dist/components/design-table/row-actions/index.js +36 -0
  27. package/dist/components/design-table/row-actions/modal-comb-action.vue.js +4 -0
  28. package/dist/components/design-table/row-actions/modal-comb-action2.vue.js +66 -0
  29. package/dist/components/design-table/row-actions/modal-custom-action.vue.js +7 -0
  30. package/dist/components/design-table/row-actions/modal-custom-action2.vue.js +105 -0
  31. package/dist/components/design-table/row-actions/modal-form-action.vue.js +4 -0
  32. package/dist/components/design-table/row-actions/modal-form-action2.vue.js +82 -0
  33. package/dist/components/design-table/row-actions/modal-table-action.vue.js +4 -0
  34. package/dist/components/design-table/row-actions/modal-table-action2.vue.js +67 -0
  35. package/dist/components/design-table/row-actions/modal-tree-action.vue.js +4 -0
  36. package/dist/components/design-table/row-actions/modal-tree-action2.vue.js +70 -0
  37. package/dist/components/design-table/row-actions/navigate-comb-action.vue.js +4 -0
  38. package/dist/components/design-table/row-actions/navigate-comb-action2.vue.js +47 -0
  39. package/dist/components/design-table/row-actions/navigate-form-action.vue.js +4 -0
  40. package/dist/components/design-table/row-actions/navigate-form-action2.vue.js +47 -0
  41. package/dist/components/design-table/row-actions/navigate-table-action.vue.js +4 -0
  42. package/dist/components/design-table/row-actions/navigate-table-action2.vue.js +47 -0
  43. package/dist/components/design-table/row-actions/navigate-tree-action.vue.js +4 -0
  44. package/dist/components/design-table/row-actions/navigate-tree-action2.vue.js +47 -0
  45. package/dist/components/design-table/row-actions/other-action.vue.js +4 -0
  46. package/dist/components/design-table/row-actions/other-action2.vue.js +44 -0
  47. package/dist/components/design-tools/add-tool.vue.js +4 -0
  48. package/dist/components/design-tools/add-tool2.vue.js +136 -0
  49. package/dist/components/design-tools/command-executor.js +135 -0
  50. package/dist/components/design-tools/export-tool.vue.js +4 -0
  51. package/dist/components/design-tools/export-tool2.vue.js +46 -0
  52. package/dist/components/design-tools/import-tool.vue.js +4 -0
  53. package/dist/components/design-tools/import-tool2.vue.js +101 -0
  54. package/dist/components/design-tools/index.js +36 -0
  55. package/dist/components/design-tools/modal-comb-tool.vue.js +4 -0
  56. package/dist/components/design-tools/modal-comb-tool2.vue.js +56 -0
  57. package/dist/components/design-tools/modal-form-tool.vue.js +4 -0
  58. package/dist/components/design-tools/modal-form-tool2.vue.js +66 -0
  59. package/dist/components/design-tools/modal-hcm-tool.vue.js +7 -0
  60. package/dist/components/design-tools/modal-hcm-tool2.vue.js +85 -0
  61. package/dist/components/design-tools/modal-table-tool.vue.js +4 -0
  62. package/dist/components/design-tools/modal-table-tool2.vue.js +54 -0
  63. package/dist/components/design-tools/modal-tree-tool.vue.js +4 -0
  64. package/dist/components/design-tools/modal-tree-tool2.vue.js +57 -0
  65. package/dist/components/design-tools/navigate-comb-tool.vue.js +4 -0
  66. package/dist/components/design-tools/navigate-comb-tool2.vue.js +34 -0
  67. package/dist/components/design-tools/navigate-form-tool.vue.js +4 -0
  68. package/dist/components/design-tools/navigate-form-tool2.vue.js +34 -0
  69. package/dist/components/design-tools/navigate-table-tool.vue.js +4 -0
  70. package/dist/components/design-tools/navigate-table-tool2.vue.js +33 -0
  71. package/dist/components/design-tools/other-tool.vue.js +4 -0
  72. package/dist/components/design-tools/other-tool2.vue.js +34 -0
  73. package/dist/components/flow-status-cell/flow-status-cell.vue.js +7 -0
  74. package/dist/components/flow-status-cell/flow-status-cell2.vue.js +124 -0
  75. package/dist/flow.js +22 -0
  76. package/dist/form/cell-condition.js +122 -0
  77. package/dist/form/derived-express.js +34 -0
  78. package/dist/form/design-form-inner.vue.js +7 -0
  79. package/dist/form/design-form-inner2.vue.js +449 -0
  80. package/dist/form/design-form.vue.js +7 -0
  81. package/dist/form/design-form2.vue.js +681 -0
  82. package/dist/form/fields/checkbox-field.vue.js +88 -0
  83. package/dist/form/fields/checkbox-field2.vue.js +4 -0
  84. package/dist/form/fields/custom-field.vue.js +36 -0
  85. package/dist/form/fields/custom-field2.vue.js +4 -0
  86. package/dist/form/fields/date-field.vue.js +64 -0
  87. package/dist/form/fields/date-field2.vue.js +4 -0
  88. package/dist/form/fields/embedded-list-field.vue.js +7 -0
  89. package/dist/form/fields/embedded-list-field2.vue.js +437 -0
  90. package/dist/form/fields/file-field.vue.js +88 -0
  91. package/dist/form/fields/file-field2.vue.js +4 -0
  92. package/dist/form/fields/image-field.vue.js +90 -0
  93. package/dist/form/fields/image-field2.vue.js +4 -0
  94. package/dist/form/fields/index.js +106 -0
  95. package/dist/form/fields/month-field.vue.js +51 -0
  96. package/dist/form/fields/month-field2.vue.js +4 -0
  97. package/dist/form/fields/org-select-field.vue.js +7 -0
  98. package/dist/form/fields/org-select-field2.vue.js +187 -0
  99. package/dist/form/fields/orgs-select-field.vue.js +182 -0
  100. package/dist/form/fields/orgs-select-field2.vue.js +4 -0
  101. package/dist/form/fields/radio-field.vue.js +91 -0
  102. package/dist/form/fields/radio-field2.vue.js +4 -0
  103. package/dist/form/fields/select-field.vue.js +7 -0
  104. package/dist/form/fields/select-field2.vue.js +317 -0
  105. package/dist/form/fields/splitline-field.vue.js +7 -0
  106. package/dist/form/fields/splitline-field2.vue.js +50 -0
  107. package/dist/form/fields/switch-field.vue.js +32 -0
  108. package/dist/form/fields/switch-field2.vue.js +4 -0
  109. package/dist/form/fields/text-field.vue.js +78 -0
  110. package/dist/form/fields/text-field2.vue.js +4 -0
  111. package/dist/form/fields/time-field.vue.js +50 -0
  112. package/dist/form/fields/time-field2.vue.js +4 -0
  113. package/dist/form/fields/tree-field.vue.js +157 -0
  114. package/dist/form/fields/tree-field2.vue.js +4 -0
  115. package/dist/form/number-precision.js +18 -0
  116. package/dist/form/transformer.js +162 -0
  117. package/dist/host.js +76 -0
  118. package/dist/http.js +19 -0
  119. package/dist/index.js +166 -0
  120. package/dist/mapping.js +44 -0
  121. package/dist/org/dept-api.js +30 -0
  122. package/dist/org/dept-tree-source.js +53 -0
  123. package/dist/org/dept-tree.js +122 -0
  124. package/dist/registry.js +77 -0
  125. package/dist/search/design-search.vue.js +7 -0
  126. package/dist/search/design-search2.vue.js +232 -0
  127. package/dist/search/transformer.js +115 -0
  128. package/dist/style.css +1220 -0
  129. package/dist/table/data.js +18 -0
  130. package/dist/table/load-gate.js +19 -0
  131. package/dist/table/query-body.js +59 -0
  132. package/dist/table/query-dedupe.js +54 -0
  133. package/dist/table/query-search.js +9 -0
  134. package/dist/table/row-action-mapping.js +34 -0
  135. package/dist/table/transformer.js +328 -0
  136. package/dist/tree/design-tree.vue.js +7 -0
  137. package/dist/tree/design-tree2.vue.js +783 -0
  138. package/dist/types/api.d.ts +83 -0
  139. package/dist/types/comb/design-comb.vue.d.ts +38 -0
  140. package/dist/types/compat.d.ts +46 -0
  141. package/dist/types/components/ApiSwitch.vue.d.ts +31 -0
  142. package/dist/types/components/design-debug/dev-mode-toggle.vue.d.ts +2 -0
  143. package/dist/types/components/design-debug/dev-mode.d.ts +8 -0
  144. package/dist/types/components/design-debug/dev-state-button.vue.d.ts +55 -0
  145. package/dist/types/components/design-debug/expr-eval.d.ts +55 -0
  146. package/dist/types/components/design-shared/host-api.d.ts +60 -0
  147. package/dist/types/components/design-shared/popup-host.d.ts +13 -0
  148. package/dist/types/components/design-table/design-table-inner.vue.d.ts +19 -0
  149. package/dist/types/components/design-table/design-table.vue.d.ts +70 -0
  150. package/dist/types/components/design-table/row-actions/delete-action.vue.d.ts +12 -0
  151. package/dist/types/components/design-table/row-actions/edit-action.vue.d.ts +14 -0
  152. package/dist/types/components/design-table/row-actions/index.d.ts +25 -0
  153. package/dist/types/components/design-table/row-actions/modal-comb-action.vue.d.ts +10 -0
  154. package/dist/types/components/design-table/row-actions/modal-custom-action.vue.d.ts +15 -0
  155. package/dist/types/components/design-table/row-actions/modal-form-action.vue.d.ts +10 -0
  156. package/dist/types/components/design-table/row-actions/modal-table-action.vue.d.ts +10 -0
  157. package/dist/types/components/design-table/row-actions/modal-tree-action.vue.d.ts +10 -0
  158. package/dist/types/components/design-table/row-actions/navigate-comb-action.vue.d.ts +10 -0
  159. package/dist/types/components/design-table/row-actions/navigate-form-action.vue.d.ts +10 -0
  160. package/dist/types/components/design-table/row-actions/navigate-table-action.vue.d.ts +10 -0
  161. package/dist/types/components/design-table/row-actions/navigate-tree-action.vue.d.ts +10 -0
  162. package/dist/types/components/design-table/row-actions/other-action.vue.d.ts +14 -0
  163. package/dist/types/components/design-tools/add-tool.vue.d.ts +23 -0
  164. package/dist/types/components/design-tools/command-executor.d.ts +80 -0
  165. package/dist/types/components/design-tools/export-tool.vue.d.ts +9 -0
  166. package/dist/types/components/design-tools/import-tool.vue.d.ts +14 -0
  167. package/dist/types/components/design-tools/index.d.ts +23 -0
  168. package/dist/types/components/design-tools/modal-comb-tool.vue.d.ts +12 -0
  169. package/dist/types/components/design-tools/modal-form-tool.vue.d.ts +12 -0
  170. package/dist/types/components/design-tools/modal-hcm-tool.vue.d.ts +23 -0
  171. package/dist/types/components/design-tools/modal-table-tool.vue.d.ts +12 -0
  172. package/dist/types/components/design-tools/modal-tree-tool.vue.d.ts +12 -0
  173. package/dist/types/components/design-tools/navigate-comb-tool.vue.d.ts +12 -0
  174. package/dist/types/components/design-tools/navigate-form-tool.vue.d.ts +11 -0
  175. package/dist/types/components/design-tools/navigate-table-tool.vue.d.ts +12 -0
  176. package/dist/types/components/design-tools/other-tool.vue.d.ts +16 -0
  177. package/dist/types/components/flow-status-cell/flow-status-cell.vue.d.ts +14 -0
  178. package/dist/types/components/index.d.ts +33 -0
  179. package/dist/types/flow.d.ts +50 -0
  180. package/dist/types/form/cell-condition.d.ts +35 -0
  181. package/dist/types/form/derived-express.d.ts +28 -0
  182. package/dist/types/form/design-form-inner.vue.d.ts +55 -0
  183. package/dist/types/form/design-form.vue.d.ts +96 -0
  184. package/dist/types/form/fields/checkbox-field.vue.d.ts +14 -0
  185. package/dist/types/form/fields/custom-field.vue.d.ts +22 -0
  186. package/dist/types/form/fields/date-field.vue.d.ts +12 -0
  187. package/dist/types/form/fields/embedded-list-field.vue.d.ts +26 -0
  188. package/dist/types/form/fields/file-field.vue.d.ts +12 -0
  189. package/dist/types/form/fields/image-field.vue.d.ts +12 -0
  190. package/dist/types/form/fields/index.d.ts +34 -0
  191. package/dist/types/form/fields/month-field.vue.d.ts +12 -0
  192. package/dist/types/form/fields/org-select-field.vue.d.ts +14 -0
  193. package/dist/types/form/fields/orgs-select-field.vue.d.ts +12 -0
  194. package/dist/types/form/fields/radio-field.vue.d.ts +14 -0
  195. package/dist/types/form/fields/select-field.vue.d.ts +14 -0
  196. package/dist/types/form/fields/splitline-field.vue.d.ts +7 -0
  197. package/dist/types/form/fields/switch-field.vue.d.ts +12 -0
  198. package/dist/types/form/fields/text-field.vue.d.ts +12 -0
  199. package/dist/types/form/fields/time-field.vue.d.ts +12 -0
  200. package/dist/types/form/fields/tree-field.vue.d.ts +12 -0
  201. package/dist/types/form/number-precision.d.ts +15 -0
  202. package/dist/types/form/transformer.d.ts +27 -0
  203. package/dist/types/host.d.ts +182 -0
  204. package/dist/types/http.d.ts +59 -0
  205. package/dist/types/index.d.ts +41 -0
  206. package/dist/types/mapping.d.ts +39 -0
  207. package/dist/types/org/dept-api.d.ts +12 -0
  208. package/dist/types/org/dept-tree-source.d.ts +15 -0
  209. package/dist/types/org/dept-tree.d.ts +62 -0
  210. package/dist/types/registry.d.ts +79 -0
  211. package/dist/types/search/design-search.vue.d.ts +46 -0
  212. package/dist/types/search/transformer.d.ts +36 -0
  213. package/dist/types/table/data.d.ts +30 -0
  214. package/dist/types/table/index.d.ts +20 -0
  215. package/dist/types/table/load-gate.d.ts +24 -0
  216. package/dist/types/table/query-body.d.ts +46 -0
  217. package/dist/types/table/query-dedupe.d.ts +42 -0
  218. package/dist/types/table/query-search.d.ts +21 -0
  219. package/dist/types/table/row-action-mapping.d.ts +36 -0
  220. package/dist/types/table/transformer.d.ts +59 -0
  221. package/dist/types/tree/design-tree.vue.d.ts +33 -0
  222. package/dist/types/types.d.ts +525 -0
  223. package/dist/types/utils/default-value.d.ts +16 -0
  224. package/dist/types/utils/download.d.ts +9 -0
  225. package/dist/types/utils/popup-width.d.ts +21 -0
  226. package/dist/utils/default-value.js +38 -0
  227. package/dist/utils/download.js +19 -0
  228. package/dist/utils/popup-width.js +19 -0
  229. package/package.json +73 -4
package/dist/index.js ADDED
@@ -0,0 +1,166 @@
1
+ /* empty css */
2
+ import { SUPPORTED_VERSIONS, checkDesignRuntimeCompat, satisfiesRange } from "./compat.js";
3
+ import { getDesignHost, getHostDict, getHostPopup, getHostUi, getHostWorkflow, hostT, installDesignPlatform, requireHttp, requireVxeGrid, resetDesignHost } from "./host.js";
4
+ import { createMemoryHttp } from "./http.js";
5
+ import { buildComponentsManifest, clearDesignComponents, hasDesignComponent, listDesignComponents, registerComponents, requireDesignComponent, resolveDesignComponent } from "./registry.js";
6
+ import { clearDesignApiCache, fetchCombConfig, fetchCombData, fetchDataSetData, fetchDataSetListData, fetchDataSetMeta, fetchDataSetTreeAsync, fetchDataSetTreeSync, fetchDesignUiConfig, fetchFormConfig, fetchSearchConfig, fetchTableConfig, fetchTreeNodeCount, fetchTreeViewConfig, fetchViewConfig } from "./api.js";
7
+ import { designFlowRemove, designFlowStatus, designFlowSubmit } from "./flow.js";
8
+ import { DEFAULT_POPUP_WIDTH, resolvePopupWidth, toPopupWidth } from "./utils/popup-width.js";
9
+ import { downloadByData } from "./utils/download.js";
10
+ import { buildExpressId, buildExtraParams, buildMappedParams, evaluateMappedExpress, isOwnRoutePage } from "./mapping.js";
11
+ import { buildConditionScope, computeConditionDebug, evalCellCondition, isConditionHidden, isInjectableScopeKey } from "./form/cell-condition.js";
12
+ import { buildDerivedScope, computeDerivedFills, evalDerivedExpress } from "./form/derived-express.js";
13
+ import { parsePrecision, roundToPrecision } from "./form/number-precision.js";
14
+ import { transformFormConfig } from "./form/transformer.js";
15
+ import { hasCustomComponent, listCustomComponents, pendingFieldTypes, register, registerFields, resolveCellComponent, resolveComponent } from "./form/fields/index.js";
16
+ import { deptChildren, deptInfo, deptList, getDeptSubTree } from "./org/dept-api.js";
17
+ import { attachChildren, createLazyDeptTree, normalizeParentId, toTreeNode } from "./org/dept-tree.js";
18
+ import { createDeptTreeSource, normalizeDeptNode } from "./org/dept-tree-source.js";
19
+ import { buildSearchFormOptions, normalizeSearchCells } from "./search/transformer.js";
20
+ import { formatNow, resolveDefaultValue } from "./utils/default-value.js";
21
+ import { default as default2 } from "./components/ApiSwitch.vue.js";
22
+ import { DESIGN_POPUP_HOST_KEY, usePopupHost } from "./components/design-shared/popup-host.js";
23
+ import { default as default3 } from "./comb/design-comb.vue.js";
24
+ import { default as default4 } from "./components/design-debug/dev-mode-toggle.vue.js";
25
+ import { default as default5 } from "./components/design-debug/dev-state-button.vue.js";
26
+ import { default as default6 } from "./form/design-form.vue.js";
27
+ import { default as default7 } from "./form/design-form-inner.vue.js";
28
+ import { default as default8 } from "./search/design-search.vue.js";
29
+ import { default as default9 } from "./components/design-table/design-table.vue.js";
30
+ import { default as default10 } from "./components/flow-status-cell/flow-status-cell.vue.js";
31
+ import { default as default11 } from "./components/design-table/design-table-inner.vue.js";
32
+ import { default as default12 } from "./tree/design-tree.vue.js";
33
+ import { buildCustomParams, buildNavigateQuery, evaluateExpress } from "./table/row-action-mapping.js";
34
+ import { buildHostApi, hostRequest, platformMessage } from "./components/design-shared/host-api.js";
35
+ import { buildQuerySearch } from "./table/query-search.js";
36
+ import { buildTableDataBody, parseConfigParams } from "./table/query-body.js";
37
+ import { createQueryDedupe } from "./table/query-dedupe.js";
38
+ import { evalExpression } from "./components/design-debug/expr-eval.js";
39
+ import { evaluateLoadGate } from "./table/load-gate.js";
40
+ import { executeCommand, openComponent } from "./components/design-tools/command-executor.js";
41
+ import { fetchTableData } from "./table/data.js";
42
+ import { pendingRowActionTypes, resolveRowActionComponent, rowActionComponentMap, rowActionTypes } from "./components/design-table/row-actions/index.js";
43
+ import { pendingToolTypes, resolveToolComponent, toolComponentMap, toolTypes } from "./components/design-tools/index.js";
44
+ import { setDevMode, useDevMode } from "./components/design-debug/dev-mode.js";
45
+ import { transformTableConfig } from "./table/transformer.js";
46
+ export {
47
+ default2 as ApiSwitch,
48
+ DEFAULT_POPUP_WIDTH,
49
+ DESIGN_POPUP_HOST_KEY,
50
+ default3 as DesignComb,
51
+ default4 as DesignDevModeToggle,
52
+ default5 as DesignDevStateButton,
53
+ default6 as DesignForm,
54
+ default7 as DesignFormInner,
55
+ default8 as DesignSearch,
56
+ default9 as DesignTable,
57
+ default10 as DesignTableFlowStatusCell,
58
+ default11 as DesignTableInner,
59
+ default12 as DesignTree,
60
+ SUPPORTED_VERSIONS,
61
+ attachChildren,
62
+ buildComponentsManifest,
63
+ buildConditionScope,
64
+ buildCustomParams,
65
+ buildDerivedScope,
66
+ buildExpressId,
67
+ buildExtraParams,
68
+ buildHostApi,
69
+ buildMappedParams,
70
+ buildNavigateQuery,
71
+ buildQuerySearch,
72
+ buildSearchFormOptions,
73
+ buildTableDataBody,
74
+ checkDesignRuntimeCompat,
75
+ clearDesignApiCache,
76
+ clearDesignComponents,
77
+ computeConditionDebug,
78
+ computeDerivedFills,
79
+ createDeptTreeSource,
80
+ createLazyDeptTree,
81
+ createMemoryHttp,
82
+ createQueryDedupe,
83
+ deptChildren,
84
+ deptInfo,
85
+ deptList,
86
+ designFlowRemove,
87
+ designFlowStatus,
88
+ designFlowSubmit,
89
+ downloadByData,
90
+ evalCellCondition,
91
+ evalDerivedExpress,
92
+ evalExpression,
93
+ evaluateExpress,
94
+ evaluateLoadGate,
95
+ evaluateMappedExpress,
96
+ executeCommand,
97
+ fetchCombConfig,
98
+ fetchCombData,
99
+ fetchDataSetData,
100
+ fetchDataSetListData,
101
+ fetchDataSetMeta,
102
+ fetchDataSetTreeAsync,
103
+ fetchDataSetTreeSync,
104
+ fetchDesignUiConfig,
105
+ fetchFormConfig,
106
+ fetchSearchConfig,
107
+ fetchTableConfig,
108
+ fetchTableData,
109
+ fetchTreeNodeCount,
110
+ fetchTreeViewConfig,
111
+ fetchViewConfig,
112
+ formatNow,
113
+ getDeptSubTree,
114
+ getDesignHost,
115
+ getHostDict,
116
+ getHostPopup,
117
+ getHostUi,
118
+ getHostWorkflow,
119
+ hasCustomComponent,
120
+ hasDesignComponent,
121
+ hostRequest,
122
+ hostT,
123
+ installDesignPlatform,
124
+ isConditionHidden,
125
+ isInjectableScopeKey,
126
+ isOwnRoutePage,
127
+ listCustomComponents,
128
+ listDesignComponents,
129
+ normalizeDeptNode,
130
+ normalizeParentId,
131
+ normalizeSearchCells,
132
+ openComponent,
133
+ parseConfigParams,
134
+ parsePrecision,
135
+ pendingFieldTypes,
136
+ pendingRowActionTypes,
137
+ pendingToolTypes,
138
+ platformMessage,
139
+ register,
140
+ registerComponents,
141
+ registerFields,
142
+ requireDesignComponent,
143
+ requireHttp,
144
+ requireVxeGrid,
145
+ resetDesignHost,
146
+ resolveCellComponent,
147
+ resolveComponent,
148
+ resolveDefaultValue,
149
+ resolveDesignComponent,
150
+ resolvePopupWidth,
151
+ resolveRowActionComponent,
152
+ resolveToolComponent,
153
+ roundToPrecision,
154
+ rowActionComponentMap,
155
+ rowActionTypes,
156
+ satisfiesRange,
157
+ setDevMode,
158
+ toPopupWidth,
159
+ toTreeNode,
160
+ toolComponentMap,
161
+ toolTypes,
162
+ transformFormConfig,
163
+ transformTableConfig,
164
+ useDevMode,
165
+ usePopupHost
166
+ };
@@ -0,0 +1,44 @@
1
+ function evaluateMappedExpress(express, scope) {
2
+ if (!(express == null ? void 0 : express.trim())) return void 0;
3
+ const keys = Object.keys(scope);
4
+ try {
5
+ const fn = new Function(...keys, `return (${express});`);
6
+ return fn(...keys.map((key) => scope[key]));
7
+ } catch (err) {
8
+ console.error("[design-platform] 映射表达式执行失败:", (err == null ? void 0 : err.message) ?? err);
9
+ return void 0;
10
+ }
11
+ }
12
+ function buildMappedParams(tool, scope) {
13
+ const list = tool == null ? void 0 : tool.mappings;
14
+ const result = {};
15
+ if (!Array.isArray(list)) return result;
16
+ for (const item of list) {
17
+ if (!(item == null ? void 0 : item.paramName)) continue;
18
+ const value = evaluateMappedExpress(item.express, scope);
19
+ if (value !== void 0) result[item.paramName] = value;
20
+ }
21
+ return result;
22
+ }
23
+ function buildExpressId(tool, scope) {
24
+ const id = evaluateMappedExpress(tool == null ? void 0 : tool.expressId, scope);
25
+ return id === void 0 || id === null || id === "" ? void 0 : id;
26
+ }
27
+ function buildExtraParams(routeParams = {}, parentParams) {
28
+ const rest = { ...routeParams };
29
+ delete rest.module;
30
+ delete rest.name;
31
+ return { ...rest, ...parentParams ?? {} };
32
+ }
33
+ function isOwnRoutePage(routePath, category, name) {
34
+ if (!category || !name) return false;
35
+ const suffix = `/${category}/${name}`;
36
+ return routePath === suffix || routePath.endsWith(suffix);
37
+ }
38
+ export {
39
+ buildExpressId,
40
+ buildExtraParams,
41
+ buildMappedParams,
42
+ evaluateMappedExpress,
43
+ isOwnRoutePage
44
+ };
@@ -0,0 +1,30 @@
1
+ import { requireHttp } from "../host.js";
2
+ const Api = {
3
+ deptList: "/system/dept/list",
4
+ deptRoot: "/system/dept",
5
+ deptTree: "/system/user/deptTree"
6
+ };
7
+ function deptList(params) {
8
+ return requireHttp().get(Api.deptList, { params, silent: true });
9
+ }
10
+ function deptChildren(parentId = 0) {
11
+ return requireHttp().get(Api.deptList, {
12
+ params: { parentId },
13
+ silent: true
14
+ });
15
+ }
16
+ function deptInfo(deptId) {
17
+ return requireHttp().get(`${Api.deptRoot}/${deptId}`, { silent: true });
18
+ }
19
+ function getDeptSubTree(parentId = 0) {
20
+ return requireHttp().get(Api.deptTree, {
21
+ params: { parentId },
22
+ silent: true
23
+ });
24
+ }
25
+ export {
26
+ deptChildren,
27
+ deptInfo,
28
+ deptList,
29
+ getDeptSubTree
30
+ };
@@ -0,0 +1,53 @@
1
+ import { deptInfo, deptChildren, getDeptSubTree } from "./dept-api.js";
2
+ function normalizeDeptNode(raw) {
3
+ const deptId = (raw == null ? void 0 : raw.deptId) ?? (raw == null ? void 0 : raw.id);
4
+ const deptName = (raw == null ? void 0 : raw.deptName) ?? (raw == null ? void 0 : raw.label) ?? "";
5
+ return {
6
+ ...raw,
7
+ deptId,
8
+ deptName,
9
+ parentId: (raw == null ? void 0 : raw.parentId) ?? null,
10
+ // 兼容旧的 TreeSelect 形状(低代码表单 deriveTo 的 source 常用 id / label / fullName)
11
+ id: deptId,
12
+ label: deptName
13
+ };
14
+ }
15
+ function isForbidden(err) {
16
+ var _a;
17
+ const status = ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.status) ?? (err == null ? void 0 : err.status) ?? (err == null ? void 0 : err.code);
18
+ const msg = String((err == null ? void 0 : err.message) ?? (err == null ? void 0 : err.msg) ?? "");
19
+ return status === 403 || status === "403" || msg.includes("403") || msg.includes("没有访问权限");
20
+ }
21
+ function createDeptTreeSource() {
22
+ let useSubTreeFallback = false;
23
+ return {
24
+ async loadChildren(parentId) {
25
+ if (!useSubTreeFallback) {
26
+ try {
27
+ const list = await deptChildren(parentId);
28
+ return (list ?? []).map((d) => normalizeDeptNode(d));
29
+ } catch (err) {
30
+ if (!isForbidden(err)) throw err;
31
+ useSubTreeFallback = true;
32
+ console.warn(
33
+ "[design-runtime][org] 无 system:dept:list 权限,懒加载回退 /system/user/deptTree?parentId=(回整棵子树,只取第一层)"
34
+ );
35
+ }
36
+ }
37
+ const subTree = await getDeptSubTree(parentId);
38
+ return (subTree ?? []).map((d) => normalizeDeptNode(d));
39
+ },
40
+ async loadNode(deptId) {
41
+ try {
42
+ const node = await deptInfo(deptId);
43
+ return node ? normalizeDeptNode(node) : void 0;
44
+ } catch {
45
+ return void 0;
46
+ }
47
+ }
48
+ };
49
+ }
50
+ export {
51
+ createDeptTreeSource,
52
+ normalizeDeptNode
53
+ };
@@ -0,0 +1,122 @@
1
+ function normalizeParentId(parentId) {
2
+ if (parentId === null || parentId === void 0 || parentId === "") return "0";
3
+ return String(parentId);
4
+ }
5
+ function toTreeNode(dept, isLeaf) {
6
+ return {
7
+ key: String(dept.deptId),
8
+ title: dept.deptName,
9
+ raw: dept,
10
+ ...isLeaf === void 0 ? {} : { isLeaf }
11
+ };
12
+ }
13
+ function attachChildren(nodes, key, children) {
14
+ const target = String(key);
15
+ let changed = false;
16
+ const next = (nodes ?? []).map((n) => {
17
+ var _a;
18
+ if (n.key === target) {
19
+ changed = true;
20
+ return { ...n, children };
21
+ }
22
+ if ((_a = n.children) == null ? void 0 : _a.length) {
23
+ const sub = attachChildren(n.children, target, children);
24
+ if (sub !== n.children) {
25
+ changed = true;
26
+ return { ...n, children: sub };
27
+ }
28
+ }
29
+ return n;
30
+ });
31
+ return changed ? next : nodes ?? [];
32
+ }
33
+ function createLazyDeptTree(source) {
34
+ const childrenCache = /* @__PURE__ */ new Map();
35
+ const nodeCache = /* @__PURE__ */ new Map();
36
+ const inFlight = /* @__PURE__ */ new Map();
37
+ function cachedLeaf(parentId) {
38
+ const key = normalizeParentId(parentId);
39
+ const list = childrenCache.get(key);
40
+ if (list === void 0) return void 0;
41
+ return list.length === 0;
42
+ }
43
+ async function childrenOf(parentId, force = false) {
44
+ const key = normalizeParentId(parentId);
45
+ if (!force && childrenCache.has(key)) {
46
+ return childrenCache.get(key);
47
+ }
48
+ const pending = inFlight.get(key);
49
+ if (!force && pending) return pending;
50
+ const task = source.loadChildren(key).then((list) => {
51
+ const safe = Array.isArray(list) ? list : [];
52
+ childrenCache.set(key, safe);
53
+ for (const d of safe) nodeCache.set(String(d.deptId), d);
54
+ return safe;
55
+ }).finally(() => {
56
+ inFlight.delete(key);
57
+ });
58
+ inFlight.set(key, task);
59
+ return task;
60
+ }
61
+ async function treeNodesOf(parentId, force = false) {
62
+ const list = await childrenOf(parentId, force);
63
+ return list.map((d) => toTreeNode(d, cachedLeaf(d.deptId)));
64
+ }
65
+ async function nodeOf(deptId) {
66
+ const key = String(deptId);
67
+ if (nodeCache.has(key)) return nodeCache.get(key);
68
+ const node = await source.loadNode(key);
69
+ if (node) nodeCache.set(key, node);
70
+ return node;
71
+ }
72
+ async function pathOf(deptId) {
73
+ const chain = [];
74
+ const seen = /* @__PURE__ */ new Set();
75
+ let current = await nodeOf(deptId);
76
+ const node = current;
77
+ let guard = 0;
78
+ while (current && guard++ < 20) {
79
+ const key = String(current.deptId);
80
+ if (seen.has(key)) break;
81
+ seen.add(key);
82
+ chain.unshift(current);
83
+ const parentId = normalizeParentId(current.parentId);
84
+ if (parentId === "0") break;
85
+ const parent = await nodeOf(parentId);
86
+ if (!parent) break;
87
+ current = parent;
88
+ }
89
+ return { chain, fullName: chain.map((n) => n.deptName).join(" / "), node };
90
+ }
91
+ async function searchNodes(list) {
92
+ const out = [];
93
+ for (const d of list) {
94
+ const { fullName } = await pathOf(d.deptId);
95
+ out.push({ key: String(d.deptId), title: fullName || d.deptName, raw: d });
96
+ }
97
+ return out;
98
+ }
99
+ function clear() {
100
+ childrenCache.clear();
101
+ nodeCache.clear();
102
+ inFlight.clear();
103
+ }
104
+ return {
105
+ childrenOf,
106
+ treeNodesOf,
107
+ nodeOf,
108
+ pathOf,
109
+ searchNodes,
110
+ cachedLeaf,
111
+ clear,
112
+ get size() {
113
+ return childrenCache.size;
114
+ }
115
+ };
116
+ }
117
+ export {
118
+ attachChildren,
119
+ createLazyDeptTree,
120
+ normalizeParentId,
121
+ toTreeNode
122
+ };
@@ -0,0 +1,77 @@
1
+ import { defineAsyncComponent, h } from "vue";
2
+ const entries = /* @__PURE__ */ new Map();
3
+ const resolved = /* @__PURE__ */ new Map();
4
+ function registerComponents(map) {
5
+ for (const [name, value] of Object.entries(map ?? {})) {
6
+ if (!name) continue;
7
+ const entry = typeof value === "function" ? { loader: value } : value;
8
+ entries.set(name, entry);
9
+ resolved.delete(name);
10
+ }
11
+ }
12
+ function createAsyncComponent(name, loader) {
13
+ return defineAsyncComponent({
14
+ delay: 120,
15
+ loader,
16
+ // 加载失败要看得见:带上 comname,直接指向"宿主没注册 / 路径写错 / 组件抛错"
17
+ errorComponent: {
18
+ render: () => h(
19
+ "span",
20
+ { class: "design-runtime-component-error", style: "color:#ff4d4f" },
21
+ `组件加载失败:${name}`
22
+ )
23
+ },
24
+ loadingComponent: {
25
+ render: () => h(
26
+ "span",
27
+ { class: "design-runtime-component-loading", style: "color:#8c8c8c" },
28
+ "加载中…"
29
+ )
30
+ },
31
+ timeout: 2e4
32
+ });
33
+ }
34
+ function hasDesignComponent(name) {
35
+ return entries.has(name);
36
+ }
37
+ function resolveDesignComponent(name) {
38
+ if (!name) return void 0;
39
+ const cached = resolved.get(name);
40
+ if (cached) return cached;
41
+ const entry = entries.get(name);
42
+ if (!entry) return void 0;
43
+ const component = createAsyncComponent(name, entry.loader);
44
+ resolved.set(name, component);
45
+ return component;
46
+ }
47
+ function requireDesignComponent(name, slot) {
48
+ const component = resolveDesignComponent(name);
49
+ if (component) return component;
50
+ throw new Error(
51
+ `[design-runtime] 未注册的自定义组件「${name}」${slot ? `(插槽 ${slot})` : ""}:请在该项目的注册文件里调用 registerComponents(),用 comname「${name}」映射到对应的组件加载器`
52
+ );
53
+ }
54
+ function listDesignComponents() {
55
+ return [...entries.entries()].map(([name, entry]) => ({
56
+ name,
57
+ modalWidth: entry.modalWidth,
58
+ slots: entry.slots,
59
+ title: entry.title
60
+ }));
61
+ }
62
+ function buildComponentsManifest() {
63
+ return { components: listDesignComponents(), version: 1 };
64
+ }
65
+ function clearDesignComponents() {
66
+ entries.clear();
67
+ resolved.clear();
68
+ }
69
+ export {
70
+ buildComponentsManifest,
71
+ clearDesignComponents,
72
+ hasDesignComponent,
73
+ listDesignComponents,
74
+ registerComponents,
75
+ requireDesignComponent,
76
+ resolveDesignComponent
77
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./design-search2.vue.js";
2
+ /* empty css */
3
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
+ const designSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce8cdb6c"]]);
5
+ export {
6
+ designSearch as default
7
+ };