@gct-paas/core 0.1.4-dev.10 → 0.1.4-dev.12

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 (298) hide show
  1. package/dist/index.esm.min.js +21679 -0
  2. package/es/constants/core.mjs +5 -4
  3. package/es/constants/default-date-type/default-date-type.d.ts +70 -0
  4. package/es/constants/default-date-type/default-date-type.mjs +74 -0
  5. package/es/constants/editor-register/editor-register.mjs +17 -5
  6. package/es/constants/expression-type/BuiltOperators.mjs +152 -145
  7. package/es/constants/expression-type/FunctionKeys.mjs +75 -79
  8. package/es/constants/expression-type/editor.mjs +10 -3
  9. package/es/constants/expression-type/function.mjs +602 -613
  10. package/es/constants/expression-type/index.mjs +111 -113
  11. package/es/constants/expression-type/modeCfg.mjs +256 -263
  12. package/es/constants/expression-type/variable.mjs +43 -39
  13. package/es/constants/form-container-type/form-container-type.mjs +17 -5
  14. package/es/constants/index.d.ts +2 -1
  15. package/es/constants/index.mjs +30 -10
  16. package/es/constants/page-designer/model.d.ts +4 -0
  17. package/es/constants/page-designer/model.mjs +17 -0
  18. package/es/create-app-vue.mjs +15 -9
  19. package/es/enums/app-designer/index.d.ts +19 -0
  20. package/es/enums/app-designer/index.mjs +131 -63
  21. package/es/enums/appEnum.mjs +681 -360
  22. package/es/enums/appStateEnum.mjs +17 -10
  23. package/es/enums/authActionEnum.mjs +63 -51
  24. package/es/enums/breakpointEnum.mjs +27 -26
  25. package/es/enums/cacheEnum.mjs +22 -21
  26. package/es/enums/designEnum.mjs +110 -71
  27. package/es/enums/developer-center/integration.mjs +7 -6
  28. package/es/enums/exceptionEnum.mjs +21 -17
  29. package/es/enums/expressionEnum.d.ts +1 -1
  30. package/es/enums/expressionEnum.mjs +81 -74
  31. package/es/enums/globalEnum.d.ts +15 -0
  32. package/es/enums/globalEnum.mjs +60 -25
  33. package/es/enums/httpEnum.mjs +71 -61
  34. package/es/enums/index.mjs +43 -14
  35. package/es/enums/menuEnum.mjs +42 -38
  36. package/es/enums/page-designer/designer.mjs +403 -407
  37. package/es/enums/page-designer/index.mjs +4 -0
  38. package/es/enums/page-designer/panel.mjs +341 -213
  39. package/es/enums/page-designer/toolkit.mjs +13 -12
  40. package/es/enums/page-designer/widget.d.ts +5 -0
  41. package/es/enums/page-designer/widget.mjs +426 -334
  42. package/es/enums/pageEnum.mjs +14 -13
  43. package/es/enums/plugin-enum.mjs +23 -7
  44. package/es/enums/processEnum.mjs +95 -60
  45. package/es/enums/roleEnum.mjs +7 -6
  46. package/es/enums/sizeEnum.d.ts +18 -0
  47. package/es/enums/sizeEnum.mjs +28 -8
  48. package/es/global/gct/gct.d.ts +9 -3
  49. package/es/global/gct/gct.mjs +84 -91
  50. package/es/global/index.mjs +1 -0
  51. package/es/hooks/index.d.ts +0 -2
  52. package/es/hooks/index.mjs +4 -0
  53. package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
  54. package/es/hooks/use-modal/use-modal.mjs +16 -10
  55. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
  56. package/es/hooks/useCopyToClipboard.mjs +50 -50
  57. package/es/index.d.ts +1 -3
  58. package/es/index.mjs +122 -134
  59. package/es/interface/i-dictionary/i-dictionary-item.d.ts +6 -0
  60. package/es/interface/i-global-register/i-global-register.d.ts +8 -0
  61. package/es/interface/i-pinia-action/i-global-actions.d.ts +4 -0
  62. package/es/interface/i-pinia-getter/i-global-getters.d.ts +2 -0
  63. package/es/interface/i-pinia-state/i-global-state.d.ts +12 -1
  64. package/es/interface/index.d.ts +3 -6
  65. package/es/interface/model-desginer/entity.d.ts +110 -0
  66. package/es/interface/provider/index.d.ts +0 -2
  67. package/es/locale/index.mjs +43 -57
  68. package/es/modules/env-manager/env-manager.const.mjs +16 -8
  69. package/es/modules/env-manager/env-manager.interface.mjs +14 -7
  70. package/es/modules/env-manager/env-manager.mjs +104 -107
  71. package/es/modules/error-handler/error-handler.const.mjs +11 -16
  72. package/es/modules/error-handler/error-strategy.mjs +199 -175
  73. package/es/modules/error-handler/index.mjs +120 -106
  74. package/es/modules/mqtt/constants/mqtt.const.d.ts +33 -0
  75. package/es/modules/mqtt/constants/mqtt.const.mjs +24 -0
  76. package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +20 -0
  77. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +24 -0
  78. package/es/modules/mqtt/index.d.ts +5 -0
  79. package/es/modules/mqtt/index.mjs +4 -0
  80. package/es/modules/mqtt/interfaces/i-mqtt.d.ts +139 -0
  81. package/es/modules/mqtt/mqtt-client.d.ts +117 -0
  82. package/es/modules/mqtt/mqtt-client.mjs +229 -0
  83. package/es/modules/mqtt/mqtt-manager.d.ts +87 -0
  84. package/es/modules/mqtt/mqtt-manager.mjs +118 -0
  85. package/es/modules/platform-config/constants/index.mjs +4 -0
  86. package/es/modules/platform-config/constants/login.const.mjs +48 -45
  87. package/es/modules/platform-config/constants/org.const.mjs +57 -52
  88. package/es/modules/platform-config/constants/theme.const.mjs +11 -4
  89. package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
  90. package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
  91. package/es/modules/platform-config/enums/login.enum.mjs +29 -15
  92. package/es/modules/platform-config/enums/platform.enum.d.ts +0 -15
  93. package/es/modules/platform-config/enums/platform.enum.mjs +17 -26
  94. package/es/modules/platform-config/index.mjs +9 -0
  95. package/es/modules/platform-config/interfaces/index.d.ts +0 -1
  96. package/es/modules/platform-config/store.mjs +68 -76
  97. package/es/modules/platform-config/useBasicSetting.mjs +47 -35
  98. package/es/modules/platform-config/useDeploySetting.mjs +29 -21
  99. package/es/modules/platform-config/useLoginSetting.mjs +151 -173
  100. package/es/modules/platform-config/useOrgSetting.mjs +63 -62
  101. package/es/modules/platform-config/useProjectSetting.mjs +14 -6
  102. package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
  103. package/es/modules/platform-config/useThemeSetting.mjs +78 -59
  104. package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
  105. package/es/modules/user-stores/index.mjs +3 -0
  106. package/es/modules/user-stores/store/permission.store.mjs +27 -36
  107. package/es/modules/user-stores/store/tenant.store.mjs +20 -22
  108. package/es/modules/user-stores/store/user.store.d.ts +74 -0
  109. package/es/modules/user-stores/store/user.store.mjs +94 -102
  110. package/es/modules/user-stores/types/user.d.ts +1 -0
  111. package/es/router/index.mjs +25 -28
  112. package/es/setup-app.mjs +23 -28
  113. package/es/state/global-pinia-state/global-pinia-state.d.ts +15 -1
  114. package/es/state/global-pinia-state/global-pinia-state.mjs +49 -57
  115. package/es/state/index.d.ts +0 -9
  116. package/es/state/index.mjs +1 -0
  117. package/es/store/global-store.mjs +50 -58
  118. package/es/store/index.mjs +25 -19
  119. package/es/types/index.d.ts +7 -0
  120. package/es/utils/axios/interceptors.mjs +21 -17
  121. package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
  122. package/es/utils/design/design.d.ts +11 -0
  123. package/es/utils/design/design.mjs +21 -0
  124. package/es/utils/deviceFingerprint.mjs +74 -63
  125. package/es/utils/dictionary/dictionary.mjs +142 -145
  126. package/es/utils/file/base64Conver.d.ts +9 -0
  127. package/es/utils/file/base64Conver.mjs +40 -0
  128. package/es/utils/file/download.d.ts +44 -0
  129. package/es/utils/file/download.mjs +103 -0
  130. package/es/utils/file/parser.d.ts +3 -0
  131. package/es/utils/file/parser.mjs +29 -0
  132. package/es/utils/i18n/index.mjs +14 -3
  133. package/es/utils/index.d.ts +7 -2
  134. package/es/utils/index.mjs +31 -0
  135. package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
  136. package/es/utils/linked-list/linked-list.mjs +115 -118
  137. package/es/utils/linked-node/linked-node.mjs +41 -31
  138. package/es/utils/lowcode/utils.mjs +13 -18
  139. package/es/utils/lowcode/validate.mjs +20 -26
  140. package/es/utils/mitt/mitt.mjs +4 -4
  141. package/es/utils/model-loader/model-loader.mjs +280 -325
  142. package/es/utils/namespace/namespace.mjs +178 -164
  143. package/es/utils/openUtil/index.mjs +2 -0
  144. package/es/utils/openUtil/modal/modal.mjs +72 -79
  145. package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
  146. package/es/utils/permission.d.ts +19 -0
  147. package/es/utils/permission.mjs +34 -0
  148. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
  149. package/es/utils/style/index.mjs +94 -138
  150. package/es/utils/tools/tools.mjs +86 -54
  151. package/es/utils/treeHelper/treeHelper.mjs +205 -233
  152. package/es/utils/uploader/uploader.d.ts +20 -0
  153. package/es/utils/uploader/uploader.mjs +86 -0
  154. package/es/utils/useUUid.mjs +79 -87
  155. package/es/utils/util.mjs +55 -35
  156. package/es/utils/uuid/uuid.d.ts +1 -0
  157. package/es/utils/uuid/uuid.mjs +36 -43
  158. package/es/utils/validate.d.ts +5 -0
  159. package/es/utils/validate.mjs +21 -0
  160. package/es/utils/value-helper/value-helper.mjs +113 -98
  161. package/package.json +14 -14
  162. package/dist/index.esm.min.mjs +0 -8101
  163. package/dist/index.min.cjs +0 -386
  164. package/dist/index.system.min.js +0 -386
  165. package/es/constants/editor-type/editor-type.d.ts +0 -244
  166. package/es/constants/editor-type/editor-type.mjs +0 -63
  167. package/es/controller/edit-form/edit-form.controller.d.ts +0 -28
  168. package/es/controller/edit-form/edit-form.controller.mjs +0 -47
  169. package/es/controller/editor/color-editor.controller.d.ts +0 -13
  170. package/es/controller/editor/color-editor.controller.mjs +0 -6
  171. package/es/controller/editor/length-unit-editor.controller.d.ts +0 -13
  172. package/es/controller/editor/length-unit-editor.controller.mjs +0 -6
  173. package/es/controller/editor-item/editor-item.controller.d.ts +0 -14
  174. package/es/controller/editor-item/editor-item.controller.mjs +0 -8
  175. package/es/controller/form/form.controller.d.ts +0 -76
  176. package/es/controller/form/form.controller.mjs +0 -147
  177. package/es/controller/form-collapse/form-collapse.controller.d.ts +0 -18
  178. package/es/controller/form-collapse/form-collapse.controller.mjs +0 -14
  179. package/es/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -18
  180. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +0 -14
  181. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +0 -27
  182. package/es/controller/form-edit-item/form-edit-item.controller.mjs +0 -74
  183. package/es/controller/form-group/form-group.controller.d.ts +0 -18
  184. package/es/controller/form-group/form-group.controller.mjs +0 -14
  185. package/es/controller/form-item/form-item.controller.d.ts +0 -21
  186. package/es/controller/form-item/form-item.controller.mjs +0 -43
  187. package/es/controller/form-item-basic/form-item-basic.controller.d.ts +0 -57
  188. package/es/controller/form-item-basic/form-item-basic.controller.mjs +0 -49
  189. package/es/controller/form-item-hidden/form-item-hidden.controller.d.ts +0 -17
  190. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -7
  191. package/es/controller/form-tab/form-tab.controller.d.ts +0 -18
  192. package/es/controller/form-tab/form-tab.controller.mjs +0 -14
  193. package/es/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -18
  194. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +0 -14
  195. package/es/controller/gct-form/gct-form.controller.d.ts +0 -101
  196. package/es/controller/gct-form/gct-form.controller.mjs +0 -214
  197. package/es/controller/index.d.ts +0 -15
  198. package/es/hooks/use-form/use-form.d.ts +0 -10
  199. package/es/hooks/use-form/use-form.mjs +0 -8
  200. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +0 -22
  201. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -89
  202. package/es/hooks/use-overlay-scrollbars/use-overlay-scrollbars.d.ts +0 -11
  203. package/es/interface/controller/edit-form/edit-form.controller.d.ts +0 -26
  204. package/es/interface/controller/editor/i-color-editor.controller.d.ts +0 -11
  205. package/es/interface/controller/editor/i-length-unit-editor.controller.d.ts +0 -11
  206. package/es/interface/controller/editor-item/editor-item.controller.d.ts +0 -19
  207. package/es/interface/controller/form/form.controller.d.ts +0 -121
  208. package/es/interface/controller/form-collapse/form-collapse.controller.d.ts +0 -23
  209. package/es/interface/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -23
  210. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +0 -59
  211. package/es/interface/controller/form-group/form-group.controller.d.ts +0 -24
  212. package/es/interface/controller/form-hidden-item/form-hidden-item.controller.d.ts +0 -24
  213. package/es/interface/controller/form-item/form-item.controller.d.ts +0 -40
  214. package/es/interface/controller/form-item-basic/form-item-basic.controller.d.ts +0 -51
  215. package/es/interface/controller/form-tab/form-tab.controller.d.ts +0 -23
  216. package/es/interface/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -23
  217. package/es/interface/controller/index.d.ts +0 -14
  218. package/es/interface/events/form/i-form.event.d.ts +0 -11
  219. package/es/interface/events/index.d.ts +0 -1
  220. package/es/interface/form/i-editor/i-check-switch.d.ts +0 -29
  221. package/es/interface/form/i-editor/i-checkbox-editor.d.ts +0 -9
  222. package/es/interface/form/i-editor/i-color-editor.d.ts +0 -13
  223. package/es/interface/form/i-editor/i-editor-basic.d.ts +0 -87
  224. package/es/interface/form/i-editor/i-icon-select-editor.d.ts +0 -21
  225. package/es/interface/form/i-editor/i-info-editor.d.ts +0 -21
  226. package/es/interface/form/i-editor/i-length-unit-editor.d.ts +0 -13
  227. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +0 -18
  228. package/es/interface/form/i-editor/i-number-editor.d.ts +0 -21
  229. package/es/interface/form/i-editor/i-picker-editor.d.ts +0 -30
  230. package/es/interface/form/i-editor/i-radio-editor.d.ts +0 -21
  231. package/es/interface/form/i-editor/i-select-editor.d.ts +0 -14
  232. package/es/interface/form/i-editor/i-span-editor.d.ts +0 -30
  233. package/es/interface/form/i-editor/i-switch-editor.d.ts +0 -14
  234. package/es/interface/form/i-editor/i-text-editor.d.ts +0 -46
  235. package/es/interface/form/i-editor/i-textarea-editor.d.ts +0 -25
  236. package/es/interface/form/i-form/i-edit-form.d.ts +0 -48
  237. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +0 -30
  238. package/es/interface/form/i-form/i-form-collapse.d.ts +0 -35
  239. package/es/interface/form/i-form/i-form-container.d.ts +0 -53
  240. package/es/interface/form/i-form/i-form-edit-item.d.ts +0 -140
  241. package/es/interface/form/i-form/i-form-group-container.d.ts +0 -24
  242. package/es/interface/form/i-form/i-form-group.d.ts +0 -35
  243. package/es/interface/form/i-form/i-form-hidden-item.d.ts +0 -11
  244. package/es/interface/form/i-form/i-form-item-basic.d.ts +0 -126
  245. package/es/interface/form/i-form/i-form-item.d.ts +0 -11
  246. package/es/interface/form/i-form/i-form-tab-pane.d.ts +0 -23
  247. package/es/interface/form/i-form/i-form-tab.d.ts +0 -21
  248. package/es/interface/form/i-form/i-form.d.ts +0 -79
  249. package/es/interface/form/index.d.ts +0 -29
  250. package/es/interface/layout/i-flex-layout/i-flex-container.d.ts +0 -75
  251. package/es/interface/layout/i-flex-layout/i-flex-item.d.ts +0 -51
  252. package/es/interface/layout/i-grid-layout/i-grid-container.d.ts +0 -29
  253. package/es/interface/layout/i-grid-layout/i-grid-item-span.d.ts +0 -54
  254. package/es/interface/layout/i-grid-layout/i-grid-item.d.ts +0 -37
  255. package/es/interface/layout/i-layout-basis/i-layout-container-basis.d.ts +0 -11
  256. package/es/interface/layout/index.d.ts +0 -6
  257. package/es/interface/provider/i-editor-provider/i-editor-provider.d.ts +0 -24
  258. package/es/interface/provider/i-form-item-provider/i-form-item-provider.d.ts +0 -44
  259. package/es/interface/state/form/form.state.d.ts +0 -53
  260. package/es/interface/state/form-collapse/form-collapse.state.d.ts +0 -11
  261. package/es/interface/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -11
  262. package/es/interface/state/form-edit-item/form-edit-item.state.d.ts +0 -38
  263. package/es/interface/state/form-group/form-group.state.d.ts +0 -21
  264. package/es/interface/state/form-hidden-item/form-hidden-item.state.d.ts +0 -5
  265. package/es/interface/state/form-item/form-item.state.d.ts +0 -20
  266. package/es/interface/state/form-item-basic/form-item-basic.state.d.ts +0 -63
  267. package/es/interface/state/form-tab/form-tab.state.d.ts +0 -19
  268. package/es/interface/state/form-tab-pane/form-tab-pane.state.d.ts +0 -11
  269. package/es/interface/state/index.d.ts +0 -10
  270. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +0 -7
  271. package/es/register/editor-register/editor-register.d.ts +0 -49
  272. package/es/register/editor-register/editor-register.mjs +0 -57
  273. package/es/register/form-item-register/form-item-register.d.ts +0 -36
  274. package/es/register/form-item-register/form-item-register.mjs +0 -42
  275. package/es/register/index.d.ts +0 -14
  276. package/es/state/form/form.state.d.ts +0 -24
  277. package/es/state/form/form.state.mjs +0 -16
  278. package/es/state/form-collapse/form-collapse.state.d.ts +0 -14
  279. package/es/state/form-collapse/form-collapse.state.mjs +0 -6
  280. package/es/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -14
  281. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -6
  282. package/es/state/form-edit-item/form-edit-item.state.d.ts +0 -17
  283. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -10
  284. package/es/state/form-group/form-group.state.d.ts +0 -21
  285. package/es/state/form-group/form-group.state.mjs +0 -14
  286. package/es/state/form-item/form-item.state.d.ts +0 -14
  287. package/es/state/form-item/form-item.state.mjs +0 -6
  288. package/es/state/form-item-basic/form-item-basic.state.d.ts +0 -17
  289. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -9
  290. package/es/state/form-tab/form-tab.state.d.ts +0 -15
  291. package/es/state/form-tab/form-tab.state.mjs +0 -7
  292. package/es/state/form-tab-pane/form-tab-pane.state.d.ts +0 -14
  293. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -6
  294. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +0 -63
  295. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +0 -66
  296. package/es/utils/props/index.d.ts +0 -1
  297. package/es/utils/width-install/width-install.d.ts +0 -17
  298. package/es/utils/width-install/width-install.mjs +0 -23
