@steedos-labs/plugin-workflow 3.0.0-beta.9 → 3.0.1-beta.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/client/instance.client.js +6 -6
- package/main/default/client/object_workflows.client.js +8 -7
- package/main/default/client/socket.client.js +46 -3
- package/main/default/manager/import.js +17 -1
- package/main/default/manager/instance_manager.js +20 -6
- package/main/default/manager/push_manager.js +20 -12
- package/main/default/manager/uuflowManagerForInitApproval.js +794 -0
- package/main/default/manager/uuflow_manager.js +53 -4
- package/main/default/manager/workflow_manager.js +1 -1
- package/main/default/methods/instance_approve.js +258 -0
- package/main/default/methods/trace_approve_cc.js +571 -0
- package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +19 -0
- package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +19 -0
- package/main/default/objectTranslations/forms.en/forms.en.objectTranslation.yml +191 -0
- package/main/default/objectTranslations/forms.zh-CN/forms.zh-CN.objectTranslation.yml +246 -0
- package/main/default/objectTranslations/instance_tasks.en/instance_tasks.en.objectTranslation.yml +213 -0
- package/main/default/objectTranslations/instance_tasks.zh-CN/instance_tasks.zh-CN.objectTranslation.yml +213 -0
- package/main/default/objectTranslations/instances.en/instances.en.objectTranslation.yml +212 -0
- package/main/default/objectTranslations/instances.zh-CN/instances.zh-CN.objectTranslation.yml +209 -0
- package/main/default/objects/categories.object.yml +1 -0
- package/main/default/objects/flows/buttons/del.button.yml +7 -10
- package/main/default/objects/flows/buttons/design_form_layout.button.js +5 -2
- package/main/default/objects/flows/buttons/distributeAdmin.button.yml +5 -5
- package/main/default/objects/flows/buttons/newexport.button.yml +1 -1
- package/main/default/objects/flows/buttons/newimport.button.yml +2 -1
- package/main/default/objects/flows/flows.object.yml +12 -4
- package/main/default/objects/forms/forms.object.yml +85 -0
- package/main/default/objects/instance_tasks/buttons/instance_new.button.yml +3 -5
- package/main/default/objects/instances/buttons/instance_cc.button.yml +7 -7
- package/main/default/objects/instances/buttons/instance_delete.button.yml +2 -2
- package/main/default/objects/instances/buttons/instance_delete_many.button.yml +6 -6
- package/main/default/objects/instances/buttons/instance_distribute.button.yml +14 -13
- package/main/default/objects/instances/buttons/instance_flow_chart.button.yml +1 -1
- package/main/default/objects/instances/buttons/instance_forward.button.yml +8 -8
- package/main/default/objects/instances/buttons/instance_new.button.yml +3 -5
- package/main/default/objects/instances/buttons/instance_reassign.button.yml +1 -16
- package/main/default/objects/instances/buttons/instance_related.button.yml +4 -4
- package/main/default/objects/instances/buttons/instance_relocate.button.yml +9 -12
- package/main/default/objects/instances/buttons/instance_retrieve.button.yml +106 -2
- package/main/default/objects/instances/buttons/instance_save.button.yml +3 -9
- package/main/default/objects/instances/buttons/instance_submit.button.yml +1 -1
- package/main/default/objects/instances/buttons/instance_terminate.button.yml +7 -10
- package/main/default/objects/instances/listviews/monitor.listview.yml +0 -1
- package/main/default/pages/flowdetail.page.amis.json +11 -11
- package/main/default/pages/instance_detail.page.amis.json +25 -37
- package/main/default/pages/instance_tasks_detail.page.amis.json +21 -5
- package/main/default/pages/instance_tasks_list.page.amis.json +147 -110
- package/main/default/pages/instances_list.page.amis.json +146 -110
- package/main/default/routes/afterHook.js +34 -0
- package/main/default/routes/am.router.js +49 -2
- package/main/default/routes/api_cc.router.js +5 -12
- package/main/default/routes/api_flow_permission.router.js +7 -2
- package/main/default/routes/api_get_object_workflows.router.js +79 -22
- package/main/default/routes/api_have_read.router.js +73 -0
- package/main/default/routes/api_object_workflow_drafts.router.js +18 -19
- package/main/default/routes/api_workflow_approve_save.router.js +2 -1
- package/main/default/routes/api_workflow_chart.router.js +682 -0
- package/main/default/routes/api_workflow_engine.router.js +4 -4
- package/main/default/routes/api_workflow_flow_version.router.js +61 -0
- package/main/default/routes/api_workflow_form_version.router.js +61 -0
- package/main/default/routes/api_workflow_instance_return.router.js +164 -167
- package/main/default/routes/api_workflow_next_step_users.router.js +13 -8
- package/main/default/routes/api_workflow_reassign.router.js +200 -196
- package/main/default/routes/api_workflow_relocate.router.js +4 -3
- package/main/default/routes/api_workflow_retrieve.router.js +246 -237
- package/main/default/routes/export.router.js +5 -4
- package/main/default/routes/flow_form_design.ejs +33 -8
- package/main/default/routes/flow_form_design.router.js +4 -3
- package/main/default/routes/import.router.js +6 -7
- package/main/default/services/flows.service.js +1 -1
- package/main/default/translations/en.translation.yml +5 -0
- package/main/default/translations/zh-CN.translation.yml +2 -1
- package/main/default/triggers/amis_form_design.trigger.js +27 -5
- package/main/default/triggers/instances.trigger.js +9 -7
- package/main/default/utils/designerManager.js +12 -5
- package/package.json +4 -4
- package/package.service.js +21 -7
- package/public/workflow/index.css +4 -0
- package/src/instance_record_queue.js +1 -3
- package/src/rests/api_workflow_instance_batch_remove.js +4 -3
- package/src/webhook_queue.js +283 -0
- package/main/default/manager/index.js +0 -23
|
@@ -15,8 +15,11 @@ module.exports = {
|
|
|
15
15
|
if (!record) {
|
|
16
16
|
return toastr.error("未找到记录");
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var locale = Builder.settings.context?.user?.language || window.navigator.language;
|
|
19
|
+
if(locale === 'en' || locale.startsWith('en-')){
|
|
20
|
+
locale = 'en-US'
|
|
21
|
+
}
|
|
22
|
+
window.open(Steedos.getRelativeUrl("/api/workflow/form_design?fid=" + record_id+`&assetUrls=${Builder.settings.assetUrls}&locale=${locale}`));
|
|
20
23
|
},
|
|
21
24
|
design_form_layoutVisible: function(object_name, record_id, record_permissions, data) {
|
|
22
25
|
var record = data && data.record;
|
|
@@ -5,7 +5,7 @@ amis_schema: |-
|
|
|
5
5
|
"body": [
|
|
6
6
|
{
|
|
7
7
|
"type": "button",
|
|
8
|
-
"label": "
|
|
8
|
+
"label": "${'CustomAction.flows.distributeAdmin' | t}",
|
|
9
9
|
"id": "u:distributeAdmin",
|
|
10
10
|
"editorState": "default",
|
|
11
11
|
"onEvent": {
|
|
@@ -17,7 +17,7 @@ amis_schema: |-
|
|
|
17
17
|
"actionType": "dialog",
|
|
18
18
|
"dialog": {
|
|
19
19
|
"type": "dialog",
|
|
20
|
-
"title": "
|
|
20
|
+
"title": "${'CustomAction.flows.distributeAdmin' | t}",
|
|
21
21
|
"body": [
|
|
22
22
|
{
|
|
23
23
|
"id": "u:473feaee9de7",
|
|
@@ -27,7 +27,7 @@ amis_schema: |-
|
|
|
27
27
|
"url": "/api/v1/flows/${recordId}?fields=[\"_id\",\"name\",\"current\",\"distribute_optional_users_id\",\"distribute_to_self\",\"distribute_end_notification\",\"upload_after_being_distributed\"]",
|
|
28
28
|
"method": "get",
|
|
29
29
|
"requestAdaptor": "",
|
|
30
|
-
"adaptor": "const data = payload.data;\n\n\n\nconst steps = _.filter(data.current.steps, { allowDistribute: true });\n\nconst stepsInputFields = [];\n\nif (steps.length == 0) {\n return {\n data: {\n \"type\": \"alert\",\n \"body\":
|
|
30
|
+
"adaptor": "const data = payload.data;\n\n\n\nconst steps = _.filter(data.current.steps, { allowDistribute: true });\n\nconst stepsInputFields = [];\n\nif (steps.length == 0) {\n return {\n data: {\n \"type\": \"alert\",\n \"body\": t('flows_action_distributeAdmin_dialog_error_not_find_step'),\n \"level\": \"info\",\n \"className\": \"mb-1\"\n }\n }\n} else { \n\n _.each(steps, (step) => {\n stepsInputFields.push({\n type: 'steedos-field',\n config: {\n label: step.name,\n name: `step_distribute_flows_${step._id}`,\n multiple: true, amis: {value: step.distribute_optional_flows},\n \n type: 'lookup',\n reference_to: 'flows',\n filters: ['state', '=', 'enabled']\n }\n })\n })\n\n}\n\nreturn {\n data: {\n \"id\": \"u:90ea4939d3d12\",\n \"type\": \"form\",\n \"title\": \"表单\",\n \"wrapWithPanel\": false,\n \"mode\": \"normal\",\n \"dsType\": \"api\",\n \"feat\": \"Insert\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"config\": {\n \"type\": \"lookup\",\n \"label\": t('flows_action_distributeAdmin_dialog_field_distribute_optional_users_id'),\n \"name\": \"distribute_optional_users_id\",\n \"deleted_lookup_record_behavior\": \"clear\",\n \"reference_to\": \"users\",\n \"multiple\": true,\n \"object\": \"\"\n },\n \"id\": \"u:36461e5ef6f9\"\n },\n {\n \"type\": \"checkbox\",\n \"option\": t('flows_action_distributeAdmin_dialog_field_distribute_to_self'),\n \"name\": \"distribute_to_self\",\n \"id\": \"u:e8607f80e975\"\n },\n {\n \"type\": \"checkbox\",\n \"option\": t('flows_action_distributeAdmin_dialog_field_distribute_end_notification'),\n \"name\": \"distribute_end_notification\",\n \"id\": \"u:f63212af4190\"\n },\n {\n \"type\": \"checkbox\",\n \"option\": t('flows_action_distributeAdmin_dialog_field_upload_after_being_distributed'),\n \"name\": \"upload_after_being_distributed\",\n \"id\": \"u:05e00a1f59b6\"\n },\n ...stepsInputFields\n ],\n \"actions\": [\n {\n \"type\": \"button\",\n \"label\": t('Submit'),\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"submit\",\n \"componentId\": \"u:90ea4939d3d1\"\n }\n ]\n }\n },\n \"level\": \"primary\"\n }\n ],\n \"resetAfterSubmit\": true,\n \"api\": {\n \"url\": \"/api/workflow/flow/${recordId}/settings/update_distribute_settings\",\n \"method\": \"post\",\n \"requestAdaptor\": \"\",\n \"adaptor\": \"\",\n \"messages\": {\n }\n },\n \"initApi\": {\n \"url\": \"/api/v1/flows/${recordId}?fields=[\\\"_id\\\",\\\"name\\\",\\\"current\\\",\\\"distribute_optional_users_id\\\",\\\"distribute_to_self\\\",\\\"distribute_end_notification\\\",\\\"upload_after_being_distributed\\\"]\",\n \"method\": \"get\",\n \"requestAdaptor\": \"\",\n \"adaptor\": \"\",\n \"messages\": {\n }\n }\n },\n}",
|
|
31
31
|
"messages": {}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -37,13 +37,13 @@ amis_schema: |-
|
|
|
37
37
|
{
|
|
38
38
|
"type": "button",
|
|
39
39
|
"actionType": "cancel",
|
|
40
|
-
"label": "
|
|
40
|
+
"label": "${'Cancel' | t}",
|
|
41
41
|
"id": "u:7cfe0ffa8b8f"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"type": "button",
|
|
45
45
|
"actionType": "confirm",
|
|
46
|
-
"label": "
|
|
46
|
+
"label": "${'OK' | t}",
|
|
47
47
|
"primary": true,
|
|
48
48
|
"id": "u:c271fb676733"
|
|
49
49
|
}
|
|
@@ -12,7 +12,7 @@ amis_schema: |-
|
|
|
12
12
|
"weight": 0,
|
|
13
13
|
"actions": [
|
|
14
14
|
{
|
|
15
|
-
"script": "// SteedosUI.refs(\"flows-listview-undefined\")\n
|
|
15
|
+
"script": "// SteedosUI.refs(\"flows-listview-undefined\")\n debugger;\nconst ids = event.data._scoped.parent.getComponentById(\"listview_flows\").props.store.selectedItems.toJSON();\n\nif (ids && ids.length > 0) {\n \n window.open(Steedos.absoluteUrl(\"/api/workflow/export/form?flows=\" + _.map(ids,\"_id\").join(',')), '_blank');\n \n} else {\n \n alert(t('flows.newexport.alert'))\n \n }\n\n\n",
|
|
16
16
|
"actionType": "custom"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
@@ -63,7 +63,8 @@ amis_schema: |-
|
|
|
63
63
|
"messages": {},
|
|
64
64
|
"requestAdaptor": "api.url += api.body.global.spaceId\n\nif (api.body.company_id) {\n api.url += \"&company_id=\" + api.body.company_id\n}\n\nreturn api;",
|
|
65
65
|
"dataType": "json"
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
|
+
"reload": "listview_flows"
|
|
67
68
|
}
|
|
68
69
|
],
|
|
69
70
|
"showCloseButton": true,
|
|
@@ -541,6 +541,7 @@ actions:
|
|
|
541
541
|
"type": "button",
|
|
542
542
|
"label": "${'flows.standard_new.new' | t}",
|
|
543
543
|
"id": "u:new_flow",
|
|
544
|
+
"level": "primary",
|
|
544
545
|
"onEvent": {
|
|
545
546
|
"click": {
|
|
546
547
|
"actions": [
|
|
@@ -573,6 +574,7 @@ actions:
|
|
|
573
574
|
"name": "category",
|
|
574
575
|
"deleted_lookup_record_behavior": "clear",
|
|
575
576
|
"reference_to": "categories",
|
|
577
|
+
"required": true,
|
|
576
578
|
"multiple": false
|
|
577
579
|
},
|
|
578
580
|
"id": "u:36461e5ef6f92"
|
|
@@ -686,7 +688,10 @@ actions:
|
|
|
686
688
|
'on': list
|
|
687
689
|
todo: !<tag:yaml.org,2002:js/function> |-
|
|
688
690
|
function (object_name, record_id, fields) {
|
|
689
|
-
|
|
691
|
+
let locale = 'ZH-CN';
|
|
692
|
+
if(Builder.settings.context.user.language != 'zh-CN'){
|
|
693
|
+
locale = 'en-us'
|
|
694
|
+
}
|
|
690
695
|
const space = Builder.settings.context.user.spaceId;
|
|
691
696
|
const flow = null;
|
|
692
697
|
const companyId = Builder.settings.context.user.company_id;
|
|
@@ -720,7 +725,10 @@ actions:
|
|
|
720
725
|
todo: !<tag:yaml.org,2002:js/function> |-
|
|
721
726
|
function (object_name, record_id, record_permissions, data) {
|
|
722
727
|
const flow = data && data.record;
|
|
723
|
-
|
|
728
|
+
let locale = 'ZH-CN';
|
|
729
|
+
if(Builder.settings.context.user.language != 'zh-CN'){
|
|
730
|
+
locale = 'en-us'
|
|
731
|
+
}
|
|
724
732
|
const space = Builder.settings.context.user.spaceId;
|
|
725
733
|
const companyId = Builder.settings.context.user.company_id;
|
|
726
734
|
let url = `/applications/designer/current/${locale.toLocaleLowerCase()}/?spaceId=${space}` + `&flowId=${flow._id}`;
|
|
@@ -789,8 +797,8 @@ actions:
|
|
|
789
797
|
todo: !<tag:yaml.org,2002:js/function> |-
|
|
790
798
|
function (object_name, record_id, fields, data) {
|
|
791
799
|
var record = data && data.record;
|
|
792
|
-
var userSession =
|
|
793
|
-
var authorization = "Bearer " + userSession.spaceId + "," + userSession.
|
|
800
|
+
var userSession = Builder.settings.context.user;
|
|
801
|
+
var authorization = "Bearer " + userSession.spaceId + "," + userSession.authToken;
|
|
794
802
|
var formId = _.isObject(record.form) ? record.form._id : record.form;
|
|
795
803
|
window.$.ajax({
|
|
796
804
|
type: "POST",
|
|
@@ -22,6 +22,45 @@ fields:
|
|
|
22
22
|
readonly: true
|
|
23
23
|
name: state
|
|
24
24
|
filterable: true
|
|
25
|
+
style:
|
|
26
|
+
type: select
|
|
27
|
+
label: Style
|
|
28
|
+
options:
|
|
29
|
+
- label: Table
|
|
30
|
+
value: table
|
|
31
|
+
- label: Groups
|
|
32
|
+
value: groups
|
|
33
|
+
- label: Tabs
|
|
34
|
+
value: tabs
|
|
35
|
+
- label: Wizard
|
|
36
|
+
value: wizard
|
|
37
|
+
readonly: true
|
|
38
|
+
name: style
|
|
39
|
+
filterable: true
|
|
40
|
+
mode:
|
|
41
|
+
type: select
|
|
42
|
+
label: Form Mode
|
|
43
|
+
options:
|
|
44
|
+
- label: Normal
|
|
45
|
+
value: normal
|
|
46
|
+
- label: Horizontal
|
|
47
|
+
value: horizontal
|
|
48
|
+
- label: Inline
|
|
49
|
+
value: inline
|
|
50
|
+
readonly: true
|
|
51
|
+
name: mode
|
|
52
|
+
filterable: true
|
|
53
|
+
wizard_mode:
|
|
54
|
+
type: select
|
|
55
|
+
label: Wizard Mode
|
|
56
|
+
options:
|
|
57
|
+
- label: Vertical
|
|
58
|
+
value: vertical
|
|
59
|
+
- label: Horizontal
|
|
60
|
+
value: horizontal
|
|
61
|
+
readonly: true
|
|
62
|
+
name: wizard_mode
|
|
63
|
+
filterable: true
|
|
25
64
|
description:
|
|
26
65
|
type: textarea
|
|
27
66
|
label: Description
|
|
@@ -170,6 +209,52 @@ fields:
|
|
|
170
209
|
value: file
|
|
171
210
|
- label: Lookup
|
|
172
211
|
value: lookup
|
|
212
|
+
- label: Steedos Field
|
|
213
|
+
value: steedos-field
|
|
214
|
+
- label: Text
|
|
215
|
+
value: text
|
|
216
|
+
- label: Textarea
|
|
217
|
+
value: textarea
|
|
218
|
+
- label: Html
|
|
219
|
+
value: html
|
|
220
|
+
- label: Lookup
|
|
221
|
+
value: lookup
|
|
222
|
+
- label: Master Detail
|
|
223
|
+
value: master_detail
|
|
224
|
+
- label: Select
|
|
225
|
+
value: select
|
|
226
|
+
- label: Boolean
|
|
227
|
+
value: boolean
|
|
228
|
+
- label: Date
|
|
229
|
+
value: date
|
|
230
|
+
- label: Datetime
|
|
231
|
+
value: datetime
|
|
232
|
+
- label: Time
|
|
233
|
+
value: time
|
|
234
|
+
- label: Number
|
|
235
|
+
value: number
|
|
236
|
+
- label: Currency
|
|
237
|
+
value: currency
|
|
238
|
+
- label: Percent
|
|
239
|
+
value: percent
|
|
240
|
+
- label: Image
|
|
241
|
+
value: image
|
|
242
|
+
- label: File
|
|
243
|
+
value: file
|
|
244
|
+
- label: Code
|
|
245
|
+
value: code
|
|
246
|
+
- label: Markdown
|
|
247
|
+
value: markdown
|
|
248
|
+
- label: Color
|
|
249
|
+
value: color
|
|
250
|
+
- label: Toggle
|
|
251
|
+
value: toggle
|
|
252
|
+
- label: Password
|
|
253
|
+
value: password
|
|
254
|
+
- label: Url
|
|
255
|
+
value: url
|
|
256
|
+
- label: Email
|
|
257
|
+
value: email
|
|
173
258
|
readonly: true
|
|
174
259
|
name: current.fields.$.type
|
|
175
260
|
filterable: true
|
|
@@ -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
|
"id": "u:instance_new",
|
|
10
10
|
"level": "primary",
|
|
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"
|
|
@@ -5,7 +5,7 @@ amis_schema: |-
|
|
|
5
5
|
"body": [
|
|
6
6
|
{
|
|
7
7
|
"type": "button",
|
|
8
|
-
"label": "
|
|
8
|
+
"label": "${'CustomAction.instances.instance_cc' | t}",
|
|
9
9
|
"id": "u:instance_cc",
|
|
10
10
|
"className": " ",
|
|
11
11
|
"onEvent": {
|
|
@@ -18,12 +18,12 @@ amis_schema: |-
|
|
|
18
18
|
"title": {
|
|
19
19
|
"type": "tpl",
|
|
20
20
|
"id": "u:0bce3c33b6e5",
|
|
21
|
-
"tpl": "<p
|
|
21
|
+
"tpl": "<p>${'CustomAction.instances.instance_cc' | t}</p>"
|
|
22
22
|
},
|
|
23
23
|
"body": [
|
|
24
24
|
{
|
|
25
25
|
"type": "tpl",
|
|
26
|
-
"tpl": "<p
|
|
26
|
+
"tpl": "<p>${'CustomLabels.instance_action_instance_cc_dialog_title_prefix' | t}${record.step.name}</p>",
|
|
27
27
|
"inline": false,
|
|
28
28
|
"id": "u:11bcfab80ce9",
|
|
29
29
|
"className": "m-b-sm"
|
|
@@ -35,7 +35,7 @@ amis_schema: |-
|
|
|
35
35
|
"body": [
|
|
36
36
|
{
|
|
37
37
|
"type": "steedos-select-user",
|
|
38
|
-
"label": "
|
|
38
|
+
"label": "${'CustomLabels.instance_action_instance_cc_dialog_field_users' | t}",
|
|
39
39
|
"name": "users",
|
|
40
40
|
"id": "u:c3ad733db360",
|
|
41
41
|
"multiple": true,
|
|
@@ -44,7 +44,7 @@ amis_schema: |-
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"type": "textarea",
|
|
47
|
-
"label": "
|
|
47
|
+
"label": "${'CustomLabels.instance_action_instance_cc_dialog_field_description' | t}",
|
|
48
48
|
"name": "description",
|
|
49
49
|
"id": "u:1dc7e49e6e7d",
|
|
50
50
|
"minRows": 3,
|
|
@@ -97,7 +97,7 @@ amis_schema: |-
|
|
|
97
97
|
"actions": [
|
|
98
98
|
{
|
|
99
99
|
"type": "button",
|
|
100
|
-
"label": "
|
|
100
|
+
"label": "${'Cancel' | t}",
|
|
101
101
|
"onEvent": {
|
|
102
102
|
"click": {
|
|
103
103
|
"actions": [
|
|
@@ -113,7 +113,7 @@ amis_schema: |-
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"type": "button",
|
|
116
|
-
"label": "
|
|
116
|
+
"label": "${'OK' | t}",
|
|
117
117
|
"onEvent": {
|
|
118
118
|
"click": {
|
|
119
119
|
"actions": [
|
|
@@ -5,7 +5,7 @@ amis_schema: |-
|
|
|
5
5
|
"body": [
|
|
6
6
|
{
|
|
7
7
|
"type": "button",
|
|
8
|
-
"label": "
|
|
8
|
+
"label": "${'CustomAction.instances.instance_delete' | t}",
|
|
9
9
|
"id": "u:instance_delete",
|
|
10
10
|
"onEvent": {
|
|
11
11
|
"click": {
|
|
@@ -57,7 +57,7 @@ amis_schema: |-
|
|
|
57
57
|
"weight": 0
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"confirmText": "
|
|
60
|
+
"confirmText": "${'CustomLabels.confirm_delete' | t}",
|
|
61
61
|
"hiddenOn": "!((record.box == 'draft' || record.box == 'monitor') \n && (context.user.is_space_admin \n || (_.includes(record.flow.perms.users_can_admin, context.user.userId) \n || _.intersection(record.flow.perms.orgs_can_admin, context.user.organizations_parents) > 0)\n ) \n || (record.box == 'inbox' && record.state == 'draft' && record.forward_from_instance))"
|
|
62
62
|
}
|
|
63
63
|
],
|
|
@@ -5,7 +5,7 @@ amis_schema: |-
|
|
|
5
5
|
"body": [
|
|
6
6
|
{
|
|
7
7
|
"type": "button",
|
|
8
|
-
"label": "
|
|
8
|
+
"label": "${'CustomAction.instances.instance_delete_many' | t}",
|
|
9
9
|
"id": "u:instance_delete_many",
|
|
10
10
|
"editorState": "default",
|
|
11
11
|
"onEvent": {
|
|
@@ -14,17 +14,17 @@ amis_schema: |-
|
|
|
14
14
|
"actions": [
|
|
15
15
|
{
|
|
16
16
|
"actionType": "custom",
|
|
17
|
-
"script": "/* 自定义JS使用说明:\n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation();可以阻止后续动作执行\n*/\n\nconst uiSchema = event.data.uiSchema;\nconst objectName = event.data.objectName;\nconst listViewRef = event.context.scoped.getComponentById(\"listview_\" + objectName);\nconst selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];\nevent.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');\nconsole.log(selectedItems);\nif (selectedItems.length === 0) {\n doAction({ actionType: 'toast', args: { msg: '
|
|
17
|
+
"script": "/* 自定义JS使用说明:\n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation();可以阻止后续动作执行\n*/\n\nconst uiSchema = event.data.uiSchema;\nconst objectName = event.data.objectName;\nconst listViewRef = event.context.scoped.getComponentById(\"listview_\" + objectName);\nconst selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];\nevent.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');\nconsole.log(selectedItems);\nif (selectedItems.length === 0) {\n doAction({ actionType: 'toast', args: { msg: t('CustomLabels.instance_action_delete_many_msg_not_select') } });\n event.stopPropagation();\n};\n"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"actionType": "dialog",
|
|
21
21
|
"dialog": {
|
|
22
22
|
"type": "dialog",
|
|
23
|
-
"title": "
|
|
23
|
+
"title": "${'CustomLabels.alert_info' | t}",
|
|
24
24
|
"body": [
|
|
25
25
|
{
|
|
26
26
|
"type": "tpl",
|
|
27
|
-
"tpl": "
|
|
27
|
+
"tpl": "${'CustomLabels.confirm_delete' | t}",
|
|
28
28
|
"wrapperComponent": "",
|
|
29
29
|
"inline": false,
|
|
30
30
|
"id": "u:0c42a6d112aa"
|
|
@@ -38,7 +38,7 @@ amis_schema: |-
|
|
|
38
38
|
"actions": [
|
|
39
39
|
{
|
|
40
40
|
"type": "button",
|
|
41
|
-
"label": "
|
|
41
|
+
"label": "${'Cancel' | t}",
|
|
42
42
|
"onEvent": {
|
|
43
43
|
"click": {
|
|
44
44
|
"actions": [
|
|
@@ -53,7 +53,7 @@ amis_schema: |-
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"type": "button",
|
|
56
|
-
"label": "
|
|
56
|
+
"label": "${'OK' | t}",
|
|
57
57
|
"onEvent": {
|
|
58
58
|
"click": {
|
|
59
59
|
"actions": [
|
|
@@ -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
|
|
29
|
+
"tpl": "<p>${'CustomAction.instances.instance_distribute' | t}</p>"
|
|
30
30
|
},
|
|
31
31
|
"body": [
|
|
32
32
|
{
|
|
33
33
|
"type": "tpl",
|
|
34
|
-
"tpl": "<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
|
|
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\"
|
|
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"
|