@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/index.esm.min.mjs +6520 -18715
  2. package/dist/index.min.cjs +386 -2
  3. package/dist/index.system.min.js +386 -2
  4. package/es/constants/core.mjs +0 -1
  5. package/es/constants/editor-register/editor-register.mjs +0 -1
  6. package/es/constants/editor-type/editor-type.d.ts +65 -1
  7. package/es/constants/editor-type/editor-type.mjs +14 -1
  8. package/es/constants/expression-type/BuiltOperators.d.ts +20 -0
  9. package/es/constants/expression-type/BuiltOperators.mjs +148 -0
  10. package/es/constants/expression-type/FunctionKeys.d.ts +1 -0
  11. package/es/constants/expression-type/FunctionKeys.mjs +81 -0
  12. package/es/constants/expression-type/editor.d.ts +8 -0
  13. package/es/constants/expression-type/editor.mjs +4 -0
  14. package/es/constants/expression-type/function.d.ts +7 -0
  15. package/es/constants/expression-type/function.mjs +875 -0
  16. package/es/constants/expression-type/index.d.ts +42 -0
  17. package/es/constants/expression-type/index.mjs +120 -0
  18. package/es/constants/expression-type/modeCfg.d.ts +30 -0
  19. package/es/constants/expression-type/modeCfg.mjs +268 -0
  20. package/es/constants/expression-type/variable.d.ts +12 -0
  21. package/es/constants/expression-type/variable.mjs +42 -0
  22. package/es/constants/form-container-type/form-container-type.mjs +0 -1
  23. package/es/constants/index.d.ts +5 -0
  24. package/es/constants/index.mjs +6 -6
  25. package/es/controller/edit-form/edit-form.controller.mjs +0 -1
  26. package/es/controller/editor/color-editor.controller.mjs +0 -1
  27. package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
  28. package/es/controller/editor-item/editor-item.controller.mjs +0 -1
  29. package/es/controller/form/form.controller.mjs +5 -4
  30. package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
  31. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
  32. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
  33. package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
  34. package/es/controller/form-group/form-group.controller.mjs +4 -3
  35. package/es/controller/form-item/form-item.controller.d.ts +1 -0
  36. package/es/controller/form-item/form-item.controller.mjs +7 -3
  37. package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
  38. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
  39. package/es/controller/form-tab/form-tab.controller.mjs +4 -3
  40. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
  41. package/es/controller/gct-form/gct-form.controller.mjs +5 -4
  42. package/es/create-app-vue.mjs +3 -9
  43. package/es/enums/app-designer/index.d.ts +13 -1
  44. package/es/enums/app-designer/index.mjs +8 -2
  45. package/es/enums/appEnum.d.ts +22 -66
  46. package/es/enums/appEnum.mjs +24 -15
  47. package/es/enums/appStateEnum.mjs +0 -1
  48. package/es/enums/authActionEnum.mjs +0 -1
  49. package/es/enums/breakpointEnum.mjs +0 -1
  50. package/es/enums/cacheEnum.mjs +0 -1
  51. package/es/enums/designEnum.d.ts +2 -2
  52. package/es/enums/designEnum.mjs +31 -32
  53. package/es/enums/developer-center/index.d.ts +1 -0
  54. package/es/enums/developer-center/integration.d.ts +4 -0
  55. package/es/enums/developer-center/integration.mjs +7 -0
  56. package/es/enums/exceptionEnum.mjs +0 -1
  57. package/es/enums/expressionEnum.d.ts +130 -0
  58. package/es/enums/expressionEnum.mjs +75 -0
  59. package/es/enums/globalEnum.d.ts +38 -0
  60. package/es/enums/globalEnum.mjs +25 -0
  61. package/es/enums/httpEnum.mjs +0 -1
  62. package/es/enums/index.d.ts +19 -0
  63. package/es/enums/index.mjs +13 -16
  64. package/es/enums/menuEnum.mjs +0 -1
  65. package/es/enums/page-designer/designer.d.ts +23 -3
  66. package/es/enums/page-designer/designer.mjs +90 -6
  67. package/es/enums/page-designer/panel.d.ts +78 -7
  68. package/es/enums/page-designer/panel.mjs +22 -4
  69. package/es/enums/page-designer/toolkit.mjs +0 -1
  70. package/es/enums/page-designer/widget.d.ts +2 -1
  71. package/es/enums/page-designer/widget.mjs +3 -3
  72. package/es/enums/pageEnum.mjs +0 -1
  73. package/es/enums/plugin-enum.mjs +0 -1
  74. package/es/enums/processEnum.d.ts +54 -0
  75. package/es/enums/processEnum.mjs +36 -2
  76. package/es/enums/roleEnum.mjs +0 -1
  77. package/es/enums/sizeEnum.mjs +0 -1
  78. package/es/global/gct/gct.d.ts +11 -28
  79. package/es/global/gct/gct.mjs +29 -32
  80. package/es/hooks/index.d.ts +2 -1
  81. package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
  82. package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
  83. package/es/hooks/use-form/use-form.mjs +0 -1
  84. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
  85. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
  86. package/es/hooks/use-modal/use-modal.mjs +0 -1
  87. package/es/hooks/use-overlay-scrollbars/use-overlay-scrollbars.d.ts +11 -0
  88. package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
  89. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
  90. package/es/hooks/useCopyToClipboard.mjs +0 -1
  91. package/es/index.d.ts +6 -8
  92. package/es/index.mjs +98 -64
  93. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
  94. package/es/interface/controller/index.d.ts +0 -1
  95. package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
  96. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
  97. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
  98. package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
  99. package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
  100. package/es/interface/form/index.d.ts +1 -0
  101. package/es/interface/i-app-context/i-app-context.d.ts +34 -0
  102. package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
  103. package/es/interface/i-global-var/i-global-var.d.ts +15 -0
  104. package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
  105. package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
  106. package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
  107. package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
  108. package/es/interface/index.d.ts +5 -5
  109. package/es/interface/open-util/i-message-util/i-message-util.d.ts +54 -0
  110. package/es/interface/{i-modal → open-util/i-modal}/i-modal.d.ts +9 -10
  111. package/es/interface/{i-modal-data → open-util/i-modal-data}/i-modal-data.d.ts +6 -0
  112. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +12 -0
  113. package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
  114. package/es/interface/open-util/i-overlay-container/i-overlay-container.d.ts +36 -0
  115. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +36 -0
  116. package/es/interface/open-util/index.d.ts +7 -0
  117. package/es/interface/state/index.d.ts +0 -1
  118. package/es/locale/index.mjs +2 -2
  119. package/es/modules/env-manager/env-manager.const.mjs +0 -1
  120. package/es/modules/env-manager/env-manager.interface.mjs +0 -1
  121. package/es/modules/env-manager/env-manager.mjs +7 -8
  122. package/es/modules/error-handler/error-handler.const.mjs +1 -30
  123. package/es/modules/error-handler/error-strategy.mjs +0 -1
  124. package/es/modules/error-handler/index.mjs +0 -1
  125. package/es/modules/platform-config/constants/index.d.ts +7 -0
  126. package/es/modules/platform-config/constants/login.const.d.ts +15 -0
  127. package/es/modules/platform-config/constants/login.const.mjs +50 -0
  128. package/es/modules/platform-config/constants/org.const.d.ts +9 -0
  129. package/es/modules/platform-config/constants/org.const.mjs +54 -0
  130. package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
  131. package/es/modules/platform-config/constants/theme.const.mjs +5 -0
  132. package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
  133. package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
  134. package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
  135. package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
  136. package/es/modules/platform-config/enums/index.d.ts +6 -0
  137. package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
  138. package/es/modules/platform-config/enums/login.enum.mjs +16 -0
  139. package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
  140. package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
  141. package/es/modules/platform-config/index.d.ts +6 -17
  142. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
  143. package/es/modules/platform-config/interfaces/index.d.ts +7 -0
  144. package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
  145. package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
  146. package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
  147. package/es/modules/platform-config/store.d.ts +221 -0
  148. package/es/modules/platform-config/store.mjs +78 -0
  149. package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
  150. package/es/modules/platform-config/useBasicSetting.mjs +39 -0
  151. package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
  152. package/es/modules/platform-config/useDeploySetting.mjs +27 -0
  153. package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
  154. package/es/modules/platform-config/useLoginSetting.mjs +177 -0
  155. package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
  156. package/es/modules/platform-config/useOrgSetting.mjs +66 -0
  157. package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
  158. package/es/modules/platform-config/useProjectSetting.mjs +11 -0
  159. package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
  160. package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
  161. package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
  162. package/es/modules/platform-config/useThemeSetting.mjs +64 -0
  163. package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
  164. package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
  165. package/es/modules/user-stores/index.d.ts +3 -0
  166. package/es/modules/user-stores/store/permission.store.d.ts +21 -0
  167. package/es/modules/user-stores/store/permission.store.mjs +38 -0
  168. package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
  169. package/es/modules/user-stores/store/tenant.store.mjs +24 -0
  170. package/es/modules/user-stores/store/user.store.d.ts +154 -0
  171. package/es/modules/user-stores/store/user.store.mjs +107 -0
  172. package/es/modules/user-stores/types/permission.d.ts +1 -0
  173. package/es/modules/user-stores/types/tenant.d.ts +1 -0
  174. package/es/modules/user-stores/types/user.d.ts +14 -0
  175. package/es/register/editor-register/editor-register.d.ts +5 -13
  176. package/es/register/editor-register/editor-register.mjs +8 -17
  177. package/es/register/form-item-register/form-item-register.d.ts +4 -15
  178. package/es/register/form-item-register/form-item-register.mjs +7 -17
  179. package/es/register/index.d.ts +12 -2
  180. package/es/router/index.mjs +0 -1
  181. package/es/setup-app.d.ts +8 -0
  182. package/es/setup-app.mjs +30 -0
  183. package/es/state/form/form.state.mjs +0 -1
  184. package/es/state/form-collapse/form-collapse.state.mjs +0 -1
  185. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
  186. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
  187. package/es/state/form-group/form-group.state.mjs +0 -1
  188. package/es/state/form-item/form-item.state.mjs +0 -1
  189. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
  190. package/es/state/form-tab/form-tab.state.mjs +0 -1
  191. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
  192. package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
  193. package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
  194. package/es/store/global-store.d.ts +1 -0
  195. package/es/store/global-store.mjs +40 -37
  196. package/es/store/index.d.ts +2 -3
  197. package/es/store/index.mjs +0 -1
  198. package/es/types/index.d.ts +18 -1
  199. package/es/utils/axios/interceptors.mjs +2 -23
  200. package/es/utils/cache-adapter/cache-adapter.d.ts +2 -0
  201. package/es/utils/cache-adapter/cache-adapter.mjs +59 -0
  202. package/es/utils/deviceFingerprint.d.ts +17 -0
  203. package/es/utils/deviceFingerprint.mjs +73 -0
  204. package/es/utils/dictionary/dictionary.mjs +0 -1
  205. package/es/utils/i18n/index.d.ts +2 -1
  206. package/es/utils/i18n/index.mjs +3 -4
  207. package/es/utils/index.d.ts +17 -3
  208. package/es/utils/linked-list/linked-list.d.ts +72 -0
  209. package/es/utils/linked-list/linked-list.mjs +119 -0
  210. package/es/utils/linked-node/linked-node.d.ts +31 -0
  211. package/es/utils/linked-node/linked-node.mjs +32 -0
  212. package/es/utils/lowcode/utils.d.ts +1 -0
  213. package/es/utils/lowcode/utils.mjs +20 -0
  214. package/es/utils/lowcode/validate.d.ts +13 -0
  215. package/es/utils/lowcode/validate.mjs +29 -0
  216. package/es/utils/mitt/mitt.d.ts +1 -0
  217. package/es/utils/mitt/mitt.mjs +5 -0
  218. package/es/utils/model-loader/model-loader.d.ts +118 -0
  219. package/es/utils/model-loader/model-loader.mjs +326 -0
  220. package/es/utils/namespace/namespace.d.ts +8 -0
  221. package/es/utils/namespace/namespace.mjs +4 -2
  222. package/es/utils/openUtil/index.d.ts +2 -0
  223. package/es/utils/openUtil/modal/modal.d.ts +61 -0
  224. package/es/utils/openUtil/modal/modal.mjs +80 -0
  225. package/es/utils/openUtil/overlay-container/overlay-container.d.ts +100 -0
  226. package/es/utils/openUtil/overlay-container/overlay-container.mjs +139 -0
  227. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
  228. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
  229. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
  230. package/es/utils/props/index.d.ts +1 -0
  231. package/es/utils/style/index.d.ts +16 -0
  232. package/es/utils/style/index.mjs +141 -0
  233. package/es/utils/tools/tools.d.ts +13 -10
  234. package/es/utils/tools/tools.mjs +23 -11
  235. package/es/utils/treeHelper/treeHelper.d.ts +124 -0
  236. package/es/utils/treeHelper/treeHelper.mjs +234 -0
  237. package/es/utils/util.d.ts +39 -0
  238. package/es/utils/util.mjs +40 -0
  239. package/es/utils/uuid/uuid.d.ts +3 -0
  240. package/es/utils/uuid/uuid.mjs +48 -0
  241. package/es/utils/value-helper/value-helper.d.ts +49 -0
  242. package/es/utils/value-helper/value-helper.mjs +111 -0
  243. package/es/utils/width-install/width-install.mjs +4 -2
  244. package/package.json +13 -16
  245. package/es/controller/index.mjs +0 -17
  246. package/es/enums/page-designer/index.mjs +0 -6
  247. package/es/global/index.mjs +0 -3
  248. package/es/hooks/index.mjs +0 -7
  249. package/es/hooks/use-namespace/use-namespace.d.ts +0 -9
  250. package/es/hooks/use-namespace/use-namespace.mjs +0 -9
  251. package/es/interface/controller/i-designer-controller.d.ts +0 -116
  252. package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
  253. package/es/interface/hooks/index.d.ts +0 -1
  254. package/es/interface/i-message-util/i-message-util.d.ts +0 -78
  255. package/es/interface/index.mjs +0 -1
  256. package/es/interface/low-code-types/index.d.ts +0 -4
  257. package/es/interface/low-code-types/modal-types.d.ts +0 -67
  258. package/es/interface/low-code-types/model/index.d.ts +0 -5338
  259. package/es/interface/low-code-types/schema/index.d.ts +0 -12
  260. package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
  261. package/es/interface/state/i-designer-state.d.ts +0 -27
  262. package/es/modules/env-manager/index.mjs +0 -5
  263. package/es/modules/platform-config/index.mjs +0 -17
  264. package/es/modules/platform-config/types.d.ts +0 -67
  265. package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
  266. package/es/provider/index.d.ts +0 -1
  267. package/es/provider/index.mjs +0 -1
  268. package/es/register/designer-register/designer-register.d.ts +0 -53
  269. package/es/register/designer-register/designer-register.mjs +0 -68
  270. package/es/register/index.mjs +0 -6
  271. package/es/register/render-register/render-register.d.ts +0 -59
  272. package/es/register/render-register/render-register.mjs +0 -64
  273. package/es/state/index.mjs +0 -12
  274. package/es/utils/index.mjs +0 -10
  275. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
  276. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
