@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.min.mjs +6520 -18715
- package/dist/index.min.cjs +386 -2
- package/dist/index.system.min.js +386 -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/expression-type/BuiltOperators.d.ts +20 -0
- package/es/constants/expression-type/BuiltOperators.mjs +148 -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 +5 -0
- package/es/constants/index.mjs +6 -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 -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 +3 -9
- 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 +2 -2
- package/es/enums/designEnum.mjs +31 -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 -16
- 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 +11 -28
- package/es/global/gct/gct.mjs +29 -32
- 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 +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 +6 -8
- package/es/index.mjs +98 -64
- 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 -5
- 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.mjs +2 -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 +107 -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.mjs +0 -1
- package/es/setup-app.d.ts +8 -0
- package/es/setup-app.mjs +30 -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 -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 +40 -37
- package/es/store/index.d.ts +2 -3
- package/es/store/index.mjs +0 -1
- package/es/types/index.d.ts +18 -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 +17 -3
- 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 +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 +23 -11
- package/es/utils/treeHelper/treeHelper.d.ts +124 -0
- package/es/utils/treeHelper/treeHelper.mjs +234 -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 +13 -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/hooks/use-namespace/use-namespace.d.ts +0 -9
- package/es/hooks/use-namespace/use-namespace.mjs +0 -9
- 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/i-message-util/i-message-util.d.ts +0 -78
- 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/register/render-register/render-register.d.ts +0 -59
- package/es/register/render-register/render-register.mjs +0 -64
- 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
|
@@ -114,3 +114,11 @@ export declare class Namespace {
|
|
|
114
114
|
*/
|
|
115
115
|
cssVarBlockName(name: string): string;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 获取 bem 操作类
|
|
119
|
+
*
|
|
120
|
+
* @export
|
|
121
|
+
* @param {string} block
|
|
122
|
+
* @return {*} {Namespace}
|
|
123
|
+
*/
|
|
124
|
+
export declare function useNamespace(block: string): Namespace;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { STYLE_NAMESPACE_TAG } from '../../constants/index.mjs';
|
|
2
2
|
|
|
3
|
-
"use strict";
|
|
4
3
|
const statePrefix = "is-";
|
|
5
4
|
function _bem(namespace, block, blockSuffix, element, modifier) {
|
|
6
5
|
let cls = `${namespace}-${block}`;
|
|
@@ -163,5 +162,8 @@ class Namespace {
|
|
|
163
162
|
return `--${this.namespace}-${this.block}-${name}`;
|
|
164
163
|
}
|
|
165
164
|
}
|
|
165
|
+
function useNamespace(block) {
|
|
166
|
+
return new Namespace(block);
|
|
167
|
+
}
|
|
166
168
|
|
|
167
|
-
export { Namespace };
|
|
169
|
+
export { Namespace, useNamespace };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AsyncSeriesHook } from 'qx-util';
|
|
2
|
+
import { IModal, IModalData } from '../../../interface';
|
|
3
|
+
interface ConstructorOpts {
|
|
4
|
+
/**
|
|
5
|
+
* 注入的模态等组件实际的关闭操作,
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghanrui
|
|
8
|
+
* @date 2024-03-19 21:03:00
|
|
9
|
+
*/
|
|
10
|
+
dismiss?: (data: IModalData) => void;
|
|
11
|
+
/**
|
|
12
|
+
* 修改属性
|
|
13
|
+
* @param data
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
setOptions?: (data: object) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class Modal implements IModal {
|
|
19
|
+
ignoreDismissCheck: boolean;
|
|
20
|
+
state: {
|
|
21
|
+
okDisabled?: boolean;
|
|
22
|
+
cancelDisabled?: boolean;
|
|
23
|
+
};
|
|
24
|
+
hooks: {
|
|
25
|
+
shouldDismiss: AsyncSeriesHook<[], {
|
|
26
|
+
allowClose?: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
beforeDismiss: AsyncSeriesHook<[], IModalData>;
|
|
29
|
+
};
|
|
30
|
+
ok?: () => Promise<IModalData | null>;
|
|
31
|
+
setOptions?: (options: object) => void;
|
|
32
|
+
constructor(opts: ConstructorOpts);
|
|
33
|
+
cancel?: (() => Promise<boolean>) | undefined;
|
|
34
|
+
callback(ok?: () => Promise<IModalData | null>, cancel?: () => Promise<boolean>): void;
|
|
35
|
+
/**
|
|
36
|
+
* 外部注入的模态等组件实际的关闭操作
|
|
37
|
+
*
|
|
38
|
+
* @author zhanghanrui
|
|
39
|
+
* @date 2024-03-19 21:03:08
|
|
40
|
+
* @param {IModalData} data
|
|
41
|
+
*/
|
|
42
|
+
_dismiss: (data: IModalData) => void;
|
|
43
|
+
/**
|
|
44
|
+
* 注入模态等组件实际的关闭操作
|
|
45
|
+
*
|
|
46
|
+
* @author zhanghanrui
|
|
47
|
+
* @date 2024-03-19 21:03:13
|
|
48
|
+
* @param {(data: IModalData) => void} dismiss
|
|
49
|
+
*/
|
|
50
|
+
injectDismiss(dismiss: (data: IModalData) => void): void;
|
|
51
|
+
dismiss(data?: IModalData): Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* 执行完一次关闭后就会调销毁
|
|
54
|
+
*
|
|
55
|
+
* @author zhanghanrui
|
|
56
|
+
* @date 2024-03-19 21:03:22
|
|
57
|
+
* @protected
|
|
58
|
+
*/
|
|
59
|
+
protected destroy(): void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
import { AsyncSeriesHook } from 'qx-util';
|
|
3
|
+
|
|
4
|
+
class Modal {
|
|
5
|
+
ignoreDismissCheck = false;
|
|
6
|
+
state = reactive({
|
|
7
|
+
okDisabled: false,
|
|
8
|
+
cancelDisabled: false
|
|
9
|
+
});
|
|
10
|
+
hooks = {
|
|
11
|
+
shouldDismiss: new AsyncSeriesHook(),
|
|
12
|
+
beforeDismiss: new AsyncSeriesHook()
|
|
13
|
+
};
|
|
14
|
+
ok;
|
|
15
|
+
setOptions;
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
if (opts.dismiss) {
|
|
18
|
+
this._dismiss = opts.dismiss;
|
|
19
|
+
}
|
|
20
|
+
if (opts.setOptions) {
|
|
21
|
+
this.setOptions = opts.setOptions;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
cancel;
|
|
25
|
+
callback(ok, cancel) {
|
|
26
|
+
if (ok) {
|
|
27
|
+
this.ok = ok;
|
|
28
|
+
}
|
|
29
|
+
if (cancel) {
|
|
30
|
+
this.cancel = cancel;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 外部注入的模态等组件实际的关闭操作
|
|
35
|
+
*
|
|
36
|
+
* @author zhanghanrui
|
|
37
|
+
* @date 2024-03-19 21:03:08
|
|
38
|
+
* @param {IModalData} data
|
|
39
|
+
*/
|
|
40
|
+
_dismiss = (data) => {
|
|
41
|
+
console.warn("外部关闭能力未注册", data);
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 注入模态等组件实际的关闭操作
|
|
45
|
+
*
|
|
46
|
+
* @author zhanghanrui
|
|
47
|
+
* @date 2024-03-19 21:03:13
|
|
48
|
+
* @param {(data: IModalData) => void} dismiss
|
|
49
|
+
*/
|
|
50
|
+
injectDismiss(dismiss) {
|
|
51
|
+
this._dismiss = dismiss;
|
|
52
|
+
}
|
|
53
|
+
async dismiss(data = { ok: false, data: [] }) {
|
|
54
|
+
const context = {};
|
|
55
|
+
if (this.ignoreDismissCheck !== true) {
|
|
56
|
+
await this.hooks.shouldDismiss.call(context);
|
|
57
|
+
}
|
|
58
|
+
if (context.allowClose === false) {
|
|
59
|
+
console.warn("shouldDismiss结果为false,关闭中断。");
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
await this.hooks.beforeDismiss.call(data);
|
|
63
|
+
this._dismiss(data);
|
|
64
|
+
this.destroy();
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 执行完一次关闭后就会调销毁
|
|
69
|
+
*
|
|
70
|
+
* @author zhanghanrui
|
|
71
|
+
* @date 2024-03-19 21:03:22
|
|
72
|
+
* @protected
|
|
73
|
+
*/
|
|
74
|
+
destroy() {
|
|
75
|
+
this.hooks.shouldDismiss.clear();
|
|
76
|
+
this.hooks.beforeDismiss.clear();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { Modal };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { IOverlayContainer } from '../../../interface';
|
|
2
|
+
import { QXEvent } from 'qx-util';
|
|
3
|
+
import { App, Component, VNode } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* 全局弹出承载组件
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghanrui
|
|
8
|
+
* @date 2024-03-19 19:03:22
|
|
9
|
+
* @export
|
|
10
|
+
* @class OverlayContainer
|
|
11
|
+
* @implements {IOverlayContainer}
|
|
12
|
+
* @template O
|
|
13
|
+
*/
|
|
14
|
+
export declare class OverlayContainer<O> implements IOverlayContainer {
|
|
15
|
+
protected component: unknown;
|
|
16
|
+
protected render: (...args: any[]) => VNode;
|
|
17
|
+
protected opts?: O | undefined;
|
|
18
|
+
protected vm?: App;
|
|
19
|
+
/**
|
|
20
|
+
* 具体模态组件对象
|
|
21
|
+
*
|
|
22
|
+
* @author zhanghanrui
|
|
23
|
+
* @date 2024-03-19 19:03:45
|
|
24
|
+
* @protected
|
|
25
|
+
* @type {*}
|
|
26
|
+
*/
|
|
27
|
+
protected modal: any;
|
|
28
|
+
/**
|
|
29
|
+
* 调用dismiss时传的result结果
|
|
30
|
+
*
|
|
31
|
+
* @author zhanghanrui
|
|
32
|
+
* @date 2024-03-19 19:03:30
|
|
33
|
+
* @protected
|
|
34
|
+
* @type {unknown}
|
|
35
|
+
*/
|
|
36
|
+
protected result?: unknown;
|
|
37
|
+
/**
|
|
38
|
+
* 内部事件
|
|
39
|
+
*
|
|
40
|
+
* @author zhanghanrui
|
|
41
|
+
* @date 2024-03-19 19:03:44
|
|
42
|
+
* @protected
|
|
43
|
+
*/
|
|
44
|
+
protected evt: QXEvent<{
|
|
45
|
+
dismiss: (data?: unknown) => void;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* init 执行完毕的 Promise,用于确保 present/dismiss 调用时 init 已完成
|
|
49
|
+
*
|
|
50
|
+
* @protected
|
|
51
|
+
* @type {Promise<void>}
|
|
52
|
+
*/
|
|
53
|
+
protected _initPromise: Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* 创建全局呈现
|
|
56
|
+
*
|
|
57
|
+
* @author zhanghanrui
|
|
58
|
+
* @date 2024-03-19 19:03:51
|
|
59
|
+
* @param {unknown} component
|
|
60
|
+
* @param {(...args: any[]) => VNode} render
|
|
61
|
+
* @param {O} [opts]
|
|
62
|
+
*/
|
|
63
|
+
constructor(component: unknown, render: (...args: any[]) => VNode, opts?: O | undefined);
|
|
64
|
+
static createVueApp(rootComponent: Component, rootProps?: IData): Promise<App<Element>>;
|
|
65
|
+
/**
|
|
66
|
+
* 初始化飘窗
|
|
67
|
+
*
|
|
68
|
+
* @author zhanghanrui
|
|
69
|
+
* @date 2024-03-19 19:03:00
|
|
70
|
+
* @protected
|
|
71
|
+
* @return {*} {void}
|
|
72
|
+
*/
|
|
73
|
+
protected init(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* 打开飘窗
|
|
76
|
+
*
|
|
77
|
+
* @author zhanghanrui
|
|
78
|
+
* @date 2024-03-19 19:03:14
|
|
79
|
+
* @return {*} {Promise<void>}
|
|
80
|
+
*/
|
|
81
|
+
present(): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* 手动调用关闭飘窗
|
|
84
|
+
*
|
|
85
|
+
* @author zhanghanrui
|
|
86
|
+
* @date 2024-03-19 19:03:19
|
|
87
|
+
* @param {unknown} [data]
|
|
88
|
+
* @return {*} {Promise<void>}
|
|
89
|
+
*/
|
|
90
|
+
dismiss(data?: unknown): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* 订阅窗口关闭
|
|
93
|
+
*
|
|
94
|
+
* @author zhanghanrui
|
|
95
|
+
* @date 2024-03-19 19:03:26
|
|
96
|
+
* @template T
|
|
97
|
+
* @return {*} {Promise<T>}
|
|
98
|
+
*/
|
|
99
|
+
onWillDismiss<T = unknown>(): Promise<T>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { QXEvent } from 'qx-util';
|
|
2
|
+
import { createApp, h, nextTick } from 'vue';
|
|
3
|
+
|
|
4
|
+
class OverlayContainer {
|
|
5
|
+
/**
|
|
6
|
+
* 创建全局呈现
|
|
7
|
+
*
|
|
8
|
+
* @author zhanghanrui
|
|
9
|
+
* @date 2024-03-19 19:03:51
|
|
10
|
+
* @param {unknown} component
|
|
11
|
+
* @param {(...args: any[]) => VNode} render
|
|
12
|
+
* @param {O} [opts]
|
|
13
|
+
*/
|
|
14
|
+
constructor(component, render, opts) {
|
|
15
|
+
this.component = component;
|
|
16
|
+
this.render = render;
|
|
17
|
+
this.opts = opts;
|
|
18
|
+
this._initPromise = this.init();
|
|
19
|
+
}
|
|
20
|
+
vm;
|
|
21
|
+
/**
|
|
22
|
+
* 具体模态组件对象
|
|
23
|
+
*
|
|
24
|
+
* @author zhanghanrui
|
|
25
|
+
* @date 2024-03-19 19:03:45
|
|
26
|
+
* @protected
|
|
27
|
+
* @type {*}
|
|
28
|
+
*/
|
|
29
|
+
modal;
|
|
30
|
+
/**
|
|
31
|
+
* 调用dismiss时传的result结果
|
|
32
|
+
*
|
|
33
|
+
* @author zhanghanrui
|
|
34
|
+
* @date 2024-03-19 19:03:30
|
|
35
|
+
* @protected
|
|
36
|
+
* @type {unknown}
|
|
37
|
+
*/
|
|
38
|
+
result;
|
|
39
|
+
/**
|
|
40
|
+
* 内部事件
|
|
41
|
+
*
|
|
42
|
+
* @author zhanghanrui
|
|
43
|
+
* @date 2024-03-19 19:03:44
|
|
44
|
+
* @protected
|
|
45
|
+
*/
|
|
46
|
+
evt = new QXEvent();
|
|
47
|
+
/**
|
|
48
|
+
* init 执行完毕的 Promise,用于确保 present/dismiss 调用时 init 已完成
|
|
49
|
+
*
|
|
50
|
+
* @protected
|
|
51
|
+
* @type {Promise<void>}
|
|
52
|
+
*/
|
|
53
|
+
_initPromise;
|
|
54
|
+
static async createVueApp(rootComponent, rootProps) {
|
|
55
|
+
console.error("没有注入createVueApp方法");
|
|
56
|
+
return createApp(rootComponent, rootProps);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 初始化飘窗
|
|
60
|
+
*
|
|
61
|
+
* @author zhanghanrui
|
|
62
|
+
* @date 2024-03-19 19:03:00
|
|
63
|
+
* @protected
|
|
64
|
+
* @return {*} {void}
|
|
65
|
+
*/
|
|
66
|
+
async init() {
|
|
67
|
+
const self = this;
|
|
68
|
+
const { render, opts } = this;
|
|
69
|
+
const container = document.createElement("div");
|
|
70
|
+
document.body.appendChild(container);
|
|
71
|
+
const vm = await OverlayContainer.createVueApp({
|
|
72
|
+
mounted() {
|
|
73
|
+
self.modal = this.$refs.root;
|
|
74
|
+
},
|
|
75
|
+
unmounted() {
|
|
76
|
+
document.body.removeChild(container);
|
|
77
|
+
self.evt.emit("dismiss", self.result);
|
|
78
|
+
},
|
|
79
|
+
render() {
|
|
80
|
+
return h(
|
|
81
|
+
self.component,
|
|
82
|
+
{
|
|
83
|
+
ref: "root",
|
|
84
|
+
opts,
|
|
85
|
+
onDismiss(data) {
|
|
86
|
+
self.result = data;
|
|
87
|
+
vm.unmount();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{ default: render }
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
vm.mount(container);
|
|
95
|
+
this.vm = vm;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 打开飘窗
|
|
99
|
+
*
|
|
100
|
+
* @author zhanghanrui
|
|
101
|
+
* @date 2024-03-19 19:03:14
|
|
102
|
+
* @return {*} {Promise<void>}
|
|
103
|
+
*/
|
|
104
|
+
async present() {
|
|
105
|
+
await this._initPromise;
|
|
106
|
+
await nextTick();
|
|
107
|
+
return this.modal.present();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 手动调用关闭飘窗
|
|
111
|
+
*
|
|
112
|
+
* @author zhanghanrui
|
|
113
|
+
* @date 2024-03-19 19:03:19
|
|
114
|
+
* @param {unknown} [data]
|
|
115
|
+
* @return {*} {Promise<void>}
|
|
116
|
+
*/
|
|
117
|
+
async dismiss(data) {
|
|
118
|
+
await this.modal.dismiss(data);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 订阅窗口关闭
|
|
122
|
+
*
|
|
123
|
+
* @author zhanghanrui
|
|
124
|
+
* @date 2024-03-19 19:03:26
|
|
125
|
+
* @template T
|
|
126
|
+
* @return {*} {Promise<T>}
|
|
127
|
+
*/
|
|
128
|
+
async onWillDismiss() {
|
|
129
|
+
return new Promise((resolve) => {
|
|
130
|
+
const callback = (data) => {
|
|
131
|
+
resolve(data);
|
|
132
|
+
this.evt.off("dismiss", callback);
|
|
133
|
+
};
|
|
134
|
+
this.evt.on("dismiss", callback);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { OverlayContainer };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IEditorBasic, IFormEditItem, IFormItemController } from '../../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 标准的表单项输入属性
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2025-06-22 13:06:34
|
|
8
|
+
* @export
|
|
9
|
+
* @template T
|
|
10
|
+
* @template M
|
|
11
|
+
* @template C
|
|
12
|
+
* @returns {*}
|
|
13
|
+
*/
|
|
14
|
+
export declare function gctFormItemEditorProps<T = IObject, M extends IEditorBasic = IEditorBasic, C extends IContext = IContext>(): {
|
|
15
|
+
context: {
|
|
16
|
+
type: PropType<C>;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
19
|
+
value: {
|
|
20
|
+
type: PropType<T>;
|
|
21
|
+
};
|
|
22
|
+
model: {
|
|
23
|
+
type: PropType<M>;
|
|
24
|
+
required: boolean;
|
|
25
|
+
};
|
|
26
|
+
c: {
|
|
27
|
+
type: PropType<IFormItemController>;
|
|
28
|
+
required: boolean;
|
|
29
|
+
};
|
|
30
|
+
itemModel: {
|
|
31
|
+
type: PropType<IFormEditItem>;
|
|
32
|
+
};
|
|
33
|
+
data: {
|
|
34
|
+
type: ObjectConstructor;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
readonly: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
keepalive: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
visible: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
size: {
|
|
53
|
+
type: PropType<"small" | "medium" | "large">;
|
|
54
|
+
};
|
|
55
|
+
count: {
|
|
56
|
+
type: NumberConstructor;
|
|
57
|
+
default: number;
|
|
58
|
+
};
|
|
59
|
+
isEmptyText: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 标准的表单项输入属性
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2025-06-22 13:06:34
|
|
6
|
+
* @export
|
|
7
|
+
* @template T
|
|
8
|
+
* @template M
|
|
9
|
+
* @template C
|
|
10
|
+
* @returns {*}
|
|
11
|
+
*/
|
|
12
|
+
function gctFormItemEditorProps() {
|
|
13
|
+
return {
|
|
14
|
+
context: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({})
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: Object
|
|
20
|
+
},
|
|
21
|
+
model: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
c: {
|
|
26
|
+
type: Object,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
itemModel: {
|
|
30
|
+
type: Object
|
|
31
|
+
},
|
|
32
|
+
data: {
|
|
33
|
+
type: Object
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
readonly: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
keepalive: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
visible: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
type: String
|
|
53
|
+
},
|
|
54
|
+
count: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 0
|
|
57
|
+
},
|
|
58
|
+
// 空数据时是否显示提示文本
|
|
59
|
+
isEmptyText: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { gctFormItemEditorProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { gctFormItemEditorProps } from './gct-form-item/gct-form-item.props';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 计算配置样式
|
|
3
|
+
*
|
|
4
|
+
* @param data
|
|
5
|
+
* @param ignoringStyle 忽略计算的样式
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const calcStyle: (data: IData, ignoringStyle?: string[]) => IObject;
|
|
9
|
+
/**
|
|
10
|
+
* 计算字体样式
|
|
11
|
+
*
|
|
12
|
+
* @param data
|
|
13
|
+
* @param ignoringStyle 忽略的样式
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare const calcFontStyle: (data: IData, ignoringStyle?: string[]) => IObject;
|