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

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 (227) hide show
  1. package/dist/index.esm.min.mjs +4456 -18521
  2. package/dist/index.min.cjs +14 -2
  3. package/dist/index.system.min.js +14 -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/form-container-type/form-container-type.mjs +0 -1
  9. package/es/constants/index.d.ts +4 -0
  10. package/es/constants/index.mjs +2 -7
  11. package/es/controller/edit-form/edit-form.controller.mjs +0 -1
  12. package/es/controller/editor/color-editor.controller.mjs +0 -1
  13. package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
  14. package/es/controller/editor-item/editor-item.controller.mjs +0 -1
  15. package/es/controller/form/form.controller.mjs +5 -4
  16. package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
  17. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
  18. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
  19. package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
  20. package/es/controller/form-group/form-group.controller.mjs +4 -3
  21. package/es/controller/form-item/form-item.controller.d.ts +1 -0
  22. package/es/controller/form-item/form-item.controller.mjs +7 -3
  23. package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
  24. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
  25. package/es/controller/form-tab/form-tab.controller.mjs +4 -3
  26. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
  27. package/es/controller/gct-form/gct-form.controller.mjs +5 -4
  28. package/es/create-app-vue.mjs +4 -3
  29. package/es/enums/app-designer/index.d.ts +13 -1
  30. package/es/enums/app-designer/index.mjs +8 -2
  31. package/es/enums/appEnum.d.ts +17 -66
  32. package/es/enums/appEnum.mjs +18 -14
  33. package/es/enums/appStateEnum.mjs +0 -1
  34. package/es/enums/authActionEnum.mjs +0 -1
  35. package/es/enums/breakpointEnum.mjs +0 -1
  36. package/es/enums/cacheEnum.mjs +0 -1
  37. package/es/enums/designEnum.mjs +0 -1
  38. package/es/enums/exceptionEnum.mjs +0 -1
  39. package/es/enums/globalEnum.d.ts +38 -0
  40. package/es/enums/globalEnum.mjs +25 -0
  41. package/es/enums/httpEnum.mjs +0 -1
  42. package/es/enums/index.d.ts +13 -0
  43. package/es/enums/index.mjs +15 -16
  44. package/es/enums/menuEnum.mjs +0 -1
  45. package/es/enums/page-designer/designer.d.ts +17 -3
  46. package/es/enums/page-designer/designer.mjs +85 -6
  47. package/es/enums/page-designer/panel.mjs +0 -1
  48. package/es/enums/page-designer/toolkit.mjs +0 -1
  49. package/es/enums/page-designer/widget.d.ts +2 -1
  50. package/es/enums/page-designer/widget.mjs +3 -3
  51. package/es/enums/pageEnum.mjs +0 -1
  52. package/es/enums/plugin-enum.mjs +0 -1
  53. package/es/enums/processEnum.mjs +0 -1
  54. package/es/enums/roleEnum.mjs +0 -1
  55. package/es/enums/sizeEnum.mjs +0 -1
  56. package/es/global/gct/gct.d.ts +2 -15
  57. package/es/global/gct/gct.mjs +19 -17
  58. package/es/hooks/index.d.ts +2 -0
  59. package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
  60. package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
  61. package/es/hooks/use-form/use-form.mjs +0 -1
  62. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
  63. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
  64. package/es/hooks/use-modal/use-modal.mjs +0 -1
  65. package/es/hooks/use-namespace/use-namespace.mjs +11 -2
  66. package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
  67. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
  68. package/es/hooks/useCopyToClipboard.mjs +0 -1
  69. package/es/index.d.ts +5 -1
  70. package/es/index.mjs +77 -58
  71. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
  72. package/es/interface/controller/index.d.ts +0 -1
  73. package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
  74. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
  75. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
  76. package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
  77. package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
  78. package/es/interface/form/index.d.ts +1 -0
  79. package/es/interface/i-app-context/i-app-context.d.ts +34 -0
  80. package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
  81. package/es/interface/i-global-var/i-global-var.d.ts +15 -0
  82. package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
  83. package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
  84. package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
  85. package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
  86. package/es/interface/index.d.ts +5 -2
  87. package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
  88. package/es/interface/state/index.d.ts +0 -1
  89. package/es/locale/index.mjs +1 -2
  90. package/es/modules/env-manager/env-manager.const.mjs +0 -1
  91. package/es/modules/env-manager/env-manager.interface.mjs +0 -1
  92. package/es/modules/env-manager/env-manager.mjs +7 -8
  93. package/es/modules/error-handler/error-handler.const.mjs +1 -30
  94. package/es/modules/error-handler/error-strategy.mjs +0 -1
  95. package/es/modules/error-handler/index.mjs +0 -1
  96. package/es/modules/platform-config/constants/index.d.ts +7 -0
  97. package/es/modules/platform-config/constants/login.const.d.ts +15 -0
  98. package/es/modules/platform-config/constants/login.const.mjs +50 -0
  99. package/es/modules/platform-config/constants/org.const.d.ts +9 -0
  100. package/es/modules/platform-config/constants/org.const.mjs +54 -0
  101. package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
  102. package/es/modules/platform-config/constants/theme.const.mjs +5 -0
  103. package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
  104. package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
  105. package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
  106. package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
  107. package/es/modules/platform-config/enums/index.d.ts +6 -0
  108. package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
  109. package/es/modules/platform-config/enums/login.enum.mjs +16 -0
  110. package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
  111. package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
  112. package/es/modules/platform-config/index.d.ts +6 -17
  113. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
  114. package/es/modules/platform-config/interfaces/index.d.ts +7 -0
  115. package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
  116. package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
  117. package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
  118. package/es/modules/platform-config/store.d.ts +221 -0
  119. package/es/modules/platform-config/store.mjs +78 -0
  120. package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
  121. package/es/modules/platform-config/useBasicSetting.mjs +39 -0
  122. package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
  123. package/es/modules/platform-config/useDeploySetting.mjs +27 -0
  124. package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
  125. package/es/modules/platform-config/useLoginSetting.mjs +177 -0
  126. package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
  127. package/es/modules/platform-config/useOrgSetting.mjs +66 -0
  128. package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
  129. package/es/modules/platform-config/useProjectSetting.mjs +11 -0
  130. package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
  131. package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
  132. package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
  133. package/es/modules/platform-config/useThemeSetting.mjs +64 -0
  134. package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
  135. package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
  136. package/es/modules/user-stores/index.d.ts +3 -0
  137. package/es/modules/user-stores/store/permission.store.d.ts +21 -0
  138. package/es/modules/user-stores/store/permission.store.mjs +38 -0
  139. package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
  140. package/es/modules/user-stores/store/tenant.store.mjs +24 -0
  141. package/es/modules/user-stores/store/user.store.d.ts +154 -0
  142. package/es/modules/user-stores/store/user.store.mjs +100 -0
  143. package/es/modules/user-stores/types/permission.d.ts +1 -0
  144. package/es/modules/user-stores/types/tenant.d.ts +1 -0
  145. package/es/modules/user-stores/types/user.d.ts +14 -0
  146. package/es/register/editor-register/editor-register.d.ts +5 -13
  147. package/es/register/editor-register/editor-register.mjs +8 -17
  148. package/es/register/form-item-register/form-item-register.d.ts +4 -15
  149. package/es/register/form-item-register/form-item-register.mjs +7 -17
  150. package/es/register/index.d.ts +18 -1
  151. package/es/register/render-register/render-register.mjs +0 -1
  152. package/es/router/index.mjs +0 -1
  153. package/es/state/form/form.state.mjs +0 -1
  154. package/es/state/form-collapse/form-collapse.state.mjs +0 -1
  155. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
  156. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
  157. package/es/state/form-group/form-group.state.mjs +0 -1
  158. package/es/state/form-item/form-item.state.mjs +0 -1
  159. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
  160. package/es/state/form-tab/form-tab.state.mjs +0 -1
  161. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
  162. package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
  163. package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
  164. package/es/store/global-store.d.ts +1 -0
  165. package/es/store/global-store.mjs +34 -37
  166. package/es/store/index.d.ts +2 -3
  167. package/es/store/index.mjs +0 -1
  168. package/es/types/index.d.ts +14 -1
  169. package/es/utils/axios/interceptors.mjs +3 -23
  170. package/es/utils/deviceFingerprint.d.ts +17 -0
  171. package/es/utils/deviceFingerprint.mjs +73 -0
  172. package/es/utils/dictionary/dictionary.mjs +0 -1
  173. package/es/utils/i18n/index.d.ts +2 -1
  174. package/es/utils/i18n/index.mjs +3 -4
  175. package/es/utils/index.d.ts +11 -2
  176. package/es/utils/linked-list/linked-list.d.ts +72 -0
  177. package/es/utils/linked-list/linked-list.mjs +119 -0
  178. package/es/utils/linked-node/linked-node.d.ts +31 -0
  179. package/es/utils/linked-node/linked-node.mjs +32 -0
  180. package/es/utils/mitt/mitt.d.ts +1 -0
  181. package/es/utils/mitt/mitt.mjs +5 -0
  182. package/es/utils/model-loader/model-loader.d.ts +118 -0
  183. package/es/utils/model-loader/model-loader.mjs +326 -0
  184. package/es/utils/namespace/namespace.mjs +0 -1
  185. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
  186. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
  187. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
  188. package/es/utils/props/index.d.ts +1 -0
  189. package/es/utils/style/index.d.ts +16 -0
  190. package/es/utils/style/index.mjs +141 -0
  191. package/es/utils/tools/tools.d.ts +13 -10
  192. package/es/utils/tools/tools.mjs +19 -11
  193. package/es/utils/treeHelper/treeHelper.d.ts +117 -0
  194. package/es/utils/treeHelper/treeHelper.mjs +220 -0
  195. package/es/utils/util.d.ts +39 -0
  196. package/es/utils/util.mjs +40 -0
  197. package/es/utils/value-helper/value-helper.d.ts +49 -0
  198. package/es/utils/value-helper/value-helper.mjs +109 -0
  199. package/es/utils/width-install/width-install.mjs +0 -2
  200. package/package.json +12 -16
  201. package/es/controller/index.mjs +0 -17
  202. package/es/enums/page-designer/index.mjs +0 -6
  203. package/es/global/index.mjs +0 -3
  204. package/es/hooks/index.mjs +0 -7
  205. package/es/interface/controller/i-designer-controller.d.ts +0 -116
  206. package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
  207. package/es/interface/hooks/index.d.ts +0 -1
  208. package/es/interface/index.mjs +0 -1
  209. package/es/interface/low-code-types/index.d.ts +0 -4
  210. package/es/interface/low-code-types/modal-types.d.ts +0 -67
  211. package/es/interface/low-code-types/model/index.d.ts +0 -5338
  212. package/es/interface/low-code-types/schema/index.d.ts +0 -12
  213. package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
  214. package/es/interface/state/i-designer-state.d.ts +0 -27
  215. package/es/modules/env-manager/index.mjs +0 -5
  216. package/es/modules/platform-config/index.mjs +0 -17
  217. package/es/modules/platform-config/types.d.ts +0 -67
  218. package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
  219. package/es/provider/index.d.ts +0 -1
  220. package/es/provider/index.mjs +0 -1
  221. package/es/register/designer-register/designer-register.d.ts +0 -53
  222. package/es/register/designer-register/designer-register.mjs +0 -68
  223. package/es/register/index.mjs +0 -6
  224. package/es/state/index.mjs +0 -12
  225. package/es/utils/index.mjs +0 -10
  226. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
  227. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
