@gct-paas/render 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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.esm.min.mjs +7825 -0
- package/dist/index.min.cjs +17 -0
- package/dist/index.system.min.js +17 -0
- package/es/Event/Dependency/controller.d.ts +13 -0
- package/es/Event/Dependency/controller.mjs +97 -0
- package/es/Event/Dependency/displayRule.d.ts +19 -0
- package/es/Event/Dependency/displayRule.mjs +76 -0
- package/es/Event/Dependency/useDependency.d.ts +7 -0
- package/es/Event/Dependency/useDependencyToShow.d.ts +10 -0
- package/es/Event/Dependency/useDependencyToShow.mjs +109 -0
- package/es/Event/baseEvent.d.ts +155 -0
- package/es/Event/baseEvent.mjs +430 -0
- package/es/Event/bizServiceRequest.d.ts +26 -0
- package/es/Event/bizServiceRequest.mjs +47 -0
- package/es/Event/eventType.d.ts +20 -0
- package/es/Event/index.d.ts +4 -0
- package/es/Event/utils/appRedis.d.ts +29 -0
- package/es/Event/utils/appRedis.mjs +50 -0
- package/es/Event/utils/globalLoading.d.ts +13 -0
- package/es/Event/utils/globalLoading.mjs +103 -0
- package/es/Event/utils/processRovedInfo.d.ts +100 -0
- package/es/Event/utils/processRovedInfo.mjs +297 -0
- package/es/Event/utils/runGlobalByPage.d.ts +333 -0
- package/es/Event/utils/runGlobalByPage.mjs +306 -0
- package/es/Event/utils/verificationVar.d.ts +2 -0
- package/es/Event/utils/verificationVar.mjs +42 -0
- package/es/enums/index.d.ts +14 -0
- package/es/enums/index.mjs +6 -0
- package/es/hooks/useStorageRef.d.ts +9 -0
- package/es/hooks/useStorageRef.mjs +33 -0
- package/es/index.d.ts +3 -0
- package/es/index.mjs +23 -0
- package/es/register/index.d.ts +1 -0
- package/es/register/render-register/render-register.d.ts +54 -0
- package/es/register/render-register/render-register.mjs +59 -0
- package/es/types/index.d.ts +7 -0
- package/es/utils/cacheAdapter.d.ts +7 -0
- package/es/utils/cacheAdapter.mjs +57 -0
- package/es/utils/expression/index.d.ts +6 -0
- package/es/utils/expression/index.mjs +133 -0
- package/es/utils/expression/regularExpression/methods.d.ts +77 -0
- package/es/utils/expression/regularExpression/methods.mjs +729 -0
- package/es/utils/field-attrs/basicAttrs.d.ts +12 -0
- package/es/utils/field-attrs/basicAttrs.mjs +82 -0
- package/es/utils/field-attrs/index.d.ts +6 -0
- package/es/utils/field-attrs/index.mjs +15 -0
- package/es/utils/get-ref-data.d.ts +1 -0
- package/es/utils/get-ref-data.mjs +62 -0
- package/es/utils/getFieldSchema.d.ts +26 -0
- package/es/utils/getFieldSchema.mjs +83 -0
- package/es/utils/index.d.ts +6 -0
- package/es/utils/model-transformer.d.ts +46 -0
- package/es/utils/model-transformer.mjs +77 -0
- package/es/utils/useStyle.d.ts +21 -0
- package/es/utils/useStyle.mjs +17 -0
- package/package.json +72 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**组件依赖触发器 */
|
|
2
|
+
export declare function insetDep({ expression, rowData, }: {
|
|
3
|
+
expression?: string;
|
|
4
|
+
rowData?: IObject | null;
|
|
5
|
+
}, callback: (value: unknown) => void): void;
|
|
6
|
+
/**
|
|
7
|
+
* 直接计算表达式结果,不进行依赖监控
|
|
8
|
+
* 用于一次性计算场景,快速获取表达式判断结果
|
|
9
|
+
*/
|
|
10
|
+
export declare function calculateDepResult({ expression, rowData, }: {
|
|
11
|
+
expression?: string;
|
|
12
|
+
rowData?: IObject | null;
|
|
13
|
+
}): Promise<true | IObject>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { formMap, globalVarCaches, pageGlobaVariables } from '../utils/runGlobalByPage.mjs';
|
|
3
|
+
import { watchDebounced } from '@vueuse/core';
|
|
4
|
+
import '@gct-paas/core';
|
|
5
|
+
import 'lodash-es';
|
|
6
|
+
import '../../utils/field-attrs/basicAttrs.mjs';
|
|
7
|
+
import '@gct-paas/schema';
|
|
8
|
+
import { identify, calculate } from '../../utils/expression/index.mjs';
|
|
9
|
+
import 'qs';
|
|
10
|
+
|
|
11
|
+
function insetDep({
|
|
12
|
+
expression = "",
|
|
13
|
+
rowData = null
|
|
14
|
+
}, callback) {
|
|
15
|
+
if (!expression || expression === "true") {
|
|
16
|
+
callback(true);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const identifyArgs = identify(expression);
|
|
20
|
+
const formCacheMap = identifyArgs.reduce((total, i) => {
|
|
21
|
+
const arg = i.split(".");
|
|
22
|
+
total[i] = { formKey: arg[0], itemKey: arg[1] };
|
|
23
|
+
return total;
|
|
24
|
+
}, {});
|
|
25
|
+
const cacheFormFileds = computed(() => {
|
|
26
|
+
return identifyArgs.reduce((total, i) => {
|
|
27
|
+
const arg = i.split(".");
|
|
28
|
+
const formKey = arg[0] + "";
|
|
29
|
+
const filedKey = arg[1];
|
|
30
|
+
if (filedKey) {
|
|
31
|
+
const value = (rowData ? rowData[filedKey] : formMap.value[formKey]?.[filedKey]) ?? "";
|
|
32
|
+
if (total[formKey]) {
|
|
33
|
+
total[formKey][filedKey] = value;
|
|
34
|
+
} else {
|
|
35
|
+
total[formKey] = { [filedKey]: value };
|
|
36
|
+
}
|
|
37
|
+
} else if (formKey.startsWith("$VAR_") || formKey.startsWith("$IVAR_")) {
|
|
38
|
+
total[formKey] = globalVarCaches.value[formKey]?.value ?? "";
|
|
39
|
+
} else if (formKey.startsWith("$PAGERVAR_") || formKey.startsWith("$IPAGERVAR_")) {
|
|
40
|
+
total[formKey] = pageGlobaVariables.value[formKey]?.value ?? "";
|
|
41
|
+
}
|
|
42
|
+
return total;
|
|
43
|
+
}, {});
|
|
44
|
+
});
|
|
45
|
+
function playValueByRule(form) {
|
|
46
|
+
const cache = {};
|
|
47
|
+
Object.keys(formCacheMap).forEach((k) => {
|
|
48
|
+
const { formKey, itemKey } = formCacheMap[k];
|
|
49
|
+
const value = itemKey ? form[formKey]?.[itemKey] : form[formKey];
|
|
50
|
+
cache[k] = value;
|
|
51
|
+
});
|
|
52
|
+
calculate(expression, cache).then(callback);
|
|
53
|
+
}
|
|
54
|
+
if (rowData) playValueByRule(cacheFormFileds.value);
|
|
55
|
+
watchDebounced(
|
|
56
|
+
cacheFormFileds,
|
|
57
|
+
() => {
|
|
58
|
+
playValueByRule(cacheFormFileds.value);
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
debounce: 200,
|
|
62
|
+
immediate: !rowData
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
async function calculateDepResult({
|
|
67
|
+
expression = "",
|
|
68
|
+
rowData = null
|
|
69
|
+
}) {
|
|
70
|
+
if (!expression || expression === "true") {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
const identifyArgs = identify(expression);
|
|
74
|
+
const formCacheMap = identifyArgs.reduce((total, i) => {
|
|
75
|
+
const arg = i.split(".");
|
|
76
|
+
total[i] = { formKey: arg[0], itemKey: arg[1] };
|
|
77
|
+
return total;
|
|
78
|
+
}, {});
|
|
79
|
+
const cache = {};
|
|
80
|
+
Object.keys(formCacheMap).forEach((k) => {
|
|
81
|
+
const { formKey, itemKey } = formCacheMap[k];
|
|
82
|
+
let value = "";
|
|
83
|
+
if (formKey.startsWith("$VAR_")) {
|
|
84
|
+
value = globalVarCaches.value[formKey]?.value ?? "";
|
|
85
|
+
} else if (formKey.startsWith("$PAGERVAR_")) {
|
|
86
|
+
value = pageGlobaVariables.value[formKey]?.value ?? "";
|
|
87
|
+
} else if (itemKey) {
|
|
88
|
+
value = (rowData ? rowData[itemKey] : formMap.value[formKey]?.[itemKey]) ?? "";
|
|
89
|
+
} else {
|
|
90
|
+
value = (rowData ? rowData[formKey] : formMap.value[formKey]) ?? "";
|
|
91
|
+
}
|
|
92
|
+
cache[k] = value;
|
|
93
|
+
});
|
|
94
|
+
return calculate(expression, cache);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { calculateDepResult, insetDep };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DisplayType } from '@gct-paas/core';
|
|
2
|
+
interface DisplayRule {
|
|
3
|
+
hidden?: boolean;
|
|
4
|
+
displayType?: DisplayType;
|
|
5
|
+
displayRule?: string;
|
|
6
|
+
tableForm?: object;
|
|
7
|
+
id?: number;
|
|
8
|
+
}
|
|
9
|
+
/**单组件显隐控制 */
|
|
10
|
+
export declare function useVisibileByRuleHook(props: DisplayRule, id: string): false | Readonly<import('vue').Ref<boolean, boolean>>;
|
|
11
|
+
/**
|
|
12
|
+
* 需要做控制的数组组件
|
|
13
|
+
* @param optopns 被控制的数组
|
|
14
|
+
* @param tableForm 需要添加的额外的form {key:object }
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function useDisplayRuleOptions(optopns: IObject[], tableForm?: IObject): Readonly<import('vue').Ref<IObject[], IObject[]>>;
|
|
18
|
+
export declare function useDisplayRuleColumnByStyles(optopnslist: IObject[], tableForm?: IObject): Readonly<import('vue').Ref<IObject | undefined, IObject | undefined>> | undefined;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { DisplayType } from '@gct-paas/core';
|
|
2
|
+
import 'lodash-es';
|
|
3
|
+
import '../../utils/field-attrs/basicAttrs.mjs';
|
|
4
|
+
import '@gct-paas/schema';
|
|
5
|
+
import { identify, calculate } from '../../utils/expression/index.mjs';
|
|
6
|
+
import 'qs';
|
|
7
|
+
import { toRef, ref } from 'vue';
|
|
8
|
+
import { getPremission, formMap } from '../utils/runGlobalByPage.mjs';
|
|
9
|
+
import { watchDebounced } from '@vueuse/core';
|
|
10
|
+
|
|
11
|
+
function useVisibileByRuleHook(props, id) {
|
|
12
|
+
if (!getPremission(id)) {
|
|
13
|
+
return false;
|
|
14
|
+
} else if (props.displayType === DisplayType.CONFIG) {
|
|
15
|
+
return toRef(() => !props.hidden);
|
|
16
|
+
} else {
|
|
17
|
+
return useDisplayRule(props);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function useDisplayRule(rule) {
|
|
21
|
+
const formCache = ref(false);
|
|
22
|
+
getOptionsByDisplayRule(rule, (f) => {
|
|
23
|
+
formCache.value = !!f;
|
|
24
|
+
});
|
|
25
|
+
return formCache;
|
|
26
|
+
}
|
|
27
|
+
function getOptionsByDisplayRule({ displayRule, tableForm }, callback) {
|
|
28
|
+
if (!displayRule) {
|
|
29
|
+
callback(true);
|
|
30
|
+
} else {
|
|
31
|
+
const identifyArgs = identify(displayRule);
|
|
32
|
+
const formCacheMap = identifyArgs.reduce((total, i) => {
|
|
33
|
+
const arg = i.split(".");
|
|
34
|
+
total[i] = { formKey: arg[0], itemKey: arg[1] };
|
|
35
|
+
return total;
|
|
36
|
+
}, {});
|
|
37
|
+
const cacheFormFileds = toRef(() => {
|
|
38
|
+
return identifyArgs.reduce((total, i) => {
|
|
39
|
+
const arg = i.split(".");
|
|
40
|
+
const formKey = arg[0] + "", filedKey = arg[1] + "";
|
|
41
|
+
const value = { ...tableForm, ...formMap.value }[formKey]?.[filedKey];
|
|
42
|
+
if (total[formKey]) {
|
|
43
|
+
total[formKey][filedKey] = value;
|
|
44
|
+
} else {
|
|
45
|
+
total[formKey] = { [filedKey]: value };
|
|
46
|
+
}
|
|
47
|
+
return total;
|
|
48
|
+
}, {});
|
|
49
|
+
});
|
|
50
|
+
watchDebounced(
|
|
51
|
+
cacheFormFileds,
|
|
52
|
+
() => {
|
|
53
|
+
playValueByRule(
|
|
54
|
+
cacheFormFileds.value,
|
|
55
|
+
formCacheMap,
|
|
56
|
+
displayRule,
|
|
57
|
+
(flag) => {
|
|
58
|
+
callback(flag);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
{ immediate: true, debounce: 300 }
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function playValueByRule(form, formCacheMap, displayRule, callback) {
|
|
67
|
+
const cache = {};
|
|
68
|
+
Object.keys(formCacheMap).forEach((k) => {
|
|
69
|
+
const { formKey, itemKey } = formCacheMap[k];
|
|
70
|
+
const value = form?.[formKey]?.[itemKey];
|
|
71
|
+
cache[k] = value;
|
|
72
|
+
});
|
|
73
|
+
calculate(displayRule, cache).then(callback);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { useVisibileByRuleHook };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
export declare function useDependency(widget: LowCodeWidget.BasicSchema, formState?: IObject, isRow?: boolean): {
|
|
3
|
+
value: import('vue').WritableComputedRef<any, any>;
|
|
4
|
+
formRowData: import('vue').ComputedRef<any>;
|
|
5
|
+
fieldKey: any;
|
|
6
|
+
};
|
|
7
|
+
export declare function useDependencyByRequired(widget: LowCodeWidget.BasicSchema): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
3
|
+
export declare function useDependencyToShow(widget: LowCodeWidget.BasicSchema): boolean | Readonly<Ref<boolean, boolean>>;
|
|
4
|
+
export declare function dependencyToShow(widget: LowCodeWidget.BasicSchema, rowData?: object): boolean | Ref<boolean>;
|
|
5
|
+
/**直接返回计算结果的依赖显隐逻辑 */
|
|
6
|
+
export declare function dependencyToShowSync(widget: LowCodeWidget.BasicSchema, rowData?: object): Promise<boolean>;
|
|
7
|
+
/**组件集合处理 */
|
|
8
|
+
export declare function useDependencyToShowList<T extends LowCodeWidget.BasicSchema = LowCodeWidget.BasicSchema>(widgetList: T[], rowData?: object): Ref<T[]>;
|
|
9
|
+
export declare function tableWidgetToShow(widget: LowCodeWidget.BasicSchema, callback: (res: unknown) => void): void;
|
|
10
|
+
export declare function tableWidgetByDept(widget: LowCodeWidget.BasicSchema): void;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { inject, toRef } from 'vue';
|
|
2
|
+
import { getPremission } from '../utils/runGlobalByPage.mjs';
|
|
3
|
+
import { insetDep, calculateDepResult } from './controller.mjs';
|
|
4
|
+
import { useVisibileByRuleHook } from './displayRule.mjs';
|
|
5
|
+
import { Dependency_ENUM, DisplayType } from '@gct-paas/core';
|
|
6
|
+
|
|
7
|
+
function useDependencyToShow(widget) {
|
|
8
|
+
if (widget.props?.displayRule && widget.props?.displayType === DisplayType.RULE) {
|
|
9
|
+
return useVisibileByRuleHook(widget.props, widget.id);
|
|
10
|
+
} else {
|
|
11
|
+
return dependencyToShow(widget);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function dependencyToShow(widget, rowData) {
|
|
15
|
+
if (!widget.id) return false;
|
|
16
|
+
if (!getPremission(widget.id)) {
|
|
17
|
+
widget.props.hidden = true;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const useProcessFieldEvent = inject(
|
|
21
|
+
"useProcessFieldEvent",
|
|
22
|
+
void 0
|
|
23
|
+
);
|
|
24
|
+
if (useProcessFieldEvent) {
|
|
25
|
+
useProcessFieldEvent.useFieldToShow(widget);
|
|
26
|
+
return !widget.props.hidden;
|
|
27
|
+
}
|
|
28
|
+
const { displayType, displayRule } = widget.props || {};
|
|
29
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
30
|
+
const { value, expression } = configDependency[Dependency_ENUM.HIDDEN] || {};
|
|
31
|
+
if (value && expression) {
|
|
32
|
+
widget.props.hidden = true;
|
|
33
|
+
insetDep({ expression, rowData }, (res) => {
|
|
34
|
+
widget.props.hidden = !!res;
|
|
35
|
+
});
|
|
36
|
+
} else if (value) {
|
|
37
|
+
widget.props.hidden = true;
|
|
38
|
+
} else if (displayType === DisplayType.RULE && displayRule) {
|
|
39
|
+
widget.props.hidden = true;
|
|
40
|
+
insetDep({ expression: displayRule, rowData }, (res) => {
|
|
41
|
+
widget.props.hidden = !res;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return toRef(() => !widget.props.hidden);
|
|
45
|
+
}
|
|
46
|
+
async function dependencyToShowSync(widget, rowData) {
|
|
47
|
+
if (!widget.id) return false;
|
|
48
|
+
if (!getPremission(widget.id)) {
|
|
49
|
+
widget.props.hidden = true;
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const useProcessFieldEvent = inject(
|
|
53
|
+
"useProcessFieldEvent",
|
|
54
|
+
void 0
|
|
55
|
+
);
|
|
56
|
+
if (useProcessFieldEvent) {
|
|
57
|
+
useProcessFieldEvent.useFieldToShow(widget);
|
|
58
|
+
return !widget.props.hidden;
|
|
59
|
+
}
|
|
60
|
+
const { displayType, displayRule } = widget.props || {};
|
|
61
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
62
|
+
const { value, expression } = configDependency[Dependency_ENUM.HIDDEN] || {};
|
|
63
|
+
if (value && expression) {
|
|
64
|
+
widget.props.hidden = true;
|
|
65
|
+
widget.props.hidden = !!await calculateDepResult({ expression, rowData });
|
|
66
|
+
} else if (value) {
|
|
67
|
+
widget.props.hidden = true;
|
|
68
|
+
} else if (displayType === DisplayType.RULE && displayRule) {
|
|
69
|
+
widget.props.hidden = true;
|
|
70
|
+
widget.props.hidden = !!await calculateDepResult({
|
|
71
|
+
expression: displayRule,
|
|
72
|
+
rowData
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return !widget.props.hidden;
|
|
76
|
+
}
|
|
77
|
+
function useDependencyToShowList(widgetList, rowData) {
|
|
78
|
+
widgetList.forEach((widget) => {
|
|
79
|
+
dependencyToShow(widget, rowData);
|
|
80
|
+
});
|
|
81
|
+
return toRef(() => widgetList.filter((i) => !i.props.hidden));
|
|
82
|
+
}
|
|
83
|
+
function tableWidgetToShow(widget, callback) {
|
|
84
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
85
|
+
const { value, expression } = configDependency[Dependency_ENUM.HIDDEN] || {};
|
|
86
|
+
if (value && expression) {
|
|
87
|
+
insetDep({ expression }, (res) => {
|
|
88
|
+
callback(res);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
callback(widget.props.hidden);
|
|
92
|
+
}
|
|
93
|
+
function tableWidgetByDept(widget) {
|
|
94
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
95
|
+
const { value, expression } = configDependency[Dependency_ENUM.HIDDEN] || {};
|
|
96
|
+
if (value && expression) {
|
|
97
|
+
insetDep({ expression }, (res) => {
|
|
98
|
+
widget.props.hidden = !!res;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const { value: required_value, expression: required_expression } = configDependency[Dependency_ENUM.REQUIRED] || {};
|
|
102
|
+
if (required_value && required_expression) {
|
|
103
|
+
insetDep({ expression: required_expression }, (res) => {
|
|
104
|
+
widget.props.required = !!res;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { dependencyToShow, dependencyToShowSync, tableWidgetByDept, tableWidgetToShow, useDependencyToShow, useDependencyToShowList };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { ProcessOperateRequest } from '@gct-paas/api/apaas';
|
|
2
|
+
import { pageLayoutModeEnum } from '@gct-paas/core';
|
|
3
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
4
|
+
import { Ref } from 'vue';
|
|
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 declare class Events<TContext extends Context = Context> {
|
|
13
|
+
#private;
|
|
14
|
+
context: TContext;
|
|
15
|
+
searchVNodes: Record<string, {
|
|
16
|
+
callback: FunctionType;
|
|
17
|
+
comId: string;
|
|
18
|
+
}[]>;
|
|
19
|
+
cssData?: {
|
|
20
|
+
css: Ref<string>;
|
|
21
|
+
load: FunctionType;
|
|
22
|
+
unload: FunctionType;
|
|
23
|
+
};
|
|
24
|
+
pageKey?: string;
|
|
25
|
+
exports: Record<string, FunctionType>;
|
|
26
|
+
/**流程信息 */
|
|
27
|
+
ProcessAppRoved?: ProcessAppRovedData;
|
|
28
|
+
pageLayoutMode?: pageLayoutModeEnum;
|
|
29
|
+
constructor({ js, css, pageKey, ContextPc, }: EventsConstructor & {
|
|
30
|
+
ContextPc: ContextConstructor<TContext>;
|
|
31
|
+
});
|
|
32
|
+
/**初始化流程节点信息 */
|
|
33
|
+
runProcessBySaskId({ taskId, processInstanceId, examineAndApproveState, refFormId, }: IObject): Promise<void>;
|
|
34
|
+
/**保存所有组件的props*/
|
|
35
|
+
runContext(key: string, widget: LowCodeWidget.BasicSchema): void;
|
|
36
|
+
/**触发内置事件 */
|
|
37
|
+
runEventByName(eventName: string, events?: Record<string, IObject>, ...arg: unknown[]): Promise<unknown>;
|
|
38
|
+
/**执行公共函数事件 */
|
|
39
|
+
runExportByName(eventName: string, ...arg: unknown[]): Promise<unknown>;
|
|
40
|
+
/**异步执行公共函数事件 */
|
|
41
|
+
runAsyncExportByName(eventName: string, ...arg: unknown[]): Promise<unknown>;
|
|
42
|
+
initNode(key: string, options: InitNodeOptions): void;
|
|
43
|
+
/**组件销毁 */
|
|
44
|
+
destroyNode(key: string): void;
|
|
45
|
+
initSearchs(key: string, callback: FunctionType, comId: string): void;
|
|
46
|
+
cancelInitSearchs(key: string, comId: string): void;
|
|
47
|
+
runTableBySearch(key: string, data: IObject): void;
|
|
48
|
+
/**
|
|
49
|
+
* 获取组件公用方法 getComponent(identity),根据组件唯一标识获取组件。
|
|
50
|
+
* @param {*} key
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
getComponent(key: string): GctComponent | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* 获取组件公用方法 getComponent(identity),根据组件唯一标识获取组件。
|
|
56
|
+
* @param {*} key
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
getSyncComponent(key?: string): Promise<GctComponent>;
|
|
60
|
+
/**
|
|
61
|
+
* 指定函数中使用到的组件初始化后才执行
|
|
62
|
+
* @param fun
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
getReadyByFun(fun: FunctionType): Promise<undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* 流程处理
|
|
68
|
+
* @param processDateValue
|
|
69
|
+
* @param data
|
|
70
|
+
*/
|
|
71
|
+
processHandle(data: IObject, { opinion, reassignId, signature, countersignUserIds, button, }: ProcessOperateRequest): Promise<void>;
|
|
72
|
+
/**流程审批校验 */
|
|
73
|
+
checkedProcess(formProcessId: string): Promise<undefined>;
|
|
74
|
+
}
|
|
75
|
+
/**作用域 上下文 */
|
|
76
|
+
export declare class Context {
|
|
77
|
+
/**根据key获取当前组件 */
|
|
78
|
+
$ref: (key: string) => GctComponent;
|
|
79
|
+
/**根据key异步获取获取组件 */
|
|
80
|
+
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
81
|
+
/**根据id获取模态框 */
|
|
82
|
+
$getModal?: (key: string) => {
|
|
83
|
+
open: FunctionType;
|
|
84
|
+
close: FunctionType;
|
|
85
|
+
};
|
|
86
|
+
/**关闭当前上下文模态框 */
|
|
87
|
+
$closeModal?: () => void;
|
|
88
|
+
/**调用第三方服务 */
|
|
89
|
+
$customBizService: {
|
|
90
|
+
post: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
91
|
+
get: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
92
|
+
put: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
93
|
+
delete: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
94
|
+
};
|
|
95
|
+
/**组件id和widget 的map */
|
|
96
|
+
gctWidgets: Record<string, LowCodeWidget.BasicSchema>;
|
|
97
|
+
constructor({ $ref, $asyncRef }: IObject);
|
|
98
|
+
/**ctx 下的工具函数 */
|
|
99
|
+
readonly $utility: IObject;
|
|
100
|
+
$httpBizService: typeof $httpBizService;
|
|
101
|
+
$request: typeof $request;
|
|
102
|
+
/**全局loading */
|
|
103
|
+
$loading: {
|
|
104
|
+
mask: HTMLDivElement;
|
|
105
|
+
container: HTMLDivElement;
|
|
106
|
+
spinner: HTMLDivElement;
|
|
107
|
+
createLoadingElement(): void;
|
|
108
|
+
initStyle(): void;
|
|
109
|
+
show(): void;
|
|
110
|
+
hide(): void;
|
|
111
|
+
};
|
|
112
|
+
$getPremission(id: string): boolean;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param key 组件权限标识
|
|
116
|
+
* @param id 组件id
|
|
117
|
+
*/
|
|
118
|
+
$setPremission(key: string, id: string): void;
|
|
119
|
+
/**获取应用全局变量 */
|
|
120
|
+
$getAppGlobalVar(id: string): any;
|
|
121
|
+
/**设置应用全局变量 */
|
|
122
|
+
$setAppGlobalVar(id: string, value: string): void;
|
|
123
|
+
/**获取页面全局变量老版本兼容问题暂时不删除 后续不维护*/
|
|
124
|
+
$getPageGlobalVar(id: string): any;
|
|
125
|
+
/**设置页面变量老版本 兼容问题暂时不删除 后续不维护 */
|
|
126
|
+
$setPageGlobalVar(id: string, value: string): void;
|
|
127
|
+
/**获取页面全局变量 */
|
|
128
|
+
$getPageVar(id: string): any;
|
|
129
|
+
/**设置页面全局变量 */
|
|
130
|
+
$setPageVar(id: string, value: string): void;
|
|
131
|
+
/**根据模态框id 获取上下文 id不传默认页面上下文*/
|
|
132
|
+
$getCtxById(modalKey?: string): any;
|
|
133
|
+
/**设置组件的属性 */
|
|
134
|
+
$setPropsByKey(key: string, fromProp: LowCodeWidget.BasicSchema['props']): void;
|
|
135
|
+
/**获取组件的属性 */
|
|
136
|
+
$getPropsByKey(key: string, PropsKey?: string | string[], root?: boolean): IObject;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 获取组件实例公用方法
|
|
140
|
+
*/
|
|
141
|
+
export declare class GctComponent {
|
|
142
|
+
modelKey?: string;
|
|
143
|
+
getValue?: () => {
|
|
144
|
+
id?: string;
|
|
145
|
+
[key: string]: string | [] | undefined;
|
|
146
|
+
};
|
|
147
|
+
setValue?: FunctionType;
|
|
148
|
+
/**提交 */
|
|
149
|
+
submit?: FunctionType;
|
|
150
|
+
/**刷新 */
|
|
151
|
+
reload?: FunctionType;
|
|
152
|
+
key: string;
|
|
153
|
+
constructor(key: string, options: InitNodeOptions);
|
|
154
|
+
}
|
|
155
|
+
export {};
|