@steedos/standard-process-approval 3.0.0-beta.70 → 3.0.0-beta.72
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/approval/process_definition/buttons/customize.button.yml +135 -0
- package/main/default/objects/process/approval/process_definition.action.js +33 -33
- 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 +1 -0
- package/package.json +3 -3
|
@@ -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
|
|
@@ -2,43 +2,43 @@
|
|
|
2
2
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
3
|
* @Date: 2025-04-14 09:47:57
|
|
4
4
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
5
|
+
* @LastEditTime: 2025-08-19 14:07:13
|
|
6
6
|
*/
|
|
7
7
|
module.exports = {
|
|
8
|
-
customize: function (object_name, record_id, fields) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// let docName = doc.name
|
|
19
|
+
// let docObjectName = doc.object_name
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
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
|
+
// },
|
|
42
42
|
customizeVisible: function (object_name, record_id, record_permissions, data) {
|
|
43
43
|
var record = data && data.record;
|
|
44
44
|
if (!record) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-process-approval",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.72",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"steedos"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/process": "3.0.0-beta.
|
|
13
|
+
"@steedos/process": "3.0.0-beta.72",
|
|
14
14
|
"nanoid": "^3.3.4"
|
|
15
15
|
},
|
|
16
16
|
"description": "steedos package",
|
|
17
17
|
"repository": {},
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "18b81ddcdafac5d7690c29bfdb1ee0bd8cf8bc48"
|
|
20
20
|
}
|