@@ -1,5 +1,5 @@
1
1
  import { ProjectName } from '../../enums';
2
- import { IGlobalState } from '../../interface';
2
+ import { IAppContext, IGlobalState } from '../../interface';
3
3
  /**
4
4
  * 全局pinia状态
5
5
  *
@@ -8,40 +8,23 @@ import { IGlobalState } from '../../interface';
8
8
  * @implements {IGlobalState}
9
9
  */
10
10
  export declare class GlobalPiniaState implements IGlobalState {
11
+ context: IAppContext;
11
12
  /**
12
- * 当前访问项目名称
13
+ * 应用信息
13
14
  *
14
- * @type {ProjectName}
15
+ * @type {IObject}
15
16
  */
16
- projectName: ProjectName;
17
+ appInfo: IObject;
17
18
  /**
18
- * 租户标识
19
+ * 当前访问项目名称
19
20
  *
20
- * @type {string}
21
+ * @type {ProjectName}
21
22
  */
22
- tenantId: string;
23
+ projectName: ProjectName;
23
24
  /**
24
25
  * 多语言
25
26
  *
26
27
  * @type {string}
27
28
  */
28
29
  lang: string;
29
- /**
30
- * 应用信息, todo: 等 api 包完成后,实际类型从 api 导入
31
- *
32
- * @type {IObject}
33
- */
34
- appInfo: IObject;
35
- /**
36
- * 用户信息
37
- *
38
- * @type {IObject}
39
- */
40
- userInfo: IObject;
41
- /**
42
- * 用户信息
43
- *
44
- * @type {IObject}
45
- */
46
- tenantUserInfo: IObject;
47
30
  }
