@steedos-labs/plugin-workflow 3.0.64 → 3.0.65
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/designer/dist/amis-renderer/amis-renderer.css +1 -1
- package/designer/dist/amis-renderer/amis-renderer.js +1 -1
- package/designer/dist/assets/index-CFR_MNwA.css +1 -0
- package/designer/dist/assets/{index-IqLl5PBH.js → index-CdtiiXeP.js} +140 -140
- package/designer/dist/index.html +2 -2
- package/main/default/manager/uuflow_manager.js +9 -2
- package/main/default/objects/instance_tasks/listviews/inbox.listview.yml +4 -1
- package/main/default/pages/page_instance_print.page.amis.json +13 -6
- package/main/default/routes/api_workflow_retrieve.router.js +64 -33
- package/package.json +1 -1
- package/public/amis-renderer/amis-renderer.css +1 -1
- package/public/amis-renderer/amis-renderer.js +1 -1
- package/public/workflow/index.css +14 -10
- package/designer/dist/assets/index-DvvBwwsG.css +0 -1
package/designer/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="shortcut icon" type="image/svg+xml" href="/images/logo.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>designer</title>
|
|
8
|
-
<script type="module" crossorigin src="/api/workflow/designer-v2/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/api/workflow/designer-v2/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/api/workflow/designer-v2/assets/index-CdtiiXeP.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/api/workflow/designer-v2/assets/index-CFR_MNwA.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
|
@@ -4076,9 +4076,16 @@ UUFlowManager.checkValueFieldsRequire = function (values = {}, form, form_versio
|
|
|
4076
4076
|
|
|
4077
4077
|
if (!form_v) return require_but_empty_fields;
|
|
4078
4078
|
|
|
4079
|
+
// 判断字段值是否为空(兼容数字类型,0 不算空)
|
|
4080
|
+
const isFieldValueEmpty = (value) => {
|
|
4081
|
+
if (typeof value === 'number') return false;
|
|
4082
|
+
if (typeof value === 'boolean') return false;
|
|
4083
|
+
return _.isEmpty(value);
|
|
4084
|
+
};
|
|
4085
|
+
|
|
4079
4086
|
form_v.fields.forEach(field => {
|
|
4080
4087
|
if (field.type !== 'table') {
|
|
4081
|
-
if (field.is_required &&
|
|
4088
|
+
if (field.is_required && isFieldValueEmpty(values[field.code])) {
|
|
4082
4089
|
require_but_empty_fields.push(field.name || field.code);
|
|
4083
4090
|
}
|
|
4084
4091
|
} else {
|
|
@@ -4091,7 +4098,7 @@ UUFlowManager.checkValueFieldsRequire = function (values = {}, form, form_versio
|
|
|
4091
4098
|
} else {
|
|
4092
4099
|
values[field.code].forEach(s_value => {
|
|
4093
4100
|
field.fields.forEach(s_field => {
|
|
4094
|
-
if (s_field.is_required &&
|
|
4101
|
+
if (s_field.is_required && isFieldValueEmpty(s_value[s_field.code])) {
|
|
4095
4102
|
require_but_empty_fields.push(s_field.name || s_field.code);
|
|
4096
4103
|
}
|
|
4097
4104
|
});
|
|
@@ -37,4 +37,7 @@ extra_columns:
|
|
|
37
37
|
- is_read
|
|
38
38
|
- type
|
|
39
39
|
- instance.values
|
|
40
|
-
disableSwitch: true
|
|
40
|
+
disableSwitch: true
|
|
41
|
+
crudDataFilter: |
|
|
42
|
+
crud.rowClassNameExpr = "<%=(data.is_read === false ? 'unread-instance ' : '') + (data._id === data.recordId ? 'steedos-record-tr steedos-record-tr-' + data._id + ' steedos-record-selected' : 'steedos-record-tr steedos-record-tr-' + data._id) %>";
|
|
43
|
+
return crud;
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"body": [
|
|
184
184
|
{
|
|
185
185
|
"type": "wrapper",
|
|
186
|
-
"className": "steedos-instance-print-wrapper steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4
|
|
186
|
+
"className": "steedos-instance-print-wrapper steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 sm:rounded",
|
|
187
187
|
"body": [
|
|
188
188
|
{
|
|
189
189
|
"type": "service",
|
|
@@ -341,6 +341,9 @@
|
|
|
341
341
|
"display": "block !important",
|
|
342
342
|
"width": "100% !important"
|
|
343
343
|
},
|
|
344
|
+
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table th": {
|
|
345
|
+
"white-space": "normal !important"
|
|
346
|
+
},
|
|
344
347
|
".antd-Table-content-colDragLine": {
|
|
345
348
|
"display": "none !important"
|
|
346
349
|
},
|
|
@@ -389,20 +392,24 @@
|
|
|
389
392
|
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table": {
|
|
390
393
|
"-webkit-print-color-adjust": "exact !important",
|
|
391
394
|
"print-color-adjust": "exact !important",
|
|
392
|
-
"table-layout": "
|
|
393
|
-
"width": "100% !important",
|
|
394
|
-
"min-width": "0 !important"
|
|
395
|
+
"table-layout": "auto !important"
|
|
395
396
|
},
|
|
396
397
|
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table th": {
|
|
397
398
|
"border-left": "1px solid #000 !important",
|
|
398
|
-
"border-bottom": "1px solid #000 !important"
|
|
399
|
+
"border-bottom": "1px solid #000 !important",
|
|
400
|
+
"white-space": "normal !important"
|
|
399
401
|
},
|
|
400
402
|
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table td": {
|
|
401
403
|
"border-left": "1px solid #000 !important",
|
|
402
404
|
"border-bottom": "1px solid #000 !important"
|
|
403
405
|
},
|
|
404
406
|
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table th.antd-Table-operationCell, .steedos-instance-related-view-wrapper .steedos-input-table .antd-Table-table td.antd-Table-operationCell": {
|
|
405
|
-
"
|
|
407
|
+
"visibility": "collapse !important",
|
|
408
|
+
"border": "none !important",
|
|
409
|
+
"padding": "0 !important"
|
|
410
|
+
},
|
|
411
|
+
".steedos-instance-related-view-wrapper .steedos-input-table .antd-Form-static": {
|
|
412
|
+
"word-break": "normal !important"
|
|
406
413
|
},
|
|
407
414
|
".steedos-instance-related-view-wrapper .instance-approve-history .antd-Table-table tr td": {
|
|
408
415
|
"border-bottom": "1px solid #e8e8e8 !important"
|
|
@@ -69,6 +69,18 @@ router.post('/api/workflow/retrieve', requireAuthentication, async function (req
|
|
|
69
69
|
previous_trace = _.find(traces, function (t) {
|
|
70
70
|
return t._id === previous_trace_id;
|
|
71
71
|
});
|
|
72
|
+
|
|
73
|
+
// 滑步处理:如果前一步是被跳过的(skipped),沿 previous_trace_ids 向前回溯,
|
|
74
|
+
// 找到用户实际操作过的那个 trace,收集中间所有被跳过的 trace
|
|
75
|
+
var skipped_trace_ids = []; // 记录滑步跳过的中间 trace id
|
|
76
|
+
while (previous_trace && previous_trace.judge === 'skipped' && previous_trace.previous_trace_ids && previous_trace.previous_trace_ids.length > 0) {
|
|
77
|
+
skipped_trace_ids.push(previous_trace._id);
|
|
78
|
+
var prev_id = previous_trace.previous_trace_ids[0];
|
|
79
|
+
previous_trace = _.find(traces, function (t) {
|
|
80
|
+
return t._id === prev_id;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
previous_trace_step_id = previous_trace.step;
|
|
73
85
|
previous_trace_name = previous_trace.name;
|
|
74
86
|
flow = await UUFlowManager.getFlow(instance.flow);
|
|
@@ -76,6 +88,18 @@ router.post('/api/workflow/retrieve', requireAuthentication, async function (req
|
|
|
76
88
|
if (previous_step.step_type === "counterSign") {
|
|
77
89
|
throw new Error('会签不能取回');
|
|
78
90
|
}
|
|
91
|
+
// 校验当前步骤(下一步)是否已读(取回到填写申请步骤时不受此限制)
|
|
92
|
+
if (previous_step.step_type !== "start") {
|
|
93
|
+
var is_read = false;
|
|
94
|
+
_.each(last_trace.approves, function (ap) {
|
|
95
|
+
if (ap.is_read === true) {
|
|
96
|
+
is_read = true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
if (is_read) {
|
|
100
|
+
throw new Error('下一步处理人已读,不能取回');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
79
103
|
// 取回步骤的前一个步骤处理人唯一(即排除掉传阅和转发的approve后,剩余的approve只有一个)并且是当前用户
|
|
80
104
|
previous_trace_approves = _.filter(previous_trace.approves, function (a) {
|
|
81
105
|
return a.type !== 'cc' && a.type !== 'distribute' && a.type !== 'forward' && ['approved', 'submitted', 'rejected'].includes(a.judge);
|
|
@@ -110,9 +134,12 @@ router.post('/api/workflow/retrieve', requireAuthentication, async function (req
|
|
|
110
134
|
let retrieve_appr_id = ''
|
|
111
135
|
|
|
112
136
|
|
|
137
|
+
// 需要标记为 retrieved 的 trace id 集合:当前步骤 + 滑步跳过的中间步骤
|
|
138
|
+
var traces_to_retrieve = [last_trace_id].concat(skipped_trace_ids);
|
|
139
|
+
|
|
113
140
|
for (const t of traces) {
|
|
114
141
|
var current_space_user, current_user_organization, retrieve_appr;
|
|
115
|
-
if (t._id
|
|
142
|
+
if (traces_to_retrieve.includes(t._id)) {
|
|
116
143
|
if (!t.approves) {
|
|
117
144
|
t.approves = new Array;
|
|
118
145
|
}
|
|
@@ -131,40 +158,44 @@ router.post('/api/workflow/retrieve', requireAuthentication, async function (req
|
|
|
131
158
|
finishedApproveIds.push(appr._id)
|
|
132
159
|
}
|
|
133
160
|
});
|
|
134
|
-
// 在同一trace下插入取回操作者的approve记录
|
|
135
|
-
current_space_user = await UUFlowManager.getSpaceUser(space_id, current_user);
|
|
136
161
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
162
|
+
// 只在最后一个trace(当前步骤)插入取回操作者的approve记录
|
|
163
|
+
if (t._id === last_trace_id) {
|
|
164
|
+
current_space_user = await UUFlowManager.getSpaceUser(space_id, current_user);
|
|
165
|
+
|
|
166
|
+
current_user_organization = await organizationsCollection.findOne({ _id: current_space_user.organization }, {
|
|
167
|
+
projection: {
|
|
168
|
+
name: 1,
|
|
169
|
+
fullname: 1
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
retrieve_appr = new Object;
|
|
174
|
+
retrieve_appr._id = _makeNewID();
|
|
175
|
+
retrieve_appr.instance = instance_id;
|
|
176
|
+
retrieve_appr.trace = t._id;
|
|
177
|
+
retrieve_appr.is_finished = true;
|
|
178
|
+
retrieve_appr.user = current_user;
|
|
179
|
+
retrieve_appr.user_name = current_user_info.name;
|
|
180
|
+
retrieve_appr.handler = current_user;
|
|
181
|
+
retrieve_appr.handler_name = current_user_info.name;
|
|
182
|
+
retrieve_appr.handler_organization = current_space_user.organization;
|
|
183
|
+
retrieve_appr.handler_organization_name = current_user_organization.name;
|
|
184
|
+
retrieve_appr.handler_organization_fullname = current_user_organization.fullname;
|
|
185
|
+
retrieve_appr.start_date = now;
|
|
186
|
+
retrieve_appr.finish_date = now;
|
|
187
|
+
retrieve_appr.due_date = t.due_date;
|
|
188
|
+
retrieve_appr.read_date = now;
|
|
189
|
+
retrieve_appr.judge = "retrieved";
|
|
190
|
+
retrieve_appr.is_read = true;
|
|
191
|
+
retrieve_appr.description = retrieve_comment;
|
|
192
|
+
retrieve_appr.is_error = false;
|
|
193
|
+
retrieve_appr.values = new Object;
|
|
194
|
+
retrieve_appr.cost_time = retrieve_appr.finish_date - retrieve_appr.start_date;
|
|
195
|
+
t.approves.push(retrieve_appr);
|
|
196
|
+
}
|
|
143
197
|
|
|
144
|
-
|
|
145
|
-
retrieve_appr._id = _makeNewID();
|
|
146
|
-
retrieve_appr.instance = instance_id;
|
|
147
|
-
retrieve_appr.trace = t._id;
|
|
148
|
-
retrieve_appr.is_finished = true;
|
|
149
|
-
retrieve_appr.user = current_user;
|
|
150
|
-
retrieve_appr.user_name = current_user_info.name;
|
|
151
|
-
retrieve_appr.handler = current_user;
|
|
152
|
-
retrieve_appr.handler_name = current_user_info.name;
|
|
153
|
-
retrieve_appr.handler_organization = current_space_user.organization;
|
|
154
|
-
retrieve_appr.handler_organization_name = current_user_organization.name;
|
|
155
|
-
retrieve_appr.handler_organization_fullname = current_user_organization.fullname;
|
|
156
|
-
retrieve_appr.start_date = now;
|
|
157
|
-
retrieve_appr.finish_date = now;
|
|
158
|
-
retrieve_appr.due_date = t.due_date;
|
|
159
|
-
retrieve_appr.read_date = now;
|
|
160
|
-
retrieve_appr.judge = "retrieved";
|
|
161
|
-
retrieve_appr.is_read = true;
|
|
162
|
-
retrieve_appr.description = retrieve_comment;
|
|
163
|
-
retrieve_appr.is_error = false;
|
|
164
|
-
retrieve_appr.values = new Object;
|
|
165
|
-
retrieve_appr.cost_time = retrieve_appr.finish_date - retrieve_appr.start_date;
|
|
166
|
-
t.approves.push(retrieve_appr);
|
|
167
|
-
// 更新当前trace记录
|
|
198
|
+
// 更新trace记录
|
|
168
199
|
t.is_finished = true;
|
|
169
200
|
t.finish_date = now;
|
|
170
201
|
t.judge = "retrieved";
|