@steedos-labs/plugin-workflow 3.0.0-beta.8 → 3.0.0

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.
Files changed (72) hide show
  1. package/main/default/client/instance.client.js +6 -6
  2. package/main/default/client/object_workflows.client.js +8 -7
  3. package/main/default/manager/import.js +17 -1
  4. package/main/default/manager/push_manager.js +20 -12
  5. package/main/default/manager/uuflowManagerForInitApproval.js +794 -0
  6. package/main/default/manager/uuflow_manager.js +53 -4
  7. package/main/default/manager/workflow_manager.js +1 -1
  8. package/main/default/methods/trace_approve_cc.js +568 -0
  9. package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +19 -0
  10. package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +19 -0
  11. package/main/default/objectTranslations/instance_tasks.en/instance_tasks.en.objectTranslation.yml +211 -0
  12. package/main/default/objectTranslations/instance_tasks.zh-CN/instance_tasks.zh-CN.objectTranslation.yml +211 -0
  13. package/main/default/objectTranslations/instances.en/instances.en.objectTranslation.yml +212 -0
  14. package/main/default/objectTranslations/instances.zh-CN/instances.zh-CN.objectTranslation.yml +209 -0
  15. package/main/default/objects/categories.object.yml +1 -0
  16. package/main/default/objects/flows/buttons/del.button.yml +7 -10
  17. package/main/default/objects/flows/buttons/design_form_layout.button.js +5 -2
  18. package/main/default/objects/flows/buttons/distributeAdmin.button.yml +5 -5
  19. package/main/default/objects/flows/buttons/newexport.button.yml +1 -1
  20. package/main/default/objects/flows/buttons/newimport.button.yml +2 -1
  21. package/main/default/objects/flows/flows.object.yml +12 -4
  22. package/main/default/objects/forms/forms.object.yml +39 -0
  23. package/main/default/objects/instance_tasks/buttons/instance_new.button.yml +3 -5
  24. package/main/default/objects/instances/buttons/instance_cc.button.yml +7 -7
  25. package/main/default/objects/instances/buttons/instance_delete.button.yml +2 -2
  26. package/main/default/objects/instances/buttons/instance_delete_many.button.yml +6 -6
  27. package/main/default/objects/instances/buttons/instance_distribute.button.yml +14 -13
  28. package/main/default/objects/instances/buttons/instance_flow_chart.button.yml +1 -1
  29. package/main/default/objects/instances/buttons/instance_forward.button.yml +8 -8
  30. package/main/default/objects/instances/buttons/instance_new.button.yml +3 -5
  31. package/main/default/objects/instances/buttons/instance_reassign.button.yml +1 -16
  32. package/main/default/objects/instances/buttons/instance_related.button.yml +4 -4
  33. package/main/default/objects/instances/buttons/instance_relocate.button.yml +9 -12
  34. package/main/default/objects/instances/buttons/instance_retrieve.button.yml +106 -2
  35. package/main/default/objects/instances/buttons/instance_save.button.yml +3 -9
  36. package/main/default/objects/instances/buttons/instance_submit.button.yml +1 -1
  37. package/main/default/objects/instances/buttons/instance_terminate.button.yml +7 -10
  38. package/main/default/objects/instances/listviews/monitor.listview.yml +0 -1
  39. package/main/default/pages/flowdetail.page.amis.json +9 -9
  40. package/main/default/pages/instance_detail.page.amis.json +3 -3
  41. package/main/default/pages/instance_tasks_detail.page.amis.json +3 -3
  42. package/main/default/pages/instance_tasks_list.page.amis.json +147 -110
  43. package/main/default/pages/instances_list.page.amis.json +146 -110
  44. package/main/default/routes/am.router.js +49 -2
  45. package/main/default/routes/api_cc.router.js +5 -12
  46. package/main/default/routes/api_flow_permission.router.js +7 -2
  47. package/main/default/routes/api_get_object_workflows.router.js +79 -22
  48. package/main/default/routes/api_object_workflow_drafts.router.js +18 -19
  49. package/main/default/routes/api_workflow_chart.router.js +682 -0
  50. package/main/default/routes/api_workflow_engine.router.js +1 -1
  51. package/main/default/routes/api_workflow_instance_return.router.js +164 -167
  52. package/main/default/routes/api_workflow_next_step_users.router.js +13 -8
  53. package/main/default/routes/api_workflow_reassign.router.js +200 -196
  54. package/main/default/routes/api_workflow_relocate.router.js +2 -2
  55. package/main/default/routes/api_workflow_retrieve.router.js +246 -237
  56. package/main/default/routes/export.router.js +5 -4
  57. package/main/default/routes/flow_form_design.ejs +33 -8
  58. package/main/default/routes/flow_form_design.router.js +4 -3
  59. package/main/default/routes/import.router.js +6 -7
  60. package/main/default/services/flows.service.js +1 -1
  61. package/main/default/translations/en.translation.yml +5 -0
  62. package/main/default/translations/zh-CN.translation.yml +2 -1
  63. package/main/default/triggers/amis_form_design.trigger.js +27 -5
  64. package/main/default/triggers/instances.trigger.js +9 -7
  65. package/main/default/utils/designerManager.js +12 -5
  66. package/package.json +4 -4
  67. package/package.service.js +21 -7
  68. package/public/workflow/index.css +4 -0
  69. package/src/instance_record_queue.js +1 -3
  70. package/src/rests/api_workflow_instance_batch_remove.js +4 -3
  71. package/src/webhook_queue.js +283 -0
  72. package/main/default/manager/index.js +0 -23