@@ -1,20 +1,34 @@
1
- import '../../enums/index.mjs';
1
+ import '../../enums/app-designer/index.mjs';
2
+ import { Platform } from '../../enums/page-designer/widget.mjs';
3
+ import '../../enums/page-designer/designer.mjs';
2
4
  import { ProjectName } from '../../enums/appEnum.mjs';
5
+ import '../../enums/breakpointEnum.mjs';
3
6
 
4
- "use strict";
5
7
  class GlobalPiniaState {
8
+ context = {
9
+ aid: "",
10
+ bid: "",
11
+ pid: "",
12
+ platform: Platform.WEB
13
+ };
6
14
  /**
7
- * 当前访问项目名称
15
+ * 应用信息
8
16
  *
9
- * @type {ProjectName}
17
+ * @type {IObject}
10
18
  */
11
- projectName = ProjectName.PORTAL;
19
+ appInfo = {};
12
20
  /**
13
- * 租户标识
21
+ * 当前访问项目名称
14
22
  *
15
- * @type {string}
23
+ * @type {ProjectName}
16
24
  */
17
- tenantId = "";
25
+ projectName = ProjectName.PORTAL;
26
+ // /**
27
+ // * 租户标识
28
+ // *
29
+ // * @type {string}
30
+ // */
31
+ // tenantId: string = '';
18
32
  /**
19
33
  * 多语言
20
34
  *
@@ -26,19 +40,19 @@ class GlobalPiniaState {
26
40
  *
27
41
  * @type {IObject}
28
42
  */
29
- appInfo = {};
30
- /**
31
- * 用户信息
32
- *
33
- * @type {IObject}
34
- */
35
- userInfo = {};
43
+ // appInfo: IObject = {};
44
+ // /**
45
+ // * 用户信息
46
+ // *
47
+ // * @type {IObject}
48
+ // */
49
+ // userInfo: IObject = {};
36
50
  /**
37
51
  * 用户信息
38
52
  *
39
53
  * @type {IObject}
40
54
  */
41
- tenantUserInfo = {};
55
+ // tenantUserInfo: IObject = {};
42
56
  }
