@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
|
@@ -1,297 +1,231 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
filterButton(list) {
|
|
213
|
-
if (this.nonRelatedPerson) return [];
|
|
214
|
-
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_DONE)
|
|
215
|
-
return [];
|
|
216
|
-
return list.filter((i) => {
|
|
217
|
-
if (i.type === FormComponents.ProcessApproveButton) {
|
|
218
|
-
const status = this.buttonConfig[i.props.action];
|
|
219
|
-
const show = !!status?.show;
|
|
220
|
-
if (show) {
|
|
221
|
-
i.props.title = status.alias;
|
|
222
|
-
}
|
|
223
|
-
return show;
|
|
224
|
-
}
|
|
225
|
-
return true;
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
/**修改字段状态 */
|
|
229
|
-
useFieldWidget(widget) {
|
|
230
|
-
if (this.nonRelatedPerson) return;
|
|
231
|
-
const field = widget.props.field;
|
|
232
|
-
const { fieldConfig, examineAndApproveState } = this;
|
|
233
|
-
if (fieldConfig && fieldConfig[field]) {
|
|
234
|
-
const { permission } = fieldConfig[field];
|
|
235
|
-
switch (permission) {
|
|
236
|
-
case "disabled" /* disabled */:
|
|
237
|
-
widget.props.disabled = true;
|
|
238
|
-
widget.props.readonly = false;
|
|
239
|
-
break;
|
|
240
|
-
case "editable" /* editable */:
|
|
241
|
-
widget.props.disabled = false;
|
|
242
|
-
widget.props.readonly = false;
|
|
243
|
-
break;
|
|
244
|
-
case "readonly" /* readonly */:
|
|
245
|
-
widget.props.readonly = true;
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
widget.props.readonly = true;
|
|
250
|
-
}
|
|
251
|
-
if (!widget.props.disabled && ([
|
|
252
|
-
ExamineAndApproveStateEnum.MY_APPLICATION,
|
|
253
|
-
ExamineAndApproveStateEnum.MY_DONE
|
|
254
|
-
].includes(examineAndApproveState) || this.isviewPage)) {
|
|
255
|
-
widget.props.readonly = true;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
/**修改字段显示隐藏状态 */
|
|
259
|
-
useFieldToShow(widget) {
|
|
260
|
-
const field = widget.props.field;
|
|
261
|
-
const { fieldConfig } = this;
|
|
262
|
-
if (fieldConfig && fieldConfig[field]) {
|
|
263
|
-
const { permission } = fieldConfig[field];
|
|
264
|
-
if (permission === "hidden" /* hidden */) {
|
|
265
|
-
widget.props.hidden = true;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
1
|
+
import { ButtonTypeEnum, ExamineAndApproveStateEnum, FormComponents, OpinionTypeEnum, t } from "@gct-paas/core";
|
|
2
|
+
//#region src/Event/utils/processRovedInfo.ts
|
|
3
|
+
/**流程审批信息 */
|
|
4
|
+
var ProcessAppRovedData = class {
|
|
5
|
+
/**是否当前处理人 */
|
|
6
|
+
isHandle = false;
|
|
7
|
+
/**需要显示的审批按钮 */
|
|
8
|
+
buttonConfig = {};
|
|
9
|
+
/**字段信息 */
|
|
10
|
+
fieldConfig = {};
|
|
11
|
+
/**流程id */
|
|
12
|
+
processId = "";
|
|
13
|
+
/**数据id */
|
|
14
|
+
dataId = "";
|
|
15
|
+
/**taskId */
|
|
16
|
+
taskId;
|
|
17
|
+
/**流程实例id */
|
|
18
|
+
processInstanceId;
|
|
19
|
+
/**模态框模式下绑定的流程表单id */
|
|
20
|
+
refFormId;
|
|
21
|
+
/**审批状态 我发起的,我的代办,我的已办*/
|
|
22
|
+
examineAndApproveState = ExamineAndApproveStateEnum.MY_CUSTOM;
|
|
23
|
+
fieldStatus = "";
|
|
24
|
+
/**查看页面 */
|
|
25
|
+
viewPageKey;
|
|
26
|
+
/**当前是否是查看页面 */
|
|
27
|
+
isviewPage;
|
|
28
|
+
/**当前是否是APP查看页面 */
|
|
29
|
+
isAPPviewPage;
|
|
30
|
+
/**非流程相关人 */
|
|
31
|
+
nonRelatedPerson = false;
|
|
32
|
+
constructor({ taskId, processInstanceId, examineAndApproveState = ExamineAndApproveStateEnum.MY_CUSTOM, refFormId }) {
|
|
33
|
+
this.taskId = taskId;
|
|
34
|
+
this.processInstanceId = processInstanceId;
|
|
35
|
+
this.examineAndApproveState = examineAndApproveState;
|
|
36
|
+
this.refFormId = refFormId;
|
|
37
|
+
}
|
|
38
|
+
/**初始化流程信息 */
|
|
39
|
+
async readyProcess() {
|
|
40
|
+
const { taskId, processInstanceId } = this;
|
|
41
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_AGENT) {
|
|
42
|
+
await this.getDataInfo();
|
|
43
|
+
const { node, processDefId, webViewPageKey, mobileViewPageKey } = await _gct.api.apaas.pmProcessEngine.getTaskExtension({ taskId });
|
|
44
|
+
this.transformByNode(node);
|
|
45
|
+
this.processId = processDefId;
|
|
46
|
+
for (const k in this.buttonConfig)
|
|
47
|
+
/**我的*/
|
|
48
|
+
if (k === ButtonTypeEnum.Withdraw) this.buttonConfig[k].show = false;
|
|
49
|
+
this.viewPageKey = node?.webViewPageKey || webViewPageKey;
|
|
50
|
+
this.isAPPviewPage = !!node?.mobileViewPageKey || !!mobileViewPageKey;
|
|
51
|
+
}
|
|
52
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_APPLICATION) {
|
|
53
|
+
await this.getDataInfo();
|
|
54
|
+
const { node, processDefId, withdrawOp } = await _gct.api.apaas.pmProcessEngine.getInitialTaskExtension({ processInstanceId }) || {};
|
|
55
|
+
this.transformByNode(node);
|
|
56
|
+
this.processId = processDefId;
|
|
57
|
+
for (const k in this.buttonConfig) {
|
|
58
|
+
if (k === ButtonTypeEnum.End) this.buttonConfig[k].show = false;
|
|
59
|
+
if (k === ButtonTypeEnum.Withdraw) this.buttonConfig[k].show = !!withdrawOp;
|
|
60
|
+
if (k === ButtonTypeEnum.Resubmit) this.buttonConfig[k].show = false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_DONE) {
|
|
64
|
+
await this.getDataInfo();
|
|
65
|
+
const { node, processDefId } = await _gct.api.apaas.pmProcessEngine.getHiTaskExtension({ taskId });
|
|
66
|
+
this.transformByNode(node);
|
|
67
|
+
this.processId = processDefId;
|
|
68
|
+
}
|
|
69
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_CUSTOM) {
|
|
70
|
+
await this.getDataInfo();
|
|
71
|
+
const { node, processDefId, btnList, webViewPageKey, taskId, initiatorNode } = await _gct.api.apaas.pmProcessEngine.getProcInstExtension({ procInstId: processInstanceId });
|
|
72
|
+
const btnkeys = btnList || [];
|
|
73
|
+
this.withdrawByNode(initiatorNode);
|
|
74
|
+
this.transformByNode(node);
|
|
75
|
+
this.processId = processDefId;
|
|
76
|
+
for (const k in this.buttonConfig) {
|
|
77
|
+
const key = k;
|
|
78
|
+
if (this.buttonConfig[key].show) this.buttonConfig[key].show = btnkeys.includes(k);
|
|
79
|
+
}
|
|
80
|
+
if (!node) {
|
|
81
|
+
this.nonRelatedPerson = true;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!btnkeys.length || node?.key === "__initiator__" && !taskId) this.isviewPage = true;
|
|
85
|
+
else this.viewPageKey = node?.webViewPageKey || webViewPageKey;
|
|
86
|
+
}
|
|
87
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_CUSTOM_Modal) {
|
|
88
|
+
await this.getDataInfo();
|
|
89
|
+
const { node, btnList, taskId, processDefId, initiatorNode } = await _gct.api.apaas.pmProcessEngine.getProcInstExtension({ procInstId: processInstanceId });
|
|
90
|
+
const btnkeys = btnList || [];
|
|
91
|
+
this.withdrawByNode(initiatorNode);
|
|
92
|
+
this.transformByNode(node);
|
|
93
|
+
this.processId = processDefId;
|
|
94
|
+
for (const k in this.buttonConfig) {
|
|
95
|
+
const key = k;
|
|
96
|
+
if (this.buttonConfig[key].show) this.buttonConfig[key].show = btnkeys.includes(k);
|
|
97
|
+
}
|
|
98
|
+
if (!node) {
|
|
99
|
+
this.nonRelatedPerson = true;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (!btnkeys.length || node?.key === "__initiator__" && !taskId) this.isviewPage = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**审批人,发起人 时候撤回按钮特殊逻辑 */
|
|
106
|
+
withdrawByNode(node) {
|
|
107
|
+
if (!node) return;
|
|
108
|
+
const { buttonConfig } = node;
|
|
109
|
+
JSON.parse(buttonConfig + "").forEach((i) => {
|
|
110
|
+
const actionTitle = t(`sys.process.paasBpmnButtonEvent.${i.type}`);
|
|
111
|
+
this.buttonConfig[i.type] = {
|
|
112
|
+
showModel: false,
|
|
113
|
+
title: t("sys.process.element.approval") + actionTitle,
|
|
114
|
+
success: actionTitle + t("sys.success") + "!",
|
|
115
|
+
show: i.enable,
|
|
116
|
+
alias: i.alias,
|
|
117
|
+
signature: !!i.signature,
|
|
118
|
+
opinion: {},
|
|
119
|
+
user: {}
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**节点按钮状态数据转化 */
|
|
124
|
+
transformByNode(node) {
|
|
125
|
+
if (!node) return;
|
|
126
|
+
try {
|
|
127
|
+
const { opinionConfig, buttonConfig, fieldConfig } = node;
|
|
128
|
+
const button = JSON.parse(buttonConfig || "[]");
|
|
129
|
+
const options = JSON.parse(opinionConfig || "{\"enabled\":false,\"opinionType\":[]}");
|
|
130
|
+
button.forEach((i) => {
|
|
131
|
+
const actionTitle = t(`sys.process.paasBpmnButtonEvent.${i.type}`);
|
|
132
|
+
this.buttonConfig[i.type] = {
|
|
133
|
+
showModel: ![
|
|
134
|
+
ButtonTypeEnum.Resubmit,
|
|
135
|
+
ButtonTypeEnum.Withdraw,
|
|
136
|
+
ButtonTypeEnum.End
|
|
137
|
+
].includes(i.type),
|
|
138
|
+
title: t("sys.process.element.approval") + actionTitle,
|
|
139
|
+
success: actionTitle + t("sys.success") + "!",
|
|
140
|
+
show: i.enable,
|
|
141
|
+
alias: i.alias,
|
|
142
|
+
signature: !!i.signature,
|
|
143
|
+
opinion: {
|
|
144
|
+
show: options.enabled,
|
|
145
|
+
required: transformOption(options.opinionType, i.type)
|
|
146
|
+
},
|
|
147
|
+
user: {
|
|
148
|
+
show: [ButtonTypeEnum.Reassign, ButtonTypeEnum.Countersign].includes(i.type),
|
|
149
|
+
multiple: ButtonTypeEnum.Countersign === i.type,
|
|
150
|
+
label: t(`sys.process.user.${i.type}`)
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
this.fieldConfig = JSON.parse(fieldConfig + "");
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.error("流程信息解析失败", error);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**获取流程数据信息 */
|
|
160
|
+
async getDataInfo() {
|
|
161
|
+
const { dataId } = await _gct.api.apaas.pmProcessEngine.getModel({ processInstanceId: this.processInstanceId });
|
|
162
|
+
this.dataId = dataId;
|
|
163
|
+
}
|
|
164
|
+
/**过滤按钮 */
|
|
165
|
+
filterButton(list) {
|
|
166
|
+
if (this.nonRelatedPerson) return [];
|
|
167
|
+
if (this.examineAndApproveState === ExamineAndApproveStateEnum.MY_DONE) return [];
|
|
168
|
+
return list.filter((i) => {
|
|
169
|
+
if (i.type === FormComponents.ProcessApproveButton) {
|
|
170
|
+
const status = this.buttonConfig[i.props.action];
|
|
171
|
+
const show = !!status?.show;
|
|
172
|
+
if (show) i.props.title = status.alias;
|
|
173
|
+
return show;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**修改字段状态 */
|
|
179
|
+
useFieldWidget(widget) {
|
|
180
|
+
if (this.nonRelatedPerson) return;
|
|
181
|
+
const field = widget.props.field;
|
|
182
|
+
const { fieldConfig, examineAndApproveState } = this;
|
|
183
|
+
if (fieldConfig && fieldConfig[field]) {
|
|
184
|
+
const { permission } = fieldConfig[field];
|
|
185
|
+
switch (permission) {
|
|
186
|
+
case FieldsPermissionEnum.disabled:
|
|
187
|
+
widget.props.disabled = true;
|
|
188
|
+
widget.props.readonly = false;
|
|
189
|
+
break;
|
|
190
|
+
case FieldsPermissionEnum.editable:
|
|
191
|
+
widget.props.disabled = false;
|
|
192
|
+
widget.props.readonly = false;
|
|
193
|
+
break;
|
|
194
|
+
case FieldsPermissionEnum.readonly:
|
|
195
|
+
widget.props.readonly = true;
|
|
196
|
+
break;
|
|
197
|
+
default: break;
|
|
198
|
+
}
|
|
199
|
+
} else widget.props.readonly = true;
|
|
200
|
+
if (!widget.props.disabled && ([ExamineAndApproveStateEnum.MY_APPLICATION, ExamineAndApproveStateEnum.MY_DONE].includes(examineAndApproveState) || this.isviewPage)) widget.props.readonly = true;
|
|
201
|
+
}
|
|
202
|
+
/**修改字段显示隐藏状态 */
|
|
203
|
+
useFieldToShow(widget) {
|
|
204
|
+
const field = widget.props.field;
|
|
205
|
+
const { fieldConfig } = this;
|
|
206
|
+
if (fieldConfig && fieldConfig[field]) {
|
|
207
|
+
const { permission } = fieldConfig[field];
|
|
208
|
+
if (permission === FieldsPermissionEnum.hidden) widget.props.hidden = true;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
270
212
|
function transformOption(opinionType, action) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
if (opinionType.includes(OpinionTypeEnum.ApproveRequired)) {
|
|
281
|
-
return action === ButtonTypeEnum.Approve;
|
|
282
|
-
}
|
|
283
|
-
if (opinionType.includes(OpinionTypeEnum.CountersignRequired)) {
|
|
284
|
-
return action === ButtonTypeEnum.Countersign;
|
|
285
|
-
}
|
|
286
|
-
if (opinionType.includes(OpinionTypeEnum.ReassignRequired)) {
|
|
287
|
-
return action === ButtonTypeEnum.Reassign;
|
|
288
|
-
}
|
|
289
|
-
if (opinionType.includes(OpinionTypeEnum.RejectRequired)) {
|
|
290
|
-
return action === ButtonTypeEnum.Reject;
|
|
291
|
-
}
|
|
292
|
-
if (opinionType.includes(OpinionTypeEnum.RefuseRequired)) {
|
|
293
|
-
return action === ButtonTypeEnum.Refuse;
|
|
294
|
-
}
|
|
213
|
+
if (opinionType.includes(OpinionTypeEnum.Required)) return true;
|
|
214
|
+
if (opinionType.includes(OpinionTypeEnum.Optional)) return false;
|
|
215
|
+
if (opinionType.includes(OpinionTypeEnum.ApproveRequired)) return action === ButtonTypeEnum.Approve;
|
|
216
|
+
if (opinionType.includes(OpinionTypeEnum.ApproveRequired)) return action === ButtonTypeEnum.Approve;
|
|
217
|
+
if (opinionType.includes(OpinionTypeEnum.CountersignRequired)) return action === ButtonTypeEnum.Countersign;
|
|
218
|
+
if (opinionType.includes(OpinionTypeEnum.ReassignRequired)) return action === ButtonTypeEnum.Reassign;
|
|
219
|
+
if (opinionType.includes(OpinionTypeEnum.RejectRequired)) return action === ButtonTypeEnum.Reject;
|
|
220
|
+
if (opinionType.includes(OpinionTypeEnum.RefuseRequired)) return action === ButtonTypeEnum.Refuse;
|
|
295
221
|
}
|
|
296
|
-
|
|
222
|
+
/** */
|
|
223
|
+
var FieldsPermissionEnum = /* @__PURE__ */ function(FieldsPermissionEnum) {
|
|
224
|
+
FieldsPermissionEnum["hidden"] = "hidden";
|
|
225
|
+
FieldsPermissionEnum["readonly"] = "readonly";
|
|
226
|
+
FieldsPermissionEnum["disabled"] = "disabled";
|
|
227
|
+
FieldsPermissionEnum["editable"] = "editable";
|
|
228
|
+
return FieldsPermissionEnum;
|
|
229
|
+
}({});
|
|
230
|
+
//#endregion
|
|
297
231
|
export { ProcessAppRovedData };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RuntimePageJson } from '@gct-paas/schema';
|
|
2
|
+
import { Events } from '../baseEvent';
|
|
2
3
|
export declare enum PageTypeEnum {
|
|
3
4
|
/** WEB */
|
|
4
5
|
WEB = "web_module",
|
|
@@ -115,6 +116,7 @@ export declare const pageDataforJson: import('vue').Ref<{
|
|
|
115
116
|
tableheight?: number | undefined;
|
|
116
117
|
tableheightConfigure?: import('@gct-paas/core').tableColumnWidthEnum | undefined;
|
|
117
118
|
enableHeaderBGColor?: boolean | undefined;
|
|
119
|
+
enableBGColor?: boolean | undefined;
|
|
118
120
|
} | undefined;
|
|
119
121
|
pageConfig?: {
|
|
120
122
|
title?: string | undefined;
|
|
@@ -231,6 +233,7 @@ export declare const pageDataforJson: import('vue').Ref<{
|
|
|
231
233
|
tableheight?: number | undefined;
|
|
232
234
|
tableheightConfigure?: import('@gct-paas/core').tableColumnWidthEnum | undefined;
|
|
233
235
|
enableHeaderBGColor?: boolean | undefined;
|
|
236
|
+
enableBGColor?: boolean | undefined;
|
|
234
237
|
} | undefined;
|
|
235
238
|
pageConfig?: {
|
|
236
239
|
title?: string | undefined;
|
|
@@ -325,7 +328,7 @@ export declare class Globals {
|
|
|
325
328
|
name: string | undefined;
|
|
326
329
|
}>;
|
|
327
330
|
/**注册钩子 */
|
|
328
|
-
static usePageHooks(Event:
|
|
331
|
+
static usePageHooks<T extends Events = Events>(Event: T, pageEvents?: RuntimePageJson['pageEvents'], globalEvents?: RuntimePageJson['globalEvents'], pageCallback?: (Event: T) => Promise<void>): {
|
|
329
332
|
pageload: import('vue').Ref<boolean, boolean>;
|
|
330
333
|
};
|
|
331
334
|
}
|