@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.
Files changed (82) 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/client/socket.client.js +46 -3
  4. package/main/default/manager/import.js +17 -1
  5. package/main/default/manager/instance_manager.js +20 -6
  6. package/main/default/manager/push_manager.js +20 -12
  7. package/main/default/manager/uuflowManagerForInitApproval.js +794 -0
  8. package/main/default/manager/uuflow_manager.js +53 -4
  9. package/main/default/manager/workflow_manager.js +1 -1
  10. package/main/default/methods/instance_approve.js +258 -0
  11. package/main/default/methods/trace_approve_cc.js +571 -0
  12. package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +19 -0
  13. package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +19 -0
  14. package/main/default/objectTranslations/forms.en/forms.en.objectTranslation.yml +191 -0
  15. package/main/default/objectTranslations/forms.zh-CN/forms.zh-CN.objectTranslation.yml +246 -0
  16. package/main/default/objectTranslations/instance_tasks.en/instance_tasks.en.objectTranslation.yml +213 -0
  17. package/main/default/objectTranslations/instance_tasks.zh-CN/instance_tasks.zh-CN.objectTranslation.yml +213 -0
  18. package/main/default/objectTranslations/instances.en/instances.en.objectTranslation.yml +212 -0
  19. package/main/default/objectTranslations/instances.zh-CN/instances.zh-CN.objectTranslation.yml +209 -0
  20. package/main/default/objects/categories.object.yml +1 -0
  21. package/main/default/objects/flows/buttons/del.button.yml +7 -10
  22. package/main/default/objects/flows/buttons/design_form_layout.button.js +5 -2
  23. package/main/default/objects/flows/buttons/distributeAdmin.button.yml +5 -5
  24. package/main/default/objects/flows/buttons/newexport.button.yml +1 -1
  25. package/main/default/objects/flows/buttons/newimport.button.yml +2 -1
  26. package/main/default/objects/flows/flows.object.yml +12 -4
  27. package/main/default/objects/forms/forms.object.yml +85 -0
  28. package/main/default/objects/instance_tasks/buttons/instance_new.button.yml +3 -5
  29. package/main/default/objects/instances/buttons/instance_cc.button.yml +7 -7
  30. package/main/default/objects/instances/buttons/instance_delete.button.yml +2 -2
  31. package/main/default/objects/instances/buttons/instance_delete_many.button.yml +6 -6
  32. package/main/default/objects/instances/buttons/instance_distribute.button.yml +14 -13
  33. package/main/default/objects/instances/buttons/instance_flow_chart.button.yml +1 -1
  34. package/main/default/objects/instances/buttons/instance_forward.button.yml +8 -8
  35. package/main/default/objects/instances/buttons/instance_new.button.yml +3 -5
  36. package/main/default/objects/instances/buttons/instance_reassign.button.yml +1 -16
  37. package/main/default/objects/instances/buttons/instance_related.button.yml +4 -4
  38. package/main/default/objects/instances/buttons/instance_relocate.button.yml +9 -12
  39. package/main/default/objects/instances/buttons/instance_retrieve.button.yml +106 -2
  40. package/main/default/objects/instances/buttons/instance_save.button.yml +3 -9
  41. package/main/default/objects/instances/buttons/instance_submit.button.yml +1 -1
  42. package/main/default/objects/instances/buttons/instance_terminate.button.yml +7 -10
  43. package/main/default/objects/instances/listviews/monitor.listview.yml +0 -1
  44. package/main/default/pages/flowdetail.page.amis.json +11 -11
  45. package/main/default/pages/instance_detail.page.amis.json +25 -37
  46. package/main/default/pages/instance_tasks_detail.page.amis.json +21 -5
  47. package/main/default/pages/instance_tasks_list.page.amis.json +147 -110
  48. package/main/default/pages/instances_list.page.amis.json +146 -110
  49. package/main/default/routes/afterHook.js +34 -0
  50. package/main/default/routes/am.router.js +49 -2
  51. package/main/default/routes/api_cc.router.js +5 -12
  52. package/main/default/routes/api_flow_permission.router.js +7 -2
  53. package/main/default/routes/api_get_object_workflows.router.js +79 -22
  54. package/main/default/routes/api_have_read.router.js +73 -0
  55. package/main/default/routes/api_object_workflow_drafts.router.js +18 -19
  56. package/main/default/routes/api_workflow_approve_save.router.js +2 -1
  57. package/main/default/routes/api_workflow_chart.router.js +682 -0
  58. package/main/default/routes/api_workflow_engine.router.js +4 -4
  59. package/main/default/routes/api_workflow_flow_version.router.js +61 -0
  60. package/main/default/routes/api_workflow_form_version.router.js +61 -0
  61. package/main/default/routes/api_workflow_instance_return.router.js +164 -167
  62. package/main/default/routes/api_workflow_next_step_users.router.js +13 -8
  63. package/main/default/routes/api_workflow_reassign.router.js +200 -196
  64. package/main/default/routes/api_workflow_relocate.router.js +4 -3
  65. package/main/default/routes/api_workflow_retrieve.router.js +246 -237
  66. package/main/default/routes/export.router.js +5 -4
  67. package/main/default/routes/flow_form_design.ejs +33 -8
  68. package/main/default/routes/flow_form_design.router.js +4 -3
  69. package/main/default/routes/import.router.js +6 -7
  70. package/main/default/services/flows.service.js +1 -1
  71. package/main/default/translations/en.translation.yml +5 -0
  72. package/main/default/translations/zh-CN.translation.yml +2 -1
  73. package/main/default/triggers/amis_form_design.trigger.js +27 -5
  74. package/main/default/triggers/instances.trigger.js +9 -7
  75. package/main/default/utils/designerManager.js +12 -5
  76. package/package.json +4 -4
  77. package/package.service.js +21 -7
  78. package/public/workflow/index.css +4 -0
  79. package/src/instance_record_queue.js +1 -3
  80. package/src/rests/api_workflow_instance_batch_remove.js +4 -3
  81. package/src/webhook_queue.js +283 -0
  82. package/main/default/manager/index.js +0 -23