43
57
 
44
58
  export { GlobalPiniaState };
@@ -1,2 +1,3 @@
1
1
  import { IGlobalActions, IGlobalGetters, IGlobalState } from '../interface';
2
2
  export declare const useGlobalStore: import('pinia').StoreDefinition<"global-store", IGlobalState, IGlobalGetters, IGlobalActions>;
3
+ export type IGlobalStore = ReturnType<typeof useGlobalStore>;
@@ -1,54 +1,57 @@
1
1
  import { defineStore } from 'pinia';
2
- import '../state/index.mjs';
3
- import { sha256 } from 'js-sha256';
4
- import '../utils/index.mjs';
5
- import { setToken } from '../utils/tools/tools.mjs';
6
2
  import { GlobalPiniaState } from '../state/global-pinia-state/global-pinia-state.mjs';
3
+ import 'qs';
4
+ import 'lodash-es';
5
+ import '../utils/mitt/mitt.mjs';
6
+ import '../enums/app-designer/index.mjs';
7
+ import '../enums/page-designer/designer.mjs';
8
+ import '../enums/breakpointEnum.mjs';
9
+ import '../constants/expression-type/modeCfg.mjs';
10
+ import '../constants/expression-type/BuiltOperators.mjs';
11
+ import '../constants/expression-type/function.mjs';
12
+ import '../constants/expression-type/variable.mjs';
13
+ import 'vue';
14
+ import 'qx-util';
15
+ import 'path-browserify';
16
+ import { parseMatrixParams } from '../utils/tools/tools.mjs';
17
+ import '../utils/uuid/uuid.mjs';
18
+ import 'axios';
19
+ import '@fingerprintjs/fingerprintjs';
7
20
 
