@steedos/standard-process-approval 2.7.27-beta.6 → 3.0.0-beta.100
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/applications/process_automation.app.yml +1 -38
- package/main/default/client/core.client.js +0 -31
- package/main/default/client/process.client.js +17 -21
- package/main/default/objectTranslations/workflow_notifications.zh-CN/workflow_notifications.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/workflow_outbound_messages.zh-CN/workflow_outbound_messages.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objects/process/approval/process_definition/buttons/copy.button.yml +58 -0
- package/main/default/objects/process/approval/process_definition/buttons/customize.button.yml +135 -0
- package/main/default/objects/process/approval/process_definition/buttons/disable.button.yml +64 -0
- package/main/default/objects/process/approval/process_definition/buttons/enable.button.yml +64 -0
- package/main/default/objects/process/approval/{process_definition.object.yml → process_definition/process_definition.object.yml} +48 -16
- package/main/default/objects/process/approval/process_definition.action.js +39 -56
- package/main/default/objects/process/approval/process_node.object.yml +58 -24
- package/main/default/objects/process_instance_history/buttons/approve.button.yml +0 -3
- package/main/default/objects/process_instance_history/buttons/reassign.button.yml +0 -3
- package/main/default/objects/process_instance_history/buttons/recall.button.yml +0 -4
- package/main/default/objects/process_instance_history/buttons/reject.button.yml +0 -3
- package/main/default/objects/process_instance_history/pages/process_instance_detail.page.amis.json +38 -43
- package/main/default/objects/workflow-actions/action_field_updates.action.js +1 -1
- package/main/default/objects/workflow-actions/action_field_updates.object.yml +1 -0
- package/main/default/objects/workflow-actions/workflow_notifications.action.js +1 -1
- package/main/default/objects/workflow-actions/workflow_notifications.object.yml +1 -0
- package/main/default/objects/workflow-actions/workflow_outbound_messages/workflow_outbound_messages.object.yml +2 -1
- package/main/default/objects/workflow-actions/workflow_rule.action.js +1 -1
- package/main/default/objects/workflow-actions/workflow_rule.object.yml +26 -24
- package/main/default/pages/process_definition_form.page.amis.json +35 -0
- package/main/default/pages/process_definition_form.page.yml +13 -0
- package/main/default/pages/process_node_form.page.amis.json +65 -0
- package/main/default/pages/process_node_form.page.yml +13 -0
- package/main/default/pages/workflow_notifications_form.page.amis.json +47 -0
- package/main/default/pages/workflow_notifications_form.page.yml +13 -0
- package/main/default/pages/workflow_rule_form.page.amis.json +55 -0
- package/main/default/pages/workflow_rule_form.page.yml +13 -0
- package/main/default/services/action_field_updates.service.js +3 -3
- package/main/default/services/approval_process.service.js +70 -2
- package/main/default/triggers/action_field_updates.trigger.js +3 -121
- package/main/default/triggers/process_definition.trigger.js +73 -12
- package/main/default/triggers/process_instance_history.trigger.js +8 -1
- package/main/default/triggers/process_node.trigger.js +2 -4
- package/main/default/triggers/workflow_notifications.trigger.js +3 -115
- package/main/default/triggers/workflow_outbound_messages.trigger.js +3 -133
- package/main/default/triggers/workflow_rule.trigger.js +4 -77
- package/package.json +3 -3
- package/package.service.js +1 -1
- package/main/default/client/action_field_updates.client.js +0 -155
- package/main/default/client/workflow_notifications.client.js +0 -74
- package/public/.md +0 -3
- package/src/.md +0 -3
- package/webapp/.md +0 -1
|
@@ -3,47 +3,10 @@ name: Process Automation
|
|
|
3
3
|
icon_slds: approval
|
|
4
4
|
is_creator: false
|
|
5
5
|
admin_menus:
|
|
6
|
-
# 分部管理员可以创建和设置流程及相关参数。
|
|
7
|
-
# - _id: process_automation
|
|
8
|
-
# name: Process Automation
|
|
9
|
-
# permission_sets:
|
|
10
|
-
# - admin
|
|
11
|
-
# expanded: false
|
|
12
|
-
# sort: 500
|
|
13
6
|
- _id: process_definition
|
|
14
7
|
name: Approval Processes
|
|
15
8
|
sort: 400
|
|
16
9
|
permission_sets:
|
|
17
10
|
- admin
|
|
18
11
|
object_name: process_definition
|
|
19
|
-
parent: process_automation
|
|
20
|
-
# - _id: process_actions
|
|
21
|
-
# name: process_actions
|
|
22
|
-
# permission_sets:
|
|
23
|
-
# - admin
|
|
24
|
-
# object_name: process_actions
|
|
25
|
-
# parent: process_automation
|
|
26
|
-
# - _id: process_steps
|
|
27
|
-
# name: process_steps
|
|
28
|
-
# permission_sets:
|
|
29
|
-
# - admin
|
|
30
|
-
# object_name: process_approvals
|
|
31
|
-
# parent: process_automation
|
|
32
|
-
# - _id: process_flows
|
|
33
|
-
# name: process_flows
|
|
34
|
-
# permission_sets:
|
|
35
|
-
# - admin
|
|
36
|
-
# object_name: process_flows
|
|
37
|
-
# parent: process_automation
|
|
38
|
-
# - _id: process_flows_criteria
|
|
39
|
-
# name: process_flows_criteria
|
|
40
|
-
# permission_sets:
|
|
41
|
-
# - admin
|
|
42
|
-
# object_name: process_flows_criteria
|
|
43
|
-
# parent: process_automation
|
|
44
|
-
# - _id: process_flows_criteria_action
|
|
45
|
-
# name: process_flows_criteria_action
|
|
46
|
-
# permission_sets:
|
|
47
|
-
# - admin
|
|
48
|
-
# object_name: process_flows_criteria_action
|
|
49
|
-
# parent: process_automation
|
|
12
|
+
parent: process_automation
|
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: baozhoutao@steedos.com
|
|
3
|
-
* @Date: 2022-12-13 10:41:08
|
|
4
|
-
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime: 2023-02-26 16:30:11
|
|
6
|
-
* @Description:
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
Steedos.getObjectsOptions = function (filterFunction) {
|
|
10
|
-
var options = [];
|
|
11
|
-
_.each(Steedos.getDisplayObjects(filterFunction), function (v, k) {
|
|
12
|
-
options.push({ label: v.label, value: v.name, icon: v.icon })
|
|
13
|
-
})
|
|
14
|
-
return options;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Steedos.getDisplayObjects = function(filterFunction){
|
|
18
|
-
var objects = [];
|
|
19
|
-
_.each(Creator.objectsByName, function (object, k) {
|
|
20
|
-
var filterReturn = true;
|
|
21
|
-
if (filterFunction && _.isFunction(filterFunction)) {
|
|
22
|
-
filterReturn = filterFunction(object);
|
|
23
|
-
}
|
|
24
|
-
if (filterReturn && !object.hidden && !_.includes(['cfs_instances_filerecord'], object.name)) {
|
|
25
|
-
objects.push(object)
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
objects.sort(Creator.sortingMethod.bind({key:"label"}))
|
|
29
|
-
return objects;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
1
|
Steedos.getFieldDataTypes = function (field) {
|
|
33
2
|
if(field.type === "select"){
|
|
34
3
|
return [
|
|
@@ -4,7 +4,7 @@ Steedos.ProcessManager.showProcessApprovalForm = function(action, fields, formId
|
|
|
4
4
|
|
|
5
5
|
var approveSchema = Creator.getObjectSchema({fields: fields})
|
|
6
6
|
|
|
7
|
-
Modal.show("quickFormModal", {formId: formId, title: title ||
|
|
7
|
+
Modal.show("quickFormModal", {formId: formId, title: title || t(`process_approval_title_${action}`), confirmBtnText: `process_approval_confirmBtnText_${action}`, schema: approveSchema, doc: doc, onConfirm: onConfirm}, {
|
|
8
8
|
backdrop: 'static',
|
|
9
9
|
keyboard: true
|
|
10
10
|
});
|
|
@@ -38,11 +38,7 @@ Steedos.ProcessManager.allowSubmit = function(object_name, record_id){
|
|
|
38
38
|
if(!object_name || !record_id){
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
const object = this.object || ((_window$Creator = window.Creator) === null || _window$Creator === void 0 ? void 0 : _window$Creator.getObject(object_name));
|
|
43
|
-
if(!object.enable_process){
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
41
|
+
|
|
46
42
|
var result = Steedos.authRequest(`/api/v4/process/permission/submit/${object_name}/${record_id}`, {type: 'get', async: false});
|
|
47
43
|
if(result && result.allowSubmit){
|
|
48
44
|
return true;
|
|
@@ -56,7 +52,7 @@ Steedos.ProcessManager.submit = function(object_name, record_id, options){
|
|
|
56
52
|
|
|
57
53
|
var schema = {
|
|
58
54
|
comment: {
|
|
59
|
-
label:
|
|
55
|
+
label: t('process_approval_comment'),
|
|
60
56
|
type: 'textarea',
|
|
61
57
|
rows: 3,
|
|
62
58
|
is_wide: true
|
|
@@ -65,7 +61,7 @@ Steedos.ProcessManager.submit = function(object_name, record_id, options){
|
|
|
65
61
|
|
|
66
62
|
if(options && options.showApprover){
|
|
67
63
|
schema.approver = {
|
|
68
|
-
label:
|
|
64
|
+
label: t('process_approval_approver_label'),
|
|
69
65
|
type: 'lookup',
|
|
70
66
|
reference_to: 'users',
|
|
71
67
|
required: true,
|
|
@@ -87,7 +83,7 @@ Steedos.ProcessManager.submit = function(object_name, record_id, options){
|
|
|
87
83
|
Steedos.ProcessManager.submit(object_name, record_id, {showApprover: true, value: {comment: formValues.insertDoc.comment}});
|
|
88
84
|
}, 800)
|
|
89
85
|
}else{
|
|
90
|
-
toastr.error(
|
|
86
|
+
toastr.error(t(result.error));
|
|
91
87
|
Modal.hide(t);
|
|
92
88
|
FlowRouter.reload();
|
|
93
89
|
}
|
|
@@ -103,7 +99,7 @@ Steedos.ProcessManager.recall = function(object_name, record_id){
|
|
|
103
99
|
var formId = 'processApprovalForm';
|
|
104
100
|
Steedos.ProcessManager.showProcessApprovalForm('recall', {
|
|
105
101
|
comment: {
|
|
106
|
-
label:
|
|
102
|
+
label: t('process_approval_comment'),
|
|
107
103
|
type: 'textarea',
|
|
108
104
|
rows: 3,
|
|
109
105
|
is_wide: true
|
|
@@ -111,7 +107,7 @@ Steedos.ProcessManager.recall = function(object_name, record_id){
|
|
|
111
107
|
}, formId, {}, function(formValues, e, t){
|
|
112
108
|
var result = Steedos.authRequest(`/api/v4/process/recall/${object_name}/${record_id}`, {type: 'post', async: false, data: JSON.stringify(formValues.insertDoc)});
|
|
113
109
|
if(result.state === 'FAILURE'){
|
|
114
|
-
toastr.error(
|
|
110
|
+
toastr.error(t(result.error));
|
|
115
111
|
}
|
|
116
112
|
FlowRouter.reload();
|
|
117
113
|
Modal.hide(t);
|
|
@@ -120,10 +116,10 @@ Steedos.ProcessManager.recall = function(object_name, record_id){
|
|
|
120
116
|
|
|
121
117
|
Steedos.ProcessManager.approve = function(object_name, record_id, options){
|
|
122
118
|
var formId = 'processApprovalForm';
|
|
123
|
-
var title = `${
|
|
119
|
+
var title = `${t('process_instance_history_action_approve')}` //TODO approval record name
|
|
124
120
|
var schema = {
|
|
125
121
|
comment: {
|
|
126
|
-
label:
|
|
122
|
+
label: t('process_approval_comment'),
|
|
127
123
|
type: 'textarea',
|
|
128
124
|
rows: 3,
|
|
129
125
|
is_wide: true
|
|
@@ -132,7 +128,7 @@ Steedos.ProcessManager.approve = function(object_name, record_id, options){
|
|
|
132
128
|
|
|
133
129
|
if(options && options.showApprover){
|
|
134
130
|
schema.approver = {
|
|
135
|
-
label:
|
|
131
|
+
label: t('process_approval_approver_label'),
|
|
136
132
|
type: 'lookup',
|
|
137
133
|
reference_to: 'users',
|
|
138
134
|
required: true,
|
|
@@ -154,7 +150,7 @@ Steedos.ProcessManager.approve = function(object_name, record_id, options){
|
|
|
154
150
|
Steedos.ProcessManager.approve(object_name, record_id, {showApprover: true, value: {comment: formValues.insertDoc.comment}});
|
|
155
151
|
}, 800)
|
|
156
152
|
}else{
|
|
157
|
-
toastr.error(
|
|
153
|
+
toastr.error(t(result.error));
|
|
158
154
|
Modal.hide(t);
|
|
159
155
|
FlowRouter.reload();
|
|
160
156
|
}
|
|
@@ -168,10 +164,10 @@ Steedos.ProcessManager.approve = function(object_name, record_id, options){
|
|
|
168
164
|
|
|
169
165
|
Steedos.ProcessManager.reject = function(object_name, record_id){
|
|
170
166
|
var formId = 'processApprovalForm';
|
|
171
|
-
var title = `${
|
|
167
|
+
var title = `${t('process_instance_history_action_reject')}` //TODO approval record name
|
|
172
168
|
Steedos.ProcessManager.showProcessApprovalForm('reject', {
|
|
173
169
|
comment: {
|
|
174
|
-
label:
|
|
170
|
+
label: t('process_approval_comment'),
|
|
175
171
|
type: 'textarea',
|
|
176
172
|
rows: 3,
|
|
177
173
|
is_wide: true
|
|
@@ -179,7 +175,7 @@ Steedos.ProcessManager.reject = function(object_name, record_id){
|
|
|
179
175
|
}, formId, {}, function(formValues, e, t){
|
|
180
176
|
var result = Steedos.authRequest(`/api/v4/process/reject/${object_name}/${record_id}`, {type: 'post', async: false, data: JSON.stringify(formValues.insertDoc)});
|
|
181
177
|
if(result.state === 'FAILURE'){
|
|
182
|
-
toastr.error(
|
|
178
|
+
toastr.error(t(result.error));
|
|
183
179
|
}
|
|
184
180
|
FlowRouter.reload();
|
|
185
181
|
Modal.hide(t);
|
|
@@ -190,14 +186,14 @@ Steedos.ProcessManager.reassign = function(object_name, record_id){
|
|
|
190
186
|
var formId = 'processApprovalForm';
|
|
191
187
|
Steedos.ProcessManager.showProcessApprovalForm('reassign', {
|
|
192
188
|
approver: {
|
|
193
|
-
label:
|
|
189
|
+
label: t('process_approval_approver_label_reassign'),
|
|
194
190
|
type: 'lookup',
|
|
195
191
|
reference_to: 'users',
|
|
196
192
|
required: true,
|
|
197
193
|
is_wide: true
|
|
198
194
|
},
|
|
199
195
|
comment: {
|
|
200
|
-
label:
|
|
196
|
+
label: t('process_approval_comment'),
|
|
201
197
|
type: 'textarea',
|
|
202
198
|
rows: 3,
|
|
203
199
|
is_wide: true
|
|
@@ -205,7 +201,7 @@ Steedos.ProcessManager.reassign = function(object_name, record_id){
|
|
|
205
201
|
}, formId, {}, function(formValues, e, t){
|
|
206
202
|
var result = Steedos.authRequest(`/api/v4/process/reassign/${object_name}/${record_id}`, {type: 'post', async: false, data: JSON.stringify(formValues.insertDoc)});
|
|
207
203
|
if(result.state === 'FAILURE'){
|
|
208
|
-
toastr.error(
|
|
204
|
+
toastr.error(t(result.error));
|
|
209
205
|
}
|
|
210
206
|
FlowRouter.reload();
|
|
211
207
|
Modal.hide(t);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: copy
|
|
2
|
+
amis_schema: |-
|
|
3
|
+
{
|
|
4
|
+
"type": "service",
|
|
5
|
+
"body": [
|
|
6
|
+
{
|
|
7
|
+
"type": "button",
|
|
8
|
+
"label": "${'CustomAction.process_definition.copy' | t}",
|
|
9
|
+
"id": "u:copy",
|
|
10
|
+
"onEvent": {
|
|
11
|
+
"click": {
|
|
12
|
+
"weight": 0,
|
|
13
|
+
"actions": [
|
|
14
|
+
{
|
|
15
|
+
"ignoreError": false,
|
|
16
|
+
"actionType": "ajax",
|
|
17
|
+
"outputVar": "responseResult",
|
|
18
|
+
"options": {},
|
|
19
|
+
"api": {
|
|
20
|
+
"url": "${context.rootUrl}/service/api/approval_process/process_definition/${recordId}/copy",
|
|
21
|
+
"method": "get",
|
|
22
|
+
"adaptor": "",
|
|
23
|
+
"messages": {}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"actionType": "custom",
|
|
28
|
+
"script": "window.location.href = '/app/admin/process_definition/view/' + (event.data.responseResult && event.data.responseResult._id);",
|
|
29
|
+
"expression": "${responseResult.state == 'SUCCESS'}"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"regions": [
|
|
37
|
+
"body"
|
|
38
|
+
],
|
|
39
|
+
"data": {
|
|
40
|
+
"context": {},
|
|
41
|
+
"dataComponentId": "",
|
|
42
|
+
"record_id": "",
|
|
43
|
+
"record": {},
|
|
44
|
+
"permissions": {}
|
|
45
|
+
},
|
|
46
|
+
"bodyClassName": "p-0",
|
|
47
|
+
"dsType": "api",
|
|
48
|
+
"asideResizor": false,
|
|
49
|
+
"editorState": "default",
|
|
50
|
+
"pullRefresh": {
|
|
51
|
+
"disabled": true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
is_enable: true
|
|
55
|
+
label: 复制
|
|
56
|
+
"on": record
|
|
57
|
+
type: amis_button
|
|
58
|
+
visible: true
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
name: customize
|
|
2
|
+
amis_schema: |-
|
|
3
|
+
{
|
|
4
|
+
"type": "service",
|
|
5
|
+
"body": [
|
|
6
|
+
{
|
|
7
|
+
"type": "button",
|
|
8
|
+
"label": "${'CustomAction.process_definition.customize' | t}",
|
|
9
|
+
"id": "u:customize",
|
|
10
|
+
"onEvent": {
|
|
11
|
+
"click": {
|
|
12
|
+
"weight": 0,
|
|
13
|
+
"actions": [
|
|
14
|
+
{
|
|
15
|
+
"ignoreError": false,
|
|
16
|
+
"actionType": "ajax",
|
|
17
|
+
"outputVar": "docForCustomize",
|
|
18
|
+
"options": {},
|
|
19
|
+
"api": {
|
|
20
|
+
"url": "${context.rootUrl}/api/v1/process_definition/${recordId}",
|
|
21
|
+
"method": "get",
|
|
22
|
+
"adaptor": "",
|
|
23
|
+
"messages": {}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"actionType": "ajax",
|
|
28
|
+
"ignoreError": false,
|
|
29
|
+
"outputVar": "customizeResponseResult",
|
|
30
|
+
"options": {},
|
|
31
|
+
"api": {
|
|
32
|
+
"url": "${context.rootUrl}/api/v1/process_definition",
|
|
33
|
+
"method": "post",
|
|
34
|
+
"requestAdaptor": "\nvar uiSchema = context.uiSchema;\nvar objectFields = uiSchema.fields;\nvar objectName = context.objectName;\nvar doc = context.docForCustomize;\nvar newDoc = {}\n_.each(objectFields, function (v, k) {\n if (_.has(doc, k)) {\n newDoc[k] = doc[k];\n }\n});\nnewDoc.active = false;\ndelete newDoc.is_system;\nreturn {\n ...api,\n data: {\n doc: newDoc\n }\n};",
|
|
35
|
+
"adaptor": "\n\nreturn {\n ...payload,\n data: {\n ...payload.data,\n isProcessDefinitionCustomizedSuccess: payload.status == 0,\n customizedProcessDefinitionId: payload.data && payload.data._id\n }\n};",
|
|
36
|
+
"messages": {
|
|
37
|
+
"success": "",
|
|
38
|
+
"failed": "${msg}"
|
|
39
|
+
},
|
|
40
|
+
"sendOn": "docForCustomize"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"actionType": "custom",
|
|
45
|
+
"args": {},
|
|
46
|
+
"script": "\nevent.data.process_nodes = event.data.docForCustomize.process_nodes;\nevent.data.loopName = \"process_nodes\";"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"actionType": "loop",
|
|
50
|
+
"args": {
|
|
51
|
+
"loopName": "${loopName}"
|
|
52
|
+
},
|
|
53
|
+
"children": [
|
|
54
|
+
{
|
|
55
|
+
"actionType": "custom",
|
|
56
|
+
"script": "event.data.customizedProcessDefinitionId = event.data.__super.customizedProcessDefinitionId;event.data.isProcessDefinitionCustomizedSuccess = event.data.__super.isProcessDefinitionCustomizedSuccess;"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"actionType": "ajax",
|
|
60
|
+
"ignoreError": false,
|
|
61
|
+
"options": {},
|
|
62
|
+
"api": {
|
|
63
|
+
"url": "${context.rootUrl}/api/v1/process_node",
|
|
64
|
+
"method": "post",
|
|
65
|
+
"requestAdaptor": "\nvar objectName = \"process_node\";\nvar uiSchema = BuilderAmisObject.AmisLib.getUISchemaSync(objectName);\nvar objectFields = uiSchema.fields;\nvar doc = JSON.parse(JSON.stringify(context));\nvar newDoc = {}\n_.each(objectFields, function (v, k) {\n if (_.has(doc, k)) {\n newDoc[k] = doc[k];\n }\n});\nnewDoc.process_definition = context.customizedProcessDefinitionId;\ndelete newDoc.is_system;\nreturn {\n ...api,\n data: {\n doc: newDoc\n }\n};",
|
|
66
|
+
"adaptor": "\n\nreturn {\n ...payload,\n data: {\n ...payload.data,\n isProcessNodeCustomizedSuccess: payload.status == 0,\n customizedProcessNodeId: payload.data && payload.data._id\n }\n};",
|
|
67
|
+
"messages": {
|
|
68
|
+
"success": "",
|
|
69
|
+
"failed": "${msg}"
|
|
70
|
+
},
|
|
71
|
+
"sendOn": "${isProcessDefinitionCustomizedSuccess}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"expression": "${isProcessDefinitionCustomizedSuccess}"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"actionType": "link",
|
|
79
|
+
"args": {
|
|
80
|
+
"link": "/app/${appId}/process_definition/view/${customizedProcessDefinitionId}"
|
|
81
|
+
},
|
|
82
|
+
"expression": "${_inDrawer != true}"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"actionType": "url",
|
|
86
|
+
"expression": "${_inDrawer == true}",
|
|
87
|
+
"args": {
|
|
88
|
+
"link": "${context.rootUrl}/app/${appId}/process_definition/view/${customizedProcessDefinitionId}",
|
|
89
|
+
"blank": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"actionType": "closeDrawer",
|
|
94
|
+
"expression": "${_inDrawer == true}"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"actionType": "broadcast",
|
|
98
|
+
"expression": "${_inDrawer == true}",
|
|
99
|
+
"args": {
|
|
100
|
+
"eventName": "@data.changed.process_definition"
|
|
101
|
+
},
|
|
102
|
+
"data": {
|
|
103
|
+
"objectName": "process_definition"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"editorState": "default"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"regions": [
|
|
113
|
+
"body"
|
|
114
|
+
],
|
|
115
|
+
"data": {
|
|
116
|
+
"context": {},
|
|
117
|
+
"dataComponentId": "",
|
|
118
|
+
"record_id": "",
|
|
119
|
+
"record": {},
|
|
120
|
+
"permissions": {}
|
|
121
|
+
},
|
|
122
|
+
"bodyClassName": "p-0",
|
|
123
|
+
"dsType": "api",
|
|
124
|
+
"asideResizor": false,
|
|
125
|
+
"editorState": "default",
|
|
126
|
+
"pullRefresh": {
|
|
127
|
+
"disabled": true
|
|
128
|
+
},
|
|
129
|
+
"id": "u:6918b5f52014"
|
|
130
|
+
}
|
|
131
|
+
is_enable: true
|
|
132
|
+
label: 自定义
|
|
133
|
+
'on': record
|
|
134
|
+
type: amis_button
|
|
135
|
+
visible: true
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: disable
|
|
2
|
+
amis_schema: |-
|
|
3
|
+
{
|
|
4
|
+
"type": "service",
|
|
5
|
+
"body": [
|
|
6
|
+
{
|
|
7
|
+
"type": "button",
|
|
8
|
+
"label": "${'CustomAction.process_definition.disable' | t}",
|
|
9
|
+
"id": "u:disable",
|
|
10
|
+
"onEvent": {
|
|
11
|
+
"click": {
|
|
12
|
+
"weight": 0,
|
|
13
|
+
"actions": [
|
|
14
|
+
{
|
|
15
|
+
"ignoreError": false,
|
|
16
|
+
"actionType": "ajax",
|
|
17
|
+
"outputVar": "responseResult",
|
|
18
|
+
"options": {},
|
|
19
|
+
"api": {
|
|
20
|
+
"url": "${context.rootUrl}/api/v1/process_definition/${recordId}",
|
|
21
|
+
"method": "put",
|
|
22
|
+
"requestAdaptor": "return {\n ...api,\n data: {\n doc: {\n active: false\n }\n }\n};",
|
|
23
|
+
"adaptor": "",
|
|
24
|
+
"messages": {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"actionType": "broadcast",
|
|
29
|
+
"args": {
|
|
30
|
+
"eventName": "@data.changed.process_definition"
|
|
31
|
+
},
|
|
32
|
+
"data": {
|
|
33
|
+
"objectName": "process_definition"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"visibleOn": "${active && !is_system}"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"regions": [
|
|
43
|
+
"body"
|
|
44
|
+
],
|
|
45
|
+
"data": {
|
|
46
|
+
"context": {},
|
|
47
|
+
"dataComponentId": "",
|
|
48
|
+
"record_id": "",
|
|
49
|
+
"record": {},
|
|
50
|
+
"permissions": {}
|
|
51
|
+
},
|
|
52
|
+
"bodyClassName": "p-0",
|
|
53
|
+
"dsType": "api",
|
|
54
|
+
"asideResizor": false,
|
|
55
|
+
"editorState": "default",
|
|
56
|
+
"pullRefresh": {
|
|
57
|
+
"disabled": true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
is_enable: true
|
|
61
|
+
label: 停用
|
|
62
|
+
"on": record
|
|
63
|
+
type: amis_button
|
|
64
|
+
visible: true
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: enable
|
|
2
|
+
amis_schema: |-
|
|
3
|
+
{
|
|
4
|
+
"type": "service",
|
|
5
|
+
"body": [
|
|
6
|
+
{
|
|
7
|
+
"type": "button",
|
|
8
|
+
"label": "${'CustomAction.process_definition.enable' | t}",
|
|
9
|
+
"id": "u:enable",
|
|
10
|
+
"onEvent": {
|
|
11
|
+
"click": {
|
|
12
|
+
"weight": 0,
|
|
13
|
+
"actions": [
|
|
14
|
+
{
|
|
15
|
+
"ignoreError": false,
|
|
16
|
+
"actionType": "ajax",
|
|
17
|
+
"outputVar": "responseResult",
|
|
18
|
+
"options": {},
|
|
19
|
+
"api": {
|
|
20
|
+
"url": "${context.rootUrl}/api/v1/process_definition/${recordId}",
|
|
21
|
+
"method": "put",
|
|
22
|
+
"requestAdaptor": "return {\n ...api,\n data: {\n doc: {\n active: true\n }\n }\n};",
|
|
23
|
+
"adaptor": "",
|
|
24
|
+
"messages": {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"actionType": "broadcast",
|
|
29
|
+
"args": {
|
|
30
|
+
"eventName": "@data.changed.process_definition"
|
|
31
|
+
},
|
|
32
|
+
"data": {
|
|
33
|
+
"objectName": "process_definition"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"visibleOn": "${!active && !is_system}"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"regions": [
|
|
43
|
+
"body"
|
|
44
|
+
],
|
|
45
|
+
"data": {
|
|
46
|
+
"context": {},
|
|
47
|
+
"dataComponentId": "",
|
|
48
|
+
"record_id": "",
|
|
49
|
+
"record": {},
|
|
50
|
+
"permissions": {}
|
|
51
|
+
},
|
|
52
|
+
"bodyClassName": "p-0",
|
|
53
|
+
"dsType": "api",
|
|
54
|
+
"asideResizor": false,
|
|
55
|
+
"editorState": "default",
|
|
56
|
+
"pullRefresh": {
|
|
57
|
+
"disabled": true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
is_enable: true
|
|
61
|
+
label: 启用
|
|
62
|
+
"on": record
|
|
63
|
+
type: amis_button
|
|
64
|
+
visible: true
|