@gct-paas/render 0.1.4-dev.9 → 0.1.5-dev.0
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.min.css +2 -0
- package/dist/loader.esm.min.js +1 -0
- package/es/Event/Dependency/controller.d.ts +1 -1
- package/es/Event/Dependency/controller.mjs +81 -94
- package/es/Event/Dependency/displayRule.mjs +130 -68
- package/es/Event/Dependency/useDependency.mjs +117 -0
- package/es/Event/Dependency/useDependencyToShow.d.ts +1 -1
- package/es/Event/Dependency/useDependencyToShow.mjs +100 -96
- package/es/Event/baseEvent.d.ts +28 -32
- package/es/Event/baseEvent.mjs +383 -439
- package/es/Event/bizServiceRequest.d.ts +1 -1
- package/es/Event/bizServiceRequest.mjs +29 -41
- package/es/Event/eventType.d.ts +1 -1
- package/es/Event/eventType.mjs +1 -0
- package/es/Event/index.d.ts +6 -3
- package/es/Event/index.mjs +7 -0
- package/es/Event/utils/appRedis.mjs +39 -49
- package/es/Event/utils/globalLoading.d.ts +13 -0
- package/es/Event/utils/globalLoading.mjs +104 -0
- package/es/Event/utils/processRovedInfo.mjs +228 -294
- package/es/Event/utils/runGlobalByPage.d.ts +4 -1
- package/es/Event/utils/runGlobalByPage.mjs +297 -301
- package/es/Event/utils/verificationVar.mjs +32 -38
- package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/components/HandwritingPad.vue.d.ts +27 -0
- package/es/components/HandwritingPad.vue.mjs +7 -0
- package/es/components/HandwritingPad.vue_vue_type_script_setup_true_name_HandwritingPad_lang.mjs +109 -0
- package/es/components/HandwritingPad.vue_vue_type_style_index_0_scoped_d5b980b7_lang.css +9 -0
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +1 -0
- package/es/constant/data-format.d.ts +52 -0
- package/es/constant/data-format.mjs +66 -0
- package/es/constant/date-time.d.ts +99 -0
- package/es/constant/date-time.mjs +187 -0
- package/es/constant/index.d.ts +94 -0
- package/es/constant/index.mjs +100 -0
- package/es/controller/design-render/design-render.controller.d.ts +18 -0
- package/es/controller/design-render/design-render.controller.mjs +78 -0
- package/es/controller/design-render-base/design-render-base.controller.d.ts +9 -0
- package/es/controller/design-render-base/design-render-base.controller.mjs +12 -0
- package/es/controller/design-render-container/design-render-container.controller.d.ts +4 -0
- package/es/controller/design-render-container/design-render-container.controller.mjs +5 -0
- package/es/controller/design-render-item/design-render-item.controller.d.ts +4 -0
- package/es/controller/design-render-item/design-render-item.controller.mjs +5 -0
- package/es/controller/index.d.ts +4 -0
- package/es/controller/index.mjs +4 -0
- package/es/enums/index.mjs +17 -5
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.mjs +2 -0
- package/es/hooks/use-design-render-controller/use-design-render-controller.d.ts +11 -0
- package/es/hooks/use-design-render-controller/use-design-render-controller.mjs +32 -0
- package/es/hooks/useStorageRef.mjs +35 -31
- package/es/index.d.ts +4 -0
- package/es/index.mjs +34 -21
- package/es/interface/controller/i-design-render-base.controller.d.ts +43 -0
- package/es/interface/controller/i-design-render-container.controller.d.ts +7 -0
- package/es/interface/controller/i-design-render-item.controller.d.ts +7 -0
- package/es/interface/controller/i-design-render.controller.d.ts +93 -0
- package/es/interface/index.d.ts +12 -0
- package/es/interface/provider/i-render-base-node.provider.d.ts +45 -0
- package/es/interface/provider/i-render-container-node.provider.d.ts +30 -0
- package/es/interface/provider/i-render-editor-node.provider.d.ts +29 -0
- package/es/interface/provider/i-render-item-node.provider.d.ts +30 -0
- package/es/interface/state/i-design-render-base.state.d.ts +19 -0
- package/es/interface/state/i-design-render-container.state.d.ts +11 -0
- package/es/interface/state/i-design-render-item.state.d.ts +11 -0
- package/es/interface/state/i-design-render.state.d.ts +18 -0
- package/es/loader.d.ts +1 -0
- package/es/register/index.d.ts +1 -0
- package/es/register/index.mjs +2 -0
- package/es/register/node/node.register.d.ts +92 -0
- package/es/register/node/node.register.mjs +116 -0
- package/es/register/render-register/render-register.mjs +63 -58
- package/es/state/design-render/design-render.state.d.ts +13 -0
- package/es/state/design-render/design-render.state.mjs +15 -0
- package/es/state/design-render-base/design-render-base.state.d.ts +4 -0
- package/es/state/design-render-base/design-render-base.state.mjs +6 -0
- package/es/state/design-render-container/design-render-container.state.d.ts +4 -0
- package/es/state/design-render-item/design-render-item.state.d.ts +4 -0
- package/es/state/index.d.ts +4 -0
- package/es/utils/cacheAdapter.mjs +62 -54
- package/es/utils/expression/index.d.ts +1 -1
- package/es/utils/expression/index.mjs +105 -122
- package/es/utils/expression/regularExpression/methods.mjs +426 -567
- package/es/utils/field-attrs/basicAttrs.mjs +56 -80
- package/es/utils/field-attrs/index.mjs +16 -13
- package/es/utils/get-ref-data.mjs +41 -59
- package/es/utils/getFieldSchema.mjs +66 -80
- package/es/utils/index.d.ts +6 -3
- package/es/utils/index.mjs +11 -0
- package/es/utils/model-transformer.mjs +74 -64
- package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.d.ts +43 -0
- package/es/utils/render-plugin-pkg-util/render-plugin-pkg-util.mjs +65 -0
- package/es/utils/search/index.d.ts +2 -0
- package/es/utils/search/index.mjs +2 -0
- package/es/utils/search/search-default-value.d.ts +7 -0
- package/es/utils/search/search-default-value.mjs +244 -0
- package/es/utils/search/search-hooks.d.ts +6 -0
- package/es/utils/search/search-hooks.mjs +67 -0
- package/es/utils/useStyle.d.ts +2 -2
- package/es/utils/useStyle.mjs +20 -15
- package/package.json +20 -17
- package/dist/index.esm.min.mjs +0 -7758
- package/dist/index.min.cjs +0 -9
- package/dist/index.system.min.js +0 -9
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { getRefInfoId } from "../../utils/get-ref-data.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import "../utils/processRovedInfo.mjs";
|
|
4
|
+
import { insetDep } from "./controller.mjs";
|
|
5
|
+
import { ASSIGNMENTSTRATEGY_ENUM, Dependency_ENUM } from "@gct-paas/core";
|
|
6
|
+
import { watchDebounced } from "@vueuse/core";
|
|
7
|
+
import { computed, inject, toRef } from "vue";
|
|
8
|
+
//#region src/Event/Dependency/useDependency.ts
|
|
9
|
+
function useDependency(widget, formState = {}, isRow = false) {
|
|
10
|
+
const { readonly, field, isFieldModel, bindFieldLink, refOriginField, refOriginModelKey, refOriginFieldType } = widget.props;
|
|
11
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
12
|
+
const formReadonly = inject("formReadonly", void 0);
|
|
13
|
+
const useProcessFieldEvent = inject("useProcessFieldEvent", void 0);
|
|
14
|
+
if (useProcessFieldEvent) useProcessFieldEvent.useFieldWidget(widget);
|
|
15
|
+
if (!useProcessFieldEvent && widget.formItem && formReadonly?.value !== void 0) widget.props.readonly = formReadonly?.value || widget.props.readonly;
|
|
16
|
+
if (!useProcessFieldEvent && !formReadonly?.value) {
|
|
17
|
+
const readonly_expression = configDependency[Dependency_ENUM.READONLY]?.expression;
|
|
18
|
+
const readonly_field_value = configDependency[Dependency_ENUM.READONLY]?.fieldValue;
|
|
19
|
+
const readonly_value = configDependency[Dependency_ENUM.READONLY]?.value;
|
|
20
|
+
if (!readonly_field_value && readonly_value && readonly_expression) insetDep({
|
|
21
|
+
expression: readonly_expression,
|
|
22
|
+
rowData: isRow ? formState : null
|
|
23
|
+
}, (res) => {
|
|
24
|
+
widget.props.readonly = !!res;
|
|
25
|
+
});
|
|
26
|
+
const required_expression = configDependency[Dependency_ENUM.REQUIRED]?.expression;
|
|
27
|
+
const required_value = configDependency[Dependency_ENUM.REQUIRED]?.value;
|
|
28
|
+
if (!configDependency[Dependency_ENUM.REQUIRED]?.fieldValue && required_value && required_expression) insetDep({
|
|
29
|
+
expression: required_expression,
|
|
30
|
+
rowData: isRow ? formState : null
|
|
31
|
+
}, (res) => {
|
|
32
|
+
widget.props.required = !!res;
|
|
33
|
+
if (res) widget.props.readonly = false;
|
|
34
|
+
else widget.props.readonly = readonly;
|
|
35
|
+
});
|
|
36
|
+
const disabled_expression = configDependency[Dependency_ENUM.DISABLED]?.expression;
|
|
37
|
+
if (configDependency[Dependency_ENUM.DISABLED]?.value && disabled_expression) insetDep({
|
|
38
|
+
expression: disabled_expression,
|
|
39
|
+
rowData: isRow ? formState : null
|
|
40
|
+
}, (res) => {
|
|
41
|
+
widget.props.disabled = !!res;
|
|
42
|
+
if (res) widget.props.readonly = false;
|
|
43
|
+
else widget.props.readonly = readonly;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const assignment_expression = configDependency[Dependency_ENUM.ASSIGNMENT]?.expression;
|
|
47
|
+
const strategy = configDependency[Dependency_ENUM.ASSIGNMENT]?.strategy;
|
|
48
|
+
if (assignment_expression) insetDep({
|
|
49
|
+
expression: assignment_expression,
|
|
50
|
+
rowData: isRow ? formState : null
|
|
51
|
+
}, (res) => {
|
|
52
|
+
formState[field] = res;
|
|
53
|
+
});
|
|
54
|
+
const fieldKey = isFieldModel ? bindFieldLink?.join(".") : field;
|
|
55
|
+
if (!formState._OPCT) formState._OPCT = { _DICT: {} };
|
|
56
|
+
const formRowData = computed(() => {
|
|
57
|
+
if (isFieldModel) return formState._OPCT;
|
|
58
|
+
return formState;
|
|
59
|
+
});
|
|
60
|
+
const value = computed({
|
|
61
|
+
get() {
|
|
62
|
+
if (fieldKey) return formRowData.value[fieldKey];
|
|
63
|
+
return "";
|
|
64
|
+
},
|
|
65
|
+
set(val) {
|
|
66
|
+
if (!!assignment_expression && strategy === ASSIGNMENTSTRATEGY_ENUM.alwaysCover) return;
|
|
67
|
+
formRowData.value[fieldKey] = val;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
if (isFieldModel && refOriginField) {
|
|
71
|
+
/**
|
|
72
|
+
* 多级字段显示逻辑
|
|
73
|
+
* 监听源字段
|
|
74
|
+
* */
|
|
75
|
+
const originField = toRef(() => {
|
|
76
|
+
return formState[bindFieldLink[0]];
|
|
77
|
+
});
|
|
78
|
+
const foreignFields = bindFieldLink.length > 2 ? [bindFieldLink[1] + ".*"] : void 0;
|
|
79
|
+
watchDebounced(originField, async () => {
|
|
80
|
+
try {
|
|
81
|
+
const data = await getRefInfoId({
|
|
82
|
+
ids: originField.value,
|
|
83
|
+
refOriginField: bindFieldLink[0],
|
|
84
|
+
refOriginFieldType,
|
|
85
|
+
model: refOriginModelKey,
|
|
86
|
+
foreignFields
|
|
87
|
+
});
|
|
88
|
+
formRowData.value[fieldKey] = data._OPCT[fieldKey];
|
|
89
|
+
if (!formRowData.value._DICT) formRowData.value._DICT = {};
|
|
90
|
+
formRowData.value._DICT[fieldKey] = data._OPCT._DICT[fieldKey];
|
|
91
|
+
} catch {
|
|
92
|
+
for (const key in formRowData.value) if (key.startsWith(fieldKey)) formRowData.value[key] = void 0;
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
debounce: 100,
|
|
96
|
+
immediate: true
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
value,
|
|
101
|
+
formRowData,
|
|
102
|
+
fieldKey
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function useDependencyByRequired(widget) {
|
|
106
|
+
const { readonly } = widget.props;
|
|
107
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
108
|
+
const required_expression = configDependency[Dependency_ENUM.REQUIRED]?.expression;
|
|
109
|
+
const required_value = configDependency[Dependency_ENUM.REQUIRED]?.value;
|
|
110
|
+
if (!configDependency[Dependency_ENUM.REQUIRED]?.fieldValue && required_value && required_expression) insetDep({ expression: required_expression }, (res) => {
|
|
111
|
+
widget.props.required = !!res;
|
|
112
|
+
if (res) widget.props.readonly = false;
|
|
113
|
+
else widget.props.readonly = readonly;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { useDependency, useDependencyByRequired };
|
|
@@ -5,6 +5,6 @@ export declare function dependencyToShow(widget: LowCodeWidget.BasicSchema, rowD
|
|
|
5
5
|
/**直接返回计算结果的依赖显隐逻辑 */
|
|
6
6
|
export declare function dependencyToShowSync(widget: LowCodeWidget.BasicSchema, rowData?: object): Promise<boolean>;
|
|
7
7
|
/**组件集合处理 */
|
|
8
|
-
export declare function useDependencyToShowList(widgetList:
|
|
8
|
+
export declare function useDependencyToShowList<T extends LowCodeWidget.BasicSchema = LowCodeWidget.BasicSchema>(widgetList: T[], rowData?: object): Ref<T[]>;
|
|
9
9
|
export declare function tableWidgetToShow(widget: LowCodeWidget.BasicSchema, callback: (res: unknown) => void): void;
|
|
10
10
|
export declare function tableWidgetByDept(widget: LowCodeWidget.BasicSchema): void;
|
|
@@ -1,109 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { useVisibileByRuleHook } from
|
|
5
|
-
import { Dependency_ENUM, DisplayType } from
|
|
6
|
-
|
|
1
|
+
import { getPremission } from "../utils/runGlobalByPage.mjs";
|
|
2
|
+
import "../utils/processRovedInfo.mjs";
|
|
3
|
+
import { calculateDepResult, insetDep } from "./controller.mjs";
|
|
4
|
+
import { useVisibileByRuleHook } from "./displayRule.mjs";
|
|
5
|
+
import { Dependency_ENUM, DisplayType } from "@gct-paas/core";
|
|
6
|
+
import { inject, toRef } from "vue";
|
|
7
|
+
//#region src/Event/Dependency/useDependencyToShow.ts
|
|
7
8
|
function useDependencyToShow(widget) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
9
|
+
if (widget.props?.displayRule && widget.props?.displayType === DisplayType.RULE)
|
|
10
|
+
/**老版本显隐逻辑 */
|
|
11
|
+
return useVisibileByRuleHook(widget.props, widget.id);
|
|
12
|
+
else return dependencyToShow(widget);
|
|
13
13
|
}
|
|
14
14
|
function dependencyToShow(widget, rowData) {
|
|
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
|
-
|
|
15
|
+
if (!widget.id) return false;
|
|
16
|
+
if (!getPremission(widget.id)) {
|
|
17
|
+
/**权限不存在就直接返回false */
|
|
18
|
+
widget.props.hidden = true;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const useProcessFieldEvent = inject("useProcessFieldEvent", void 0);
|
|
22
|
+
if (useProcessFieldEvent) {
|
|
23
|
+
/**流程节点隐藏的字段 */
|
|
24
|
+
useProcessFieldEvent.useFieldToShow(widget);
|
|
25
|
+
return !widget.props.hidden;
|
|
26
|
+
}
|
|
27
|
+
const { displayType, displayRule } = widget.props || {};
|
|
28
|
+
const { value, expression } = (widget.props.componentDependency?.configDependency || {})[Dependency_ENUM.HIDDEN] || {};
|
|
29
|
+
if (value && expression) {
|
|
30
|
+
widget.props.hidden = true;
|
|
31
|
+
insetDep({
|
|
32
|
+
expression,
|
|
33
|
+
rowData
|
|
34
|
+
}, (res) => {
|
|
35
|
+
widget.props.hidden = !!res;
|
|
36
|
+
});
|
|
37
|
+
} else if (value)
|
|
38
|
+
/**开启组件依赖没有配置隐藏条件 */
|
|
39
|
+
widget.props.hidden = true;
|
|
40
|
+
else if (displayType === DisplayType.RULE && displayRule) {
|
|
41
|
+
/**老数据显示隐藏配置兼容 */
|
|
42
|
+
widget.props.hidden = true;
|
|
43
|
+
insetDep({
|
|
44
|
+
expression: displayRule,
|
|
45
|
+
rowData
|
|
46
|
+
}, (res) => {
|
|
47
|
+
widget.props.hidden = !res;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return toRef(() => !widget.props.hidden);
|
|
45
51
|
}
|
|
52
|
+
/**直接返回计算结果的依赖显隐逻辑 */
|
|
46
53
|
async function dependencyToShowSync(widget, rowData) {
|
|
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
|
-
|
|
54
|
+
if (!widget.id) return false;
|
|
55
|
+
if (!getPremission(widget.id)) {
|
|
56
|
+
/**权限不存在就直接返回false */
|
|
57
|
+
widget.props.hidden = true;
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const useProcessFieldEvent = inject("useProcessFieldEvent", void 0);
|
|
61
|
+
if (useProcessFieldEvent) {
|
|
62
|
+
/**流程节点隐藏的字段 */
|
|
63
|
+
useProcessFieldEvent.useFieldToShow(widget);
|
|
64
|
+
return !widget.props.hidden;
|
|
65
|
+
}
|
|
66
|
+
const { displayType, displayRule } = widget.props || {};
|
|
67
|
+
const { value, expression } = (widget.props.componentDependency?.configDependency || {})[Dependency_ENUM.HIDDEN] || {};
|
|
68
|
+
if (value && expression) {
|
|
69
|
+
widget.props.hidden = true;
|
|
70
|
+
widget.props.hidden = !!await calculateDepResult({
|
|
71
|
+
expression,
|
|
72
|
+
rowData
|
|
73
|
+
});
|
|
74
|
+
} else if (value)
|
|
75
|
+
/**开启组件依赖没有配置隐藏条件 */
|
|
76
|
+
widget.props.hidden = true;
|
|
77
|
+
else if (displayType === DisplayType.RULE && displayRule) {
|
|
78
|
+
/**老数据显示隐藏配置兼容 */
|
|
79
|
+
widget.props.hidden = true;
|
|
80
|
+
widget.props.hidden = !!await calculateDepResult({
|
|
81
|
+
expression: displayRule,
|
|
82
|
+
rowData
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return !widget.props.hidden;
|
|
76
86
|
}
|
|
87
|
+
/**组件集合处理 */
|
|
77
88
|
function useDependencyToShowList(widgetList, rowData) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
widgetList.forEach((widget) => {
|
|
90
|
+
dependencyToShow(widget, rowData);
|
|
91
|
+
});
|
|
92
|
+
return toRef(() => widgetList.filter((i) => !i.props.hidden));
|
|
82
93
|
}
|
|
83
94
|
function tableWidgetToShow(widget, callback) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
callback(widget.props.hidden);
|
|
95
|
+
const { value, expression } = (widget.props.componentDependency?.configDependency || {})[Dependency_ENUM.HIDDEN] || {};
|
|
96
|
+
if (value && expression) insetDep({ expression }, (res) => {
|
|
97
|
+
callback(res);
|
|
98
|
+
});
|
|
99
|
+
callback(widget.props.hidden);
|
|
92
100
|
}
|
|
93
101
|
function tableWidgetByDept(widget) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
insetDep({ expression: required_expression }, (res) => {
|
|
104
|
-
widget.props.required = !!res;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
102
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
103
|
+
const { value, expression } = configDependency[Dependency_ENUM.HIDDEN] || {};
|
|
104
|
+
if (value && expression) insetDep({ expression }, (res) => {
|
|
105
|
+
widget.props.hidden = !!res;
|
|
106
|
+
});
|
|
107
|
+
const { value: required_value, expression: required_expression } = configDependency[Dependency_ENUM.REQUIRED] || {};
|
|
108
|
+
if (required_value && required_expression) insetDep({ expression: required_expression }, (res) => {
|
|
109
|
+
widget.props.required = !!res;
|
|
110
|
+
});
|
|
107
111
|
}
|
|
108
|
-
|
|
112
|
+
//#endregion
|
|
109
113
|
export { dependencyToShow, dependencyToShowSync, tableWidgetByDept, tableWidgetToShow, useDependencyToShow, useDependencyToShowList };
|
package/es/Event/baseEvent.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { ProcessOperateRequest } from '@gct-paas/api/apaas';
|
|
1
2
|
import { pageLayoutModeEnum } from '@gct-paas/core';
|
|
2
|
-
import { Ref } from 'vue';
|
|
3
|
-
import { FunctionType, InitNodeOptions, EventsConstructor } from './eventType';
|
|
4
|
-
import { ProcessAppRovedData } from './utils/processRovedInfo';
|
|
5
3
|
import { LowCodeWidget } from '@gct-paas/schema';
|
|
6
|
-
import {
|
|
4
|
+
import { ComponentPublicInstance, Ref } from 'vue';
|
|
7
5
|
import { $httpBizService, $request } from './bizServiceRequest';
|
|
6
|
+
import { EventsConstructor, FunctionType, InitNodeOptions } from './eventType';
|
|
7
|
+
import { ProcessAppRovedData } from './utils/processRovedInfo';
|
|
8
|
+
type ContextConstructor<T extends Context> = new (args: {
|
|
9
|
+
$ref: (key: string) => GctComponent | undefined;
|
|
10
|
+
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
11
|
+
}) => T;
|
|
12
|
+
export type ModalInstance = null | undefined | (ComponentPublicInstance & {
|
|
13
|
+
open: Fn;
|
|
14
|
+
close: Fn;
|
|
15
|
+
});
|
|
8
16
|
export declare class Events<TContext extends Context = Context> {
|
|
9
17
|
#private;
|
|
10
18
|
context: TContext;
|
|
@@ -22,8 +30,8 @@ export declare class Events<TContext extends Context = Context> {
|
|
|
22
30
|
/**流程信息 */
|
|
23
31
|
ProcessAppRoved?: ProcessAppRovedData;
|
|
24
32
|
pageLayoutMode?: pageLayoutModeEnum;
|
|
25
|
-
constructor({ js, css, pageKey,
|
|
26
|
-
|
|
33
|
+
constructor({ js, css, pageKey, ContextVm, }: EventsConstructor & {
|
|
34
|
+
ContextVm: ContextConstructor<TContext>;
|
|
27
35
|
});
|
|
28
36
|
/**初始化流程节点信息 */
|
|
29
37
|
runProcessBySaskId({ taskId, processInstanceId, examineAndApproveState, refFormId, }: IObject): Promise<void>;
|
|
@@ -58,7 +66,7 @@ export declare class Events<TContext extends Context = Context> {
|
|
|
58
66
|
* @param fun
|
|
59
67
|
* @returns
|
|
60
68
|
*/
|
|
61
|
-
getReadyByFun(fun
|
|
69
|
+
getReadyByFun(fun?: FunctionType): Promise<undefined>;
|
|
62
70
|
/**
|
|
63
71
|
* 流程处理
|
|
64
72
|
* @param processDateValue
|
|
@@ -75,14 +83,9 @@ export declare class Context {
|
|
|
75
83
|
/**根据key异步获取获取组件 */
|
|
76
84
|
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
77
85
|
/**根据id获取模态框 */
|
|
78
|
-
$getModal?: (key: string) =>
|
|
79
|
-
open: FunctionType;
|
|
80
|
-
close: FunctionType;
|
|
81
|
-
};
|
|
86
|
+
$getModal?: (key: string) => ModalInstance;
|
|
82
87
|
/**关闭当前上下文模态框 */
|
|
83
88
|
$closeModal?: () => void;
|
|
84
|
-
/** 跳转指定页面 */
|
|
85
|
-
$push?: (path: string, params?: IData) => void;
|
|
86
89
|
/**调用第三方服务 */
|
|
87
90
|
$customBizService: {
|
|
88
91
|
post: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
@@ -90,28 +93,23 @@ export declare class Context {
|
|
|
90
93
|
put: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
91
94
|
delete: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
92
95
|
};
|
|
93
|
-
/**建模追溯 */
|
|
94
|
-
$modelingTraceability?: FunctionType;
|
|
95
|
-
/** 电子签名 */
|
|
96
|
-
$modelingElectronicSignature?: FunctionType;
|
|
97
|
-
/** 单据打印预览弹框 */
|
|
98
|
-
$documentPrint?: FunctionType;
|
|
99
|
-
/** 在线表单信息弹框 */
|
|
100
|
-
$onlineFormModal?: FunctionType;
|
|
101
|
-
/** eDHR填报全屏弹框 */
|
|
102
|
-
$eDHRFillFullScreenModal?: FunctionType;
|
|
103
|
-
/** 表单填报弹框 */
|
|
104
|
-
$openDocumentFillingModal?: FunctionType;
|
|
105
|
-
/** 签名确认弹框 */
|
|
106
|
-
$modelingSignatureConfirm?: FunctionType;
|
|
107
|
-
$routeQuery?: () => IData;
|
|
108
96
|
/**组件id和widget 的map */
|
|
109
97
|
gctWidgets: Record<string, LowCodeWidget.BasicSchema>;
|
|
98
|
+
constructor({ $ref, $asyncRef }: IObject);
|
|
110
99
|
/**ctx 下的工具函数 */
|
|
111
100
|
readonly $utility: IObject;
|
|
112
101
|
$httpBizService: typeof $httpBizService;
|
|
113
102
|
$request: typeof $request;
|
|
114
|
-
|
|
103
|
+
/**全局loading */
|
|
104
|
+
$loading: {
|
|
105
|
+
mask: HTMLDivElement;
|
|
106
|
+
container: HTMLDivElement;
|
|
107
|
+
spinner: HTMLDivElement;
|
|
108
|
+
createLoadingElement(): void;
|
|
109
|
+
initStyle(): void;
|
|
110
|
+
show(): void;
|
|
111
|
+
hide(): void;
|
|
112
|
+
};
|
|
115
113
|
$getPremission(id: string): boolean;
|
|
116
114
|
/**
|
|
117
115
|
*
|
|
@@ -137,13 +135,11 @@ export declare class Context {
|
|
|
137
135
|
$setPropsByKey(key: string, fromProp: LowCodeWidget.BasicSchema['props']): void;
|
|
138
136
|
/**获取组件的属性 */
|
|
139
137
|
$getPropsByKey(key: string, PropsKey?: string | string[], root?: boolean): IObject;
|
|
140
|
-
/**全局loading */
|
|
141
|
-
$loading?: FunctionType;
|
|
142
138
|
}
|
|
143
139
|
/**
|
|
144
140
|
* 获取组件实例公用方法
|
|
145
141
|
*/
|
|
146
|
-
declare class GctComponent {
|
|
142
|
+
export declare class GctComponent {
|
|
147
143
|
modelKey?: string;
|
|
148
144
|
getValue?: () => {
|
|
149
145
|
id?: string;
|