@steedos-labs/plugin-workflow 3.0.4 → 3.0.6
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/main/default/objects/flows/flows.object.yml +12 -0
- package/main/default/objects/instances/buttons/instance_print.button.yml +1 -1
- package/main/default/pages/page_instance_print.page.amis.json +42 -32
- package/main/default/routes/api_workflow_instance_save.router.js +3 -3
- package/main/default/routes/api_workflow_instance_upgrade.router.js +38 -0
- package/package.json +1 -1
|
@@ -449,6 +449,18 @@ fields:
|
|
|
449
449
|
type: boolean
|
|
450
450
|
label: 分发时允许自动创建关联文件
|
|
451
451
|
group: Distribution
|
|
452
|
+
instance_template:
|
|
453
|
+
label: Form Template
|
|
454
|
+
type: code
|
|
455
|
+
language: html
|
|
456
|
+
is_wide: true
|
|
457
|
+
group: template
|
|
458
|
+
print_template:
|
|
459
|
+
label: Print Template
|
|
460
|
+
type: code
|
|
461
|
+
language: html
|
|
462
|
+
is_wide: true
|
|
463
|
+
group: template
|
|
452
464
|
name_formula:
|
|
453
465
|
label: Formula of Title
|
|
454
466
|
type: text
|
|
@@ -15,7 +15,7 @@ amis_schema: |-
|
|
|
15
15
|
"ignoreError": false,
|
|
16
16
|
"actionType": "url",
|
|
17
17
|
"args": {
|
|
18
|
-
"url": "/app/approve_workflow/page/page_instance_print?recordId=${instanceId || record._id}"
|
|
18
|
+
"url": "/app/approve_workflow/page/page_instance_print?embed=1&recordId=${instanceId || record._id}"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
],
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"actions": [
|
|
105
105
|
{
|
|
106
106
|
"actionType": "custom",
|
|
107
|
-
"script": "doAction({actionType: 'setValue', componentId: 'u:print-width', args: {value: Number(event.data.value)}}); $('.steedos-instance-related-view-wrapper
|
|
107
|
+
"script": "doAction({actionType: 'setValue', componentId: 'u:print-width', args: {value: Number(event.data.value)}}); $('.steedos-instance-related-view-wrapper .instance-form').css('width', event.data.value + 'mm');"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
}
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"actions": [
|
|
124
124
|
{
|
|
125
125
|
"actionType": "custom",
|
|
126
|
-
"script": "$('.steedos-instance-related-view-wrapper
|
|
126
|
+
"script": "$('.steedos-instance-related-view-wrapper .instance-form').css('width', event.data.value + 'mm');"
|
|
127
127
|
}
|
|
128
128
|
]
|
|
129
129
|
}
|
|
@@ -136,37 +136,42 @@
|
|
|
136
136
|
"mode": "inline"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
"type": "wrapper",
|
|
140
|
+
"className": "inline-block p-0",
|
|
141
|
+
"body": [
|
|
142
|
+
{
|
|
143
|
+
"label": "",
|
|
144
|
+
"type": "button",
|
|
145
|
+
"icon": "fa fa-plus",
|
|
146
|
+
"mode": "inline",
|
|
147
|
+
"onEvent": {
|
|
148
|
+
"click": {
|
|
149
|
+
"actions": [
|
|
150
|
+
{
|
|
151
|
+
"actionType": "custom",
|
|
152
|
+
"script": "window.instancePrint.plusFontSize($('.steedos-amis-instance-view-body'))"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
151
156
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"label": "",
|
|
160
|
+
"type": "button",
|
|
161
|
+
"icon": "fa fa-minus",
|
|
162
|
+
"mode": "inline",
|
|
163
|
+
"onEvent": {
|
|
164
|
+
"click": {
|
|
165
|
+
"actions": [
|
|
166
|
+
{
|
|
167
|
+
"actionType": "custom",
|
|
168
|
+
"script": "window.instancePrint.minusFontSize($('.steedos-amis-instance-view-body'))"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
}
|
|
169
|
-
}
|
|
174
|
+
]}
|
|
170
175
|
]
|
|
171
176
|
}
|
|
172
177
|
]
|
|
@@ -186,7 +191,7 @@
|
|
|
186
191
|
"schemaApi": {
|
|
187
192
|
"method": "get",
|
|
188
193
|
"url": "/api/health_check?trace=${recordId}",
|
|
189
|
-
"adaptor": "const result = {data: {'type':'wrapper','className':'p-0 h-full','body':[{'type':'steedos-instance-detail','id':'u:steedos-instance-detail','label':'Instance Detail','instanceId':context.recordId,'boxName':context.side_listview_id}],'id':'u:steedos-instance-detail-service'}};console.log('result===>', result); return result;"
|
|
194
|
+
"adaptor": "const result = {data: {'type':'wrapper','className':'p-0 h-full','body':[{'type':'steedos-instance-detail', 'print': true, 'id':'u:steedos-instance-detail','label':'Instance Detail','instanceId':context.recordId,'boxName':context.side_listview_id}],'id':'u:steedos-instance-detail-service'}};console.log('result===>', result); return result;"
|
|
190
195
|
},
|
|
191
196
|
"visibleOn": "${permission === true}"
|
|
192
197
|
},
|
|
@@ -210,7 +215,7 @@
|
|
|
210
215
|
"bodyClassName": "p-0 flex flex-1 overflow-hidden h-full",
|
|
211
216
|
"name": "amis-root-workflow",
|
|
212
217
|
"initApi": {
|
|
213
|
-
"url": "
|
|
218
|
+
"url": "/api/workflow/v2/instance/${recordId}/permission",
|
|
214
219
|
"method": "get",
|
|
215
220
|
"data": {},
|
|
216
221
|
"requestAdaptor": "",
|
|
@@ -226,6 +231,11 @@
|
|
|
226
231
|
"editorState": "default",
|
|
227
232
|
"css": {
|
|
228
233
|
".steedos-instance-related-view-wrapper > .antd-Page-content": {
|
|
234
|
+
"display": "inline-block",
|
|
235
|
+
"transition": "width 0.5s ease-in-out",
|
|
236
|
+
"width": "unset"
|
|
237
|
+
},
|
|
238
|
+
".steedos-instance-related-view-wrapper .instance-form": {
|
|
229
239
|
"width": "210mm",
|
|
230
240
|
"transition": "width 0.5s ease-in-out"
|
|
231
241
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-09-15 13:09:51
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-12-17 17:55:57
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const express = require("express");
|
|
@@ -17,7 +17,7 @@ router.post('/api/workflow/v2/instance/save', requireAuthentication, async funct
|
|
|
17
17
|
const { instance } = req.body;
|
|
18
18
|
const record = await objectql.getObject('instances').findOne(instance._id, {fields:[
|
|
19
19
|
'flow','form','applicant_name','applicant_organization','applicant_organization_fullname','applicant_organization_name',
|
|
20
|
-
'code', 'flow_version', 'form_version', 'submit_date'
|
|
20
|
+
'code', 'flow_version', 'form_version', 'submit_date', 'flow_name', 'code'
|
|
21
21
|
]});
|
|
22
22
|
const ins = await UUFlowManager.draft_save_instance(Object.assign(record, instance), userSession.userId);
|
|
23
23
|
res.status(200).send({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-09-15 13:09:51
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-12-17 18:09:28
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
const express = require("express");
|
|
9
|
+
const router = express.Router();
|
|
10
|
+
const { requireAuthentication } = require("@steedos/auth");
|
|
11
|
+
const _ = require('lodash');
|
|
12
|
+
const objectql = require('@steedos/objectql');
|
|
13
|
+
const UUFlowManager = require('../manager/uuflow_manager');
|
|
14
|
+
router.post('/api/workflow/v2/instance/upgrade', requireAuthentication, async function (req, res) {
|
|
15
|
+
try {
|
|
16
|
+
let userSession = req.user;
|
|
17
|
+
const { instance } = req.body;
|
|
18
|
+
const record = await objectql.getObject('instances').findOne(instance._id, {fields:[
|
|
19
|
+
'flow','form','applicant_name','applicant_organization','applicant_organization_fullname','applicant_organization_name',
|
|
20
|
+
'code', 'flow_version', 'form_version', 'submit_date', 'flow_name', 'code', 'traces', 'state'
|
|
21
|
+
]});
|
|
22
|
+
if(record.state !== 'draft'){
|
|
23
|
+
return res.status(200).send({
|
|
24
|
+
instance: true
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const ins = await UUFlowManager.draft_save_instance(Object.assign(record, instance), userSession.userId);
|
|
28
|
+
res.status(200).send({
|
|
29
|
+
'instance': ins
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error(error);
|
|
33
|
+
res.status(200).send({
|
|
34
|
+
error: error.message
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
exports.default = router;
|