@@ -1,14 +1,15 @@
1
- var PageEnum = /* @__PURE__ */ ((PageEnum2) => {
2
- PageEnum2["BASE_LOGIN"] = "/login";
3
- PageEnum2["BASE_TENANT"] = "/tenant";
4
- PageEnum2["BASE_HOME"] = "/home";
5
- PageEnum2["USER_CENTER"] = "/user-center";
6
- PageEnum2["PROCESS_CENTER"] = "/process";
7
- PageEnum2["MESSAGE_CENTER"] = "/message";
8
- PageEnum2["ERROR_PAGE"] = "/exception";
9
- PageEnum2["ERROR_LOG_PAGE"] = "/error-log/list";
10
- PageEnum2["USER_CENTER_PWD"] = "/user-center/password";
11
- return PageEnum2;
12
- })(PageEnum || {});
13
-
1
+ //#region src/enums/pageEnum.ts
2
+ var PageEnum = /* @__PURE__ */ function(PageEnum) {
3
+ PageEnum["BASE_LOGIN"] = "/login";
4
+ PageEnum["BASE_TENANT"] = "/tenant";
5
+ PageEnum["BASE_HOME"] = "/home";
6
+ PageEnum["USER_CENTER"] = "/user-center";
7
+ PageEnum["PROCESS_CENTER"] = "/process";
8
+ PageEnum["MESSAGE_CENTER"] = "/message";
9
+ PageEnum["ERROR_PAGE"] = "/exception";
10
+ PageEnum["ERROR_LOG_PAGE"] = "/error-log/list";
11
+ PageEnum["USER_CENTER_PWD"] = "/user-center/password";
12
+ return PageEnum;
13
+ }({});
14
+ //#endregion
14
15
  export { PageEnum };
