@gct-paas/render 0.1.4-dev.8 → 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 +7684 -15
- package/dist/index.min.cjs +9 -1
- package/dist/index.system.min.js +9 -1
- 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 +160 -0
- package/es/Event/baseEvent.mjs +445 -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/processRovedInfo.d.ts +100 -0
- package/es/Event/utils/processRovedInfo.mjs +297 -0
- package/es/Event/utils/runGlobalByPage.d.ts +332 -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 +2 -0
- package/es/index.mjs +22 -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 +6 -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/index.d.ts +1 -1
- 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 +1 -3
- package/es/utils/getFieldSchema.mjs +83 -0
- package/es/utils/index.d.ts +5 -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 +25 -6
|
@@ -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(widgetList: LowCodeWidget.BasicSchema[], rowData?: object): Readonly<Ref<import('@gct-paas/schema').IBasicSchema[], import('@gct-paas/schema').IBasicSchema[]>>;
|
|
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,160 @@
|
|
|
1
|
+
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
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
6
|
+
import { ProcessOperateRequest } from '@gct-paas/api/apaas';
|
|
7
|
+
import { $httpBizService, $request } from './bizServiceRequest';
|
|
8
|
+
export declare class Events<TContext extends Context = Context> {
|
|
9
|
+
#private;
|
|
10
|
+
context: TContext;
|
|
11
|
+
searchVNodes: Record<string, {
|
|
12
|
+
callback: FunctionType;
|
|
13
|
+
comId: string;
|
|
14
|
+
}[]>;
|
|
15
|
+
cssData?: {
|
|
16
|
+
css: Ref<string>;
|
|
17
|
+
load: FunctionType;
|
|
18
|
+
unload: FunctionType;
|
|
19
|
+
};
|
|
20
|
+
pageKey?: string;
|
|
21
|
+
exports: Record<string, FunctionType>;
|
|
22
|
+
/**流程信息 */
|
|
23
|
+
ProcessAppRoved?: ProcessAppRovedData;
|
|
24
|
+
pageLayoutMode?: pageLayoutModeEnum;
|
|
25
|
+
constructor({ js, css, pageKey, ContextPc, }: EventsConstructor & {
|
|
26
|
+
ContextPc: new (args: IObject) => TContext;
|
|
27
|
+
});
|
|
28
|
+
/**初始化流程节点信息 */
|
|
29
|
+
runProcessBySaskId({ taskId, processInstanceId, examineAndApproveState, refFormId, }: IObject): Promise<void>;
|
|
30
|
+
/**保存所有组件的props*/
|
|
31
|
+
runContext(key: string, widget: LowCodeWidget.BasicSchema): void;
|
|
32
|
+
/**触发内置事件 */
|
|
33
|
+
runEventByName(eventName: string, events?: Record<string, IObject>, ...arg: unknown[]): Promise<unknown>;
|
|
34
|
+
/**执行公共函数事件 */
|
|
35
|
+
runExportByName(eventName: string, ...arg: unknown[]): Promise<unknown>;
|
|
36
|
+
/**异步执行公共函数事件 */
|
|
37
|
+
runAsyncExportByName(eventName: string, ...arg: unknown[]): Promise<unknown>;
|
|
38
|
+
initNode(key: string, options: InitNodeOptions): void;
|
|
39
|
+
/**组件销毁 */
|
|
40
|
+
destroyNode(key: string): void;
|
|
41
|
+
initSearchs(key: string, callback: FunctionType, comId: string): void;
|
|
42
|
+
cancelInitSearchs(key: string, comId: string): void;
|
|
43
|
+
runTableBySearch(key: string, data: IObject): void;
|
|
44
|
+
/**
|
|
45
|
+
* 获取组件公用方法 getComponent(identity),根据组件唯一标识获取组件。
|
|
46
|
+
* @param {*} key
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
getComponent(key: string): GctComponent | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* 获取组件公用方法 getComponent(identity),根据组件唯一标识获取组件。
|
|
52
|
+
* @param {*} key
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
getSyncComponent(key?: string): Promise<GctComponent>;
|
|
56
|
+
/**
|
|
57
|
+
* 指定函数中使用到的组件初始化后才执行
|
|
58
|
+
* @param fun
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
getReadyByFun(fun: FunctionType): Promise<undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* 流程处理
|
|
64
|
+
* @param processDateValue
|
|
65
|
+
* @param data
|
|
66
|
+
*/
|
|
67
|
+
processHandle(data: IObject, { opinion, reassignId, signature, countersignUserIds, button, }: ProcessOperateRequest): Promise<void>;
|
|
68
|
+
/**流程审批校验 */
|
|
69
|
+
checkedProcess(formProcessId: string): Promise<undefined>;
|
|
70
|
+
}
|
|
71
|
+
/**作用域 上下文 */
|
|
72
|
+
export declare class Context {
|
|
73
|
+
/**根据key获取当前组件 */
|
|
74
|
+
$ref: (key: string) => GctComponent;
|
|
75
|
+
/**根据key异步获取获取组件 */
|
|
76
|
+
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
77
|
+
/**根据id获取模态框 */
|
|
78
|
+
$getModal?: (key: string) => {
|
|
79
|
+
open: FunctionType;
|
|
80
|
+
close: FunctionType;
|
|
81
|
+
};
|
|
82
|
+
/**关闭当前上下文模态框 */
|
|
83
|
+
$closeModal?: () => void;
|
|
84
|
+
/** 跳转指定页面 */
|
|
85
|
+
$push?: (path: string, params?: IData) => void;
|
|
86
|
+
/**调用第三方服务 */
|
|
87
|
+
$customBizService: {
|
|
88
|
+
post: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
89
|
+
get: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
90
|
+
put: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
91
|
+
delete: (path: import('./bizServiceRequest').PathType, query?: IObject, data?: IObject, config?: import('axios').AxiosRequestConfig) => Promise<unknown>;
|
|
92
|
+
};
|
|
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
|
+
/**组件id和widget 的map */
|
|
109
|
+
gctWidgets: Record<string, LowCodeWidget.BasicSchema>;
|
|
110
|
+
/**ctx 下的工具函数 */
|
|
111
|
+
readonly $utility: IObject;
|
|
112
|
+
$httpBizService: typeof $httpBizService;
|
|
113
|
+
$request: typeof $request;
|
|
114
|
+
constructor({ $ref, $asyncRef }: IObject);
|
|
115
|
+
$getPremission(id: string): boolean;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param key 组件权限标识
|
|
119
|
+
* @param id 组件id
|
|
120
|
+
*/
|
|
121
|
+
$setPremission(key: string, id: string): void;
|
|
122
|
+
/**获取应用全局变量 */
|
|
123
|
+
$getAppGlobalVar(id: string): any;
|
|
124
|
+
/**设置应用全局变量 */
|
|
125
|
+
$setAppGlobalVar(id: string, value: string): void;
|
|
126
|
+
/**获取页面全局变量老版本兼容问题暂时不删除 后续不维护*/
|
|
127
|
+
$getPageGlobalVar(id: string): any;
|
|
128
|
+
/**设置页面变量老版本 兼容问题暂时不删除 后续不维护 */
|
|
129
|
+
$setPageGlobalVar(id: string, value: string): void;
|
|
130
|
+
/**获取页面全局变量 */
|
|
131
|
+
$getPageVar(id: string): any;
|
|
132
|
+
/**设置页面全局变量 */
|
|
133
|
+
$setPageVar(id: string, value: string): void;
|
|
134
|
+
/**根据模态框id 获取上下文 id不传默认页面上下文*/
|
|
135
|
+
$getCtxById(modalKey?: string): any;
|
|
136
|
+
/**设置组件的属性 */
|
|
137
|
+
$setPropsByKey(key: string, fromProp: LowCodeWidget.BasicSchema['props']): void;
|
|
138
|
+
/**获取组件的属性 */
|
|
139
|
+
$getPropsByKey(key: string, PropsKey?: string | string[], root?: boolean): IObject;
|
|
140
|
+
/**全局loading */
|
|
141
|
+
$loading?: FunctionType;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 获取组件实例公用方法
|
|
145
|
+
*/
|
|
146
|
+
declare class GctComponent {
|
|
147
|
+
modelKey?: string;
|
|
148
|
+
getValue?: () => {
|
|
149
|
+
id?: string;
|
|
150
|
+
[key: string]: string | [] | undefined;
|
|
151
|
+
};
|
|
152
|
+
setValue?: FunctionType;
|
|
153
|
+
/**提交 */
|
|
154
|
+
submit?: FunctionType;
|
|
155
|
+
/**刷新 */
|
|
156
|
+
reload?: FunctionType;
|
|
157
|
+
key: string;
|
|
158
|
+
constructor(key: string, options: InitNodeOptions);
|
|
159
|
+
}
|
|
160
|
+
export {};
|