@steedos/standard-process-approval 3.0.0-beta.9 → 3.0.0-beta.92
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/client/process.client.js +1 -5
- 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 +38 -55
- 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.object.yml +1 -0
- 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.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/approval_process.service.js +70 -2
- package/main/default/triggers/process_definition.trigger.js +160 -10
- package/main/default/triggers/process_instance_history.trigger.js +8 -1
- package/package.json +3 -3
- package/main/default/client/action_field_updates.client.js +0 -155
- package/main/default/client/workflow_notifications.client.js +0 -74
|
@@ -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;
|
|
@@ -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
|
|
@@ -123,8 +123,12 @@ fields:
|
|
|
123
123
|
- object_name
|
|
124
124
|
filtersFunction: !!js/function |
|
|
125
125
|
function (filters, dependValues) {
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
127
|
+
if(pObjectName){
|
|
128
|
+
return ['object_name', '=', pObjectName];
|
|
129
|
+
}
|
|
130
|
+
else{
|
|
131
|
+
return ['object_name', '=', -1];
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
group: Initial Submission Actions
|
|
@@ -138,8 +142,12 @@ fields:
|
|
|
138
142
|
- object_name
|
|
139
143
|
filtersFunction: !!js/function |
|
|
140
144
|
function (filters, dependValues) {
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
146
|
+
if(pObjectName){
|
|
147
|
+
return ['object_name', '=', pObjectName];
|
|
148
|
+
}
|
|
149
|
+
else{
|
|
150
|
+
return ['object_name', '=', -1];
|
|
143
151
|
}
|
|
144
152
|
}
|
|
145
153
|
group: Initial Submission Actions
|
|
@@ -165,8 +173,12 @@ fields:
|
|
|
165
173
|
- object_name
|
|
166
174
|
filtersFunction: !!js/function |
|
|
167
175
|
function (filters, dependValues) {
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
177
|
+
if(pObjectName){
|
|
178
|
+
return ['object_name', '=', pObjectName];
|
|
179
|
+
}
|
|
180
|
+
else{
|
|
181
|
+
return ['object_name', '=', -1];
|
|
170
182
|
}
|
|
171
183
|
}
|
|
172
184
|
group: Final Approval Actions
|
|
@@ -180,8 +192,12 @@ fields:
|
|
|
180
192
|
- object_name
|
|
181
193
|
filtersFunction: !!js/function |
|
|
182
194
|
function (filters, dependValues) {
|
|
183
|
-
|
|
184
|
-
|
|
195
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
196
|
+
if(pObjectName){
|
|
197
|
+
return ['object_name', '=', pObjectName];
|
|
198
|
+
}
|
|
199
|
+
else{
|
|
200
|
+
return ['object_name', '=', -1];
|
|
185
201
|
}
|
|
186
202
|
}
|
|
187
203
|
group: Final Approval Actions
|
|
@@ -207,8 +223,12 @@ fields:
|
|
|
207
223
|
- object_name
|
|
208
224
|
filtersFunction: !!js/function |
|
|
209
225
|
function (filters, dependValues) {
|
|
210
|
-
|
|
211
|
-
|
|
226
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
227
|
+
if(pObjectName){
|
|
228
|
+
return ['object_name', '=', pObjectName];
|
|
229
|
+
}
|
|
230
|
+
else{
|
|
231
|
+
return ['object_name', '=', -1];
|
|
212
232
|
}
|
|
213
233
|
}
|
|
214
234
|
group: Final Rejection Actions
|
|
@@ -222,8 +242,12 @@ fields:
|
|
|
222
242
|
- object_name
|
|
223
243
|
filtersFunction: !!js/function |
|
|
224
244
|
function (filters, dependValues) {
|
|
225
|
-
|
|
226
|
-
|
|
245
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
246
|
+
if(pObjectName){
|
|
247
|
+
return ['object_name', '=', pObjectName];
|
|
248
|
+
}
|
|
249
|
+
else{
|
|
250
|
+
return ['object_name', '=', -1];
|
|
227
251
|
}
|
|
228
252
|
}
|
|
229
253
|
group: Final Rejection Actions
|
|
@@ -250,8 +274,12 @@ fields:
|
|
|
250
274
|
- object_name
|
|
251
275
|
filtersFunction: !!js/function |
|
|
252
276
|
function (filters, dependValues) {
|
|
253
|
-
|
|
254
|
-
|
|
277
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
278
|
+
if(pObjectName){
|
|
279
|
+
return ['object_name', '=', pObjectName];
|
|
280
|
+
}
|
|
281
|
+
else{
|
|
282
|
+
return ['object_name', '=', -1];
|
|
255
283
|
}
|
|
256
284
|
}
|
|
257
285
|
group: Recall Actions
|
|
@@ -265,8 +293,12 @@ fields:
|
|
|
265
293
|
- object_name
|
|
266
294
|
filtersFunction: !!js/function |
|
|
267
295
|
function (filters, dependValues) {
|
|
268
|
-
|
|
269
|
-
|
|
296
|
+
var pObjectName = dependValues && dependValues.object_name;
|
|
297
|
+
if(pObjectName){
|
|
298
|
+
return ['object_name', '=', pObjectName];
|
|
299
|
+
}
|
|
300
|
+
else{
|
|
301
|
+
return ['object_name', '=', -1];
|
|
270
302
|
}
|
|
271
303
|
}
|
|
272
304
|
group: Recall Actions
|
|
@@ -1,61 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
|
+
* @Date: 2025-04-14 09:47:57
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-08-19 14:07:13
|
|
6
|
+
*/
|
|
1
7
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var result = Steedos.authRequest(`/api/v4/${object_name}/${record_id}`, { type: 'get', async: false });
|
|
12
|
-
return result.active && !result.is_system
|
|
13
|
-
},
|
|
14
|
-
disable: function (object_name, record_id, fields) {
|
|
15
|
-
Steedos.authRequest(`/api/v4/${object_name}/${record_id}`, { type: 'put', async: false, data: JSON.stringify({ active: false }) });
|
|
16
|
-
FlowRouter.reload();
|
|
17
|
-
},
|
|
18
|
-
copyVisible: function(){
|
|
19
|
-
return true;
|
|
20
|
-
},
|
|
21
|
-
copy: function (object_name, record_id, fields) {
|
|
22
|
-
let result = Steedos.authRequest(`/api/v4/${object_name}/${record_id}/copy`, { type: 'get', async: false });
|
|
23
|
-
FlowRouter.go(`/app/admin/process_definition/view/${result._id}`);
|
|
24
|
-
},
|
|
25
|
-
customize: function (object_name, record_id, fields) {
|
|
26
|
-
var doc = Creator.odata.get(object_name, record_id);
|
|
27
|
-
var newDoc = {}
|
|
28
|
-
_.each(Creator.getObject(object_name).fields, function (v, k) {
|
|
29
|
-
if (_.has(doc, k)) {
|
|
30
|
-
newDoc[k] = doc[k]
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
delete newDoc.is_system;
|
|
8
|
+
// customize: function (object_name, record_id, fields) {
|
|
9
|
+
// var doc = Creator.odata.get(object_name, record_id);
|
|
10
|
+
// var newDoc = {}
|
|
11
|
+
// _.each(Creator.getObject(object_name).fields, function (v, k) {
|
|
12
|
+
// if (_.has(doc, k)) {
|
|
13
|
+
// newDoc[k] = doc[k]
|
|
14
|
+
// }
|
|
15
|
+
// })
|
|
16
|
+
// delete newDoc.is_system;
|
|
34
17
|
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
// let docName = doc.name
|
|
19
|
+
// let docObjectName = doc.object_name
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
21
|
+
// Creator.odata.insert(object_name, Object.assign(newDoc, { name: docName, object_name: docObjectName, active: false }), function (result, error) {
|
|
22
|
+
// if (result) {
|
|
23
|
+
// for (let node of doc.process_nodes) {
|
|
24
|
+
// let nodeName = node.name
|
|
25
|
+
// var newNode = {}
|
|
26
|
+
// _.each(Creator.getObject('process_node').fields, function (v, k) {
|
|
27
|
+
// if (_.has(node, k)) {
|
|
28
|
+
// newNode[k] = node[k]
|
|
29
|
+
// }
|
|
30
|
+
// })
|
|
31
|
+
// Creator.odata.insert('process_node', Object.assign(newNode, { name: nodeName, process_definition: result._id }))
|
|
32
|
+
// }
|
|
33
|
+
// if (Session.get("object_name") === 'process_definition') {
|
|
34
|
+
// FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
35
|
+
// } else {
|
|
36
|
+
// href = Creator.getObjectUrl(object_name, result._id);
|
|
37
|
+
// window.open(href, '_blank', 'width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
40
|
+
// });
|
|
41
|
+
// },
|
|
59
42
|
customizeVisible: function (object_name, record_id, record_permissions, data) {
|
|
60
43
|
var record = data && data.record;
|
|
61
44
|
if (!record) {
|