@@ -11,47 +11,39 @@ export declare class EditorRegister {
11
11
  /**
12
12
  * 编辑器集合
13
13
  *
14
- * @author zhanghanrui
15
- * @date 2024-03-27 10:03:25
16
14
  * @private
17
- * @static
18
15
  * @type {Map<string, () => IEditorProvider>}
19
16
  */
20
- private static editors;
17
+ private editors;
21
18
  /**
22
19
  * 已经实例化的编辑器集合
23
20
  *
24
- * @author zhanghanrui
25
- * @date 2024-03-27 10:03:43
26
21
  * @private
27
- * @static
28
22
  * @type {Map<string, IEditorProvider>}
29
23
  */
30
- private static providers;
24
+ private providers;
31
25
  /**
32
26
  * 编辑器适配器注册
33
27
  *
34
28
  * @param {string} tag 适配器标识
35
29
  * @param {() => IEditorProvider} provider 编辑器提供者
36
30
  */
37
- static register(tag: string, provider: () => IEditorProvider): void;
31
+ register(tag: string, provider: () => IEditorProvider): void;
38
32
  /**
39
33
  * 编辑器适配器注销
40
34
  *
41
35
  * @author zhanghanrui
42
36
  * @date 2024-03-27 10:03:29
43
- * @static
44
37
  * @param {string} tag
45
38
  */
46
- static unregister(tag: string): void;
39
+ unregister(tag: string): void;
47
40
  /**
48
41
  * 获取编辑器适配器
49
42
  *
50
43
  * @author zhanghanrui
51
44
  * @date 2024-03-27 10:03:16
52
- * @static
53
45
  * @param {string} tag
54
46
  * @return {*} {(IEditorProvider | null)}
55
47
  */
56
- static get(tag: string): IEditorProvider | null;
48
+ get(tag: string): IEditorProvider | null;
57
49
  }
