@steedos/standard-process-approval 2.5.0-beta.9 → 2.5.1
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/process_instance_history/buttons/approve.button.yml +8 -2
- package/main/default/objects/process_instance_history/buttons/reassign.button.yml +10 -4
- package/main/default/objects/process_instance_history/buttons/recall.button.js +4 -4
- package/main/default/objects/process_instance_history/buttons/recall.button.yml +11 -5
- package/main/default/objects/process_instance_history/buttons/reject.button.yml +10 -4
- package/main/default/objects/process_instance_history/pages/process_instance_detail.page.amis.json +7 -5
- package/main/default/objects/workflow-actions/workflow_notifications.object.yml +1 -1
- package/main/default/triggers/process_node.trigger.js +25 -49
- package/package.json +3 -3
- package/main/default/objects/process/process_instance/process_instance_history.action.js +0 -26
|
@@ -59,8 +59,14 @@ amis_schema: |-
|
|
|
59
59
|
"weight": 0,
|
|
60
60
|
"actions": [
|
|
61
61
|
{
|
|
62
|
-
"actionType": "
|
|
63
|
-
"
|
|
62
|
+
"actionType": "broadcast",
|
|
63
|
+
"args": {
|
|
64
|
+
"eventName": "@data.changed.process_instance_history"
|
|
65
|
+
},
|
|
66
|
+
"data": {
|
|
67
|
+
"objectName": "process_instance_history",
|
|
68
|
+
"displayAs": "${displayAs}"
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
71
|
]
|
|
66
72
|
}
|
|
@@ -57,10 +57,16 @@ amis_schema: |-
|
|
|
57
57
|
"submitSucc": {
|
|
58
58
|
"weight": 0,
|
|
59
59
|
"actions": [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
{
|
|
61
|
+
"actionType": "broadcast",
|
|
62
|
+
"args": {
|
|
63
|
+
"eventName": "@data.changed.process_instance_history"
|
|
64
|
+
},
|
|
65
|
+
"data": {
|
|
66
|
+
"objectName": "process_instance_history",
|
|
67
|
+
"displayAs": "${displayAs}"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
64
70
|
]
|
|
65
71
|
}
|
|
66
72
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
recallVisible: function (object_name, record_id, record_permissions, props) {
|
|
3
|
+
return Steedos.ProcessManager.allowRecall(props.record.target_object.o, props.record.target_object.ids[0])
|
|
4
|
+
},
|
|
5
|
+
}
|
|
@@ -32,7 +32,7 @@ amis_schema: |-
|
|
|
32
32
|
"mode": "normal",
|
|
33
33
|
"api": {
|
|
34
34
|
"method": "post",
|
|
35
|
-
"url": "${context.rootUrl}/api/v4/process/recall/${
|
|
35
|
+
"url": "${context.rootUrl}/api/v4/process/recall/${record.target_object.o}/${record.target_object.ids[0]}",
|
|
36
36
|
"data": {
|
|
37
37
|
"&": "$$"
|
|
38
38
|
},
|
|
@@ -50,10 +50,16 @@ amis_schema: |-
|
|
|
50
50
|
"submitSucc": {
|
|
51
51
|
"weight": 0,
|
|
52
52
|
"actions": [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
{
|
|
54
|
+
"actionType": "broadcast",
|
|
55
|
+
"args": {
|
|
56
|
+
"eventName": "@data.changed.process_instance_history"
|
|
57
|
+
},
|
|
58
|
+
"data": {
|
|
59
|
+
"objectName": "process_instance_history",
|
|
60
|
+
"displayAs": "${displayAs}"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
57
63
|
]
|
|
58
64
|
}
|
|
59
65
|
}
|
|
@@ -50,10 +50,16 @@ amis_schema: |-
|
|
|
50
50
|
"submitSucc": {
|
|
51
51
|
"weight": 0,
|
|
52
52
|
"actions": [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
{
|
|
54
|
+
"actionType": "broadcast",
|
|
55
|
+
"args": {
|
|
56
|
+
"eventName": "@data.changed.process_instance_history"
|
|
57
|
+
},
|
|
58
|
+
"data": {
|
|
59
|
+
"objectName": "process_instance_history",
|
|
60
|
+
"displayAs": "${displayAs}"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
57
63
|
]
|
|
58
64
|
}
|
|
59
65
|
}
|
package/main/default/objects/process_instance_history/pages/process_instance_detail.page.amis.json
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"name": "${event.data.record.name}",
|
|
19
19
|
"record": "${event.data.record}",
|
|
20
20
|
"recordLoaded": true
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"expression": "${event.data.objectName == \"process_instance_history\"}"
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
"actionType": "reload",
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
"name": "${event.data.record.name}",
|
|
28
29
|
"record": "${event.data.record}",
|
|
29
30
|
"recordLoaded": true
|
|
30
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"expression": "${event.data.objectName == \"process_instance_history\"}"
|
|
31
33
|
}
|
|
32
34
|
]
|
|
33
35
|
}
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
"id": "u:d1f14744310b",
|
|
52
54
|
"label": "对象表单",
|
|
53
55
|
"recordId": "${target_object.ids[0]}",
|
|
54
|
-
"
|
|
56
|
+
"visibleOn": "${!!target_object}",
|
|
55
57
|
"className": "antd-Form antd-Form--normal steedos-amis-form bg-white",
|
|
56
58
|
"mode": "read"
|
|
57
59
|
}
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"label": "所有相关表",
|
|
84
86
|
"recordId": "${target_object.ids[0]}",
|
|
85
87
|
"objectApiName": "${target_object.o}",
|
|
86
|
-
"
|
|
88
|
+
"visibleOn": "${!!target_object}"
|
|
87
89
|
}
|
|
88
90
|
]
|
|
89
91
|
}
|
|
@@ -145,4 +147,4 @@
|
|
|
145
147
|
"id": "page_process_instance_history_record_detail",
|
|
146
148
|
"name": "page_process_instance_history_record_detail",
|
|
147
149
|
"bodyClassName": ""
|
|
148
|
-
}
|
|
150
|
+
}
|
|
@@ -53,7 +53,7 @@ fields:
|
|
|
53
53
|
var options = [];
|
|
54
54
|
if(object){
|
|
55
55
|
var userFields = _.filter(object.fields, function(field){
|
|
56
|
-
return (field.type === 'lookup' || field.type === 'master_detail') && field.omit != true && field.reference_to === 'users'
|
|
56
|
+
return (field.type === 'lookup' || field.type === 'master_detail') && field.omit != true && (field.reference_to === 'users' || ('space_users' === field.reference_to && 'user' === field.reference_to_field))
|
|
57
57
|
});
|
|
58
58
|
_.each(userFields, function(field){
|
|
59
59
|
options.push({label:field.label, value:field.name});
|
|
@@ -100,6 +100,18 @@ const getProcessNodeObjectName = async function(processId){
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
|
|
104
|
+
const getSourceApprovalProcessNodes = ()=>{
|
|
105
|
+
const nodes = [];
|
|
106
|
+
_.each(objectql.getSourceApprovalProcesses(), (item)=>{
|
|
107
|
+
_.each(item.process_nodes, (pNode)=>{
|
|
108
|
+
nodes.push(Object.assign({}, pNode, {process_definition: item._id, _id: `${item.name}.${pNode.name}`}))
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
})
|
|
112
|
+
return nodes;
|
|
113
|
+
}
|
|
114
|
+
|
|
103
115
|
module.exports = {
|
|
104
116
|
beforeInsert: async function () {
|
|
105
117
|
|
|
@@ -170,62 +182,26 @@ module.exports = {
|
|
|
170
182
|
await reviseRecordOrder(this.previousDoc.process_definition);
|
|
171
183
|
},
|
|
172
184
|
afterFind: async function(){
|
|
173
|
-
let
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
delete filters.process_definition
|
|
185
|
+
let spaceId = this.spaceId;
|
|
186
|
+
let sourceData = getSourceApprovalProcessNodes();
|
|
187
|
+
this.data.values = this.data.values.concat(sourceData);
|
|
188
|
+
const values = objectql.getSteedosSchema().metadataDriver.find(this.data.values, this.query, spaceId);
|
|
189
|
+
for(let node of values){
|
|
190
|
+
setSpaceAndOwner(node, this);
|
|
181
191
|
}
|
|
192
|
+
this.data.values = values
|
|
182
193
|
|
|
183
|
-
if(processNodes){
|
|
184
|
-
for(let node of processNodes){
|
|
185
|
-
setSpaceAndOwner(node, this);
|
|
186
|
-
}
|
|
187
|
-
this.data.values = this.data.values.concat(processNodes)
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
afterAggregate: async function(){
|
|
191
|
-
let filters = InternalData.parserFilters(this.query.filters)
|
|
192
|
-
let processNodes = [];
|
|
193
|
-
if(filters.process_definition){
|
|
194
|
-
approvalProcess = objectql.getSourceApprovalProcess(filters.process_definition);
|
|
195
|
-
if(approvalProcess){
|
|
196
|
-
processNodes = approvalProcess.process_nodes
|
|
197
|
-
}
|
|
198
|
-
delete filters.process_definition
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if(processNodes){
|
|
202
|
-
this.data.values = this.data.values.concat(processNodes)
|
|
203
|
-
}
|
|
204
194
|
},
|
|
205
195
|
afterCount: async function(){
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
if(filters.process_definition){
|
|
209
|
-
approvalProcess = objectql.getSourceApprovalProcess(filters.process_definition);
|
|
210
|
-
if(approvalProcess){
|
|
211
|
-
processNodes = approvalProcess.process_nodes
|
|
212
|
-
}
|
|
213
|
-
delete filters.process_definition
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if(processNodes){
|
|
217
|
-
this.data.values = this.data.values + processNodes.length
|
|
218
|
-
}
|
|
196
|
+
let spaceId = this.spaceId;
|
|
197
|
+
this.data.values = this.data.values + objectql.getSteedosSchema().metadataDriver.count(getSourceApprovalProcessNodes(), this.query, spaceId);
|
|
219
198
|
},
|
|
220
199
|
afterFindOne: async function(){
|
|
200
|
+
let spaceId = this.spaceId;
|
|
221
201
|
if(_.isEmpty(this.data.values)){
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
let processNode = objectql.getSourceProcessNode(objectName, id.substr(id.indexOf(".")+1));
|
|
226
|
-
if(processNode){
|
|
227
|
-
this.data.values = processNode;
|
|
228
|
-
}
|
|
202
|
+
const records = objectql.getSteedosSchema().metadataDriver.find(getSourceApprovalProcessNodes(), {filters: ['_id', '=', this.id]}, spaceId);
|
|
203
|
+
if(records.length > 0){
|
|
204
|
+
this.data.values = records[0]
|
|
229
205
|
}
|
|
230
206
|
}
|
|
231
207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-process-approval",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"steedos"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/process": "2.5.
|
|
13
|
+
"@steedos/process": "2.5.1"
|
|
14
14
|
},
|
|
15
15
|
"description": "steedos package",
|
|
16
16
|
"repository": {},
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "793bcd4718210c693aa52d0280e9b1b2a8d3230e"
|
|
19
19
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
approveVisible: function(object_name, record_id, record_permissions){
|
|
3
|
-
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
4
|
-
},
|
|
5
|
-
approve: function(object_name, record_id, fields){
|
|
6
|
-
Steedos.ProcessManager.approve(object_name, record_id);
|
|
7
|
-
},
|
|
8
|
-
rejectVisible: function(object_name, record_id, record_permissions){
|
|
9
|
-
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
10
|
-
},
|
|
11
|
-
reject: function(object_name, record_id, fields){
|
|
12
|
-
Steedos.ProcessManager.reject(object_name, record_id);
|
|
13
|
-
},
|
|
14
|
-
reassignVisible: function(object_name, record_id, record_permissions){
|
|
15
|
-
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
16
|
-
},
|
|
17
|
-
reassign: function(object_name, record_id, fields){
|
|
18
|
-
Steedos.ProcessManager.reassign(object_name, record_id);
|
|
19
|
-
},
|
|
20
|
-
recallVisible: function(){
|
|
21
|
-
return Steedos.ProcessManager.allowRecall(Session.get("object_name"), Session.get("record_id"))
|
|
22
|
-
},
|
|
23
|
-
recall: function(object_name, record_id, fields){
|
|
24
|
-
Steedos.ProcessManager.recall(object_name, record_id);
|
|
25
|
-
}
|
|
26
|
-
}
|