8
- "use strict";
9
21
  const useGlobalStore = defineStore("global-store", {
10
22
  state() {
11
23
  return new GlobalPiniaState();
12
24
  },
13
25
  getters: {
14
- tenantList() {
15
- return this.userInfo.tenantList || [];
26
+ getProjectName() {
27
+ return this.projectName;
28
+ },
29
+ geLang() {
30
+ return this.lang;
31
+ },
32
+ getAppInfo() {
33
+ return this.appInfo;
16
34
  }
17
35
  },
18
36
  actions: {
19
- setProjectName(name) {
20
- this.$state.projectName = name;
21
- },
22
- setTenantId(id) {
23
- this.$state.tenantId = id;
37
+ async init() {
38
+ const paramStr = location.pathname.split("/")[2];
39
+ if (paramStr) {
40
+ const params = parseMatrixParams(paramStr);
41
+ if (params) {
42
+ this.context = params;
43
+ }
44
+ }
24
45
  },
25
- setLang(lang) {
26
- this.$state.lang = lang;
27
- },
28
- /**
29
- * 登录方法,使用 js-sha256 进行 SHA-256 加密
30
- * @param payload 用户名和密码
31
- */
32
- async login(payload) {
33
- const { username, password } = payload;
34
- const hashHex = sha256(password);
35
- const res = await _gct.api.platform.login.postSign({
36
- username,
37
- password: hashHex
38
- });
39
- this.$state.userInfo = res.data;
40
- setToken(res.data.token);
41
- return res.data;
46
+ async loadAppInfo() {
47
+ const res = await _api.apaas.designerCommon.getGetApp();
48
+ this.appInfo = res;
42
49
  },
43
- async loadUserInfo() {
44
- const res = await _gct.api.platform.user.getInfo();
45
- this.$state.userInfo = res.data;
46
- return res.data;
50
+ setProjectName(name) {
51
+ this.projectName = name;
47
52
  },
48
- async loadTenantUserInfo() {
49
- const res = await _gct.api.platform.tenant.getUserInfo();
50
- this.$state.tenantUserInfo = res.data;
51
- return res.data;
53
+ setLang(lang) {
54
+ this.lang = lang;
52
55
  }
53
56
  }
54
57
  });
@@ -1,5 +1,4 @@
1
- import { Store } from 'pinia';
2
- import { IGlobalActions, IGlobalGetters, IGlobalState } from '../interface';
1
+ import { IGlobalStore } from './global-store';
3
2
  /**
4
3
  * 全局的状态管理工具类
5
4
  *
@@ -15,6 +14,6 @@ export declare class GlobalStoreUtil {
15
14
  * 全局状态管理实例
16
15
  *
17
16
  */
18
- readonly store: Store<'global-store', IGlobalState, IGlobalGetters, IGlobalActions>;
17
+ readonly store: IGlobalStore;
19
18
  constructor();
20
19
  }
@@ -1,7 +1,6 @@
1
1
  import { createPinia, setActivePinia } from 'pinia';
2
2
  import { useGlobalStore } from './global-store.mjs';
3
3
 
4
- "use strict";
5
4
  class GlobalStoreUtil {
6
5
  /**
7
6
  * 全局唯一实例
@@ -1,9 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import '@gct-paas/api/global-type';
2
3
  import 'systemjs';
3
4
  import 'vite/types/importMeta.d.ts';
4
5
  import type { GctGlobal } from '../global';
5
- import type { ApiManage as APaasApiManage } from '@gct-paas/api-apaas';
6
+ import type { ApiManage as APaasApiManage } from '@gct-paas/api/apaas';
6
7
  import type { ApiManage as PlatformApiManage } from '@gct-paas/api/platform';
8
+ import type { bus } from 'wujie';
7
9
 
8
10
  /**
9
11
  * 全局 api 对象
@@ -42,6 +44,12 @@ declare global {
42
44
  * @type {GlobalApi}
43
45
  */
44
46
  _api: GlobalApi;
47
+ /**
48
+ * wujie 微前端对象,当作为微前端子应用运行时可用
49
+ *
50
+ * @type {*}
51
+ */
52
+ $wujie: { props: IObject; bus: bus };
45
53
  }
46
54
 
47
55
  interface ImportMetaEnv {
@@ -79,6 +87,11 @@ declare global {
79
87
  */
80
88
  type IObject = Record<string | symbol, any>;
81
89
 
90
+ /**
91
+ * 标识上下文对象的任意结构
92
+ */
93
+ type IContext = Record<string | symbol, any>;
94
+
82
95
  /**
83
96
  * 查询分页对象
84
97
  *
@@ -129,4 +142,8 @@ declare global {
129
142
  */
130
143
  data: T[];
131
144
  }
145
+
146
+ type Fn<T = any, R = T> = (...arg: T[]) => R;
147
+
148
+ type PromiseFn<T = any, R = T> = (...arg: T[]) => Promise<R>;
132
149
  }
@@ -1,9 +1,6 @@
1
1
  import { AxiosHeaders } from 'axios';
2
- import { getTimezone, isMobile, getToken, getPathQuery } from '../tools/tools.mjs';
3
- import '../../enums/index.mjs';
4
- import { ProjectName } from '../../enums/appEnum.mjs';
2
+ import { getTimezone, getTenant, isMobile, getToken } from '../tools/tools.mjs';
5
3
 
6
- "use strict";
7
4
  function interceptors(axios) {
8
5
  axios.interceptors.request.use((config) => {
9
6
  if (!config.headers) {
@@ -13,27 +10,9 @@ function interceptors(axios) {
13
10
  Token: getToken(),
14
11
  Source: isMobile ? 502 : 501,
15
12
  Lang: _gct.store.lang,
16
- "Tenant-Id": _gct.store.tenantId,
13
+ "Tenant-Id": getTenant(),
17
14
  Timezone: getTimezone()
18
15
  });
19
- if (!config.headers["App-Tag"]) {
20
- if (config.url.includes("/gct-apaas/")) {
21
- const query = getPathQuery();
22
- config.headers["App-Tag"] = query.aid;
23
- config.headers["Module"] = "TENANT_CENTER";
24
- } else {
25
- config.headers["App-Tag"] = "__platform__";
26
- }
27
- }
28
- if ([
29
- ProjectName.TENANT_CENTER,
30
- ProjectName.APP_DESIGNER,
31
- ProjectName.WEB_RENDER
32
- ].includes(_gct.store.projectName)) {
33
- config.headers["Module"] = "TENANT_CENTER";
34
- } else if (_gct.store.projectName === ProjectName.BACKEND_MANAGEMENT) {
35
- config.headers["Module"] = "BACKEND_MANAGEMENT";
36
- }
37
16
  return config;
38
17
  });
39
18
  }
@@ -0,0 +1,2 @@
1
+ /**异步缓存函数 */
2
+ export declare const gctMemoizeAsync: (...arg: unknown[]) => (...args: any[]) => any;
@@ -0,0 +1,59 @@
1
+ import qs from 'qs';
2
+
3
+ const gctMemoizeAsync = (...arg) => cacheAdapter.bind(null, ...arg);
4
+ function cacheAdapter(adapter, ...args) {
5
+ const maxAge = 1e3 * 60 * 5;
6
+ const requestKey = typeof args === "object" ? qs.stringify(args) : args;
7
+ let responsePromise = MemoryCache.get(requestKey);
8
+ if (!responsePromise) {
9
+ responsePromise = (async () => {
10
+ try {
11
+ return await adapter(...args);
12
+ } catch (reason) {
13
+ MemoryCache.delete(requestKey);
14
+ throw reason;
15
+ }
16
+ })();
17
+ MemoryCache.set(requestKey, responsePromise, maxAge);
18
+ return responsePromise;
19
+ }
20
+ return responsePromise;
21
+ }
22
+ class MemoryCache {
23
+ static cachedata = {};
24
+ static set(key, value, maxAge) {
25
+ this.cachedata[key] = {
26
+ maxAge: maxAge || 0,
27
+ value,
28
+ now: Date.now()
29
+ };
30
+ }
31
+ static get(key) {
32
+ this.reset();
33
+ const cachedItem = this.cachedata[key];
34
+ if (!cachedItem) return null;
35
+ return cachedItem.value;
36
+ }
37
+ static delete(key) {
38
+ return delete this.cachedata[key];
39
+ }
40
+ static clear() {
41
+ this.cachedata = {};
42
+ }
43
+ /**
44
+ *清空过期的数据
45
+ */
46
+ static reset() {
47
+ for (const key in this.cachedata) {
48
+ const cachedItem = this.cachedata[key];
49
+ if (cachedItem) {
50
+ const isExpired = Date.now() - cachedItem.now > cachedItem.maxAge;
51
+ if (isExpired) {
52
+ this.delete(key);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ export { gctMemoizeAsync };
@@ -0,0 +1,17 @@
1
+ /** 客户端平台信息 */
2
+ export interface ClientPlatform {
3
+ type: 'web' | 'mobile' | 'unknown';
4
+ name: string;
5
+ }
6
+ /** 获取客户端平台(浏览器 / 移动系统) */
7
+ export declare function getClientPlatform(): ClientPlatform;
8
+ /** 获取浏览器指纹对象 */
9
+ export declare function getFingerprint(): Promise<import('@fingerprintjs/fingerprintjs').GetResult>;
10
+ /** 获取设备指纹标识(统一入口) */
11
+ export declare function getDeviceFingerprint(): Promise<string>;
12
+ /** web 端指纹(语义兼容) */
13
+ export declare function getBrowserFingerprint(): Promise<string>;
14
+ /** mobile 端指纹(语义兼容) */
15
+ export declare function getMobileBrowserFingerprint(): Promise<string>;
16
+ /** 页签唯一标识 */
17
+ export declare function getPageIdentification(): string;
@@ -0,0 +1,73 @@
1
+ import FingerprintJS from '@fingerprintjs/fingerprintjs';
2
+
3
+ const FINGERPRINT_KEY = "FINGERPRINT";
4
+ function isBrowserEnv() {
5
+ return typeof window !== "undefined" && typeof navigator !== "undefined";
6
+ }
7
+ function getClientPlatform() {
8
+ if (!isBrowserEnv()) {
9
+ return { type: "unknown", name: "unknown" };
10
+ }
11
+ const ua = navigator.userAgent;
12
+ if (/iPad|iPhone|iPod/i.test(ua)) {
13
+ return { type: "mobile", name: "iOS" };
14
+ }
15
+ if (/Android/i.test(ua)) {
16
+ return { type: "mobile", name: "Android" };
17
+ }
18
+ if (/Windows Phone/i.test(ua)) {
19
+ return { type: "mobile", name: "Windows Phone" };
20
+ }
21
+ if (/BlackBerry/i.test(ua)) {
22
+ return { type: "mobile", name: "BlackBerry" };
23
+ }
24
+ if (/Edg/i.test(ua)) {
25
+ return { type: "web", name: "Edge" };
26
+ }
27
+ if (/OPR|Opera/i.test(ua)) {
28
+ return { type: "web", name: "Opera" };
29
+ }
30
+ if (/Firefox/i.test(ua)) {
31
+ return { type: "web", name: "Firefox" };
32
+ }
33
+ if (/Chrome/i.test(ua)) {
34
+ return { type: "web", name: "Chrome" };
35
+ }
36
+ if (/Safari/i.test(ua)) {
37
+ return { type: "web", name: "Safari" };
38
+ }
39
+ return { type: "unknown", name: "unknown" };
40
+ }
41
+ async function getFingerprint() {
42
+ const agent = await FingerprintJS.load();
43
+ return agent.get();
44
+ }
45
+ async function getDeviceFingerprint() {
46
+ if (!isBrowserEnv()) {
47
+ return "unknown/unknown";
48
+ }
49
+ const { type, name } = getClientPlatform();
50
+ const isWeb = type === "web";
51
+ if (isWeb) {
52
+ const cached = localStorage.getItem(FINGERPRINT_KEY);
53
+ if (cached) {
54
+ return `${name}/${cached}`;
55
+ }
56
+ }
57
+ const fingerprint = await getFingerprint();
58
+ const visitorId = fingerprint.visitorId;
59
+ if (isWeb) {
60
+ localStorage.setItem(FINGERPRINT_KEY, visitorId);
61
+ }
62
+ return `${name}/${visitorId}`;
63
+ }
64
+ function getPageIdentification() {
65
+ let pageTag = sessionStorage.getItem("currentPageTag");
66
+ if (!pageTag) {
67
+ pageTag = Date.now().toString();
68
+ sessionStorage.setItem("currentPageTag", pageTag);
69
+ }
70
+ return pageTag;
71
+ }
72
+
73
+ export { getClientPlatform, getDeviceFingerprint, getFingerprint, getPageIdentification };
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  class DictionaryUtil {
3
2
  /**
4
3
  * 代码表配置
@@ -1,3 +1,4 @@
1
+ import { Composer } from 'vue-i18n';
1
2
  /**
2
3
  * 多语言转换
3
4
  *
@@ -8,4 +9,4 @@
8
9
  * @param {string} [def]
9
10
  * @returns {*} {string}
10
11
  */
11
- export declare function t(key: string, def?: string): string;
12
+ export declare const t: Composer['t'];
@@ -1,6 +1,5 @@
1
- "use strict";
2
- function t(key, def) {
3
- return _gct.i18n.global.t(key, def);
4
- }
1
+ const t = (...args) => {
2
+ return _gct.i18n.global.t(...args);
3
+ };
5
4
 
6
5
  export { t };
@@ -1,8 +1,22 @@
1
+ export { gctMemoizeAsync } from './cache-adapter/cache-adapter';
1
2
  export { DictionaryUtil } from './dictionary/dictionary';
2
3
  export { t } from './i18n';
3
- export { Namespace } from './namespace/namespace';
4
- export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
4
+ export { LinkedList } from './linked-list/linked-list';
5
+ export { LinkedNode } from './linked-node/linked-node';
6
+ export { insertCustomCssToHead } from './lowcode/utils';
7
+ export { buildItemRules } from './lowcode/validate';
8
+ export { mitt } from './mitt/mitt';
9
+ export { modelLoader } from './model-loader/model-loader';
10
+ export { Namespace, useNamespace } from './namespace/namespace';
11
+ export * from './openUtil';
5
12
  export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
6
- export { getToken, setToken, getPathQuery, getTenant, getTimezone, isMobile, setTenant, deepMerge, } from './tools/tools';
13
+ export { gctFormItemEditorProps } from './props';
14
+ export { getToken, setToken, getTenant, getTimezone, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, } from './tools/tools';
15
+ export * from './uuid/uuid';
16
+ export * from './value-helper/value-helper';
7
17
  export { widthEditorInstall } from './width-install/width-install';
8
18
  export { interceptors } from './axios/interceptors';
19
+ export { getDeviceFingerprint, getPageIdentification, } from './deviceFingerprint';
20
+ export { TreeHelper } from './treeHelper/treeHelper';
21
+ export * from './style';
22
+ export * from './util';
@@ -0,0 +1,72 @@
1
+ import { LinkedNode } from '../linked-node/linked-node';
2
+ /**
3
+ * 链表列表
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-07-31 15:07:37
7
+ * @export
8
+ * @class LinkedList
9
+ */
10
+ export declare class LinkedList<T = any> {
11
+ /**
12
+ * 当前激活节点
13
+ *
14
+ * @author zhanghanrui
15
+ * @date 2024-07-31 15:07:02
16
+ * @type {(LinkedNode<T> | null)}
17
+ */
18
+ active: LinkedNode<T> | null;
19
+ /**
20
+ * 新增节点
21
+ *
22
+ * @author zhanghanrui
23
+ * @date 2024-07-31 15:07:45
24
+ * @param {T} data
25
+ */
26
+ add(data: T): void;
27
+ /**
28
+ * 删除节点
29
+ *
30
+ * @author zhanghanrui
31
+ * @date 2024-07-31 15:07:11
32
+ * @param {LinkedNode<T>} node
33
+ */
34
+ delete(node: LinkedNode<T>): void;
35
+ /**
36
+ * 上一个节点
37
+ *
38
+ * @author zhanghanrui
39
+ * @date 2024-07-31 16:07:41
40
+ */
41
+ prev(): void;
42
+ /**
43
+ * 下一个节点
44
+ *
45
+ * @author zhanghanrui
46
+ * @date 2024-07-31 16:07:57
47
+ */
48
+ next(): void;
49
+ /**
50
+ * 清理所有缓存
51
+ *
52
+ * @author zhanghanrui
53
+ * @date 2024-07-31 16:07:43
54
+ */
55
+ clearAll(): void;
56
+ /**
57
+ * 是否可以撤销
58
+ *
59
+ * @author zhanghanrui
60
+ * @date 2024-08-21 15:08:57
61
+ * @return {*} {boolean}
62
+ */
63
+ canUndo(): boolean;
64
+ /**
65
+ * 是否可以重做
66
+ *
67
+ * @author zhanghanrui
68
+ * @date 2024-08-21 15:08:33
69
+ * @return {*} {boolean}
70
+ */
71
+ canRedo(): boolean;
72
+ }