@@ -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
@@ -72,7 +72,7 @@
72
72
  "actionType": "dialog",
73
73
  "dialog": {
74
74
  "type": "dialog",
75
- "title": "编辑表单",
75
+ "title": "${'flows_page_record_action_edit_dialog_title' | t}",
76
76
  "body": [
77
77
  {
78
78
  "type": "form",
@@ -80,13 +80,13 @@
80
80
  "body": [
81
81
  {
82
82
  "type": "input-text",
83
- "label": "表单名称",
83
+ "label": "${'flows_page_record_field_form_name' | t}",
84
84
  "name": "name",
85
85
  "id": "u:84af37d53da42"
86
86
  },
87
87
  {
88
88
  "type": "textarea",
89
- "label": "表单描述",
89
+ "label": "${'flows_page_record_field_form_description' | t}",
90
90
  "name": "description",
91
91
  "id": "u:84af37d53da4",
92
92
  "minRows": 3,
@@ -94,7 +94,7 @@
94
94
  },
95
95
  {
96
96
  "type": "textarea",
97
- "label": "标题公式",
97
+ "label": "${'flows_page_record_field_form_name_forumla' | t}",
98
98
  "name": "name_forumla",
99
99
  "id": "u:69b6536e9fd8",
100
100
  "minRows": 3,
@@ -102,7 +102,7 @@
102
102
  },
103
103
  {
104
104
  "type": "editor",
105
- "label": "表单脚本",
105
+ "label": "${'flows_page_record_field_form_script' | t}",
106
106
  "name": "form_script",
107
107
  "id": "u:025f8c4f09b6",
108
108
  "minRows": 3,
@@ -163,13 +163,13 @@
163
163
  "body": [
164
164
  {
165
165
  "type": "input-text",
166
- "label": "表单名称",
166
+ "label": "${'flows_page_record_field_form_name' | t}",
167
167
  "name": "name",
168
168
  "id": "u:84af37d53da42"
169
169
  },
170
170
  {
171
171
  "type": "textarea",
172
- "label": "表单描述",
172
+ "label": "${'flows_page_record_field_form_description' | t}",
173
173
  "name": "description",
174
174
  "id": "u:84af37d53da4",
175
175
  "minRows": 3,
@@ -177,7 +177,7 @@
177
177
  },
178
178
  {
179
179
  "type": "textarea",
180
- "label": "标题公式",
180
+ "label": "${'flows_page_record_field_form_name_forumla' | t}",
181
181
  "name": "name_forumla",
182
182
  "id": "u:69b6536e9fd8",
183
183
  "minRows": 3,
@@ -185,7 +185,7 @@
185
185
  },
186
186
  {
187
187
  "type": "editor",
188
- "label": "表单脚本",
188
+ "label": "${'flows_page_record_field_form_script' | t}",
189
189
  "name": "form_script",
190
190
  "id": "u:025f8c4f09b6",
191
191
  "minRows": 3,
@@ -615,7 +615,7 @@
615
615
  "id": "u:5df987ad9bc8",
616
616
  "className": "bg-white",
617
617
  "mode": "edit",
618
- "initApiAdaptor": "_.each(payload.data.current.fields, (item)=>{if(item.type =='table' || item.type == 'section'){ var _item = _.find(payload.data.current.fields, function(__item){return __item.code == item.code}); if(_item){_item.children = item.fields;} }}); return payload",
618
+ "initApiAdaptor": "_.each(payload.data.current.fields, (item)=>{if(item.type=='steedos-field'){item.type = item.config.type} if(item.type =='table' || item.type == 'section'){ var _item = _.find(payload.data.current.fields, function(__item){return __item.code == item.code}); if(_item){_item.children = item.fields;} }}); return payload",
619
619
  "fields": [
620
620
  "current",
621
621
  "current.fields",
@@ -630,7 +630,7 @@
630
630
  "current.fields.$.visibleOn"
631
631
  ],
632
632
  "fieldsExtend": "{\n \"current\": {\n \"label\": false\n },\n \"current.fields\": {\n \"label\": false\n }\n}",
633
- "formDataFilter": "if (!form.onEvent.change) {\n form.onEvent.change = { actions: [] }\n};\nform.onEvent.change.actions.push({\n actionType: \"custom\",\n script: \"console.log('onChange event.data', event.data)\"\n}, {\n \"actionType\": \"ajax\",\n \"outputVar\": \"responseResult\",\n \"args\": {\n \"options\": { \"silent\": false },\n \"api\": {\n \"url\": \"/api/workflow/updateFormFields\",\n \"method\": \"post\",\n \"requestAdaptor\": `\n console.log('api.data', api, 'context', context);\n var fields = (context.current.fields || []).map(function(item){\n // 有时编辑children子行记录时未同步到fields属性值中,造成保存数据不成功\n if(item.children){\n var newItem = _.clone(item);\n newItem.fields = newItem.children;\n delete newItem.children;\n return newItem;\n }\n else{\n return item;\n }\n });\n api.data = { \n formId: context.current.form, \n fields: fields\n };\n return api;\n `,\n \"adaptor\": \"\",\n \"messages\": {},\n \"dataType\": \"json\"\n }\n }\n})"
633
+ "formDataFilter": "if (!form.onEvent.change) {\n form.onEvent.change = { actions: [] }\n};\nform.onEvent.change.actions.push({\n actionType: \"custom\",\n script: \"console.log('onChange event.data', event.data)\"\n}, {\n \"actionType\": \"ajax\",\n \"outputVar\": \"responseResult\",\n \"args\": {\n \"options\": { \"silent\": false },\n \"api\": {\n \"url\": \"/api/workflow/updateFormFields\",\n \"method\": \"post\",\n \"requestAdaptor\": `\n console.log('api.data', api, 'context', context);\n var fields = (context.current.fields || []).map(function(item){\n if(item.config.type){item.type='steedos-field'} // 有时编辑children子行记录时未同步到fields属性值中,造成保存数据不成功\n if(item.children){\n var newItem = _.clone(item);\n newItem.fields = newItem.children;\n delete newItem.children;\n return newItem;\n }\n else{\n return item;\n }\n });\n api.data = { \n formId: context.current.form, \n fields: fields\n };\n return api;\n `,\n \"adaptor\": \"\",\n \"messages\": {},\n \"dataType\": \"json\"\n }\n }\n})"
634
634
  }
635
635
  ],
636
636
  "id": "u:827750209c5d",
@@ -3,7 +3,7 @@
3
3
  "body": [{
4
4
  "type": "wrapper",
5
5
  "visibleOn": "${AND(display != 'split', ${window:innerWidth > 768},!!!_inDrawer)}",
6
- "className": "bg-white m-0 p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col border-r border-gray-300",
6
+ "className": "bg-white p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col rounded shadow my-4 ml-4 mr-1 my-4 sm:rounded",
7
7
  "body": [{
8
8
  "type": "service",
9
9
  "className": "w-full h-full",
@@ -18,7 +18,7 @@
18
18
  "type": "input-tree",
19
19
  "treeContainerClassName": "h-full",
20
20
  "name": "tree",
21
- "className": "instance-box-tree bg-white w-full",
21
+ "className": "instance-box-tree w-full",
22
22
  "id": "u:9f3dd961ca12",
23
23
  "stacked": true,
24
24
  "multiple": false,
@@ -85,46 +85,34 @@
85
85
  "visibleOn": "false"
86
86
  }
87
87
  },
88
+ {
89
+ "type": "button",
90
+ "label": "刷新",
91
+ "className": "steedos-workflow-reload-btn hidden",
92
+ "onEvent": {
93
+ "click": {
94
+ "actions": [
95
+ {
96
+ "componentId": "u:d6db0c84f150",
97
+ "groupType": "component",
98
+ "actionType": "rebuild"
99
+ }
100
+ ]
101
+ }
102
+ }
103
+ },
88
104
  {
89
105
  "type": "wrapper",
90
- "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:pt-3 sm:px-3",
106
+ "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 shadow sm:rounded",
91
107
  "body": [{
92
108
  "type": "service",
93
109
  "id": "u:d6db0c84f150",
94
- "body": [{
95
- "type": "wrapper",
96
- "className": "p-0 h-full",
97
- "body": [{
98
- "type": "steedos-instance-detail",
99
- "id": "u:40052b3812c1",
100
- "label": "Instance Detail",
101
- "instanceId": "${recordId}",
102
- "boxName": "${side_listview_id}",
103
- "hiddenOn": "!!!this.recordId"
104
- }],
105
- "visibleOn": "${window:InstanceDetailEnabledAmisRender != false}",
106
- "id": "u:829a40757f0a"
107
- },
108
- {
109
- "type": "wrapper",
110
- "className": "workflow-main flex w-full h-full no-columns instance-show instance-detail-service-wrapper",
111
- "visibleOn": "${window:InstanceDetailEnabledAmisRender == false}",
112
- "body": [{
113
- "type": "custom",
114
- "html": "<div className='workflow-main flex w-full h-full no-columns instance-show instance-detail-service-wrapper'></div>",
115
- "onMount": "try {\n Session.set(\"instance_change\", false);\n\n Session.set(\"instance_loading\", true);\n Session.set(\"judge\", null);\n Session.set(\"next_step_id\", null);\n Session.set(\"next_step_multiple\", null);\n Session.set(\"next_user_multiple\", null);\n let box;\n let recordId;\n if (props.data._inDrawer) {\n // 主表记录详细页面审批相关列表中点击名称字段右侧弹出drawer时,box写死,recordId取作用域中值\n box = \"outbox\";\n recordId = props.data.recordId;\n }\n else {\n box = props.data.side_listview_id;\n recordId = Session.get(\"record_id\");\n }\n Session.set(\"box\", box);\n Session.set(\"instanceId\", recordId);\n Session.set(\"instanceTaskId\", null);\n window.instanceDetailBlazeRenderView = Blaze.render(Blaze._getTemplate('instance_view_wrapper'), document.getElementsByClassName('instance-detail-service-wrapper')[0])\n} catch (error) {\n console.error(error)\n};\nif (window.instanceDetailBlazeRenderView) {\n window.instanceDetailBlazeRenderView.autorun(() => {\n if (FlowRouter.current().params.object_name == \"instances\") {\n console.debug('====onMount=', props);\n Session.set(\"instanceId\", Session.get(\"record_id\"));\n Session.set(\"instanceTaskId\", null)\n }\n }\n )\n};",
116
- "id": "u:a6e0685d1da3",
117
- "onUnmount": "if(window.instanceDetailBlazeRenderView){console.log('Blaze.remove===>instanceDetailBlazeRenderView');Blaze.remove(window.instanceDetailBlazeRenderView); window.instanceDetailBlazeRenderView = null;}"
118
- }],
119
- "id": "u:16cf880c925a",
120
- "style": {
121
- "position": "static",
122
- "display": "block"
123
- },
124
- "isFixedHeight": false,
125
- "isFixedWidth": false
126
- }
127
- ],
110
+ "schemaApi": {
111
+ "method": "get",
112
+ "url": "/api/health_check",
113
+ "adaptor": "return {data: {'type':'wrapper','className':'p-0 h-full','body':[{'type':'steedos-instance-detail','id':'u:40052b3812c1','label':'Instance Detail','instanceId':context.recordId,'boxName':context.side_listview_id}],'id':'u:829a40757f0a'}}"
114
+ },
115
+ "body": {},
128
116
  "className": "h-full",
129
117
  "dsType": "api"
130
118
  }],
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "type": "wrapper",
6
6
  "visibleOn": "${AND(display != 'split', ${window:innerWidth > 768})}",
7
- "className": "bg-white m-0 p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col border-r border-gray-300",
7
+ "className": "bg-white p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col rounded shadow my-4 ml-4 mr-1 my-4 sm:rounded",
8
8
  "body": [
9
9
  {
10
10
  "type": "service",
@@ -23,7 +23,7 @@
23
23
  "type": "input-tree",
24
24
  "treeContainerClassName": "h-full",
25
25
  "name": "tree",
26
- "className": "instance-box-tree bg-white w-full",
26
+ "className": "instance-box-tree w-full",
27
27
  "id": "u:9f3dd961ca12",
28
28
  "stacked": true,
29
29
  "multiple": false,
@@ -90,7 +90,7 @@
90
90
  },
91
91
  {
92
92
  "type": "wrapper",
93
- "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:pt-3 sm:px-3",
93
+ "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 shadow sm:rounded",
94
94
  "body": [
95
95
  {
96
96
  "type": "service",
@@ -123,8 +123,24 @@
123
123
  "headers": {
124
124
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
125
125
  },
126
- "requestAdaptor": "\nconst { recordId } = api.body;\napi.data = {\n query: `{instance_task:instance_tasks__findOne(id: \"${recordId}\"){_id,instance}}`\n};\n\nreturn api;",
127
- "adaptor": "\nlet boxName = api.body.side_listview_id === 'inbox' ? 'inbox' : 'outbox';\npayload.data = {\n instanceId: payload.data.instance_task.instance,\n boxName: boxName\n}\n; console.log('=======>payload===>', payload); \nreturn payload;"
126
+ "requestAdaptor": "\nconst { recordId } = api.body;\napi.data = {\n query: `{instance_task:instance_tasks__findOne(id: \"${recordId}\"){_id,instance,is_read}}`\n};\n\nreturn api;",
127
+ "adaptor": "\nlet boxName = api.body.side_listview_id === 'inbox' ? 'inbox' : 'outbox';\npayload.data = {\n instanceId: payload.data.instance_task.instance,\n boxName: boxName,\n isRead: payload.data.instance_task.is_read\n}\n; console.log('=======>payload===>', payload); \nreturn payload;"
128
+ },
129
+ "onEvent": {
130
+ "fetchInited": {
131
+ "actions": [
132
+ {
133
+ "actionType": "ajax",
134
+ "api": {
135
+ "url": "${context.rootUrl}/api/workflow/v2/set_have_read",
136
+ "method": "post",
137
+ "requestAdaptor": "api.data={instanceTaskId: context.recordId, isRead: context.isRead}\n\n\nreturn api;",
138
+ "adaptor": "return payload.success ? {data: {...payload}, status: 0} : {...payload, status: 1, msg: (t('CustomLabels.instance_task_set_have_read_failed') + ':' + payload.error)};"
139
+ },
140
+ "expression": "${!event.data.isRead}"
141
+ }
142
+ ]
143
+ }
128
144
  },
129
145
  "className": "h-full"
130
146
  }