@@ -1,59 +1,50 @@
1
- "use strict";
2
1
  class EditorRegister {
3
2
  /**
4
3
  * 编辑器集合
5
4
  *
6
- * @author zhanghanrui
7
- * @date 2024-03-27 10:03:25
8
5
  * @private
9
- * @static
10
6
  * @type {Map<string, () => IEditorProvider>}
11
7
  */
12
- static editors = /* @__PURE__ */ new Map();
8
+ editors = /* @__PURE__ */ new Map();
13
9
  /**
14
10
  * 已经实例化的编辑器集合
15
11
  *
16
- * @author zhanghanrui
17
- * @date 2024-03-27 10:03:43
18
12
  * @private
19
- * @static
20
13
  * @type {Map<string, IEditorProvider>}
21
14
  */
22
- static providers = /* @__PURE__ */ new Map();
15
+ providers = /* @__PURE__ */ new Map();
23
16
  /**
24
17
  * 编辑器适配器注册
25
18
  *
26
19
  * @param {string} tag 适配器标识
27
20
  * @param {() => IEditorProvider} provider 编辑器提供者
28
21
  */
29
- static register(tag, provider) {
30
- EditorRegister.editors.set(tag, provider);
22
+ register(tag, provider) {
23
+ this.editors.set(tag, provider);
31
24
  }
32
25
  /**
33
26
  * 编辑器适配器注销
34
27
  *
35
28
  * @author zhanghanrui
36
29
  * @date 2024-03-27 10:03:29
37
- * @static
38
30
  * @param {string} tag
39
31
  */
40
- static unregister(tag) {
41
- EditorRegister.editors.delete(tag);
32
+ unregister(tag) {
33
+ this.editors.delete(tag);
42
34
  }
43
35
  /**
44
36
  * 获取编辑器适配器
45
37
  *
46
38
  * @author zhanghanrui
47
39
  * @date 2024-03-27 10:03:16
48
- * @static
49
40
  * @param {string} tag
50
41
  * @return {*} {(IEditorProvider | null)}
51
42
  */
52
- static get(tag) {
43
+ get(tag) {
53
44
  if (this.providers.has(tag)) {
54
45
  return this.providers.get(tag);
55
46
  }
56
- const provider = EditorRegister.editors.get(tag);
47
+ const provider = this.editors.get(tag);
57
48
  if (provider) {
58
49
  const instance = provider();
59
50
  this.providers.set(tag, instance);
@@ -2,8 +2,6 @@ import { IFormItemProvider } from '../../interface';
2
2
  /**
3
3
  * 表单项适配器注册器
4
4
  *
5
- * @author zhanghanrui
6
- * @date 2024-04-01 13:04:12
7
5
  * @export
8
6
  * @class FormItemRegister
9
7
  */
@@ -11,37 +9,28 @@ export declare class FormItemRegister {
11
9
  /**
12
10
  * 编辑器集合
13
11
  *
14
- * @author zhanghanrui
15
- * @date 2024-03-27 10:03:25
16
12
  * @private
17
- * @static
18
13
  * @type {Map<string, () => IFormItemProvider>}
19
14
  */
20
- private static items;
15
+ private items;
21
16
  /**
22
17
  * 编辑器适配器注册
23
18
  *
24
19
  * @param {string} tag 适配器标识
25
20
  * @param {() => IFormItemProvider} provider 编辑器提供者
26
21
  */
27
- static register(tag: string, provider: () => IFormItemProvider): void;
22
+ register(tag: string, provider: () => IFormItemProvider): void;
28
23
  /**
29
24
  * 编辑器适配器注销
30
25
  *
31
- * @author zhanghanrui
32
- * @date 2024-03-27 10:03:29
33
- * @static
34
26
  * @param {string} tag
35
27
  */
36
- static unregister(tag: string): void;
28
+ unregister(tag: string): void;
37
29
  /**
38
30
  * 获取编辑器适配器
39
31
  *
40
- * @author zhanghanrui
41
- * @date 2024-03-27 10:03:16
42
- * @static
43
32
  * @param {string} tag
44
33
  * @return {*} {(IFormItemProvider | null)}
45
34
  */
46
- static create(tag: string): IFormItemProvider | null;
35
+ create(tag: string): IFormItemProvider | null;
47
36
  }
@@ -1,46 +1,36 @@
1
- "use strict";
2
1
  class FormItemRegister {
3
2
  /**
4
3
  * 编辑器集合
5
4
  *
6
- * @author zhanghanrui
7
- * @date 2024-03-27 10:03:25
8
5
  * @private
9
- * @static
10
6
  * @type {Map<string, () => IFormItemProvider>}
11
7
  */
12
- static items = /* @__PURE__ */ new Map();
8
+ items = /* @__PURE__ */ new Map();
13
9
  /**
14
10
  * 编辑器适配器注册
15
11
  *
16
12
  * @param {string} tag 适配器标识
17
13
  * @param {() => IFormItemProvider} provider 编辑器提供者
18
14
  */
19
- static register(tag, provider) {
20
- FormItemRegister.items.set(tag, provider);
15
+ register(tag, provider) {
16
+ this.items.set(tag, provider);
21
17
  }
22
18
  /**
23
19
  * 编辑器适配器注销
24
20
  *
25
- * @author zhanghanrui
26
- * @date 2024-03-27 10:03:29
27
- * @static
28
21
  * @param {string} tag
29
22
  */
30
- static unregister(tag) {
31
- FormItemRegister.items.delete(tag);
23
+ unregister(tag) {
24
+ this.items.delete(tag);
32
25
  }
33
26
  /**
34
27
  * 获取编辑器适配器
35
28
  *
36
- * @author zhanghanrui
37
- * @date 2024-03-27 10:03:16
38
- * @static
39
29
  * @param {string} tag
40
30
  * @return {*} {(IFormItemProvider | null)}
41
31
  */
42
- static create(tag) {
43
- const provider = FormItemRegister.items.get(tag);
32
+ create(tag) {
33
+ const provider = this.items.get(tag);
44
34
  if (provider) {
45
35
  const instance = provider();
46
36
  return instance;
@@ -1,4 +1,21 @@
1
- export { DesignerRegister } from './designer-register/designer-register';
1
+ import { EditorRegister } from './editor-register/editor-register';
2
+ import { FormItemRegister } from './form-item-register/form-item-register';
3
+ import { RenderRegister } from './render-register/render-register';
2
4
  export { EditorRegister } from './editor-register/editor-register';
3
5
  export { FormItemRegister } from './form-item-register/form-item-register';
4
6
  export { RenderRegister } from './render-register/render-register';
7
+ /**
8
+ * 综合性注册中心
9
+ *
10
+ * @export
11
+ * @interface IGlobalRegister
12
+ */
13
+ export interface IGlobalRegister {
14
+ render: {
15
+ pad: RenderRegister;
16
+ mobile: RenderRegister;
17
+ web: RenderRegister;
18
+ };
19
+ editor: EditorRegister;
20
+ formItem: FormItemRegister;
21
+ }
@@ -1,6 +1,5 @@
1
1
  import { SyncSeriesHook } from 'qx-util';
2
2
 
3
- "use strict";
4
3
  class RenderRegister {
5
4
  /**
6
5
  * 组件清单
@@ -1,7 +1,6 @@
1
1
  import { createRouter, createWebHashHistory } from 'vue-router';
2
2
  import 'vue';
3
3
 
4
- "use strict";
5
4
  const routes = [];
6
5
  class RouterUtil {
7
6
  router;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  class FormState {
3
2
  loaded = false;
4
3
  isNew = true;
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormCollapseState extends FormItemBasicState {
5
4
  }
6
5
 
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormCollapsePaneState extends FormItemBasicState {
5
4
  }
6
5
 
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormEditItemState extends FormItemBasicState {
5
4
  label = "";
6
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormGroupState extends FormItemBasicState {
5
4
  /**
6
5
  * 是否在展开状态
@@ -1,6 +1,5 @@
1
1
  import { FormEditItemState } from '../form-edit-item/form-edit-item.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormItemState extends FormEditItemState {
5
4
  }
6
5
 
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  class FormItemBasicState {
3
2
  disabled = false;
4
3
  readonly = false;
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormTabState extends FormItemBasicState {
5
4
  activePane = "";
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import { FormItemBasicState } from '../form-item-basic/form-item-basic.state.mjs';
2
2
 
3
- "use strict";
4
3
  class FormTabPaneState extends FormItemBasicState {
5
4
  }
6
5
 
@@ -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,51 @@
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 '../utils/mitt/mitt.mjs';
4
+ import 'lodash-es';
5
+ import '../enums/app-designer/index.mjs';
6
+ import '../enums/page-designer/designer.mjs';
7
+ import '../enums/breakpointEnum.mjs';
8
+ import 'path-browserify';
9
+ import { parseMatrixParams } from '../utils/tools/tools.mjs';
10
+ import 'vue';
11
+ import 'axios';
12
+ import '@fingerprintjs/fingerprintjs';
7
13
 
8
- "use strict";
9
14
  const useGlobalStore = defineStore("global-store", {
10
15
  state() {
11
16
  return new GlobalPiniaState();
12
17
  },
13
18
  getters: {
14
- tenantList() {
15
- return this.userInfo.tenantList || [];
19
+ getProjectName() {
20
+ return this.projectName;
21
+ },
22
+ geLang() {
23
+ return this.lang;
24
+ },
25
+ getAppInfo() {
26
+ return this.appInfo;
16
27
  }
17
28
  },
18
29
  actions: {
19
- setProjectName(name) {
20
- this.$state.projectName = name;
21
- },
22
- setTenantId(id) {
23
- this.$state.tenantId = id;
30
+ async init() {
31
+ const paramStr = location.pathname.split("/")[2];
32
+ if (paramStr) {
33
+ const params = parseMatrixParams(paramStr);
34
+ if (params) {
35
+ this.context = params;
36
+ }
37
+ }
24
38
  },
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;
39
+ async loadAppInfo() {
40
+ const res = await _api.apaas.designerCommon.getGetApp();
41
+ console.log(res);
42
+ this.appInfo = res;
42
43
  },
43
- async loadUserInfo() {
44
- const res = await _gct.api.platform.user.getInfo();
45
- this.$state.userInfo = res.data;
46
- return res.data;
44
+ setProjectName(name) {
45
+ this.projectName = name;
47
46
  },
48
- async loadTenantUserInfo() {
49
- const res = await _gct.api.platform.tenant.getUserInfo();
50
- this.$state.tenantUserInfo = res.data;
51
- return res.data;
47
+ setLang(lang) {
48
+ this.lang = lang;
52
49
  }
53
50
  }
54
51
  });
@@ -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
  *
@@ -1,11 +1,9 @@
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) => {
6
+ config.headers["Lang"] = _gct.store.lang;
9
7
  if (!config.headers) {
10
8
  config.headers = new AxiosHeaders();
11
9
  }
@@ -13,27 +11,9 @@ function interceptors(axios) {
13
11
  Token: getToken(),
14
12
  Source: isMobile ? 502 : 501,
15
13
  Lang: _gct.store.lang,
16
- "Tenant-Id": _gct.store.tenantId,
14
+ "Tenant-Id": getTenant(),
17
15
  Timezone: getTimezone()
18
16
  });
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
17
  return config;
38
18
  });
39
19
  }