@@ -11,7 +11,7 @@ amis_schema: |-
11
11
  "body": [
12
12
  {
13
13
  "type": "button",
14
- "label": "分发",
14
+ "label": "${'CustomAction.instances.instance_distribute' | t}",
15
15
  "id": "u:instance_distribute",
16
16
  "className": " ",
17
17
  "onEvent": {
@@ -26,12 +26,12 @@ amis_schema: |-
26
26
  "title": {
27
27
  "type": "tpl",
28
28
  "id": "u:0bce3c33b6e5",
29
- "tpl": "<p>分发<a href=\"https://www.steedos.cn/docs/user/workflow#%E5%A6%82%E4%BD%95%E5%88%86%E5%8F%91\" target=\"_blank\" rel=\"noopener\"> ?&nbsp;</a></p>"
29
+ "tpl": "<p>${'CustomAction.instances.instance_distribute' | t}</p>"
30
30
  },
31
31
  "body": [
32
32
  {
33
33
  "type": "tpl",
34
- "tpl": "<p>将当前选中的文件分发到新的流程,继续执行审批操作</p>",
34
+ "tpl": "<p>${'CustomLabels.instance_action_instance_distribute_dialog_sub_title' | t}</p>",
35
35
  "inline": false,
36
36
  "id": "u:11bcfab80ce9",
37
37
  "className": "m-b-sm"
@@ -43,7 +43,7 @@ amis_schema: |-
43
43
  "body": [
44
44
  {
45
45
  "type": "steedos-select-flow",
46
- "label": "流程名称",
46
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_process' | t}",
47
47
  "name": "flow_id",
48
48
  "id": "instanceForwardFlow",
49
49
  "multiple": false,
@@ -124,7 +124,7 @@ amis_schema: |-
124
124
  },
125
125
  {
126
126
  "type": "steedos-select-user",
127
- "label": "分发对象",
127
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_users' | t}",
128
128
  "name": "users",
129
129
  "id": "u:c3ad733db365",
130
130
  "multiple": true,
@@ -133,7 +133,7 @@ amis_schema: |-
133
133
  },
134
134
  {
135
135
  "type": "steedos-select-user",
136
- "label": "分发对象",
136
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_users' | t}",
137
137
  "name": "users",
138
138
  "id": "u:c3ad733db360",
139
139
  "multiple": true,
@@ -163,7 +163,7 @@ amis_schema: |-
163
163
  },
164
164
  {
165
165
  "type": "textarea",
166
- "label": "备注",
166
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_description' | t}",
167
167
  "name": "description",
168
168
  "id": "u:1dc7e49e6e7d",
169
169
  "minRows": 3,
@@ -173,21 +173,21 @@ amis_schema: |-
173
173
  "type": "checkbox",
174
174
  "name": "instance_distribute_to_self",
175
175
  "id": "u:da17af0371f82",
176
- "option": "同时分发给自己",
176
+ "option": "${'CustomLabels.instance_action_instance_distribute_dialog_field_to_self' | t}",
177
177
  "hiddenOn": "${distribute_to_self != true}"
178
178
  },
179
179
  {
180
180
  "type": "checkbox",
181
181
  "name": "saveInstanceToAttachment",
182
182
  "id": "u:da17af0371f8",
183
- "option": "将原表单存储为附件",
183
+ "option": "${'CustomLabels.instance_action_instance_distribute_dialog_field_to_attachment' | t}",
184
184
  "hidden": true
185
185
  },
186
186
  {
187
187
  "type": "checkbox",
188
188
  "name": "instance_related",
189
189
  "id": "u:da17af0371f9",
190
- "option": "自动创建关联文件",
190
+ "option": "${'CustomLabels.instance_action_instance_distribute_dialog_field_related' | t}",
191
191
  "hiddenOn": "${enable_distribute_instance_related != true}"
192
192
  }
193
193
  ],
@@ -252,7 +252,7 @@ amis_schema: |-
252
252
  "actions": [
253
253
  {
254
254
  "type": "button",
255
- "label": "取消",
255
+ "label": "${'Cancel' | t}",
256
256
  "onEvent": {
257
257
  "click": {
258
258
  "actions": [
@@ -268,7 +268,7 @@ amis_schema: |-
268
268
  },
269
269
  {
270
270
  "type": "button",
271
- "label": "确定",
271
+ "label": "${'OK' | t}",
272
272
  "onEvent": {
273
273
  "click": {
274
274
  "actions": [
@@ -298,7 +298,8 @@ amis_schema: |-
298
298
  ],
299
299
  "weight": 0
300
300
  }
301
- }
301
+ },
302
+ "hiddenOn": "!(record.box === 'inbox' && record.step.allowDistribute == true)"
302
303
  }
303
304
  ],
304
305
  "regions": [
@@ -13,7 +13,7 @@ amis_schema: |-
13
13
  "actions": [
14
14
  {
15
15
  "args": {
16
- "url": "${context.rootUrl}/api/workflow/chart?instance_id=${recordId}&title=${record.flow.name}",
16
+ "url": "${context.rootUrl}/api/workflow/chart?instance_id=${instanceId || recordId}&title=${record.flow.name}",
17
17
  "blank": true
18
18
  },
19
19
  "actionType": "url"
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "转发",
8
+ "label": "${'CustomAction.instances.instance_forward' | t}",
9
9
  "id": "u:instance_forward",
10
10
  "onEvent": {
11
11
  "click": {
@@ -17,12 +17,12 @@ amis_schema: |-
17
17
  "title": {
18
18
  "type": "tpl",
19
19
  "id": "u:4733f85da58b",
20
- "tpl": "<p>转发&nbsp;<a href=\"https://www.steedos.cn/docs/user/workflow#%E5%A6%82%E4%BD%95%E8%BD%AC%E5%8F%91\" target=\"_blank\" rel=\"noopener\">?</a></p>"
20
+ "tpl": "<p>${'CustomAction.instances.instance_forward' | t}</p>"
21
21
  },
22
22
  "body": [
23
23
  {
24
24
  "type": "tpl",
25
- "tpl": "<div class=\"box-title\">将当前选中的文件转发到新的流程,继续执行审批操作</div>",
25
+ "tpl": "<div class=\"box-title\">${'CustomLabels.instance_action_instance_cc_dialog_sub_title' | t}</div>",
26
26
  "inline": false,
27
27
  "id": "u:cf94d83ee7a8",
28
28
  "className": "m-b-sm"
@@ -33,7 +33,7 @@ amis_schema: |-
33
33
  "title": "表单",
34
34
  "body": [
35
35
  {
36
- "label": "流程名称",
36
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_process' | t}",
37
37
  "type": "steedos-select-flow",
38
38
  "mode": "tree-select",
39
39
  "name": "flow_id",
@@ -47,7 +47,7 @@ amis_schema: |-
47
47
  },
48
48
  {
49
49
  "type": "textarea",
50
- "label": "备注",
50
+ "label": "${'CustomLabels.instance_action_instance_distribute_dialog_field_description' | t}",
51
51
  "name": "description",
52
52
  "id": "u:bb3fcb0c4e8c",
53
53
  "minRows": 3,
@@ -57,7 +57,7 @@ amis_schema: |-
57
57
  "type": "checkbox",
58
58
  "name": "hasSaveInstanceToAttachment",
59
59
  "id": "u:da17af0371f8",
60
- "option": "将原表单存储为附件",
60
+ "option": "${'CustomLabels.instance_action_instance_distribute_dialog_field_to_attachment' | t}",
61
61
  "hidden": true
62
62
  }
63
63
  ],
@@ -100,7 +100,7 @@ amis_schema: |-
100
100
  "actions": [
101
101
  {
102
102
  "type": "button",
103
- "label": "取消",
103
+ "label": "${'Cancel' | t}",
104
104
  "onEvent": {
105
105
  "click": {
106
106
  "actions": [
@@ -116,7 +116,7 @@ amis_schema: |-
116
116
  },
117
117
  {
118
118
  "type": "button",
119
- "label": "确定",
119
+ "label": "${'OK' | t}",
120
120
  "onEvent": {
121
121
  "click": {
122
122
  "actions": [
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "新建",
8
+ "label": "${'CustomAction.instances.instance_new' | t}",
9
9
  "level": "primary",
10
10
  "id": "u:instance_new",
11
11
  "className": "instance-new-btn",
@@ -16,7 +16,7 @@ amis_schema: |-
16
16
  "actionType": "dialog",
17
17
  "dialog": {
18
18
  "type": "dialog",
19
- "title": "请选择流程",
19
+ "title": "${'CustomLabels.instance_action_new_dialog_title' | t}",
20
20
  "body": [
21
21
  {
22
22
  "type": "steedos-select-flow",
@@ -43,12 +43,10 @@ amis_schema: |-
43
43
  "flow": "$event.data.value"
44
44
  }
45
45
  },
46
+ "adaptor": "return payload.instance ? {data: {...payload}, status: 0, msg: t('instance_action_new_dialog_msg_success')} : {...payload, status: 1, msg: t('instance_action_new_dialog_msg_failed')};",
46
47
  "headers": {
47
48
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
48
49
  }
49
- },
50
- "messages": {
51
- "success": "创建成功!"
52
50
  }
53
51
  },
54
52
  "actionType": "ajax"
@@ -17,7 +17,7 @@ amis_schema: |-
17
17
  "type": "button",
18
18
  "label": "转签核",
19
19
  "id": "u:instance_reassign",
20
- "hiddenOn": "!(this.record.box === 'monitor' && this.record.state == 'pending' && this.flowPermissions.includes('admin'))",
20
+ "hiddenOn": "!(this.record.box === 'monitor' && this.record.state == 'pending' && this.record.flowPermissions.includes('admin'))",
21
21
  "onEvent": {
22
22
  "click": {
23
23
  "weight": 0,
@@ -104,20 +104,5 @@ amis_schema: |-
104
104
  }
105
105
  }
106
106
  ],
107
- "data": {
108
- "context": {
109
- "rootUrl": "http://127.0.0.1:5300",
110
- "tenantId": "63ed8fb288feeecd0165843d",
111
- "userId": "1852bcb9-a3cb-4d04-905b-1cd12e4cdb3b",
112
- "authToken": "4c6a0b7d705b6fcab7f09d08006e644e30a37d3b5e198a056e85d7383ced3f492a097a30b63ad8e42d1c08"
113
- },
114
- "app_id": "",
115
- "tab_id": "",
116
- "object_name": "",
117
- "dataComponentId": "",
118
- "record_id": "",
119
- "record": {},
120
- "permissions": {}
121
- },
122
107
  "id": "u:fbe25e9811ea"
123
108
  }
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "关联文件",
8
+ "label": "${'CustomAction.instances.instance_related' | t}",
9
9
  "id": "u:instance_link",
10
10
  "onEvent": {
11
11
  "click": {
@@ -14,7 +14,7 @@ amis_schema: |-
14
14
  "actionType": "dialog",
15
15
  "dialog": {
16
16
  "type": "dialog",
17
- "title": "关联文件",
17
+ "title": "${'CustomAction.instances.instance_related' | t}",
18
18
  "body": [
19
19
  {
20
20
  "type": "form",
@@ -78,7 +78,7 @@ amis_schema: |-
78
78
  "actions": [
79
79
  {
80
80
  "type": "button",
81
- "label": "取消",
81
+ "label": "${'Cancel' | t}",
82
82
  "onEvent": {
83
83
  "click": {
84
84
  "actions": [
@@ -94,7 +94,7 @@ amis_schema: |-
94
94
  },
95
95
  {
96
96
  "type": "button",
97
- "label": "确定",
97
+ "label": "${'OK' | t}",
98
98
  "onEvent": {
99
99
  "click": {
100
100
  "actions": [
@@ -15,8 +15,8 @@ amis_schema: |-
15
15
  "body": [
16
16
  {
17
17
  "type": "button",
18
- "label": "重定位",
19
- "hiddenOn": "!(this.record.box === 'monitor' && this.record.state != 'draft' && this.flowPermissions.includes('admin'))",
18
+ "label": "${'CustomAction.instances.instance_relocate' | t}",
19
+ "hiddenOn": "!(this.record.box === 'monitor' && this.record.state != 'draft' && this.record.flowPermissions.includes('admin'))",
20
20
  "onEvent": {
21
21
  "click": {
22
22
  "weight": 0,
@@ -24,7 +24,7 @@ amis_schema: |-
24
24
  {
25
25
  "dialog": {
26
26
  "type": "dialog",
27
- "title": "重定位",
27
+ "title": "${'instance_action_instance_relocate_dialog_title' | t}",
28
28
  "body": [
29
29
  {
30
30
  "type": "service",
@@ -37,14 +37,14 @@ amis_schema: |-
37
37
  "body": [
38
38
  {
39
39
  "type": "tpl",
40
- "tpl": "当前步骤: <p class='font-medium inline'>${record.currentStep.name}</p>",
40
+ "tpl": "${'instance_action_instance_relocate_dialog_title_prefix' | t} <p class='font-medium inline'>${record.currentStep.name}</p>",
41
41
  "inline": true,
42
42
  "wrapperComponent": "",
43
43
  "id": "u:1f7dd93080d3"
44
44
  },
45
45
  {
46
46
  "type": "select",
47
- "label": "下一步",
47
+ "label": "${'instance_next_step' | t",
48
48
  "name": "relocate_step",
49
49
  "id": "u:ee15214c1808",
50
50
  "multiple": false,
@@ -53,7 +53,7 @@ amis_schema: |-
53
53
  },
54
54
  {
55
55
  "type": "steedos-select-user",
56
- "label": "处理人",
56
+ "label": "${'instance_next_step_users' | t}",
57
57
  "name": "relocate_users",
58
58
  "id": "u:c3ad733db360",
59
59
  "multiple": true,
@@ -68,7 +68,7 @@ amis_schema: |-
68
68
  "id": "u:bffe87a42168",
69
69
  "minRows": 3,
70
70
  "maxRows": 20,
71
- "placeholder": "请填写重定位的理由",
71
+ "description": "${'instance_action_instance_relocate_dialog_field_reason' | t}",
72
72
  "className": "mt-3"
73
73
  }
74
74
  ],
@@ -78,12 +78,9 @@ amis_schema: |-
78
78
  "api": {
79
79
  "url": "${context.rootUrl}/api/workflow/relocate",
80
80
  "method": "post",
81
- "messages": {
82
- "success": "重定位成功",
83
- "failed": "重定位失败"
84
- },
85
81
  "dataType": "json",
86
- "requestAdaptor": "const { record, relocate_users, relocate_step, reason } = api.data;\napi.data = {\n \"Instances\": [{\n _id: record._id, relocate_next_step: relocate_step.split('.')[1], relocate_inbox_users: relocate_users, relocate_comment: reason\n }]\n}\n\nreturn api;"
82
+ "requestAdaptor": "const { record, relocate_users, relocate_step, reason } = api.data;\napi.data = {\n \"Instances\": [{\n _id: record._id, relocate_next_step: relocate_step.split('.')[1], relocate_inbox_users: relocate_users, relocate_comment: reason\n }]\n}\n\nreturn api;",
83
+ "adaptor": "return response.status == 200 ? {data: {...payload}, status: 0, msg: t('instance_action_relocate_dialog_msg_success')} : {...payload, status: 1, msg: t('instance_action_relocate_dialog_msg_failed')};"
87
84
  },
88
85
  "onEvent": {
89
86
  "submitFail": {
@@ -1,7 +1,111 @@
1
1
  name: instance_retrieve
2
- is_enable: false
2
+ amis_schema: |-
3
+ {
4
+ "type": "service",
5
+ "body": [
6
+ {
7
+ "type": "button",
8
+ "label": "取回",
9
+ "id": "u:instance_retrieve",
10
+ "editorState": "default",
11
+ "onEvent": {
12
+ "click": {
13
+ "weight": 0,
14
+ "actions": [
15
+ {
16
+ "ignoreError": false,
17
+ "actionType": "dialog",
18
+ "dialog": {
19
+ "type": "dialog",
20
+ "title": "取回",
21
+ "body": [
22
+ {
23
+ "type": "input-text",
24
+ "label": "备注",
25
+ "name": "retrieve_comment",
26
+ "id": "u:c7fa318c8af1",
27
+ "editorState": "default"
28
+ }
29
+ ],
30
+ "id": "u:b05694926b78",
31
+ "actions": [
32
+ {
33
+ "type": "button",
34
+ "actionType": "cancel",
35
+ "label": "取消",
36
+ "id": "u:76960d34d658"
37
+ },
38
+ {
39
+ "type": "button",
40
+ "actionType": "confirm",
41
+ "label": "确定",
42
+ "primary": true,
43
+ "id": "u:907978324dc2",
44
+ "editorState": "default",
45
+ "onEvent": {
46
+ "click": {
47
+ "weight": 0,
48
+ "actions": [
49
+ {
50
+ "ignoreError": false,
51
+ "actionType": "ajax",
52
+ "outputVar": "responseResult",
53
+ "options": {},
54
+ "api": {
55
+ "url": "${context.rootUrl}/api/workflow/retrieve",
56
+ "method": "post",
57
+ "requestAdaptor": "debugger;\nconsole.log(\"api:\", api);\napi.data = {\n \"_id\": api.body.record._id,\n \"retrieve_comment\": api.body.retrieve_comment\n};\nreturn api;",
58
+ "adaptor": "console.log('payload', payload);\nreturn payload;",
59
+ "messages": {},
60
+ "headers": {
61
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
62
+ },
63
+ "data": {
64
+ "&": "$$",
65
+ "record": "${record}"
66
+ }
67
+ }
68
+ },
69
+ {
70
+ "actionType": "broadcast",
71
+ "args": {
72
+ "eventName": "@data.@instanceDetail.changed"
73
+ },
74
+ "data": {}
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ }
80
+ ],
81
+ "showCloseButton": true,
82
+ "closeOnOutside": false,
83
+ "closeOnEsc": false,
84
+ "showErrorMsg": true,
85
+ "showLoading": true,
86
+ "draggable": false,
87
+ "actionType": "dialog"
88
+ }
89
+ }
90
+ ]
91
+ }
92
+ },
93
+ "hiddenOn": "!(record.box === 'outbox' && record.state === 'pending')"
94
+ }
95
+ ],
96
+ "regions": [
97
+ "body"
98
+ ],
99
+ "data": {
100
+ },
101
+ "id": "u:5b9a5a685ac9",
102
+ "bodyClassName": "p-0",
103
+ "dsType": "api",
104
+ "definitions": {}
105
+ }
106
+ is_enable: true
3
107
  label: 取回
4
108
  'on': record_only
109
+ sort: 40
5
110
  type: amis_button
6
111
  visible: true
7
- sort: 40
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "保存",
8
+ "label": "${'CustomAction.instances.instance_save' | t}",
9
9
  "id": "u:instance_save",
10
10
  "className": " ",
11
11
  "onEvent": {
@@ -18,16 +18,13 @@ amis_schema: |-
18
18
  "method": "post",
19
19
  "sendOn": "",
20
20
  "requestAdaptor": "var _SteedosUI$getRef$get, _approveValues$next_s;\nconst formValues = context._scoped.getComponentById(\"instance_form\").getValues();\nconst approveValues = (_SteedosUI$getRef$get = context._scoped.getComponentById(\"instance_approval\")) === null || _SteedosUI$getRef$get === void 0 ? void 0 : _SteedosUI$getRef$get.getValues();\nlet nextUsers = approveValues === null || approveValues === void 0 ? void 0 : approveValues.next_users;\nif (_.isString(nextUsers)) {\n nextUsers = [approveValues.next_users];\n}\nconst instance = context.record;\nconst body = {\n instance: {\n _id: instance._id,\n applicant: formValues.applicant,\n submitter: formValues.submitter,\n traces: [{\n _id: instance.trace._id,\n step: instance.step._id,\n approves: [{\n _id: instance.approve._id,\n next_steps: [{\n step: approveValues === null || approveValues === void 0 || (_approveValues$next_s = approveValues.next_step) === null || _approveValues$next_s === void 0 ? void 0 : _approveValues$next_s._id,\n users: nextUsers\n }],\n description: approveValues === null || approveValues === void 0 ? void 0 : approveValues.suggestion,\n values: formValues\n }]\n }]\n }\n};\napi.data = body;\nreturn api;",
21
+ "adaptor": "if (payload.instance == \"upgraded\") { window.setTimeout(function(){ window.location.reload(); }, 2000); return {...payload, status: 1, msg: t('instance_action_instance_save_msg_upgraded')}; } \n return payload.instance === true ? {...payload, status: 0, msg: t('instance_action_instance_save_msg_success')} : {...payload, status: 1, msg: t('instance_action_instance_save_msg_failed')};",
21
22
  "headers": {
22
23
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
23
24
  },
24
25
  "data": {
25
26
  "&": "$$"
26
27
  }
27
- },
28
- "messages": {
29
- "success": "暂存成功",
30
- "failed": "暂存失败"
31
28
  }
32
29
  },
33
30
  "actionType": "ajax",
@@ -40,16 +37,13 @@ amis_schema: |-
40
37
  "method": "post",
41
38
  "sendOn": "",
42
39
  "requestAdaptor": "var _SteedosUI$getRef$get, _approveValues$next_s;\nconst formValues = context._scoped.getComponentById(\"instance_form\").getValues();\nconst approveValues = (_SteedosUI$getRef$get = context._scoped.getComponentById(\"instance_approval\")) === null || _SteedosUI$getRef$get === void 0 ? void 0 : _SteedosUI$getRef$get.getValues();\nlet nextUsers = approveValues === null || approveValues === void 0 ? void 0 : approveValues.next_users;\nif (_.isString(nextUsers)) {\n nextUsers = [approveValues.next_users];\n}\nconst instance = context.record;\nconst body = {\n approve: {\n id: instance.approve._id,\n instance: instance._id,\n trace: instance.trace._id,\n next_steps: [{\n step: approveValues === null || approveValues === void 0 || (_approveValues$next_s = approveValues.next_step) === null || _approveValues$next_s === void 0 ? void 0 : _approveValues$next_s._id,\n users: nextUsers\n }],\n description: approveValues === null || approveValues === void 0 ? void 0 : approveValues.suggestion,\n judge: approveValues === null || approveValues === void 0 ? void 0 : approveValues.judge,\n values: formValues\n }\n};\napi.data = body;\nreturn api;",
40
+ "adaptor": "return payload.instance ? {...payload, status: 0, msg: t('instance_action_instance_save_msg_success')} : {...payload, status: 1, msg: t('instance_action_instance_save_msg_failed')};",
43
41
  "headers": {
44
42
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
45
43
  },
46
44
  "data": {
47
45
  "&": "$$"
48
46
  }
49
- },
50
- "messages": {
51
- "success": "暂存成功",
52
- "failed": "暂存失败"
53
47
  }
54
48
  },
55
49
  "actionType": "ajax",
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "发送",
8
+ "label": "${'CustomAction.instances.instance_submit' | t}",
9
9
  "level": "primary",
10
10
  "id": "u:instance_submit",
11
11
  "hiddenOn": "!(this.record.box === 'inbox' || this.record.box === 'draft')",
@@ -5,7 +5,7 @@ amis_schema: |-
5
5
  "body": [
6
6
  {
7
7
  "type": "button",
8
- "label": "取消申请",
8
+ "label": "${'CustomAction.instances.instance_terminate' | t}",
9
9
  "id": "u:instance_terminate",
10
10
  "className": " ",
11
11
  "onEvent": {
@@ -15,11 +15,11 @@ amis_schema: |-
15
15
  "actionType": "dialog",
16
16
  "dialog": {
17
17
  "type": "dialog",
18
- "title": "取消申请",
18
+ "title": "${'CustomLabels.instance_action_terminate_dialog_title' | t}",
19
19
  "body": [
20
20
  {
21
21
  "type": "tpl",
22
- "tpl": "<p>&nbsp;请填写取消申请的理由</p>",
22
+ "tpl": "${'CustomLabels.instance_action_terminate_dialog_content' | t}",
23
23
  "inline": false,
24
24
  "id": "u:0a1847d1d018",
25
25
  "className": "m-b-sm"
@@ -47,12 +47,9 @@ amis_schema: |-
47
47
  "record": "${record}"
48
48
  },
49
49
  "requestAdaptor": "\nconsole.log(\"api.data\", api.data)\nconst { record, terminate_reason } = api.data;\napi.data = {\n terminate_reason: terminate_reason,\n instance_id: record._id\n}\nreturn api;",
50
+ "adaptor": "return response.status == 200 ? {data: {...payload}, status: 0, msg: t('instance_action_terminate_dialog_msg_success')} : {...payload, status: 1, msg: t('instance_action_terminate_dialog_msg_failed')};",
50
51
  "headers": {
51
52
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
52
- },
53
- "messages": {
54
- "success": "取消申请成功!",
55
- "failed": "取消申请失败"
56
53
  }
57
54
  },
58
55
  "onEvent": {
@@ -67,7 +64,7 @@ amis_schema: |-
67
64
  "componentId": "",
68
65
  "args": {
69
66
  "blank": false,
70
- "url": "/app/${appId}/instance_tasks/grid/${side_listview_id}"
67
+ "url": "/app/${appId}/instances/grid/${side_listview_id}"
71
68
  },
72
69
  "actionType": "url"
73
70
  }
@@ -80,7 +77,7 @@ amis_schema: |-
80
77
  "actions": [
81
78
  {
82
79
  "type": "button",
83
- "label": "取消",
80
+ "label": "${'Cancel' | t}",
84
81
  "onEvent": {
85
82
  "click": {
86
83
  "actions": [
@@ -96,7 +93,7 @@ amis_schema: |-
96
93
  },
97
94
  {
98
95
  "type": "button",
99
- "label": "确定",
96
+ "label": "${'OK' | t}",
100
97
  "onEvent": {
101
98
  "click": {
102
99
  "actions": [
@@ -9,7 +9,6 @@ columns:
9
9
  - flow_name
10
10
  - current_step_name
11
11
  - modified
12
- - is_archived
13
12
  mobile_columns:
14
13
  - name
15
14
  - flow_name