@gct-paas/core 0.1.4-dev.10 → 0.1.4-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.min.js +21679 -0
- package/es/constants/core.mjs +5 -4
- package/es/constants/default-date-type/default-date-type.d.ts +70 -0
- package/es/constants/default-date-type/default-date-type.mjs +74 -0
- package/es/constants/editor-register/editor-register.mjs +17 -5
- package/es/constants/expression-type/BuiltOperators.mjs +152 -145
- package/es/constants/expression-type/FunctionKeys.mjs +75 -79
- package/es/constants/expression-type/editor.mjs +10 -3
- package/es/constants/expression-type/function.mjs +602 -613
- package/es/constants/expression-type/index.mjs +111 -113
- package/es/constants/expression-type/modeCfg.mjs +256 -263
- package/es/constants/expression-type/variable.mjs +43 -39
- package/es/constants/form-container-type/form-container-type.mjs +17 -5
- package/es/constants/index.d.ts +2 -1
- package/es/constants/index.mjs +30 -10
- package/es/constants/page-designer/model.d.ts +4 -0
- package/es/constants/page-designer/model.mjs +17 -0
- package/es/create-app-vue.mjs +15 -9
- package/es/enums/app-designer/index.d.ts +19 -0
- package/es/enums/app-designer/index.mjs +131 -63
- package/es/enums/appEnum.mjs +681 -360
- package/es/enums/appStateEnum.mjs +17 -10
- package/es/enums/authActionEnum.mjs +63 -51
- package/es/enums/breakpointEnum.mjs +27 -26
- package/es/enums/cacheEnum.mjs +22 -21
- package/es/enums/designEnum.mjs +110 -71
- package/es/enums/developer-center/integration.mjs +7 -6
- package/es/enums/exceptionEnum.mjs +21 -17
- package/es/enums/expressionEnum.d.ts +1 -1
- package/es/enums/expressionEnum.mjs +81 -74
- package/es/enums/globalEnum.d.ts +15 -0
- package/es/enums/globalEnum.mjs +60 -25
- package/es/enums/httpEnum.mjs +71 -61
- package/es/enums/index.mjs +43 -14
- package/es/enums/menuEnum.mjs +42 -38
- package/es/enums/page-designer/designer.mjs +403 -407
- package/es/enums/page-designer/index.mjs +4 -0
- package/es/enums/page-designer/panel.mjs +341 -213
- package/es/enums/page-designer/toolkit.mjs +13 -12
- package/es/enums/page-designer/widget.d.ts +5 -0
- package/es/enums/page-designer/widget.mjs +426 -334
- package/es/enums/pageEnum.mjs +14 -13
- package/es/enums/plugin-enum.mjs +23 -7
- package/es/enums/processEnum.mjs +95 -60
- package/es/enums/roleEnum.mjs +7 -6
- package/es/enums/sizeEnum.d.ts +18 -0
- package/es/enums/sizeEnum.mjs +28 -8
- package/es/global/gct/gct.d.ts +9 -3
- package/es/global/gct/gct.mjs +84 -91
- package/es/global/index.mjs +1 -0
- package/es/hooks/index.d.ts +0 -2
- package/es/hooks/index.mjs +4 -0
- package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
- package/es/hooks/use-modal/use-modal.mjs +16 -10
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
- package/es/hooks/useCopyToClipboard.mjs +50 -50
- package/es/index.d.ts +1 -3
- package/es/index.mjs +122 -134
- package/es/interface/i-dictionary/i-dictionary-item.d.ts +6 -0
- package/es/interface/i-global-register/i-global-register.d.ts +8 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +4 -0
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +2 -0
- package/es/interface/i-pinia-state/i-global-state.d.ts +12 -1
- package/es/interface/index.d.ts +3 -6
- package/es/interface/model-desginer/entity.d.ts +110 -0
- package/es/interface/provider/index.d.ts +0 -2
- package/es/locale/index.mjs +43 -57
- package/es/modules/env-manager/env-manager.const.mjs +16 -8
- package/es/modules/env-manager/env-manager.interface.mjs +14 -7
- package/es/modules/env-manager/env-manager.mjs +104 -107
- package/es/modules/error-handler/error-handler.const.mjs +11 -16
- package/es/modules/error-handler/error-strategy.mjs +199 -175
- package/es/modules/error-handler/index.mjs +120 -106
- package/es/modules/mqtt/constants/mqtt.const.d.ts +33 -0
- package/es/modules/mqtt/constants/mqtt.const.mjs +24 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +20 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.mjs +24 -0
- package/es/modules/mqtt/index.d.ts +5 -0
- package/es/modules/mqtt/index.mjs +4 -0
- package/es/modules/mqtt/interfaces/i-mqtt.d.ts +139 -0
- package/es/modules/mqtt/mqtt-client.d.ts +117 -0
- package/es/modules/mqtt/mqtt-client.mjs +229 -0
- package/es/modules/mqtt/mqtt-manager.d.ts +87 -0
- package/es/modules/mqtt/mqtt-manager.mjs +118 -0
- package/es/modules/platform-config/constants/index.mjs +4 -0
- package/es/modules/platform-config/constants/login.const.mjs +48 -45
- package/es/modules/platform-config/constants/org.const.mjs +57 -52
- package/es/modules/platform-config/constants/theme.const.mjs +11 -4
- package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
- package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
- package/es/modules/platform-config/enums/login.enum.mjs +29 -15
- package/es/modules/platform-config/enums/platform.enum.d.ts +0 -15
- package/es/modules/platform-config/enums/platform.enum.mjs +17 -26
- package/es/modules/platform-config/index.mjs +9 -0
- package/es/modules/platform-config/interfaces/index.d.ts +0 -1
- package/es/modules/platform-config/store.mjs +68 -76
- package/es/modules/platform-config/useBasicSetting.mjs +47 -35
- package/es/modules/platform-config/useDeploySetting.mjs +29 -21
- package/es/modules/platform-config/useLoginSetting.mjs +151 -173
- package/es/modules/platform-config/useOrgSetting.mjs +63 -62
- package/es/modules/platform-config/useProjectSetting.mjs +14 -6
- package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
- package/es/modules/platform-config/useThemeSetting.mjs +78 -59
- package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
- package/es/modules/user-stores/index.mjs +3 -0
- package/es/modules/user-stores/store/permission.store.mjs +27 -36
- package/es/modules/user-stores/store/tenant.store.mjs +20 -22
- package/es/modules/user-stores/store/user.store.d.ts +74 -0
- package/es/modules/user-stores/store/user.store.mjs +94 -102
- package/es/modules/user-stores/types/user.d.ts +1 -0
- package/es/router/index.mjs +25 -28
- package/es/setup-app.mjs +23 -28
- package/es/state/global-pinia-state/global-pinia-state.d.ts +15 -1
- package/es/state/global-pinia-state/global-pinia-state.mjs +49 -57
- package/es/state/index.d.ts +0 -9
- package/es/state/index.mjs +1 -0
- package/es/store/global-store.mjs +50 -58
- package/es/store/index.mjs +25 -19
- package/es/types/index.d.ts +7 -0
- package/es/utils/axios/interceptors.mjs +21 -17
- package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
- package/es/utils/design/design.d.ts +11 -0
- package/es/utils/design/design.mjs +21 -0
- package/es/utils/deviceFingerprint.mjs +74 -63
- package/es/utils/dictionary/dictionary.mjs +142 -145
- package/es/utils/file/base64Conver.d.ts +9 -0
- package/es/utils/file/base64Conver.mjs +40 -0
- package/es/utils/file/download.d.ts +44 -0
- package/es/utils/file/download.mjs +103 -0
- package/es/utils/file/parser.d.ts +3 -0
- package/es/utils/file/parser.mjs +29 -0
- package/es/utils/i18n/index.mjs +14 -3
- package/es/utils/index.d.ts +7 -2
- package/es/utils/index.mjs +31 -0
- package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
- package/es/utils/linked-list/linked-list.mjs +115 -118
- package/es/utils/linked-node/linked-node.mjs +41 -31
- package/es/utils/lowcode/utils.mjs +13 -18
- package/es/utils/lowcode/validate.mjs +20 -26
- package/es/utils/mitt/mitt.mjs +4 -4
- package/es/utils/model-loader/model-loader.mjs +280 -325
- package/es/utils/namespace/namespace.mjs +178 -164
- package/es/utils/openUtil/index.mjs +2 -0
- package/es/utils/openUtil/modal/modal.mjs +72 -79
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
- package/es/utils/permission.d.ts +19 -0
- package/es/utils/permission.mjs +34 -0
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
- package/es/utils/style/index.mjs +94 -138
- package/es/utils/tools/tools.mjs +86 -54
- package/es/utils/treeHelper/treeHelper.mjs +205 -233
- package/es/utils/uploader/uploader.d.ts +20 -0
- package/es/utils/uploader/uploader.mjs +86 -0
- package/es/utils/useUUid.mjs +79 -87
- package/es/utils/util.mjs +55 -35
- package/es/utils/uuid/uuid.d.ts +1 -0
- package/es/utils/uuid/uuid.mjs +36 -43
- package/es/utils/validate.d.ts +5 -0
- package/es/utils/validate.mjs +21 -0
- package/es/utils/value-helper/value-helper.mjs +113 -98
- package/package.json +14 -14
- package/dist/index.esm.min.mjs +0 -8101
- package/dist/index.min.cjs +0 -386
- package/dist/index.system.min.js +0 -386
- package/es/constants/editor-type/editor-type.d.ts +0 -244
- package/es/constants/editor-type/editor-type.mjs +0 -63
- package/es/controller/edit-form/edit-form.controller.d.ts +0 -28
- package/es/controller/edit-form/edit-form.controller.mjs +0 -47
- package/es/controller/editor/color-editor.controller.d.ts +0 -13
- package/es/controller/editor/color-editor.controller.mjs +0 -6
- package/es/controller/editor/length-unit-editor.controller.d.ts +0 -13
- package/es/controller/editor/length-unit-editor.controller.mjs +0 -6
- package/es/controller/editor-item/editor-item.controller.d.ts +0 -14
- package/es/controller/editor-item/editor-item.controller.mjs +0 -8
- package/es/controller/form/form.controller.d.ts +0 -76
- package/es/controller/form/form.controller.mjs +0 -147
- package/es/controller/form-collapse/form-collapse.controller.d.ts +0 -18
- package/es/controller/form-collapse/form-collapse.controller.mjs +0 -14
- package/es/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -18
- package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +0 -14
- package/es/controller/form-edit-item/form-edit-item.controller.d.ts +0 -27
- package/es/controller/form-edit-item/form-edit-item.controller.mjs +0 -74
- package/es/controller/form-group/form-group.controller.d.ts +0 -18
- package/es/controller/form-group/form-group.controller.mjs +0 -14
- package/es/controller/form-item/form-item.controller.d.ts +0 -21
- package/es/controller/form-item/form-item.controller.mjs +0 -43
- package/es/controller/form-item-basic/form-item-basic.controller.d.ts +0 -57
- package/es/controller/form-item-basic/form-item-basic.controller.mjs +0 -49
- package/es/controller/form-item-hidden/form-item-hidden.controller.d.ts +0 -17
- package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -7
- package/es/controller/form-tab/form-tab.controller.d.ts +0 -18
- package/es/controller/form-tab/form-tab.controller.mjs +0 -14
- package/es/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -18
- package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +0 -14
- package/es/controller/gct-form/gct-form.controller.d.ts +0 -101
- package/es/controller/gct-form/gct-form.controller.mjs +0 -214
- package/es/controller/index.d.ts +0 -15
- package/es/hooks/use-form/use-form.d.ts +0 -10
- package/es/hooks/use-form/use-form.mjs +0 -8
- package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +0 -22
- package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -89
- package/es/hooks/use-overlay-scrollbars/use-overlay-scrollbars.d.ts +0 -11
- package/es/interface/controller/edit-form/edit-form.controller.d.ts +0 -26
- package/es/interface/controller/editor/i-color-editor.controller.d.ts +0 -11
- package/es/interface/controller/editor/i-length-unit-editor.controller.d.ts +0 -11
- package/es/interface/controller/editor-item/editor-item.controller.d.ts +0 -19
- package/es/interface/controller/form/form.controller.d.ts +0 -121
- package/es/interface/controller/form-collapse/form-collapse.controller.d.ts +0 -23
- package/es/interface/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -23
- package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +0 -59
- package/es/interface/controller/form-group/form-group.controller.d.ts +0 -24
- package/es/interface/controller/form-hidden-item/form-hidden-item.controller.d.ts +0 -24
- package/es/interface/controller/form-item/form-item.controller.d.ts +0 -40
- package/es/interface/controller/form-item-basic/form-item-basic.controller.d.ts +0 -51
- package/es/interface/controller/form-tab/form-tab.controller.d.ts +0 -23
- package/es/interface/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -23
- package/es/interface/controller/index.d.ts +0 -14
- package/es/interface/events/form/i-form.event.d.ts +0 -11
- package/es/interface/events/index.d.ts +0 -1
- package/es/interface/form/i-editor/i-check-switch.d.ts +0 -29
- package/es/interface/form/i-editor/i-checkbox-editor.d.ts +0 -9
- package/es/interface/form/i-editor/i-color-editor.d.ts +0 -13
- package/es/interface/form/i-editor/i-editor-basic.d.ts +0 -87
- package/es/interface/form/i-editor/i-icon-select-editor.d.ts +0 -21
- package/es/interface/form/i-editor/i-info-editor.d.ts +0 -21
- package/es/interface/form/i-editor/i-length-unit-editor.d.ts +0 -13
- package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +0 -18
- package/es/interface/form/i-editor/i-number-editor.d.ts +0 -21
- package/es/interface/form/i-editor/i-picker-editor.d.ts +0 -30
- package/es/interface/form/i-editor/i-radio-editor.d.ts +0 -21
- package/es/interface/form/i-editor/i-select-editor.d.ts +0 -14
- package/es/interface/form/i-editor/i-span-editor.d.ts +0 -30
- package/es/interface/form/i-editor/i-switch-editor.d.ts +0 -14
- package/es/interface/form/i-editor/i-text-editor.d.ts +0 -46
- package/es/interface/form/i-editor/i-textarea-editor.d.ts +0 -25
- package/es/interface/form/i-form/i-edit-form.d.ts +0 -48
- package/es/interface/form/i-form/i-form-collapse-pane.d.ts +0 -30
- package/es/interface/form/i-form/i-form-collapse.d.ts +0 -35
- package/es/interface/form/i-form/i-form-container.d.ts +0 -53
- package/es/interface/form/i-form/i-form-edit-item.d.ts +0 -140
- package/es/interface/form/i-form/i-form-group-container.d.ts +0 -24
- package/es/interface/form/i-form/i-form-group.d.ts +0 -35
- package/es/interface/form/i-form/i-form-hidden-item.d.ts +0 -11
- package/es/interface/form/i-form/i-form-item-basic.d.ts +0 -126
- package/es/interface/form/i-form/i-form-item.d.ts +0 -11
- package/es/interface/form/i-form/i-form-tab-pane.d.ts +0 -23
- package/es/interface/form/i-form/i-form-tab.d.ts +0 -21
- package/es/interface/form/i-form/i-form.d.ts +0 -79
- package/es/interface/form/index.d.ts +0 -29
- package/es/interface/layout/i-flex-layout/i-flex-container.d.ts +0 -75
- package/es/interface/layout/i-flex-layout/i-flex-item.d.ts +0 -51
- package/es/interface/layout/i-grid-layout/i-grid-container.d.ts +0 -29
- package/es/interface/layout/i-grid-layout/i-grid-item-span.d.ts +0 -54
- package/es/interface/layout/i-grid-layout/i-grid-item.d.ts +0 -37
- package/es/interface/layout/i-layout-basis/i-layout-container-basis.d.ts +0 -11
- package/es/interface/layout/index.d.ts +0 -6
- package/es/interface/provider/i-editor-provider/i-editor-provider.d.ts +0 -24
- package/es/interface/provider/i-form-item-provider/i-form-item-provider.d.ts +0 -44
- package/es/interface/state/form/form.state.d.ts +0 -53
- package/es/interface/state/form-collapse/form-collapse.state.d.ts +0 -11
- package/es/interface/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -11
- package/es/interface/state/form-edit-item/form-edit-item.state.d.ts +0 -38
- package/es/interface/state/form-group/form-group.state.d.ts +0 -21
- package/es/interface/state/form-hidden-item/form-hidden-item.state.d.ts +0 -5
- package/es/interface/state/form-item/form-item.state.d.ts +0 -20
- package/es/interface/state/form-item-basic/form-item-basic.state.d.ts +0 -63
- package/es/interface/state/form-tab/form-tab.state.d.ts +0 -19
- package/es/interface/state/form-tab-pane/form-tab-pane.state.d.ts +0 -11
- package/es/interface/state/index.d.ts +0 -10
- package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +0 -7
- package/es/register/editor-register/editor-register.d.ts +0 -49
- package/es/register/editor-register/editor-register.mjs +0 -57
- package/es/register/form-item-register/form-item-register.d.ts +0 -36
- package/es/register/form-item-register/form-item-register.mjs +0 -42
- package/es/register/index.d.ts +0 -14
- package/es/state/form/form.state.d.ts +0 -24
- package/es/state/form/form.state.mjs +0 -16
- package/es/state/form-collapse/form-collapse.state.d.ts +0 -14
- package/es/state/form-collapse/form-collapse.state.mjs +0 -6
- package/es/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -14
- package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -6
- package/es/state/form-edit-item/form-edit-item.state.d.ts +0 -17
- package/es/state/form-edit-item/form-edit-item.state.mjs +0 -10
- package/es/state/form-group/form-group.state.d.ts +0 -21
- package/es/state/form-group/form-group.state.mjs +0 -14
- package/es/state/form-item/form-item.state.d.ts +0 -14
- package/es/state/form-item/form-item.state.mjs +0 -6
- package/es/state/form-item-basic/form-item-basic.state.d.ts +0 -17
- package/es/state/form-item-basic/form-item-basic.state.mjs +0 -9
- package/es/state/form-tab/form-tab.state.d.ts +0 -15
- package/es/state/form-tab/form-tab.state.mjs +0 -7
- package/es/state/form-tab-pane/form-tab-pane.state.d.ts +0 -14
- package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -6
- package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +0 -63
- package/es/utils/props/gct-form-item/gct-form-item.props.mjs +0 -66
- package/es/utils/props/index.d.ts +0 -1
- package/es/utils/width-install/width-install.d.ts +0 -17
- package/es/utils/width-install/width-install.mjs +0 -23
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { FIELD_TYPE, FieldDefaultValueTypeEnum, FieldSysVarDefaultValueEnum, UniqueConstraintType } from '../../enums';
|
|
2
|
+
export interface FieldFormState {
|
|
3
|
+
id?: string;
|
|
4
|
+
modelKey: string;
|
|
5
|
+
name: string;
|
|
6
|
+
key: string;
|
|
7
|
+
type: FIELD_TYPE;
|
|
8
|
+
required: number;
|
|
9
|
+
parentField?: number;
|
|
10
|
+
uniqueConstraint: {
|
|
11
|
+
type: UniqueConstraintType;
|
|
12
|
+
fieldKeys?: string[];
|
|
13
|
+
};
|
|
14
|
+
/** 默认值 */
|
|
15
|
+
defaultValue: {
|
|
16
|
+
type: FieldDefaultValueTypeEnum;
|
|
17
|
+
value?: string | number | boolean | FieldSysVarDefaultValueEnum;
|
|
18
|
+
name?: string;
|
|
19
|
+
};
|
|
20
|
+
description: string;
|
|
21
|
+
/** 字段特性配置 */
|
|
22
|
+
specificConfig: {
|
|
23
|
+
/**数值/长度限制 */
|
|
24
|
+
minValue?: number;
|
|
25
|
+
/**数值/长度限制 */
|
|
26
|
+
maxValue?: number;
|
|
27
|
+
/**数值精度 */
|
|
28
|
+
digits?: number;
|
|
29
|
+
/** 布尔 true 文案 */
|
|
30
|
+
true?: string;
|
|
31
|
+
/** 布尔 false 文案 */
|
|
32
|
+
false?: string;
|
|
33
|
+
/** 上传数量 */
|
|
34
|
+
maxNumber?: number;
|
|
35
|
+
/** 文件大小 */
|
|
36
|
+
fileSize?: number;
|
|
37
|
+
/** 文件类型 */
|
|
38
|
+
fileTypes?: string[];
|
|
39
|
+
ruleType?: string;
|
|
40
|
+
/** 显示规则 人员、模型应用 */
|
|
41
|
+
displayRule?: {
|
|
42
|
+
exp: string;
|
|
43
|
+
exprInEditor: string;
|
|
44
|
+
relationColumns: string[];
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* 公式新增参数
|
|
48
|
+
* 2024年11月21日
|
|
49
|
+
*/
|
|
50
|
+
expType?: string;
|
|
51
|
+
/**实时计算 */
|
|
52
|
+
expRealCompute?: boolean;
|
|
53
|
+
/** 公式配置 */
|
|
54
|
+
expConfig?: unknown | {
|
|
55
|
+
exp: string;
|
|
56
|
+
expression: string;
|
|
57
|
+
relationColumns: string[];
|
|
58
|
+
};
|
|
59
|
+
/** 汇总配置 */
|
|
60
|
+
aggConfig?: {
|
|
61
|
+
/** 汇总类型 */
|
|
62
|
+
aggFunc: string;
|
|
63
|
+
/** 汇总字段名 */
|
|
64
|
+
relationColumns: string[];
|
|
65
|
+
};
|
|
66
|
+
ruleConfig?: unknown | {
|
|
67
|
+
nodes: IObject[];
|
|
68
|
+
designJson: IObject;
|
|
69
|
+
fieldKey: string;
|
|
70
|
+
};
|
|
71
|
+
[k: string]: unknown;
|
|
72
|
+
/**枚举 */
|
|
73
|
+
customEnumConfig?: {
|
|
74
|
+
enabled: number;
|
|
75
|
+
values: string[];
|
|
76
|
+
};
|
|
77
|
+
/**前端公式 */
|
|
78
|
+
formulaConfig?: {
|
|
79
|
+
exp: string;
|
|
80
|
+
expression: string;
|
|
81
|
+
showQrCode?: boolean;
|
|
82
|
+
digits?: number;
|
|
83
|
+
truelabel?: string;
|
|
84
|
+
falselabel?: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/**关联信息KEY 如:枚举/主子/关联 */
|
|
88
|
+
bindInfo?: string;
|
|
89
|
+
/** 主子/引用关联模型类型 */
|
|
90
|
+
refModelType?: string;
|
|
91
|
+
i18nConfig?: string;
|
|
92
|
+
/**
|
|
93
|
+
* 普通数据类型 值为fieldType
|
|
94
|
+
* 映射类型(公式、函数等实际映射的类型)
|
|
95
|
+
*/
|
|
96
|
+
mappingType?: string;
|
|
97
|
+
/** 主子关联 绑定子模型字段 */
|
|
98
|
+
bindFieldKey?: string;
|
|
99
|
+
/** 在线表单新建字段中的子模型key */
|
|
100
|
+
subModelKey?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface SpecificConfig {
|
|
103
|
+
exp?: string;
|
|
104
|
+
expression?: string;
|
|
105
|
+
relationColumns?: IObject[];
|
|
106
|
+
aggFunc?: string;
|
|
107
|
+
bindField?: string;
|
|
108
|
+
refModelType?: string;
|
|
109
|
+
digits?: number;
|
|
110
|
+
}
|
package/es/locale/index.mjs
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import { createI18n } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
acc[key] = value.join(":");
|
|
43
|
-
return acc;
|
|
44
|
-
}, {});
|
|
45
|
-
this.i18n.global.mergeLocaleMessage(locale, messages);
|
|
46
|
-
}
|
|
47
|
-
getMessageUrl(payload) {
|
|
48
|
-
if ("app" in payload) {
|
|
49
|
-
const tag = payload.env === "dev" ? `dev_${payload.branch}` : payload.env;
|
|
50
|
-
return `minio/${payload.app}/locale-js/${tag}/${payload.locale}__.json`;
|
|
51
|
-
}
|
|
52
|
-
return `/minio/locale-js/${payload.locale}__platform__.json`;
|
|
53
|
-
}
|
|
54
|
-
// changeLocale(locale: string) {}
|
|
55
|
-
}
|
|
1
|
+
import { createI18n } from "vue-i18n";
|
|
2
|
+
//#region src/locale/index.ts
|
|
3
|
+
var LocaleUtil = class {
|
|
4
|
+
i18n = createI18n({
|
|
5
|
+
legacy: false,
|
|
6
|
+
locale: "zh-CN",
|
|
7
|
+
fallbackLocale: "en",
|
|
8
|
+
messages: {
|
|
9
|
+
en: { message: { hello: "hello world" } },
|
|
10
|
+
ja: { message: { hello: "こんにちは、世界" } }
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
locale = "zh-CN";
|
|
14
|
+
constructor() {
|
|
15
|
+
this.init();
|
|
16
|
+
}
|
|
17
|
+
async init() {
|
|
18
|
+
await this.loadLocales();
|
|
19
|
+
const platformUrl = this.getMessageUrl({ locale: this.locale });
|
|
20
|
+
await this.loadMessages(platformUrl);
|
|
21
|
+
}
|
|
22
|
+
async loadLocales() {
|
|
23
|
+
const res = await (await fetch("/gct-platform/api/i18n-config/list")).json();
|
|
24
|
+
if (res.code === 200) this.locale = res.data.find((item) => item.defaultLanguage).languageTag;
|
|
25
|
+
}
|
|
26
|
+
async loadMessages(url, locale = this.locale) {
|
|
27
|
+
const messages = (await (await fetch(url)).text()).split("\n").reduce((acc, item) => {
|
|
28
|
+
const [key, ...value] = item.split(":");
|
|
29
|
+
acc[key] = value.join(":");
|
|
30
|
+
return acc;
|
|
31
|
+
}, {});
|
|
32
|
+
this.i18n.global.mergeLocaleMessage(locale, messages);
|
|
33
|
+
}
|
|
34
|
+
getMessageUrl(payload) {
|
|
35
|
+
if ("app" in payload) {
|
|
36
|
+
const tag = payload.env === "dev" ? `dev_${payload.branch}` : payload.env;
|
|
37
|
+
return `minio/${payload.app}/locale-js/${tag}/${payload.locale}__.json`;
|
|
38
|
+
}
|
|
39
|
+
return `/minio/locale-js/${payload.locale}__platform__.json`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
56
42
|
function setupI18n(app) {
|
|
57
|
-
|
|
43
|
+
app.use(_gct.i18n);
|
|
58
44
|
}
|
|
59
|
-
|
|
45
|
+
//#endregion
|
|
60
46
|
export { LocaleUtil, setupI18n };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
//#region src/modules/env-manager/env-manager.const.ts
|
|
2
|
+
/** IP地址正则表达式 */
|
|
3
|
+
var IP_REG = /^http:\/\/\d{1,3}(\.\d{1,3}){3}:(\d{1,5})$/;
|
|
4
|
+
/** 域名正则表达式 */
|
|
5
|
+
var HOST_REG = /^https?:\/\/([a-z0-9]+)-test\./;
|
|
6
|
+
/** 应用运行时路径正则表达式 */
|
|
7
|
+
var APP_RUN_PATH_REG = /\/web-render|\/web\/|web-single\/|dev-single\/|test-single\//;
|
|
8
|
+
/** 应用生产环境路径正则表达式 */
|
|
9
|
+
var APP_PROD_PATH_REG = /\/web\/|\/web-single\//;
|
|
10
|
+
/** 应用预览环境路径正则表达式 */
|
|
11
|
+
var APP_PREVIEW_PATH_REG = /\/web-render\//;
|
|
12
|
+
/** dev环境单应用路径正则表达式 */
|
|
13
|
+
var DEV_SINGLE_PATH_REG = /\/dev-single\//;
|
|
14
|
+
/** 测试环境单应用路径正则表达式 */
|
|
15
|
+
var TEST_SINGLE_PATH_REG = /\/test-single\//;
|
|
16
|
+
//#endregion
|
|
9
17
|
export { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, TEST_SINGLE_PATH_REG };
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/modules/env-manager/env-manager.interface.ts
|
|
2
|
+
/**
|
|
3
|
+
* 环境类型枚举
|
|
4
|
+
*/
|
|
5
|
+
var EnvironmentType = /* @__PURE__ */ function(EnvironmentType) {
|
|
6
|
+
/** 开发环境 */
|
|
7
|
+
EnvironmentType["DEV"] = "dev";
|
|
8
|
+
/** 测试环境 */
|
|
9
|
+
EnvironmentType["TEST"] = "test";
|
|
10
|
+
/** 生产环境 */
|
|
11
|
+
EnvironmentType["PROD"] = "prod";
|
|
12
|
+
return EnvironmentType;
|
|
13
|
+
}({});
|
|
14
|
+
//#endregion
|
|
8
15
|
export { EnvironmentType };
|
|
@@ -1,108 +1,105 @@
|
|
|
1
|
-
import { EnvironmentType } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
1
|
+
import { EnvironmentType } from "./env-manager.interface.mjs";
|
|
2
|
+
import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, TEST_SINGLE_PATH_REG } from "./env-manager.const.mjs";
|
|
3
|
+
//#region src/modules/env-manager/env-manager.ts
|
|
4
|
+
/**
|
|
5
|
+
* 环境管理器
|
|
6
|
+
*
|
|
7
|
+
* @description 负责检测和管理应用运行环境,包括测试环境检测、租户信息获取等功能
|
|
8
|
+
*/
|
|
9
|
+
var EnvironmentManager = class {
|
|
10
|
+
/** 测试环境标识 */
|
|
11
|
+
_testEnv = false;
|
|
12
|
+
/** 测试环境租户数据 */
|
|
13
|
+
_testTenantData = {};
|
|
14
|
+
/** 平台地址 */
|
|
15
|
+
_platformOrigin;
|
|
16
|
+
/** 域名访问模式标识 */
|
|
17
|
+
_isHostMode = false;
|
|
18
|
+
constructor() {
|
|
19
|
+
this._platformOrigin = location.origin || "";
|
|
20
|
+
this._isHostMode = HOST_REG.test(this._platformOrigin);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 是否为应用前端运行时
|
|
24
|
+
*/
|
|
25
|
+
get isAppRun() {
|
|
26
|
+
return APP_RUN_PATH_REG.test(location.pathname);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 是否为应用前端运行时生产环境包含测试环境
|
|
30
|
+
*/
|
|
31
|
+
get isAppProd() {
|
|
32
|
+
return APP_PROD_PATH_REG.test(location.pathname);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 是否为应用前端运行时预览环境
|
|
36
|
+
*/
|
|
37
|
+
get isAppPreview() {
|
|
38
|
+
return APP_PREVIEW_PATH_REG.test(location.pathname);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 是否为dev环境单应用
|
|
42
|
+
*/
|
|
43
|
+
get isDevSingleEnv() {
|
|
44
|
+
return DEV_SINGLE_PATH_REG.test(location.pathname);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 是否为测试环境
|
|
48
|
+
*/
|
|
49
|
+
get isTestEnv() {
|
|
50
|
+
return TEST_SINGLE_PATH_REG.test(location.pathname) || this._testEnv;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 平台地址
|
|
54
|
+
*/
|
|
55
|
+
get platformOrigin() {
|
|
56
|
+
return this._platformOrigin;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 是否为域名访问模式
|
|
60
|
+
*/
|
|
61
|
+
get isHostMode() {
|
|
62
|
+
return this._isHostMode;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 测试环境租户数据
|
|
66
|
+
*/
|
|
67
|
+
get testTenantData() {
|
|
68
|
+
return this._testTenantData;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 检测是否为测试环境
|
|
72
|
+
*/
|
|
73
|
+
async checkIsTestEnv() {
|
|
74
|
+
let matches = null;
|
|
75
|
+
if (this._isHostMode) {
|
|
76
|
+
matches = this._platformOrigin.match(HOST_REG);
|
|
77
|
+
this._testEnv = !!(matches && matches[1]);
|
|
78
|
+
if (this._testEnv) {
|
|
79
|
+
const data = await _api.platform.tenant.getInfoByPortOrDomain({ domain: matches[1] });
|
|
80
|
+
Object.assign(this._testTenantData, data);
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
matches = this._platformOrigin.match(IP_REG);
|
|
84
|
+
const port = matches && matches[2];
|
|
85
|
+
if (port) {
|
|
86
|
+
const data = await _api.platform.tenant.getInfoByPortOrDomain({ port });
|
|
87
|
+
if (data) {
|
|
88
|
+
Object.assign(this._testTenantData, data);
|
|
89
|
+
this._testEnv = data.testEnvPort === port;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 获取当前环境类型
|
|
96
|
+
* @returns 环境类型
|
|
97
|
+
*/
|
|
98
|
+
getEnv() {
|
|
99
|
+
if (this.isTestEnv) return EnvironmentType.TEST;
|
|
100
|
+
else if (this.isAppProd) return EnvironmentType.PROD;
|
|
101
|
+
else return EnvironmentType.DEV;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
108
105
|
export { EnvironmentManager };
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
BAD_GATEWAY: 502,
|
|
12
|
-
/** 服务不可用 */
|
|
13
|
-
SERVICE_UNAVAILABLE: 503,
|
|
14
|
-
/** 网关超时 */
|
|
15
|
-
GATEWAY_TIMEOUT: 504
|
|
1
|
+
//#region src/modules/error-handler/error-handler.const.ts
|
|
2
|
+
/** HTTP 状态码常量 */
|
|
3
|
+
var HTTP_STATUS_CODE = {
|
|
4
|
+
UNAUTHORIZED: 401,
|
|
5
|
+
FORBIDDEN: 403,
|
|
6
|
+
NOT_FOUND: 404,
|
|
7
|
+
INTERNAL_SERVER_ERROR: 500,
|
|
8
|
+
BAD_GATEWAY: 502,
|
|
9
|
+
SERVICE_UNAVAILABLE: 503,
|
|
10
|
+
GATEWAY_TIMEOUT: 504
|
|
16
11
|
};
|
|
17
|
-
|
|
12
|
+
//#endregion
|
|
18
13
|
export { HTTP_STATUS_CODE };
|