@gct-paas/core 0.1.4-dev.0 → 0.1.4-dev.10
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 +8101 -0
- package/dist/index.min.cjs +386 -1
- package/dist/index.system.min.js +386 -1
- 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/expression-type/BuiltOperators.d.ts +20 -0
- package/es/constants/expression-type/BuiltOperators.mjs +149 -0
- package/es/constants/expression-type/FunctionKeys.d.ts +1 -0
- package/es/constants/expression-type/FunctionKeys.mjs +81 -0
- package/es/constants/expression-type/editor.d.ts +8 -0
- package/es/constants/expression-type/editor.mjs +4 -0
- package/es/constants/expression-type/function.d.ts +7 -0
- package/es/constants/expression-type/function.mjs +875 -0
- package/es/constants/expression-type/index.d.ts +42 -0
- package/es/constants/expression-type/index.mjs +120 -0
- package/es/constants/expression-type/modeCfg.d.ts +30 -0
- package/es/constants/expression-type/modeCfg.mjs +268 -0
- package/es/constants/expression-type/variable.d.ts +12 -0
- package/es/constants/expression-type/variable.mjs +42 -0
- package/es/constants/form-container-type/form-container-type.mjs +0 -1
- package/es/constants/index.d.ts +9 -0
- package/es/constants/index.mjs +7 -6
- 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 -5
- 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 -5
- package/es/create-app-vue.d.ts +8 -0
- package/es/create-app-vue.mjs +12 -0
- 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 +22 -66
- package/es/enums/appEnum.mjs +24 -15
- 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.d.ts +9 -3
- package/es/enums/designEnum.mjs +34 -32
- package/es/enums/developer-center/index.d.ts +1 -0
- package/es/enums/developer-center/integration.d.ts +4 -0
- package/es/enums/developer-center/integration.mjs +7 -0
- package/es/enums/exceptionEnum.mjs +0 -1
- package/es/enums/expressionEnum.d.ts +130 -0
- package/es/enums/expressionEnum.mjs +75 -0
- 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 +19 -0
- package/es/enums/index.mjs +13 -20
- package/es/enums/menuEnum.mjs +0 -1
- package/es/enums/page-designer/designer.d.ts +23 -3
- package/es/enums/page-designer/designer.mjs +90 -6
- package/es/enums/page-designer/panel.d.ts +78 -7
- package/es/enums/page-designer/panel.mjs +22 -4
- 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.d.ts +54 -0
- package/es/enums/processEnum.mjs +36 -2
- package/es/enums/roleEnum.mjs +0 -1
- package/es/enums/sizeEnum.mjs +0 -1
- package/es/global/gct/gct.d.ts +39 -25
- package/es/global/gct/gct.mjs +49 -27
- package/es/hooks/index.d.ts +2 -1
- 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-overlay-scrollbars/use-overlay-scrollbars.d.ts +11 -0
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +27 -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 +7 -9
- package/es/index.mjs +94 -48
- 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 +7 -4
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -5
- package/es/interface/i-pinia-state/i-global-state.d.ts +7 -2
- package/es/interface/index.d.ts +5 -6
- package/es/interface/open-util/i-message-util/i-message-util.d.ts +54 -0
- package/es/interface/{i-modal → open-util/i-modal}/i-modal.d.ts +9 -10
- package/es/interface/{i-modal-data → open-util/i-modal-data}/i-modal-data.d.ts +6 -0
- package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +12 -0
- package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
- package/es/interface/open-util/i-overlay-container/i-overlay-container.d.ts +36 -0
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +36 -0
- package/es/interface/open-util/index.d.ts +7 -0
- package/es/interface/state/index.d.ts +0 -1
- package/es/locale/index.d.ts +19 -0
- package/es/locale/index.mjs +60 -0
- package/es/modules/env-manager/env-manager.const.d.ts +14 -0
- package/es/modules/env-manager/env-manager.const.mjs +9 -0
- package/es/modules/env-manager/env-manager.d.ts +59 -0
- package/es/modules/env-manager/env-manager.interface.d.ts +43 -0
- package/es/modules/env-manager/env-manager.interface.mjs +8 -0
- package/es/modules/env-manager/env-manager.mjs +108 -0
- package/es/modules/env-manager/index.d.ts +3 -0
- package/es/modules/error-handler/error-handler.const.d.ts +48 -0
- package/es/modules/error-handler/error-handler.const.mjs +18 -0
- package/es/modules/error-handler/error-handler.interface.d.ts +51 -0
- package/es/modules/error-handler/error-strategy.d.ts +138 -0
- package/es/modules/error-handler/error-strategy.mjs +175 -0
- package/es/modules/error-handler/index.d.ts +78 -0
- package/es/modules/error-handler/index.mjs +108 -0
- 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/enums/login.enum.d.ts +25 -0
- 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 +8 -0
- 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 +11 -0
- package/es/modules/platform-config/useBasicSetting.mjs +39 -0
- package/es/modules/platform-config/useDeploySetting.d.ts +19 -0
- package/es/modules/platform-config/useDeploySetting.mjs +27 -0
- package/es/modules/platform-config/useLoginSetting.d.ts +15 -0
- package/es/modules/platform-config/useLoginSetting.mjs +177 -0
- package/es/modules/platform-config/useOrgSetting.d.ts +34 -0
- 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 +11 -0
- package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
- package/es/modules/platform-config/useThemeSetting.d.ts +16 -0
- package/es/modules/platform-config/useThemeSetting.mjs +64 -0
- package/es/modules/platform-config/useWatermarkSetting.d.ts +21 -0
- 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 +108 -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 +12 -2
- package/es/router/index.d.ts +13 -0
- package/es/router/index.mjs +31 -0
- package/es/setup-app.d.ts +8 -0
- package/es/setup-app.mjs +31 -0
- 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 -13
- package/es/state/global-pinia-state/global-pinia-state.mjs +35 -9
- package/es/store/global-store.d.ts +1 -0
- package/es/store/global-store.mjs +38 -9
- package/es/store/index.d.ts +2 -3
- package/es/store/index.mjs +0 -1
- package/es/types/index.d.ts +51 -1
- package/es/utils/axios/interceptors.mjs +2 -23
- package/es/utils/cache-adapter/cache-adapter.d.ts +2 -0
- package/es/utils/cache-adapter/cache-adapter.mjs +59 -0
- 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 +20 -4
- package/es/utils/is-sort-filed/is-sort-filed.d.ts +10 -0
- package/es/utils/is-sort-filed/is-sort-filed.mjs +40 -0
- 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/lowcode/utils.d.ts +1 -0
- package/es/utils/lowcode/utils.mjs +20 -0
- package/es/utils/lowcode/validate.d.ts +13 -0
- package/es/utils/lowcode/validate.mjs +29 -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.d.ts +8 -0
- package/es/utils/namespace/namespace.mjs +4 -2
- package/es/utils/openUtil/index.d.ts +2 -0
- package/es/utils/openUtil/modal/modal.d.ts +61 -0
- package/es/utils/openUtil/modal/modal.mjs +80 -0
- package/es/utils/openUtil/overlay-container/overlay-container.d.ts +100 -0
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +139 -0
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +1 -2
- 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 +23 -21
- package/es/utils/tools/tools.mjs +37 -27
- package/es/utils/treeHelper/treeHelper.d.ts +118 -0
- package/es/utils/treeHelper/treeHelper.mjs +234 -0
- package/es/utils/useUUid.d.ts +41 -0
- package/es/utils/useUUid.mjs +93 -0
- package/es/utils/util.d.ts +39 -0
- package/es/utils/util.mjs +40 -0
- package/es/utils/uuid/uuid.d.ts +3 -0
- package/es/utils/uuid/uuid.mjs +48 -0
- package/es/utils/value-helper/value-helper.d.ts +49 -0
- package/es/utils/value-helper/value-helper.mjs +111 -0
- package/es/utils/width-install/width-install.mjs +4 -2
- package/package.json +41 -22
- package/es/_virtual/_commonjsHelpers.mjs +0 -44
- package/es/_virtual/index.mjs +0 -7
- 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/hooks/use-namespace/use-namespace.d.ts +0 -9
- package/es/hooks/use-namespace/use-namespace.mjs +0 -9
- package/es/interface/controller/edit-form/edit-form.controller.mjs +0 -1
- package/es/interface/controller/editor/i-color-editor.controller.mjs +0 -1
- package/es/interface/controller/editor/i-length-unit-editor.controller.mjs +0 -1
- package/es/interface/controller/editor-item/editor-item.controller.mjs +0 -1
- package/es/interface/controller/form/form.controller.mjs +0 -3
- package/es/interface/controller/form-collapse/form-collapse.controller.mjs +0 -1
- package/es/interface/controller/form-collapse-pane/form-collapse-pane.controller.mjs +0 -1
- package/es/interface/controller/form-edit-item/form-edit-item.controller.mjs +0 -1
- package/es/interface/controller/form-group/form-group.controller.mjs +0 -1
- package/es/interface/controller/form-hidden-item/form-hidden-item.controller.mjs +0 -1
- package/es/interface/controller/form-item/form-item.controller.mjs +0 -1
- package/es/interface/controller/form-item-basic/form-item-basic.controller.mjs +0 -1
- package/es/interface/controller/form-tab/form-tab.controller.mjs +0 -1
- package/es/interface/controller/form-tab-pane/form-tab-pane.controller.mjs +0 -1
- package/es/interface/controller/i-designer-controller.d.ts +0 -116
- package/es/interface/controller/i-designer-controller.mjs +0 -1
- package/es/interface/controller/index.mjs +0 -1
- package/es/interface/events/form/i-form.event.mjs +0 -1
- package/es/interface/events/index.mjs +0 -1
- package/es/interface/form/i-editor/i-check-switch.mjs +0 -3
- package/es/interface/form/i-editor/i-checkbox-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-color-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-editor-basic.mjs +0 -1
- package/es/interface/form/i-editor/i-icon-select-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-info-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-length-unit-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-number-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-picker-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-radio-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-select-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-span-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-switch-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-text-editor.mjs +0 -3
- package/es/interface/form/i-editor/i-textarea-editor.mjs +0 -3
- package/es/interface/form/i-form/i-edit-form.mjs +0 -1
- package/es/interface/form/i-form/i-form-collapse-pane.mjs +0 -1
- package/es/interface/form/i-form/i-form-collapse.mjs +0 -1
- package/es/interface/form/i-form/i-form-container.mjs +0 -1
- package/es/interface/form/i-form/i-form-edit-item.mjs +0 -1
- package/es/interface/form/i-form/i-form-group-container.mjs +0 -1
- package/es/interface/form/i-form/i-form-group.mjs +0 -1
- package/es/interface/form/i-form/i-form-hidden-item.mjs +0 -1
- package/es/interface/form/i-form/i-form-item-basic.mjs +0 -1
- package/es/interface/form/i-form/i-form-item.mjs +0 -1
- package/es/interface/form/i-form/i-form-tab-pane.mjs +0 -1
- package/es/interface/form/i-form/i-form-tab.mjs +0 -1
- package/es/interface/form/i-form/i-form.mjs +0 -1
- package/es/interface/form/index.mjs +0 -1
- package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
- package/es/interface/hooks/i-designer-hooks.mjs +0 -3
- package/es/interface/hooks/index.d.ts +0 -1
- package/es/interface/hooks/index.mjs +0 -1
- package/es/interface/i-dictionary/i-dictionary-item.mjs +0 -1
- package/es/interface/i-dictionary/i-dictionary.mjs +0 -1
- package/es/interface/i-http-response/i-http-response.d.ts +0 -29
- package/es/interface/i-http-response/i-http-response.mjs +0 -1
- package/es/interface/i-import-style-map/i-import-style-map.mjs +0 -1
- package/es/interface/i-message-util/i-message-util.d.ts +0 -78
- package/es/interface/i-message-util/i-message-util.mjs +0 -1
- package/es/interface/i-modal/i-modal.mjs +0 -3
- package/es/interface/i-modal-data/i-modal-data.mjs +0 -1
- package/es/interface/i-pinia-action/i-global-actions.mjs +0 -1
- package/es/interface/i-pinia-getter/i-global-getters.mjs +0 -1
- package/es/interface/i-pinia-state/i-global-state.mjs +0 -1
- package/es/interface/index.mjs +0 -1
- package/es/interface/layout/i-flex-layout/i-flex-container.mjs +0 -1
- package/es/interface/layout/i-flex-layout/i-flex-item.mjs +0 -1
- package/es/interface/layout/i-grid-layout/i-grid-container.mjs +0 -1
- package/es/interface/layout/i-grid-layout/i-grid-item-span.mjs +0 -1
- package/es/interface/layout/i-grid-layout/i-grid-item.mjs +0 -1
- package/es/interface/layout/i-layout-basis/i-layout-container-basis.mjs +0 -1
- package/es/interface/layout/index.mjs +0 -1
- package/es/interface/low-code-types/index.d.ts +0 -4
- package/es/interface/low-code-types/index.mjs +0 -5
- package/es/interface/low-code-types/modal-types.d.ts +0 -67
- package/es/interface/low-code-types/modal-types.mjs +0 -3
- package/es/interface/low-code-types/model/index.d.ts +0 -5338
- package/es/interface/low-code-types/model/index.mjs +0 -1
- package/es/interface/low-code-types/schema/index.d.ts +0 -12
- package/es/interface/low-code-types/schema/index.mjs +0 -1
- package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
- package/es/interface/low-code-types/widget-basic-types.mjs +0 -3
- package/es/interface/provider/i-editor-provider/i-editor-provider.mjs +0 -1
- package/es/interface/provider/i-form-item-provider/i-form-item-provider.mjs +0 -1
- package/es/interface/provider/i-provider-basic/i-provider-basic.mjs +0 -1
- package/es/interface/provider/index.mjs +0 -1
- package/es/interface/state/form/form.state.mjs +0 -1
- package/es/interface/state/form-collapse/form-collapse.state.mjs +0 -1
- package/es/interface/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
- package/es/interface/state/form-edit-item/form-edit-item.state.mjs +0 -1
- package/es/interface/state/form-group/form-group.state.mjs +0 -1
- package/es/interface/state/form-hidden-item/form-hidden-item.state.mjs +0 -1
- package/es/interface/state/form-item/form-item.state.mjs +0 -1
- package/es/interface/state/form-item-basic/form-item-basic.state.mjs +0 -1
- package/es/interface/state/form-tab/form-tab.state.mjs +0 -1
- package/es/interface/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
- package/es/interface/state/i-designer-state.d.ts +0 -27
- package/es/interface/state/i-designer-state.mjs +0 -1
- package/es/interface/state/index.mjs +0 -1
- package/es/interface/style/i-border.mjs +0 -1
- package/es/interface/style/i-font.mjs +0 -1
- package/es/interface/style/i-margin.mjs +0 -1
- package/es/interface/style/i-padding.mjs +0 -1
- package/es/interface/style/i-position.mjs +0 -1
- package/es/interface/style/i-spacing.mjs +0 -1
- package/es/interface/style/index.mjs +0 -1
- package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +0 -541
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/async-series-hook/async-series-hook.mjs +0 -73
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/index.mjs +0 -2
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs +0 -100
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs +0 -2
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/array/array.mjs +0 -47
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/index.mjs +0 -5
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/object/object.mjs +0 -24
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event/qx-event.mjs +0 -94
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event-emitter/qx-event-emitter.mjs +0 -146
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/type-util/type-util.mjs +0 -149
- package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/util/util.mjs +0 -227
- package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
- package/es/provider/i-designer-provider/i-designer-provider.mjs +0 -1
- 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 -69
- package/es/register/index.mjs +0 -6
- package/es/register/render-register/render-register.d.ts +0 -59
- package/es/register/render-register/render-register.mjs +0 -65
- package/es/service/base.service.d.ts +0 -19
- package/es/service/base.service.mjs +0 -41
- package/es/service/index.d.ts +0 -1
- package/es/service/index.mjs +0 -3
- package/es/state/index.mjs +0 -12
- package/es/utils/axios/axios.d.ts +0 -27
- package/es/utils/axios/axios.mjs +0 -84
- 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 -262
package/es/interface/index.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
export type * from './controller';
|
|
2
2
|
export type * from './events';
|
|
3
3
|
export type * from './form';
|
|
4
|
-
export type * from './
|
|
4
|
+
export type * from './i-app-context/i-app-context';
|
|
5
5
|
export type { IDictionary } from './i-dictionary/i-dictionary';
|
|
6
6
|
export type { IDictionaryItem } from './i-dictionary/i-dictionary-item';
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export type { IModalData } from './i-modal-data/i-modal-data';
|
|
7
|
+
export type { IFieldCodeChain } from './i-field-code-chain/i-field-code-chain';
|
|
8
|
+
export type { GlobalVar } from './i-global-var/i-global-var';
|
|
9
|
+
export type { IMobileHomeMenuItem } from './i-mobile-home-menu-item/i-mobile-home-menu-item';
|
|
11
10
|
export type { IStyleIMportMap } from './i-import-style-map/i-import-style-map';
|
|
12
11
|
export type { IGlobalActions } from './i-pinia-action/i-global-actions';
|
|
13
12
|
export type { IGlobalGetters } from './i-pinia-getter/i-global-getters';
|
|
14
13
|
export type { IGlobalState } from './i-pinia-state/i-global-state';
|
|
14
|
+
export type * from './open-util';
|
|
15
15
|
export type * from './layout';
|
|
16
|
-
export type * from './low-code-types';
|
|
17
16
|
export type * from './provider';
|
|
18
17
|
export type * from './state';
|
|
19
18
|
export type * from './style';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息参数
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IMessageParams
|
|
6
|
+
*/
|
|
7
|
+
export interface IMessageParams {
|
|
8
|
+
/**
|
|
9
|
+
* 持续时间,单位:秒,默认:1.5
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
duration?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 顶部居中显示,并自动消失
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface IMessageUtil
|
|
20
|
+
*/
|
|
21
|
+
export interface IMessageUtil {
|
|
22
|
+
/**
|
|
23
|
+
* 普通消息
|
|
24
|
+
*
|
|
25
|
+
* @param {string} msg
|
|
26
|
+
* @param {IMessageParams} [params]
|
|
27
|
+
* @return {*} {Promise<void>}
|
|
28
|
+
*/
|
|
29
|
+
info(msg: string, params?: IMessageParams): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* 成功消息
|
|
32
|
+
*
|
|
33
|
+
* @param {string} msg
|
|
34
|
+
* @param {IMessageParams} [params]
|
|
35
|
+
* @return {*} {Promise<void>}
|
|
36
|
+
*/
|
|
37
|
+
success(msg: string, params?: IMessageParams): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 警告消息
|
|
40
|
+
*
|
|
41
|
+
* @param {string} msg
|
|
42
|
+
* @param {IMessageParams} [params]
|
|
43
|
+
* @return {*} {Promise<void>}
|
|
44
|
+
*/
|
|
45
|
+
warning(msg: string, params?: IMessageParams): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* 错误消息
|
|
48
|
+
*
|
|
49
|
+
* @param {string} msg
|
|
50
|
+
* @param {IMessageParams} [params]
|
|
51
|
+
* @return {*} {Promise<void>}
|
|
52
|
+
*/
|
|
53
|
+
error(msg: string, params?: IMessageParams): Promise<void>;
|
|
54
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncSeriesHook } from 'qx-util';
|
|
2
2
|
import { IModalData } from '../i-modal-data/i-modal-data';
|
|
3
|
-
interface
|
|
3
|
+
export interface IModalHooks {
|
|
4
4
|
shouldDismiss: AsyncSeriesHook<[
|
|
5
5
|
], {
|
|
6
6
|
allowClose?: boolean;
|
|
@@ -29,22 +29,22 @@ export interface IModal {
|
|
|
29
29
|
*
|
|
30
30
|
* @author zhanghanrui
|
|
31
31
|
* @date 2024-03-19 21:03:55
|
|
32
|
-
* @type {
|
|
32
|
+
* @type {IModalHooks}
|
|
33
33
|
*/
|
|
34
|
-
hooks:
|
|
34
|
+
hooks: IModalHooks;
|
|
35
35
|
/**
|
|
36
36
|
* 统一关闭入口
|
|
37
37
|
*
|
|
38
|
-
* @
|
|
39
|
-
* @
|
|
38
|
+
* @param {IModalData} [data]
|
|
39
|
+
* @return {*} {Promise<boolean>}
|
|
40
40
|
*/
|
|
41
|
-
dismiss
|
|
41
|
+
dismiss(data?: IModalData): Promise<boolean>;
|
|
42
42
|
/**
|
|
43
43
|
* 设置模态框属性
|
|
44
|
-
*
|
|
45
|
-
* @
|
|
44
|
+
*
|
|
45
|
+
* @param {object} options
|
|
46
46
|
*/
|
|
47
|
-
setOptions
|
|
47
|
+
setOptions?(options: object): void;
|
|
48
48
|
/**
|
|
49
49
|
* 确认操作
|
|
50
50
|
*
|
|
@@ -68,4 +68,3 @@ export interface IModal {
|
|
|
68
68
|
*/
|
|
69
69
|
cancel?: () => Promise<boolean>;
|
|
70
70
|
}
|
|
71
|
-
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openWindow 函数的配置选项接口
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IOpenWindowOptions
|
|
6
|
+
*/
|
|
7
|
+
export interface IOpenWindowOptions {
|
|
8
|
+
/**
|
|
9
|
+
* 窗口打开方式
|
|
10
|
+
*
|
|
11
|
+
* @type {HTMLAnchorElement['target']}
|
|
12
|
+
* @memberof IOpenWindowOptions
|
|
13
|
+
* @default '_blank'
|
|
14
|
+
*/
|
|
15
|
+
target?: HTMLAnchorElement['target'];
|
|
16
|
+
/**
|
|
17
|
+
* 是否启用 noopener 特性
|
|
18
|
+
* 防止新页面访问 window.opener
|
|
19
|
+
*
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
* @memberof IOpenWindowOptions
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
noopener?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 是否启用 noreferrer 特性
|
|
27
|
+
* 防止新页面获取来源页面信息
|
|
28
|
+
*
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
* @memberof IOpenWindowOptions
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
noreferrer?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* URL 参数数据
|
|
36
|
+
* 用于替换 URL 中的占位符,格式如 /path/{id}/{name?}
|
|
37
|
+
*
|
|
38
|
+
* @type {IObject}
|
|
39
|
+
* @memberof IOpenWindowOptions
|
|
40
|
+
*/
|
|
41
|
+
genUrlData?: IObject;
|
|
42
|
+
/**
|
|
43
|
+
* 路由路径
|
|
44
|
+
* 将附加到 URL 末尾
|
|
45
|
+
*
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @memberof IOpenWindowOptions
|
|
48
|
+
* @default ''
|
|
49
|
+
*/
|
|
50
|
+
routePath?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 额外的 window.open 特性字符串
|
|
53
|
+
* 如: 'width=800,height=600'
|
|
54
|
+
*
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @memberof IOpenWindowOptions
|
|
57
|
+
*/
|
|
58
|
+
optionStr?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局呈现容器
|
|
3
|
+
*
|
|
4
|
+
* @author zhanghanrui
|
|
5
|
+
* @date 2024-03-19 18:03:21
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IOverlayContainer
|
|
8
|
+
*/
|
|
9
|
+
export interface IOverlayContainer {
|
|
10
|
+
/**
|
|
11
|
+
* 展示容器
|
|
12
|
+
*
|
|
13
|
+
* @author zhanghanrui
|
|
14
|
+
* @date 2024-03-19 18:03:02
|
|
15
|
+
* @return {*} {Promise<void>}
|
|
16
|
+
*/
|
|
17
|
+
present(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 关闭容器
|
|
20
|
+
*
|
|
21
|
+
* @author zhanghanrui
|
|
22
|
+
* @date 2024-03-19 18:03:08
|
|
23
|
+
* @param {unknown} [data]
|
|
24
|
+
* @return {*} {Promise<void>}
|
|
25
|
+
*/
|
|
26
|
+
dismiss(data?: unknown): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 等待容器关闭并返回返回值
|
|
29
|
+
*
|
|
30
|
+
* @author zhanghanrui
|
|
31
|
+
* @date 2024-03-19 18:03:12
|
|
32
|
+
* @template T
|
|
33
|
+
* @return {*} {Promise<T>}
|
|
34
|
+
*/
|
|
35
|
+
onWillDismiss<T = unknown>(): Promise<T>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
|
|
2
|
+
import { IModalOptions } from '../i-modal-options/i-modal-options';
|
|
3
|
+
import { IModalData } from '../i-modal-data/i-modal-data';
|
|
4
|
+
/**
|
|
5
|
+
* 全局呈现容器控制器
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghanrui
|
|
8
|
+
* @date 2024-03-19 19:03:18
|
|
9
|
+
* @export
|
|
10
|
+
* @interface IOverlayController
|
|
11
|
+
*/
|
|
12
|
+
export interface IOverlayController {
|
|
13
|
+
/**
|
|
14
|
+
* 模态打开组件
|
|
15
|
+
*
|
|
16
|
+
* @author zhanghanrui
|
|
17
|
+
* @date 2024-03-19 19:03:42
|
|
18
|
+
* @template T
|
|
19
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
20
|
+
* @param {IParams} [props] 组件props
|
|
21
|
+
* @param {IModalOptions} [opts]
|
|
22
|
+
* @return {*} {Promise<T>}
|
|
23
|
+
*/
|
|
24
|
+
modal<T = IModalData>(component: unknown, props?: IParams, opts?: IModalOptions): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* 创建全局模态容器
|
|
27
|
+
*
|
|
28
|
+
* @author zhanghanrui
|
|
29
|
+
* @date 2024-03-19 19:03:04
|
|
30
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
31
|
+
* @param {IParams} [props] 组件props
|
|
32
|
+
* @param {IModalOptions} [opts]
|
|
33
|
+
* @return {*} {IOverlayContainer}
|
|
34
|
+
*/
|
|
35
|
+
createModal(component: unknown, props?: IParams, opts?: IModalOptions): IOverlayContainer;
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { IMessageParams, IMessageUtil, } from './i-message-util/i-message-util';
|
|
2
|
+
export type { IModal } from './i-modal/i-modal';
|
|
3
|
+
export type { IModalData } from './i-modal-data/i-modal-data';
|
|
4
|
+
export type { IModalOptions } from './i-modal-options/i-modal-options';
|
|
5
|
+
export type { IOpenWindowOptions } from './i-open-window-options/i-open-window-options';
|
|
6
|
+
export type { IOverlayContainer } from './i-overlay-container/i-overlay-container';
|
|
7
|
+
export type { IOverlayController } from './i-overlay-controller/i-overlay-controller';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { IDesignerState } from './i-designer-state';
|
|
2
1
|
export type { IFormState } from './form/form.state';
|
|
3
2
|
export type { IFormCollapsePaneState } from './form-collapse-pane/form-collapse-pane.state';
|
|
4
3
|
export type { IFormCollapseState } from './form-collapse/form-collapse.state';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { I18n } from 'vue-i18n';
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
export declare class LocaleUtil {
|
|
4
|
+
i18n: I18n;
|
|
5
|
+
protected locale: string;
|
|
6
|
+
constructor();
|
|
7
|
+
protected init(): Promise<void>;
|
|
8
|
+
protected loadLocales(): Promise<void>;
|
|
9
|
+
protected loadMessages(url: string, locale?: string): Promise<void>;
|
|
10
|
+
getMessageUrl(payload: {
|
|
11
|
+
locale: string;
|
|
12
|
+
} | {
|
|
13
|
+
locale: string;
|
|
14
|
+
app: string;
|
|
15
|
+
env: 'dev' | 'test' | 'prod';
|
|
16
|
+
branch?: string;
|
|
17
|
+
}): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function setupI18n(app: App): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createI18n } from 'vue-i18n';
|
|
2
|
+
|
|
3
|
+
class LocaleUtil {
|
|
4
|
+
i18n = createI18n({
|
|
5
|
+
legacy: false,
|
|
6
|
+
locale: "zh-CN",
|
|
7
|
+
fallbackLocale: "en",
|
|
8
|
+
messages: {
|
|
9
|
+
en: {
|
|
10
|
+
message: {
|
|
11
|
+
hello: "hello world"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
ja: {
|
|
15
|
+
message: {
|
|
16
|
+
hello: "こんにちは、世界"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
locale = "zh-CN";
|
|
22
|
+
constructor() {
|
|
23
|
+
this.init();
|
|
24
|
+
}
|
|
25
|
+
async init() {
|
|
26
|
+
await this.loadLocales();
|
|
27
|
+
const platformUrl = this.getMessageUrl({ locale: this.locale });
|
|
28
|
+
await this.loadMessages(platformUrl);
|
|
29
|
+
}
|
|
30
|
+
async loadLocales() {
|
|
31
|
+
const res = await (await fetch("/gct-platform/api/i18n-config/list")).json();
|
|
32
|
+
if (res.code === 200) {
|
|
33
|
+
const defaultItem = res.data.find((item) => item.defaultLanguage);
|
|
34
|
+
this.locale = defaultItem.languageTag;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async loadMessages(url, locale = this.locale) {
|
|
38
|
+
const res = await fetch(url);
|
|
39
|
+
const text = await res.text();
|
|
40
|
+
const messages = text.split("\n").reduce((acc, item) => {
|
|
41
|
+
const [key, ...value] = item.split(":");
|
|
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
|
+
}
|
|
56
|
+
function setupI18n(app) {
|
|
57
|
+
app.use(_gct.i18n);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { LocaleUtil, setupI18n };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** IP地址正则表达式 */
|
|
2
|
+
export declare const IP_REG: RegExp;
|
|
3
|
+
/** 域名正则表达式 */
|
|
4
|
+
export declare const HOST_REG: RegExp;
|
|
5
|
+
/** 应用运行时路径正则表达式 */
|
|
6
|
+
export declare const APP_RUN_PATH_REG: RegExp;
|
|
7
|
+
/** 应用生产环境路径正则表达式 */
|
|
8
|
+
export declare const APP_PROD_PATH_REG: RegExp;
|
|
9
|
+
/** 应用预览环境路径正则表达式 */
|
|
10
|
+
export declare const APP_PREVIEW_PATH_REG: RegExp;
|
|
11
|
+
/** dev环境单应用路径正则表达式 */
|
|
12
|
+
export declare const DEV_SINGLE_PATH_REG: RegExp;
|
|
13
|
+
/** 测试环境单应用路径正则表达式 */
|
|
14
|
+
export declare const TEST_SINGLE_PATH_REG: RegExp;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const IP_REG = /^http:\/\/\d{1,3}(\.\d{1,3}){3}:(\d{1,5})$/;
|
|
2
|
+
const HOST_REG = /^https?:\/\/([a-z0-9]+)-test\./;
|
|
3
|
+
const APP_RUN_PATH_REG = /\/web-render|\/web\/|web-single\/|dev-single\/|test-single\//;
|
|
4
|
+
const APP_PROD_PATH_REG = /\/web\/|\/web-single\//;
|
|
5
|
+
const APP_PREVIEW_PATH_REG = /\/web-render\//;
|
|
6
|
+
const DEV_SINGLE_PATH_REG = /\/dev-single\//;
|
|
7
|
+
const TEST_SINGLE_PATH_REG = /\/test-single\//;
|
|
8
|
+
|
|
9
|
+
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 };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Tenant } from '@gct-paas/api/platform';
|
|
2
|
+
import { IEnvironmentManager, EnvironmentType } from './env-manager.interface';
|
|
3
|
+
/**
|
|
4
|
+
* 环境管理器
|
|
5
|
+
*
|
|
6
|
+
* @description 负责检测和管理应用运行环境,包括测试环境检测、租户信息获取等功能
|
|
7
|
+
*/
|
|
8
|
+
export declare class EnvironmentManager implements IEnvironmentManager {
|
|
9
|
+
/** 测试环境标识 */
|
|
10
|
+
private _testEnv;
|
|
11
|
+
/** 测试环境租户数据 */
|
|
12
|
+
private readonly _testTenantData;
|
|
13
|
+
/** 平台地址 */
|
|
14
|
+
private readonly _platformOrigin;
|
|
15
|
+
/** 域名访问模式标识 */
|
|
16
|
+
private _isHostMode;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* 是否为应用前端运行时
|
|
20
|
+
*/
|
|
21
|
+
get isAppRun(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 是否为应用前端运行时生产环境包含测试环境
|
|
24
|
+
*/
|
|
25
|
+
get isAppProd(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 是否为应用前端运行时预览环境
|
|
28
|
+
*/
|
|
29
|
+
get isAppPreview(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否为dev环境单应用
|
|
32
|
+
*/
|
|
33
|
+
get isDevSingleEnv(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否为测试环境
|
|
36
|
+
*/
|
|
37
|
+
get isTestEnv(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 平台地址
|
|
40
|
+
*/
|
|
41
|
+
get platformOrigin(): string;
|
|
42
|
+
/**
|
|
43
|
+
* 是否为域名访问模式
|
|
44
|
+
*/
|
|
45
|
+
get isHostMode(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 测试环境租户数据
|
|
48
|
+
*/
|
|
49
|
+
get testTenantData(): Tenant;
|
|
50
|
+
/**
|
|
51
|
+
* 检测是否为测试环境
|
|
52
|
+
*/
|
|
53
|
+
checkIsTestEnv(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* 获取当前环境类型
|
|
56
|
+
* @returns 环境类型
|
|
57
|
+
*/
|
|
58
|
+
getEnv(): EnvironmentType;
|
|
59
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Tenant } from '@gct-paas/api/platform';
|
|
2
|
+
/**
|
|
3
|
+
* 环境类型枚举
|
|
4
|
+
*/
|
|
5
|
+
export declare enum EnvironmentType {
|
|
6
|
+
/** 开发环境 */
|
|
7
|
+
DEV = "dev",
|
|
8
|
+
/** 测试环境 */
|
|
9
|
+
TEST = "test",
|
|
10
|
+
/** 生产环境 */
|
|
11
|
+
PROD = "prod"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 环境管理器接口
|
|
15
|
+
*/
|
|
16
|
+
export interface IEnvironmentManager {
|
|
17
|
+
/** 是否为应用前端运行时 */
|
|
18
|
+
readonly isAppRun: boolean;
|
|
19
|
+
/** 是否为应用前端运行时生产环境 */
|
|
20
|
+
readonly isAppProd: boolean;
|
|
21
|
+
/** 是否为应用前端运行时预览环境 */
|
|
22
|
+
readonly isAppPreview: boolean;
|
|
23
|
+
/** 是否为dev环境单应用 */
|
|
24
|
+
readonly isDevSingleEnv: boolean;
|
|
25
|
+
/** 是否为测试环境 */
|
|
26
|
+
readonly isTestEnv: boolean;
|
|
27
|
+
/** 平台地址 */
|
|
28
|
+
readonly platformOrigin: string;
|
|
29
|
+
/** 是否为域名访问模式 */
|
|
30
|
+
readonly isHostMode: boolean;
|
|
31
|
+
/** 测试环境租户数据 */
|
|
32
|
+
readonly testTenantData: Tenant;
|
|
33
|
+
/**
|
|
34
|
+
* 检测是否为测试环境
|
|
35
|
+
* @param loadTenant 是否加载租户信息
|
|
36
|
+
*/
|
|
37
|
+
checkIsTestEnv(loadTenant?: boolean): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 获取当前环境类型
|
|
40
|
+
* @returns 环境类型
|
|
41
|
+
*/
|
|
42
|
+
getEnv(): EnvironmentType;
|
|
43
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { EnvironmentType } from './env-manager.interface.mjs';
|
|
2
|
+
import { HOST_REG, APP_RUN_PATH_REG, APP_PROD_PATH_REG, APP_PREVIEW_PATH_REG, DEV_SINGLE_PATH_REG, TEST_SINGLE_PATH_REG, IP_REG } from './env-manager.const.mjs';
|
|
3
|
+
|
|
4
|
+
class EnvironmentManager {
|
|
5
|
+
/** 测试环境标识 */
|
|
6
|
+
_testEnv = false;
|
|
7
|
+
/** 测试环境租户数据 */
|
|
8
|
+
_testTenantData = {};
|
|
9
|
+
/** 平台地址 */
|
|
10
|
+
_platformOrigin;
|
|
11
|
+
/** 域名访问模式标识 */
|
|
12
|
+
_isHostMode = false;
|
|
13
|
+
constructor() {
|
|
14
|
+
this._platformOrigin = (location.origin) || "";
|
|
15
|
+
this._isHostMode = HOST_REG.test(this._platformOrigin);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 是否为应用前端运行时
|
|
19
|
+
*/
|
|
20
|
+
get isAppRun() {
|
|
21
|
+
return APP_RUN_PATH_REG.test(location.pathname);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 是否为应用前端运行时生产环境包含测试环境
|
|
25
|
+
*/
|
|
26
|
+
get isAppProd() {
|
|
27
|
+
return APP_PROD_PATH_REG.test(location.pathname);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 是否为应用前端运行时预览环境
|
|
31
|
+
*/
|
|
32
|
+
get isAppPreview() {
|
|
33
|
+
return APP_PREVIEW_PATH_REG.test(location.pathname);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 是否为dev环境单应用
|
|
37
|
+
*/
|
|
38
|
+
get isDevSingleEnv() {
|
|
39
|
+
return DEV_SINGLE_PATH_REG.test(location.pathname);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 是否为测试环境
|
|
43
|
+
*/
|
|
44
|
+
get isTestEnv() {
|
|
45
|
+
return TEST_SINGLE_PATH_REG.test(location.pathname) || this._testEnv;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 平台地址
|
|
49
|
+
*/
|
|
50
|
+
get platformOrigin() {
|
|
51
|
+
return this._platformOrigin;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 是否为域名访问模式
|
|
55
|
+
*/
|
|
56
|
+
get isHostMode() {
|
|
57
|
+
return this._isHostMode;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 测试环境租户数据
|
|
61
|
+
*/
|
|
62
|
+
get testTenantData() {
|
|
63
|
+
return this._testTenantData;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 检测是否为测试环境
|
|
67
|
+
*/
|
|
68
|
+
async checkIsTestEnv() {
|
|
69
|
+
let matches = null;
|
|
70
|
+
if (this._isHostMode) {
|
|
71
|
+
matches = this._platformOrigin.match(HOST_REG);
|
|
72
|
+
this._testEnv = !!(matches && matches[1]);
|
|
73
|
+
if (this._testEnv) {
|
|
74
|
+
const data = await _api.platform.tenant.getInfoByPortOrDomain({
|
|
75
|
+
domain: matches[1]
|
|
76
|
+
});
|
|
77
|
+
Object.assign(this._testTenantData, data);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
matches = this._platformOrigin.match(IP_REG);
|
|
81
|
+
const port = matches && matches[2];
|
|
82
|
+
if (port) {
|
|
83
|
+
const data = await _api.platform.tenant.getInfoByPortOrDomain({
|
|
84
|
+
port
|
|
85
|
+
});
|
|
86
|
+
if (data) {
|
|
87
|
+
Object.assign(this._testTenantData, data);
|
|
88
|
+
this._testEnv = data.testEnvPort === port;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 获取当前环境类型
|
|
95
|
+
* @returns 环境类型
|
|
96
|
+
*/
|
|
97
|
+
getEnv() {
|
|
98
|
+
if (this.isTestEnv) {
|
|
99
|
+
return EnvironmentType.TEST;
|
|
100
|
+
} else if (this.isAppProd) {
|
|
101
|
+
return EnvironmentType.PROD;
|
|
102
|
+
} else {
|
|
103
|
+
return EnvironmentType.DEV;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { EnvironmentManager };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** HTTP 状态码常量 */
|
|
2
|
+
export declare const HTTP_STATUS_CODE: {
|
|
3
|
+
/** 未授权 */
|
|
4
|
+
readonly UNAUTHORIZED: 401;
|
|
5
|
+
/** 禁止访问 */
|
|
6
|
+
readonly FORBIDDEN: 403;
|
|
7
|
+
/** 资源未找到 */
|
|
8
|
+
readonly NOT_FOUND: 404;
|
|
9
|
+
/** 内部服务器错误 */
|
|
10
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
11
|
+
/** 网关错误 */
|
|
12
|
+
readonly BAD_GATEWAY: 502;
|
|
13
|
+
/** 服务不可用 */
|
|
14
|
+
readonly SERVICE_UNAVAILABLE: 503;
|
|
15
|
+
/** 网关超时 */
|
|
16
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
17
|
+
};
|
|
18
|
+
/** 错误日志输出模板 */
|
|
19
|
+
export declare const ERROR_LOG_TEMPLATE: {
|
|
20
|
+
/** JavaScript 错误模板 */
|
|
21
|
+
readonly SCRIPT_ERROR: "[SCRIPT ERROR]";
|
|
22
|
+
/** Vue 组件错误模板 */
|
|
23
|
+
readonly VUE_ERROR: "[VUE ERROR]";
|
|
24
|
+
/** 资源加载错误模板 */
|
|
25
|
+
readonly RESOURCE_ERROR: "[RESOURCE ERROR]";
|
|
26
|
+
/** Ajax 请求错误模板 */
|
|
27
|
+
readonly AJAX_ERROR: "[AJAX ERROR]";
|
|
28
|
+
/** Promise 异常模板 */
|
|
29
|
+
readonly PROMISE_ERROR: "[PROMISE ERROR]";
|
|
30
|
+
};
|
|
31
|
+
/** 网络状态消息 */
|
|
32
|
+
export declare const NETWORK_STATUS_MESSAGE: {
|
|
33
|
+
/** 网络连接丢失 */
|
|
34
|
+
readonly CONNECTION_LOST: "Network connection lost";
|
|
35
|
+
/** 网络连接恢复 */
|
|
36
|
+
readonly CONNECTION_RESTORED: "Network connection restored";
|
|
37
|
+
};
|
|
38
|
+
/** 错误处理事件名称 */
|
|
39
|
+
export declare const ERROR_EVENT_NAMES: {
|
|
40
|
+
/** JavaScript 错误事件 */
|
|
41
|
+
readonly ERROR: "error";
|
|
42
|
+
/** Promise 拒绝事件 */
|
|
43
|
+
readonly UNHANDLED_REJECTION: "unhandledrejection";
|
|
44
|
+
/** 网络离线事件 */
|
|
45
|
+
readonly OFFLINE: "offline";
|
|
46
|
+
/** 网络在线事件 */
|
|
47
|
+
readonly ONLINE: "online";
|
|
48
|
+
};
|