@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.
- package/dist/index.esm.min.mjs +4456 -18521
- package/dist/index.min.cjs +14 -2
- package/dist/index.system.min.js +14 -2
- package/es/constants/core.mjs +0 -1
- package/es/constants/editor-register/editor-register.mjs +0 -1
- package/es/constants/editor-type/editor-type.d.ts +65 -1
- package/es/constants/editor-type/editor-type.mjs +14 -1
- package/es/constants/form-container-type/form-container-type.mjs +0 -1
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.mjs +2 -7
- package/es/controller/edit-form/edit-form.controller.mjs +0 -1
- package/es/controller/editor/color-editor.controller.mjs +0 -1
- package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
- package/es/controller/editor-item/editor-item.controller.mjs +0 -1
- package/es/controller/form/form.controller.mjs +5 -4
- package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
- package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
- package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
- package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
- package/es/controller/form-group/form-group.controller.mjs +4 -3
- package/es/controller/form-item/form-item.controller.d.ts +1 -0
- package/es/controller/form-item/form-item.controller.mjs +7 -3
- package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
- package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
- package/es/controller/form-tab/form-tab.controller.mjs +4 -3
- package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
- package/es/controller/gct-form/gct-form.controller.mjs +5 -4
- package/es/create-app-vue.mjs +4 -3
- package/es/enums/app-designer/index.d.ts +13 -1
- package/es/enums/app-designer/index.mjs +8 -2
- package/es/enums/appEnum.d.ts +17 -66
- package/es/enums/appEnum.mjs +18 -14
- package/es/enums/appStateEnum.mjs +0 -1
- package/es/enums/authActionEnum.mjs +0 -1
- package/es/enums/breakpointEnum.mjs +0 -1
- package/es/enums/cacheEnum.mjs +0 -1
- package/es/enums/designEnum.mjs +0 -1
- package/es/enums/exceptionEnum.mjs +0 -1
- package/es/enums/globalEnum.d.ts +38 -0
- package/es/enums/globalEnum.mjs +25 -0
- package/es/enums/httpEnum.mjs +0 -1
- package/es/enums/index.d.ts +13 -0
- package/es/enums/index.mjs +15 -16
- package/es/enums/menuEnum.mjs +0 -1
- package/es/enums/page-designer/designer.d.ts +17 -3
- package/es/enums/page-designer/designer.mjs +85 -6
- package/es/enums/page-designer/panel.mjs +0 -1
- package/es/enums/page-designer/toolkit.mjs +0 -1
- package/es/enums/page-designer/widget.d.ts +2 -1
- package/es/enums/page-designer/widget.mjs +3 -3
- package/es/enums/pageEnum.mjs +0 -1
- package/es/enums/plugin-enum.mjs +0 -1
- package/es/enums/processEnum.mjs +0 -1
- package/es/enums/roleEnum.mjs +0 -1
- package/es/enums/sizeEnum.mjs +0 -1
- package/es/global/gct/gct.d.ts +2 -15
- package/es/global/gct/gct.mjs +19 -17
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
- package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
- package/es/hooks/use-form/use-form.mjs +0 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
- package/es/hooks/use-modal/use-modal.mjs +0 -1
- package/es/hooks/use-namespace/use-namespace.mjs +11 -2
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
- package/es/hooks/useCopyToClipboard.mjs +0 -1
- package/es/index.d.ts +5 -1
- package/es/index.mjs +77 -58
- package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
- package/es/interface/controller/index.d.ts +0 -1
- package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
- package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
- package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
- package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
- package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
- package/es/interface/form/index.d.ts +1 -0
- package/es/interface/i-app-context/i-app-context.d.ts +34 -0
- package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
- package/es/interface/i-global-var/i-global-var.d.ts +15 -0
- package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
- package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
- package/es/interface/index.d.ts +5 -2
- package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
- package/es/interface/state/index.d.ts +0 -1
- package/es/locale/index.mjs +1 -2
- package/es/modules/env-manager/env-manager.const.mjs +0 -1
- package/es/modules/env-manager/env-manager.interface.mjs +0 -1
- package/es/modules/env-manager/env-manager.mjs +7 -8
- package/es/modules/error-handler/error-handler.const.mjs +1 -30
- package/es/modules/error-handler/error-strategy.mjs +0 -1
- package/es/modules/error-handler/index.mjs +0 -1
- package/es/modules/platform-config/constants/index.d.ts +7 -0
- package/es/modules/platform-config/constants/login.const.d.ts +15 -0
- package/es/modules/platform-config/constants/login.const.mjs +50 -0
- package/es/modules/platform-config/constants/org.const.d.ts +9 -0
- package/es/modules/platform-config/constants/org.const.mjs +54 -0
- package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
- package/es/modules/platform-config/constants/theme.const.mjs +5 -0
- package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
- package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
- package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
- package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
- package/es/modules/platform-config/enums/index.d.ts +6 -0
- package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
- package/es/modules/platform-config/enums/login.enum.mjs +16 -0
- package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
- package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
- package/es/modules/platform-config/index.d.ts +6 -17
- package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
- package/es/modules/platform-config/interfaces/index.d.ts +7 -0
- package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
- package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
- package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
- package/es/modules/platform-config/store.d.ts +221 -0
- package/es/modules/platform-config/store.mjs +78 -0
- package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
- package/es/modules/platform-config/useBasicSetting.mjs +39 -0
- package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
- package/es/modules/platform-config/useDeploySetting.mjs +27 -0
- package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
- package/es/modules/platform-config/useLoginSetting.mjs +177 -0
- package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
- package/es/modules/platform-config/useOrgSetting.mjs +66 -0
- package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
- package/es/modules/platform-config/useProjectSetting.mjs +11 -0
- package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
- package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
- package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
- package/es/modules/platform-config/useThemeSetting.mjs +64 -0
- package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
- package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
- package/es/modules/user-stores/index.d.ts +3 -0
- package/es/modules/user-stores/store/permission.store.d.ts +21 -0
- package/es/modules/user-stores/store/permission.store.mjs +38 -0
- package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
- package/es/modules/user-stores/store/tenant.store.mjs +24 -0
- package/es/modules/user-stores/store/user.store.d.ts +154 -0
- package/es/modules/user-stores/store/user.store.mjs +100 -0
- package/es/modules/user-stores/types/permission.d.ts +1 -0
- package/es/modules/user-stores/types/tenant.d.ts +1 -0
- package/es/modules/user-stores/types/user.d.ts +14 -0
- package/es/register/editor-register/editor-register.d.ts +5 -13
- package/es/register/editor-register/editor-register.mjs +8 -17
- package/es/register/form-item-register/form-item-register.d.ts +4 -15
- package/es/register/form-item-register/form-item-register.mjs +7 -17
- package/es/register/index.d.ts +18 -1
- package/es/register/render-register/render-register.mjs +0 -1
- package/es/router/index.mjs +0 -1
- package/es/state/form/form.state.mjs +0 -1
- package/es/state/form-collapse/form-collapse.state.mjs +0 -1
- package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
- package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
- package/es/state/form-group/form-group.state.mjs +0 -1
- package/es/state/form-item/form-item.state.mjs +0 -1
- package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
- package/es/state/form-tab/form-tab.state.mjs +0 -1
- package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
- package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
- package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
- package/es/store/global-store.d.ts +1 -0
- package/es/store/global-store.mjs +34 -37
- package/es/store/index.d.ts +2 -3
- package/es/store/index.mjs +0 -1
- package/es/types/index.d.ts +14 -1
- package/es/utils/axios/interceptors.mjs +3 -23
- package/es/utils/deviceFingerprint.d.ts +17 -0
- package/es/utils/deviceFingerprint.mjs +73 -0
- package/es/utils/dictionary/dictionary.mjs +0 -1
- package/es/utils/i18n/index.d.ts +2 -1
- package/es/utils/i18n/index.mjs +3 -4
- package/es/utils/index.d.ts +11 -2
- package/es/utils/linked-list/linked-list.d.ts +72 -0
- package/es/utils/linked-list/linked-list.mjs +119 -0
- package/es/utils/linked-node/linked-node.d.ts +31 -0
- package/es/utils/linked-node/linked-node.mjs +32 -0
- package/es/utils/mitt/mitt.d.ts +1 -0
- package/es/utils/mitt/mitt.mjs +5 -0
- package/es/utils/model-loader/model-loader.d.ts +118 -0
- package/es/utils/model-loader/model-loader.mjs +326 -0
- package/es/utils/namespace/namespace.mjs +0 -1
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
- package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
- package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
- package/es/utils/props/index.d.ts +1 -0
- package/es/utils/style/index.d.ts +16 -0
- package/es/utils/style/index.mjs +141 -0
- package/es/utils/tools/tools.d.ts +13 -10
- package/es/utils/tools/tools.mjs +19 -11
- package/es/utils/treeHelper/treeHelper.d.ts +117 -0
- package/es/utils/treeHelper/treeHelper.mjs +220 -0
- package/es/utils/util.d.ts +39 -0
- package/es/utils/util.mjs +40 -0
- package/es/utils/value-helper/value-helper.d.ts +49 -0
- package/es/utils/value-helper/value-helper.mjs +109 -0
- package/es/utils/width-install/width-install.mjs +0 -2
- package/package.json +12 -16
- package/es/controller/index.mjs +0 -17
- package/es/enums/page-designer/index.mjs +0 -6
- package/es/global/index.mjs +0 -3
- package/es/hooks/index.mjs +0 -7
- package/es/interface/controller/i-designer-controller.d.ts +0 -116
- package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
- package/es/interface/hooks/index.d.ts +0 -1
- package/es/interface/index.mjs +0 -1
- package/es/interface/low-code-types/index.d.ts +0 -4
- package/es/interface/low-code-types/modal-types.d.ts +0 -67
- package/es/interface/low-code-types/model/index.d.ts +0 -5338
- package/es/interface/low-code-types/schema/index.d.ts +0 -12
- package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
- package/es/interface/state/i-designer-state.d.ts +0 -27
- package/es/modules/env-manager/index.mjs +0 -5
- package/es/modules/platform-config/index.mjs +0 -17
- package/es/modules/platform-config/types.d.ts +0 -67
- package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
- package/es/provider/index.d.ts +0 -1
- package/es/provider/index.mjs +0 -1
- package/es/register/designer-register/designer-register.d.ts +0 -53
- package/es/register/designer-register/designer-register.mjs +0 -68
- package/es/register/index.mjs +0 -6
- package/es/state/index.mjs +0 -12
- package/es/utils/index.mjs +0 -10
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
- 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
|
|
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
|
|
24
|
+
private providers;
|
|
31
25
|
/**
|
|
32
26
|
* 编辑器适配器注册
|
|
33
27
|
*
|
|
34
28
|
* @param {string} tag 适配器标识
|
|
35
29
|
* @param {() => IEditorProvider} provider 编辑器提供者
|
|
36
30
|
*/
|
|
37
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
15
|
+
providers = /* @__PURE__ */ new Map();
|
|
23
16
|
/**
|
|
24
17
|
* 编辑器适配器注册
|
|
25
18
|
*
|
|
26
19
|
* @param {string} tag 适配器标识
|
|
27
20
|
* @param {() => IEditorProvider} provider 编辑器提供者
|
|
28
21
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
43
|
+
get(tag) {
|
|
53
44
|
if (this.providers.has(tag)) {
|
|
54
45
|
return this.providers.get(tag);
|
|
55
46
|
}
|
|
56
|
-
const provider =
|
|
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
|
|
15
|
+
private items;
|
|
21
16
|
/**
|
|
22
17
|
* 编辑器适配器注册
|
|
23
18
|
*
|
|
24
19
|
* @param {string} tag 适配器标识
|
|
25
20
|
* @param {() => IFormItemProvider} provider 编辑器提供者
|
|
26
21
|
*/
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
+
items = /* @__PURE__ */ new Map();
|
|
13
9
|
/**
|
|
14
10
|
* 编辑器适配器注册
|
|
15
11
|
*
|
|
16
12
|
* @param {string} tag 适配器标识
|
|
17
13
|
* @param {() => IFormItemProvider} provider 编辑器提供者
|
|
18
14
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
43
|
-
const provider =
|
|
32
|
+
create(tag) {
|
|
33
|
+
const provider = this.items.get(tag);
|
|
44
34
|
if (provider) {
|
|
45
35
|
const instance = provider();
|
|
46
36
|
return instance;
|
package/es/register/index.d.ts
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
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
|
+
}
|
package/es/router/index.mjs
CHANGED
|
@@ -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 {
|
|
15
|
+
* @type {IObject}
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
appInfo: IObject;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* 当前访问项目名称
|
|
19
20
|
*
|
|
20
|
-
* @type {
|
|
21
|
+
* @type {ProjectName}
|
|
21
22
|
*/
|
|
22
|
-
|
|
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 {
|
|
17
|
+
* @type {IObject}
|
|
10
18
|
*/
|
|
11
|
-
|
|
19
|
+
appInfo = {};
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* 当前访问项目名称
|
|
14
22
|
*
|
|
15
|
-
* @type {
|
|
23
|
+
* @type {ProjectName}
|
|
16
24
|
*/
|
|
17
|
-
|
|
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
|
-
|
|
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,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
|
-
|
|
15
|
-
return this.
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
this.$state.userInfo = res.data;
|
|
46
|
-
return res.data;
|
|
44
|
+
setProjectName(name) {
|
|
45
|
+
this.projectName = name;
|
|
47
46
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.$state.tenantUserInfo = res.data;
|
|
51
|
-
return res.data;
|
|
47
|
+
setLang(lang) {
|
|
48
|
+
this.lang = lang;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
});
|
package/es/store/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
17
|
+
readonly store: IGlobalStore;
|
|
19
18
|
constructor();
|
|
20
19
|
}
|
package/es/store/index.mjs
CHANGED
package/es/types/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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":
|
|
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
|
}
|