@@ -1,8 +1,24 @@
1
- var PluginModeEnum = /* @__PURE__ */ ((PluginModeEnum2) => {
2
- PluginModeEnum2["DESIGN"] = "design";
3
- PluginModeEnum2["WEB"] = "web";
4
- PluginModeEnum2["MOBILE"] = "mobile";
5
- return PluginModeEnum2;
6
- })(PluginModeEnum || {});
7
-
1
+ //#region src/enums/plugin-enum.ts
2
+ /**
3
+ * 插件模式枚举
4
+ *
5
+ * @export
6
+ * @enum {number}
7
+ */
8
+ var PluginModeEnum = /* @__PURE__ */ function(PluginModeEnum) {
9
+ /**
10
+ * 设计模式
11
+ */
12
+ PluginModeEnum["DESIGN"] = "design";
13
+ /**
14
+ * 网页端绘制模式
15
+ */
16
+ PluginModeEnum["WEB"] = "web";
17
+ /**
18
+ * 移动端绘制模式
19
+ */
20
+ PluginModeEnum["MOBILE"] = "mobile";
21
+ return PluginModeEnum;
22
+ }({});
23
+ //#endregion
8
24
  export { PluginModeEnum };
@@ -1,62 +1,97 @@
1
- var ProcessStatusEnum = /* @__PURE__ */ ((ProcessStatusEnum2) => {
2
- ProcessStatusEnum2["APPROVING"] = "APPROVING";
3
- ProcessStatusEnum2["COMPLETED"] = "COMPLETED";
4
- ProcessStatusEnum2["REFUSED"] = "REFUSED";
5
- ProcessStatusEnum2["REJECTED"] = "REJECTED";
6
- ProcessStatusEnum2["TERMINATED"] = "TERMINATED";
7
- ProcessStatusEnum2["WITHDRAWN"] = "WITHDRAWN";
8
- return ProcessStatusEnum2;
9
- })(ProcessStatusEnum || {});
10
- const ch_ProcessStatusMap = {
11
- ["APPROVING" /* APPROVING */]: "sys.process.status.approving",
12
- ["COMPLETED" /* COMPLETED */]: "sys.process.status.completed",
13
- ["REFUSED" /* REFUSED */]: "sys.process.status.refused",
14
- ["REJECTED" /* REJECTED */]: "sys.process.status.rejected",
15
- ["TERMINATED" /* TERMINATED */]: "sys.process.status.terminated",
16
- ["WITHDRAWN" /* WITHDRAWN */]: "sys.process.status.withdrawn"
1
+ //#region src/enums/processEnum.ts
2
+ var ProcessStatusEnum = /* @__PURE__ */ function(ProcessStatusEnum) {
3
+ /** 审批中 */
4
+ ProcessStatusEnum["APPROVING"] = "APPROVING";
5
+ /** 已完成 */
6
+ ProcessStatusEnum["COMPLETED"] = "COMPLETED";
7
+ /** 已拒绝 */
8
+ ProcessStatusEnum["REFUSED"] = "REFUSED";
9
+ /** 已驳回 */
10
+ ProcessStatusEnum["REJECTED"] = "REJECTED";
11
+ /** 已终止 */
12
+ ProcessStatusEnum["TERMINATED"] = "TERMINATED";
13
+ /** 已撤回 */
14
+ ProcessStatusEnum["WITHDRAWN"] = "WITHDRAWN";
15
+ return ProcessStatusEnum;
16
+ }({});
17
+ var ch_ProcessStatusMap = {
18
+ [ProcessStatusEnum.APPROVING]: "sys.process.status.approving",
19
+ [ProcessStatusEnum.COMPLETED]: "sys.process.status.completed",
20
+ [ProcessStatusEnum.REFUSED]: "sys.process.status.refused",
21
+ [ProcessStatusEnum.REJECTED]: "sys.process.status.rejected",
22
+ [ProcessStatusEnum.TERMINATED]: "sys.process.status.terminated",
23
+ [ProcessStatusEnum.WITHDRAWN]: "sys.process.status.withdrawn"
17
24
  };
18
- var ExamineAndApproveStateEnum = /* @__PURE__ */ ((ExamineAndApproveStateEnum2) => {
19
- ExamineAndApproveStateEnum2["MY_APPLICATION"] = "myApplication";
20
- ExamineAndApproveStateEnum2["MY_AGENT"] = "myAgent";
21
- ExamineAndApproveStateEnum2["MY_DONE"] = "myDone";
22
- ExamineAndApproveStateEnum2["MY_CUSTOM"] = "myCustom";
23
- ExamineAndApproveStateEnum2["MY_CUSTOM_Modal"] = "myCustomModal";
24
- return ExamineAndApproveStateEnum2;
25
- })(ExamineAndApproveStateEnum || {});
26
- var ButtonTypeEnum = /* @__PURE__ */ ((ButtonTypeEnum2) => {
27
- ButtonTypeEnum2["Resubmit"] = "Resubmit";
28
- ButtonTypeEnum2["End"] = "Terminate";
29
- ButtonTypeEnum2["Withdraw"] = "Withdraw";
30
- ButtonTypeEnum2["Approve"] = "Approve";
31
- ButtonTypeEnum2["Refuse"] = "Refuse";
32
- ButtonTypeEnum2["Reassign"] = "Reassign";
33
- ButtonTypeEnum2["Countersign"] = "Countersign";
34
- ButtonTypeEnum2["Reject"] = "Reject";
35
- return ButtonTypeEnum2;
36
- })(ButtonTypeEnum || {});
37
- var OpinionTypeEnum = /* @__PURE__ */ ((OpinionTypeEnum2) => {
38
- OpinionTypeEnum2["Required"] = "Required";
39
- OpinionTypeEnum2["Optional"] = "Optional";
40
- OpinionTypeEnum2["ApproveRequired"] = "ApproveRequired";
41
- OpinionTypeEnum2["RefuseRequired"] = "RefuseRequired";
42
- OpinionTypeEnum2["ReassignRequired"] = "ReassignRequired";
43
- OpinionTypeEnum2["RejectRequired"] = "RejectRequired";
44
- OpinionTypeEnum2["CountersignRequired"] = "CountersignRequired";
45
- return OpinionTypeEnum2;
46
- })(OpinionTypeEnum || {});
47
- var BpmnNodeTypeEnum = /* @__PURE__ */ ((BpmnNodeTypeEnum2) => {
48
- BpmnNodeTypeEnum2["BpmnStart"] = "bpmnStart";
49
- BpmnNodeTypeEnum2["BpmnSubmit"] = "bpmnSubmit";
50
- BpmnNodeTypeEnum2["BpmnApproval"] = "bpmnApproval";
51
- BpmnNodeTypeEnum2["BpmnEnd"] = "bpmnEnd";
52
- BpmnNodeTypeEnum2["BpmnExclusive"] = "bpmnExclusive";
53
- BpmnNodeTypeEnum2["BpmnJs"] = "bpmnJs";
54
- BpmnNodeTypeEnum2["BpmnMessage"] = "bpmnMessage";
55
- BpmnNodeTypeEnum2["BpmnParallel"] = "bpmnParallel";
56
- BpmnNodeTypeEnum2["BpmnJoin"] = "bpmnJoin";
57
- BpmnNodeTypeEnum2["BpmnForm"] = "bpmnForm";
58
- BpmnNodeTypeEnum2["BpmnBusiness"] = "bpmnBusiness";
59
- return BpmnNodeTypeEnum2;
60
- })(BpmnNodeTypeEnum || {});
61
-
25
+ /**审批状态 */
26
+ var ExamineAndApproveStateEnum = /* @__PURE__ */ function(ExamineAndApproveStateEnum) {
27
+ /**我的申请 */
28
+ ExamineAndApproveStateEnum["MY_APPLICATION"] = "myApplication";
29
+ /**我的代办 */
30
+ ExamineAndApproveStateEnum["MY_AGENT"] = "myAgent";
31
+ /**我的已办 */
32
+ ExamineAndApproveStateEnum["MY_DONE"] = "myDone";
33
+ /**我的自定义审批 */
34
+ ExamineAndApproveStateEnum["MY_CUSTOM"] = "myCustom";
35
+ /**我的自定义审批模态框 */
36
+ ExamineAndApproveStateEnum["MY_CUSTOM_Modal"] = "myCustomModal";
37
+ return ExamineAndApproveStateEnum;
38
+ }({});
39
+ /**
40
+ * tips: 增加枚举时同步后端增加,该值会作为变量运行在 bpmn 中
41
+ */
42
+ var ButtonTypeEnum = /* @__PURE__ */ function(ButtonTypeEnum) {
43
+ /** 重新提交 */
44
+ ButtonTypeEnum["Resubmit"] = "Resubmit";
45
+ /** 终止 */
46
+ ButtonTypeEnum["End"] = "Terminate";
47
+ /** 撤回 */
48
+ ButtonTypeEnum["Withdraw"] = "Withdraw";
49
+ /** 同意 */
50
+ ButtonTypeEnum["Approve"] = "Approve";
51
+ /** 拒绝 */
52
+ ButtonTypeEnum["Refuse"] = "Refuse";
53
+ /** 转交 */
54
+ ButtonTypeEnum["Reassign"] = "Reassign";
55
+ /** 加签 */
56
+ ButtonTypeEnum["Countersign"] = "Countersign";
57
+ /** 驳回 */
58
+ ButtonTypeEnum["Reject"] = "Reject";
59
+ return ButtonTypeEnum;
60
+ }({});
61
+ /** 审批意见枚举 */
62
+ var OpinionTypeEnum = /* @__PURE__ */ function(OpinionTypeEnum) {
63
+ /** 全部必填 */
64
+ OpinionTypeEnum["Required"] = "Required";
65
+ /** 全部非必填 */
66
+ OpinionTypeEnum["Optional"] = "Optional";
67
+ /** 同意时必填 */
68
+ OpinionTypeEnum["ApproveRequired"] = "ApproveRequired";
69
+ /** 拒绝时必填 */
70
+ OpinionTypeEnum["RefuseRequired"] = "RefuseRequired";
71
+ /** 转交时必填 */
72
+ OpinionTypeEnum["ReassignRequired"] = "ReassignRequired";
73
+ /** 驳回时必填 */
74
+ OpinionTypeEnum["RejectRequired"] = "RejectRequired";
75
+ /** 加签时必填 */
76
+ OpinionTypeEnum["CountersignRequired"] = "CountersignRequired";
77
+ return OpinionTypeEnum;
78
+ }({});
79
+ /**
80
+ * bpmn节点类型
81
+ */
82
+ var BpmnNodeTypeEnum = /* @__PURE__ */ function(BpmnNodeTypeEnum) {
83
+ BpmnNodeTypeEnum["BpmnStart"] = "bpmnStart";
84
+ BpmnNodeTypeEnum["BpmnSubmit"] = "bpmnSubmit";
85
+ BpmnNodeTypeEnum["BpmnApproval"] = "bpmnApproval";
86
+ BpmnNodeTypeEnum["BpmnEnd"] = "bpmnEnd";
87
+ BpmnNodeTypeEnum["BpmnExclusive"] = "bpmnExclusive";
88
+ BpmnNodeTypeEnum["BpmnJs"] = "bpmnJs";
89
+ BpmnNodeTypeEnum["BpmnMessage"] = "bpmnMessage";
90
+ BpmnNodeTypeEnum["BpmnParallel"] = "bpmnParallel";
91
+ BpmnNodeTypeEnum["BpmnJoin"] = "bpmnJoin";
92
+ BpmnNodeTypeEnum["BpmnForm"] = "bpmnForm";
93
+ BpmnNodeTypeEnum["BpmnBusiness"] = "bpmnBusiness";
94
+ return BpmnNodeTypeEnum;
95
+ }({});
96
+ //#endregion
62
97
  export { BpmnNodeTypeEnum, ButtonTypeEnum, ExamineAndApproveStateEnum, OpinionTypeEnum, ProcessStatusEnum, ch_ProcessStatusMap };
@@ -1,7 +1,8 @@
1
- var RoleEnum = /* @__PURE__ */ ((RoleEnum2) => {
2
- RoleEnum2["SUPER"] = "super";
3
- RoleEnum2["TEST"] = "test";
4
- return RoleEnum2;
5
- })(RoleEnum || {});
6
-
1
+ //#region src/enums/roleEnum.ts
2
+ var RoleEnum = /* @__PURE__ */ function(RoleEnum) {
3
+ RoleEnum["SUPER"] = "super";
4
+ RoleEnum["TEST"] = "test";
5
+ return RoleEnum;
6
+ }({});
7
+ //#endregion
7
8
  export { RoleEnum };
@@ -3,3 +3,21 @@ export declare enum SizeEnum {
3
3
  SMALL = "small",
4
4
  LARGE = "large"
5
5
  }
6
+ /**
7
+ * 附件类型
8
+ */
9
+ export declare enum UploadTypeEnum {
10
+ JPG = "jpg",
11
+ JPEG = "jpeg",
12
+ PNG = "png",
13
+ BMP = "bmp",
14
+ DOCX = "docx",
15
+ PDF = "pdf",
16
+ XLSX = "xlsx",
17
+ DOC = "doc",
18
+ MP4 = "mp4",
19
+ AVI = "avi",
20
+ PPT = "ppt",
21
+ GIF = "gif",
22
+ CER = "cer"
23
+ }
@@ -1,8 +1,28 @@
1
- var SizeEnum = /* @__PURE__ */ ((SizeEnum2) => {
2
- SizeEnum2["DEFAULT"] = "default";
3
- SizeEnum2["SMALL"] = "small";
4
- SizeEnum2["LARGE"] = "large";
5
- return SizeEnum2;
6
- })(SizeEnum || {});
7
-
8
- export { SizeEnum };
1
+ //#region src/enums/sizeEnum.ts
2
+ var SizeEnum = /* @__PURE__ */ function(SizeEnum) {
3
+ SizeEnum["DEFAULT"] = "default";
4
+ SizeEnum["SMALL"] = "small";
5
+ SizeEnum["LARGE"] = "large";
6
+ return SizeEnum;
7
+ }({});
8
+ /**
9
+ * 附件类型
10
+ */
11
+ var UploadTypeEnum = /* @__PURE__ */ function(UploadTypeEnum) {
12
+ UploadTypeEnum["JPG"] = "jpg";
13
+ UploadTypeEnum["JPEG"] = "jpeg";
14
+ UploadTypeEnum["PNG"] = "png";
15
+ UploadTypeEnum["BMP"] = "bmp";
16
+ UploadTypeEnum["DOCX"] = "docx";
17
+ UploadTypeEnum["PDF"] = "pdf";
18
+ UploadTypeEnum["XLSX"] = "xlsx";
19
+ UploadTypeEnum["DOC"] = "doc";
20
+ UploadTypeEnum["MP4"] = "mp4";
21
+ UploadTypeEnum["AVI"] = "avi";
22
+ UploadTypeEnum["PPT"] = "ppt";
23
+ UploadTypeEnum["GIF"] = "gif";
24
+ UploadTypeEnum["CER"] = "cer";
25
+ return UploadTypeEnum;
26
+ }({});
27
+ //#endregion
28
+ export { SizeEnum, UploadTypeEnum };
@@ -1,9 +1,9 @@
1
1
  import { I18n } from 'vue-i18n';
2
- import { IGlobalRegister } from '../../register';
3
- import { IMessageUtil, IOverlayController } from '../../interface';
2
+ import { ApiMap } from '@gct-paas/api';
3
+ import { IGlobalRegister, IMessageUtil, IOverlayController } from '../../interface';
4
4
  import { DictionaryUtil } from '../../utils';
5
5
  import { EnvironmentManager } from '../../modules/env-manager';
6
- import { ApiMap } from '@gct-paas/api';
6
+ import { MqttManager } from '../../modules/mqtt';
7
7
  import { RouterUtil } from '../../router';
8
8
  /**
9
9
  * gct paas 平台全局对象
@@ -51,6 +51,12 @@ export declare class GctGlobal {
51
51
  * 环境管理器
52
52
  */
53
53
  readonly env: EnvironmentManager;
54
+ /**
55
+ * MQTT 实例管理中心
56
+ *
57
+ * @description 管理多个 MQTT 客户端实例的生命周期,支持多实例连接、订阅、发布
58
+ */
59
+ readonly mqtt: MqttManager;
54
60
  /**
55
61
  * 综合性注册中心
56
62
  */
@@ -1,92 +1,85 @@
1
- import { GlobalStoreUtil } from '../../store/index.mjs';
2
- import { EditorRegister } from '../../register/editor-register/editor-register.mjs';
3
- import { FormItemRegister } from '../../register/form-item-register/form-item-register.mjs';
4
- import 'qs';
5
- import { DictionaryUtil } from '../../utils/dictionary/dictionary.mjs';
6
- import 'lodash-es';
7
- import '../../utils/mitt/mitt.mjs';
8
- import '../../enums/app-designer/index.mjs';
9
- import '../../enums/page-designer/designer.mjs';
10
- import '../../enums/breakpointEnum.mjs';
11
- import '../../constants/expression-type/modeCfg.mjs';
12
- import '../../constants/expression-type/BuiltOperators.mjs';
13
- import '../../constants/expression-type/function.mjs';
14
- import '../../constants/expression-type/variable.mjs';
15
- import 'vue';
16
- import 'qx-util';
17
- import 'path-browserify';
18
- import '../../utils/uuid/uuid.mjs';
19
- import 'axios';
20
- import '@fingerprintjs/fingerprintjs';
21
- import '../../utils/useUUid.mjs';
22
- import { EnvironmentManager } from '../../modules/env-manager/env-manager.mjs';
23
- import { LocaleUtil } from '../../locale/index.mjs';
24
- import { RouterUtil } from '../../router/index.mjs';
25
-
26
- class GctGlobal {
27
- /**
28
- * i18n 工具类
29
- */
30
- i18nUtil = new LocaleUtil();
31
- /**
32
- * i18n 实例
33
- *
34
- * @description 目前底包的实例化只是为了避免报错,需要由主项目实例化后挂载
35
- * @type {I18n}
36
- */
37
- i18n = this.i18nUtil.i18n;
38
- /**
39
- * 全局 store 工具类
40
- */
41
- storeUtil = new GlobalStoreUtil();
42
- /**
43
- * 全局 store 实例
44
- */
45
- store = this.storeUtil.store;
46
- /**
47
- * 全局 router 工具类
48
- */
49
- routerUtil = new RouterUtil();
50
- router = this.routerUtil.router;
51
- /**
52
- * 消息提示工具类(预览、移动、网页,需要分别实现)
53
- *
54
- * @type {IMessageUtil}
55
- */
56
- message;
57
- /**
58
- * 全局数据字典工具类
59
- *
60
- */
61
- dictionary = new DictionaryUtil();
62
- /**
63
- * 环境管理器
64
- */
65
- env = new EnvironmentManager();
66
- /**
67
- * 综合性注册中心
68
- */
69
- register = {
70
- editor: new EditorRegister(),
71
- formItem: new FormItemRegister()
72
- };
73
- /**
74
- * 全局呈现容器控制器,这里只是声明了类型,具体实例需要由主项目根据实际情况进行实现和挂载
75
- *
76
- * @type {IOverlayController}
77
- */
78
- openUtil;
79
- /**
80
- * 异步初始化一些内容,在 createApp 之前调用
81
- *
82
- * @author chitanda
83
- * @date 2025-08-20 16:08:12
84
- * @returns {*} {Promise<void>}
85
- */
86
- async init() {
87
- await this.env.checkIsTestEnv();
88
- await this.store.init();
89
- }
90
- }
91
-
1
+ import { DictionaryUtil } from "../../utils/dictionary/dictionary.mjs";
2
+ import "../../utils/index.mjs";
3
+ import { GlobalStoreUtil } from "../../store/index.mjs";
4
+ import { EnvironmentManager } from "../../modules/env-manager/env-manager.mjs";
5
+ import { MqttManager } from "../../modules/mqtt/mqtt-manager.mjs";
6
+ import "../../modules/mqtt/index.mjs";
7
+ import { LocaleUtil } from "../../locale/index.mjs";
8
+ import { RouterUtil } from "../../router/index.mjs";
9
+ //#region src/global/gct/gct.ts
10
+ /**
11
+ * gct paas 平台全局对象
12
+ *
13
+ * @export
14
+ * @class GctGlobal
15
+ */
16
+ var GctGlobal = class {
17
+ /**
18
+ * i18n 工具类
19
+ */
20
+ i18nUtil = new LocaleUtil();
21
+ /**
22
+ * i18n 实例
23
+ *
24
+ * @description 目前底包的实例化只是为了避免报错,需要由主项目实例化后挂载
25
+ * @type {I18n}
26
+ */
27
+ i18n = this.i18nUtil.i18n;
28
+ /**
29
+ * 全局 store 工具类
30
+ */
31
+ storeUtil = new GlobalStoreUtil();
32
+ /**
33
+ * 全局 store 实例
34
+ */
35
+ store = this.storeUtil.store;
36
+ /**
37
+ * 全局 router 工具类
38
+ */
39
+ routerUtil = new RouterUtil();
40
+ router = this.routerUtil.router;
41
+ /**
42
+ * 消息提示工具类(预览、移动、网页,需要分别实现)
43
+ *
44
+ * @type {IMessageUtil}
45
+ */
46
+ message;
47
+ /**
48
+ * 全局数据字典工具类
49
+ *
50
+ */
51
+ dictionary = new DictionaryUtil();
52
+ /**
53
+ * 环境管理器
54
+ */
55
+ env = new EnvironmentManager();
56
+ /**
57
+ * MQTT 实例管理中心
58
+ *
59
+ * @description 管理多个 MQTT 客户端实例的生命周期,支持多实例连接、订阅、发布
60
+ */
61
+ mqtt = new MqttManager();
62
+ /**
63
+ * 综合性注册中心
64
+ */
65
+ register = {};
66
+ /**
67
+ * 全局呈现容器控制器,这里只是声明了类型,具体实例需要由主项目根据实际情况进行实现和挂载
68
+ *
69
+ * @type {IOverlayController}
70
+ */
71
+ openUtil;
72
+ /**
73
+ * 异步初始化一些内容,在 createApp 之前调用
74
+ *
75
+ * @author chitanda
76
+ * @date 2025-08-20 16:08:12
77
+ * @returns {*} {Promise<void>}
78
+ */
79
+ async init() {
80
+ await this.env.checkIsTestEnv();
81
+ await this.store.init();
82
+ }
83
+ };
84
+ //#endregion
92
85
  export { GctGlobal };
@@ -0,0 +1 @@
1
+ import "./gct/gct.mjs";
@@ -1,6 +1,4 @@
1
1
  export { useAppInst } from './use-app-inst/use-app-inst';
2
- export { useForm } from './use-form/use-form';
3
- export { useGctFormValue, useGctFormValueByText, } from './use-gct-form-value/use-gct-form-value';
4
2
  export { useModal } from './use-modal/use-modal';
5
3
  export { useIFrameProps, useWuJieBus, useWuJieProps, } from './use-sub-app-utils/use-sub-app-utils';
6
4
  export { copyTextToClipboard, isDef, useCopyToClipboard, } from './useCopyToClipboard';
@@ -0,0 +1,4 @@
1
+ import "./use-app-inst/use-app-inst.mjs";
2
+ import "./use-modal/use-modal.mjs";
3
+ import "./use-sub-app-utils/use-sub-app-utils.mjs";
4
+ import "./useCopyToClipboard.mjs";
@@ -1,8 +1,14 @@
1
- import { inject } from 'vue';
2
- import { APP_INST } from '../../constants/index.mjs';
3
-
1
+ import { APP_INST } from "../../constants/index.mjs";
2
+ import { inject } from "vue";
3
+ //#region src/hooks/use-app-inst/use-app-inst.ts
4
+ /**
5
+ * 获取当前绘制界面Vue应用实例
6
+ *
7
+ * @export
8
+ * @returns {*} {App}
9
+ */
4
10
  function useAppInst() {
5
- return inject(APP_INST);
11
+ return inject(APP_INST);
6
12
  }
7
-
13
+ //#endregion
8
14
  export { useAppInst };
@@ -1,13 +1,19 @@
1
- import { inject } from 'vue';
2
-
1
+ import { inject } from "vue";
2
+ //#region src/hooks/use-modal/use-modal.ts
3
+ /**
4
+ * 获取模态打开时的模态实例
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-04-02 23:04:32
8
+ * @export
9
+ * @return {*} {IModal}
10
+ */
3
11
  function useModal(ok) {
4
- const modal = inject("modal");
5
- if (modal) {
6
- if (ok) {
7
- modal.ok = ok;
8
- }
9
- }
10
- return modal;
12
+ const modal = inject("modal");
13
+ if (modal) {
14
+ if (ok) modal.ok = ok;
15
+ }
16
+ return modal;
11
17
  }
12
-
18
+ //#endregion
13
19
  export { useModal };
@@ -1,30 +1,50 @@
1
- import { shallowRef, onMounted, onUnmounted, computed } from 'vue';
2
-
1
+ import { computed, onMounted, onUnmounted, shallowRef } from "vue";
2
+ //#region src/hooks/use-sub-app-utils/use-sub-app-utils.ts
3
+ /**
4
+ * 获取 IFrame 通信的 props
5
+ *
6
+ * @author chitanda
7
+ * @date 2025-09-22 09:09:22
8
+ * @export
9
+ * @template T
10
+ * @returns {*} {ComputedRef<T>}
11
+ */
3
12
  function useIFrameProps() {
4
- const props = shallowRef({});
5
- onMounted(() => {
6
- const handleMessage = (event) => {
7
- if (event.data?.type === "IFRAME_PROPS") {
8
- props.value = event.data.props;
9
- }
10
- };
11
- window.addEventListener("message", handleMessage);
12
- window.parent.postMessage({ type: "IFRAME_READY" }, "*");
13
- onUnmounted(() => {
14
- window.removeEventListener("message", handleMessage);
15
- });
16
- });
17
- return computed(() => props.value);
13
+ const props = shallowRef({});
14
+ onMounted(() => {
15
+ const handleMessage = (event) => {
16
+ if (event.data?.type === "IFRAME_PROPS") props.value = event.data.props;
17
+ };
18
+ window.addEventListener("message", handleMessage);
19
+ window.parent.postMessage({ type: "IFRAME_READY" }, "*");
20
+ onUnmounted(() => {
21
+ window.removeEventListener("message", handleMessage);
22
+ });
23
+ });
24
+ return computed(() => props.value);
18
25
  }
26
+ /**
27
+ * 获取 WuJie 输入的 props
28
+ *
29
+ * @export
30
+ * @template T
31
+ * @return {*} {ComputedRef<T>}
32
+ */
19
33
  function useWuJieProps() {
20
- return computed(() => {
21
- return window.$wujie?.props || {};
22
- });
34
+ return computed(() => {
35
+ return window.$wujie?.props || {};
36
+ });
23
37
  }
38
+ /**
39
+ * 获取 WuJie 的事件总线
40
+ *
41
+ * @export
42
+ * @return {*} {(ComputedRef<EventBus | undefined>)}
43
+ */
24
44
  function useWuJieBus() {
25
- return computed(() => {
26
- return window.$wujie?.bus;
27
- });
45
+ return computed(() => {
46
+ return window.$wujie?.bus;
47
+ });
28
48
  }
29
-
49
+ //#endregion
30
50
  export { useIFrameProps, useWuJieBus, useWuJieProps };