@gct-paas/render 0.1.4-dev.11 → 0.1.4-dev.13
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.js +6189 -0
- package/dist/index.min.css +2 -0
- package/es/Event/Dependency/controller.mjs +81 -94
- package/es/Event/Dependency/displayRule.mjs +65 -67
- package/es/Event/Dependency/useDependency.mjs +117 -0
- package/es/Event/Dependency/useDependencyToShow.mjs +100 -96
- package/es/Event/baseEvent.d.ts +8 -7
- package/es/Event/baseEvent.mjs +382 -423
- package/es/Event/bizServiceRequest.mjs +28 -40
- package/es/Event/eventType.d.ts +1 -1
- package/es/Event/eventType.mjs +1 -0
- package/es/Event/index.d.ts +4 -3
- package/es/Event/index.mjs +5 -0
- package/es/Event/utils/appRedis.mjs +39 -49
- package/es/Event/utils/globalLoading.mjs +95 -94
- package/es/Event/utils/processRovedInfo.mjs +228 -294
- 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/enums/index.mjs +17 -5
- package/es/hooks/useStorageRef.mjs +35 -31
- package/es/index.d.ts +1 -0
- package/es/index.mjs +20 -21
- package/es/register/render-register/render-register.mjs +63 -58
- package/es/utils/cacheAdapter.mjs +62 -54
- 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 +2 -2
- package/es/utils/index.mjs +6 -0
- package/es/utils/model-transformer.mjs +74 -64
- package/es/utils/useStyle.mjs +20 -16
- package/package.json +10 -10
- package/dist/index.esm.min.mjs +0 -7042
- package/dist/index.min.cjs +0 -17
- package/dist/index.system.min.js +0 -17
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { ProcessOperateRequest } from '@gct-paas/api/apaas';
|
|
2
2
|
import { pageLayoutModeEnum } from '@gct-paas/core';
|
|
3
3
|
import { LowCodeWidget } from '@gct-paas/schema';
|
|
4
|
-
import { Ref } from 'vue';
|
|
4
|
+
import { ComponentPublicInstance, Ref } from 'vue';
|
|
5
5
|
import { $httpBizService, $request } from './bizServiceRequest';
|
|
6
6
|
import { EventsConstructor, FunctionType, InitNodeOptions } from './eventType';
|
|
7
7
|
import { ProcessAppRovedData } from './utils/processRovedInfo';
|
|
@@ -9,6 +9,10 @@ type ContextConstructor<T extends Context> = new (args: {
|
|
|
9
9
|
$ref: (key: string) => GctComponent | undefined;
|
|
10
10
|
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
11
11
|
}) => T;
|
|
12
|
+
export type ModalInstance = null | undefined | (ComponentPublicInstance & {
|
|
13
|
+
open: Fn;
|
|
14
|
+
close: Fn;
|
|
15
|
+
});
|
|
12
16
|
export declare class Events<TContext extends Context = Context> {
|
|
13
17
|
#private;
|
|
14
18
|
context: TContext;
|
|
@@ -26,8 +30,8 @@ export declare class Events<TContext extends Context = Context> {
|
|
|
26
30
|
/**流程信息 */
|
|
27
31
|
ProcessAppRoved?: ProcessAppRovedData;
|
|
28
32
|
pageLayoutMode?: pageLayoutModeEnum;
|
|
29
|
-
constructor({ js, css, pageKey,
|
|
30
|
-
|
|
33
|
+
constructor({ js, css, pageKey, ContextVm, }: EventsConstructor & {
|
|
34
|
+
ContextVm: ContextConstructor<TContext>;
|
|
31
35
|
});
|
|
32
36
|
/**初始化流程节点信息 */
|
|
33
37
|
runProcessBySaskId({ taskId, processInstanceId, examineAndApproveState, refFormId, }: IObject): Promise<void>;
|
|
@@ -79,10 +83,7 @@ export declare class Context {
|
|
|
79
83
|
/**根据key异步获取获取组件 */
|
|
80
84
|
$asyncRef: (key: string) => Promise<GctComponent>;
|
|
81
85
|
/**根据id获取模态框 */
|
|
82
|
-
$getModal?: (key: string) =>
|
|
83
|
-
open: FunctionType;
|
|
84
|
-
close: FunctionType;
|
|
85
|
-
};
|
|
86
|
+
$getModal?: (key: string) => ModalInstance;
|
|
86
87
|
/**关闭当前上下文模态框 */
|
|
87
88
|
$closeModal?: () => void;
|
|
88
89
|
/**调用第三方服务 */
|