@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.
- package/main/default/client/instance.client.js +6 -6
- package/main/default/client/object_workflows.client.js +8 -7
- package/main/default/manager/import.js +17 -1
- 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/trace_approve_cc.js +568 -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/instance_tasks.en/instance_tasks.en.objectTranslation.yml +211 -0
- package/main/default/objectTranslations/instance_tasks.zh-CN/instance_tasks.zh-CN.objectTranslation.yml +211 -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 +39 -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 +9 -9
- package/main/default/pages/instance_detail.page.amis.json +3 -3
- package/main/default/pages/instance_tasks_detail.page.amis.json +3 -3
- 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/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_object_workflow_drafts.router.js +18 -19
- package/main/default/routes/api_workflow_chart.router.js +682 -0
- package/main/default/routes/api_workflow_engine.router.js +1 -1
- 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 +2 -2
- 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
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
name: instances
|
|
2
|
+
label: 审批单
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: 文件标题
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
flow:
|
|
10
|
+
label: 流程
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
flow_version:
|
|
14
|
+
label: 流程版本号
|
|
15
|
+
help:
|
|
16
|
+
description:
|
|
17
|
+
form:
|
|
18
|
+
label: 表单
|
|
19
|
+
help:
|
|
20
|
+
description:
|
|
21
|
+
form_version:
|
|
22
|
+
label: 表单版本号
|
|
23
|
+
help:
|
|
24
|
+
description:
|
|
25
|
+
submitter:
|
|
26
|
+
label: 提交人
|
|
27
|
+
help:
|
|
28
|
+
description:
|
|
29
|
+
submitter_name:
|
|
30
|
+
label: 提交人姓名
|
|
31
|
+
help:
|
|
32
|
+
description:
|
|
33
|
+
submit_date:
|
|
34
|
+
label: 提交日期
|
|
35
|
+
help:
|
|
36
|
+
description:
|
|
37
|
+
applicant:
|
|
38
|
+
label: 申请人
|
|
39
|
+
help:
|
|
40
|
+
description:
|
|
41
|
+
applicant_name:
|
|
42
|
+
label: 申请人姓名
|
|
43
|
+
help:
|
|
44
|
+
description:
|
|
45
|
+
applicant_organization:
|
|
46
|
+
label: 申请人部门
|
|
47
|
+
help:
|
|
48
|
+
description:
|
|
49
|
+
applicant_organization_name:
|
|
50
|
+
label: 申请人部门名称
|
|
51
|
+
help:
|
|
52
|
+
description:
|
|
53
|
+
applicant_organization_fullname:
|
|
54
|
+
label: 申请人部门全称
|
|
55
|
+
help:
|
|
56
|
+
description:
|
|
57
|
+
code:
|
|
58
|
+
label: 公式
|
|
59
|
+
help:
|
|
60
|
+
description:
|
|
61
|
+
values:
|
|
62
|
+
label: 审批单字段
|
|
63
|
+
help:
|
|
64
|
+
description:
|
|
65
|
+
inbox_users:
|
|
66
|
+
label: 待办处理人
|
|
67
|
+
help:
|
|
68
|
+
description:
|
|
69
|
+
outbox_users:
|
|
70
|
+
label: 已办处理人
|
|
71
|
+
help:
|
|
72
|
+
description:
|
|
73
|
+
traces:
|
|
74
|
+
label: 步骤审批
|
|
75
|
+
help:
|
|
76
|
+
description:
|
|
77
|
+
attachments:
|
|
78
|
+
label: 附件
|
|
79
|
+
help:
|
|
80
|
+
description:
|
|
81
|
+
flow_name:
|
|
82
|
+
label: 流程名
|
|
83
|
+
help:
|
|
84
|
+
description:
|
|
85
|
+
category_name:
|
|
86
|
+
label: 流程分类
|
|
87
|
+
help:
|
|
88
|
+
description:
|
|
89
|
+
category:
|
|
90
|
+
label: 流程分类
|
|
91
|
+
help:
|
|
92
|
+
description:
|
|
93
|
+
state:
|
|
94
|
+
label: 审批单状态
|
|
95
|
+
help:
|
|
96
|
+
options:
|
|
97
|
+
- label: 草稿
|
|
98
|
+
value: draft
|
|
99
|
+
- label: 进行中
|
|
100
|
+
value: pending
|
|
101
|
+
- label: 已完成
|
|
102
|
+
value: completed
|
|
103
|
+
description:
|
|
104
|
+
is_archived:
|
|
105
|
+
label: 已归档
|
|
106
|
+
help:
|
|
107
|
+
description:
|
|
108
|
+
is_deleted:
|
|
109
|
+
label: 已删除
|
|
110
|
+
help:
|
|
111
|
+
description:
|
|
112
|
+
related_instances:
|
|
113
|
+
label: 相关审批单
|
|
114
|
+
help:
|
|
115
|
+
description:
|
|
116
|
+
record_ids:
|
|
117
|
+
label: 记录ID
|
|
118
|
+
help:
|
|
119
|
+
description:
|
|
120
|
+
record_ids.$.o:
|
|
121
|
+
label:
|
|
122
|
+
help:
|
|
123
|
+
description:
|
|
124
|
+
record_ids.$.ids:
|
|
125
|
+
label:
|
|
126
|
+
help:
|
|
127
|
+
description:
|
|
128
|
+
current_step_auto_submit:
|
|
129
|
+
label: 当前步骤超时自动流转
|
|
130
|
+
help:
|
|
131
|
+
description:
|
|
132
|
+
current_step_name:
|
|
133
|
+
label: 当前步骤
|
|
134
|
+
help:
|
|
135
|
+
description:
|
|
136
|
+
applicant_company:
|
|
137
|
+
label: 申请人所属分部
|
|
138
|
+
help:
|
|
139
|
+
description:
|
|
140
|
+
cc_count:
|
|
141
|
+
label: 传阅数
|
|
142
|
+
help:
|
|
143
|
+
description:
|
|
144
|
+
listviews:
|
|
145
|
+
all:
|
|
146
|
+
label: 所有
|
|
147
|
+
inbox:
|
|
148
|
+
label: 待办文件
|
|
149
|
+
outbox:
|
|
150
|
+
label: 已办文件
|
|
151
|
+
draft:
|
|
152
|
+
label: 草稿
|
|
153
|
+
pending:
|
|
154
|
+
label: 进行中
|
|
155
|
+
completed:
|
|
156
|
+
label: 已完成
|
|
157
|
+
monitor:
|
|
158
|
+
label: 监控箱
|
|
159
|
+
actions:
|
|
160
|
+
view_instance:
|
|
161
|
+
label: 查看审批单
|
|
162
|
+
instance_terminate:
|
|
163
|
+
label: 取消申请
|
|
164
|
+
instance_save:
|
|
165
|
+
label: 保存
|
|
166
|
+
instance_related:
|
|
167
|
+
label: 关联文件
|
|
168
|
+
instance_distribute:
|
|
169
|
+
label: 分发
|
|
170
|
+
instance_submit:
|
|
171
|
+
label: 发送
|
|
172
|
+
instance_forward:
|
|
173
|
+
label: 转发
|
|
174
|
+
instance_cc:
|
|
175
|
+
label: 传阅
|
|
176
|
+
instance_relocate:
|
|
177
|
+
label: 重定位
|
|
178
|
+
instance_new:
|
|
179
|
+
label: 新建
|
|
180
|
+
instance_delete_many:
|
|
181
|
+
label: 删除
|
|
182
|
+
CustomLabels:
|
|
183
|
+
instance_action_new_dialog_title: 请选择流程
|
|
184
|
+
instance_action_new_dialog_msg_success: 创建成功!
|
|
185
|
+
instance_action_new_dialog_msg_failed: 创建失败!
|
|
186
|
+
instance_action_delete_many_msg_not_select: 请至少选择一条记录
|
|
187
|
+
instance_action_instance_save_msg_success: 暂存成功
|
|
188
|
+
instance_action_instance_save_msg_failed: 暂存失败
|
|
189
|
+
instance_action_instance_distribute_dialog_sub_title: 将当前选中的文件分发到新的流程,继续执行审批操作
|
|
190
|
+
instance_action_instance_distribute_dialog_field_process: 流程名称
|
|
191
|
+
instance_action_instance_distribute_dialog_field_users: 分发对象
|
|
192
|
+
instance_action_instance_distribute_dialog_field_description: 备注
|
|
193
|
+
instance_action_instance_distribute_dialog_field_to_self: 同时分发给自己
|
|
194
|
+
instance_action_instance_distribute_dialog_field_to_attachment: 将原表单存储为附件
|
|
195
|
+
instance_action_instance_distribute_dialog_field_related: 自动创建关联文件
|
|
196
|
+
instance_action_instance_cc_dialog_title_prefix: 当前步骤:
|
|
197
|
+
instance_action_instance_cc_dialog_field_users: 传阅对象
|
|
198
|
+
instance_action_instance_cc_dialog_field_description: 传阅说明
|
|
199
|
+
instance_action_instance_cc_dialog_sub_title: 将当前选中的文件转发到新的流程,继续执行审批操作
|
|
200
|
+
instance_action_terminate_dialog_title: 取消申请
|
|
201
|
+
instance_action_terminate_dialog_content: 请填写取消申请的理由
|
|
202
|
+
instance_action_terminate_dialog_msg_success: 取消申请成功!
|
|
203
|
+
instance_action_terminate_dialog_msg_failed: 取消申请失败
|
|
204
|
+
instance_action_instance_relocate_dialog_title: 重定位
|
|
205
|
+
instance_action_instance_relocate_dialog_title_prefix: 当前步骤:
|
|
206
|
+
instance_action_instance_relocate_dialog_field_reason: 请填写重定位的理由
|
|
207
|
+
instance_action_relocate_dialog_msg_success: 重定位成功
|
|
208
|
+
instance_action_relocate_dialog_msg_failed: 重定位失败
|
|
209
|
+
instance_action_instance_save_msg_upgraded: 流程已升级,页面将自动刷新。
|
|
@@ -5,7 +5,7 @@ amis_schema: |-
|
|
|
5
5
|
"body": [
|
|
6
6
|
{
|
|
7
7
|
"type": "button",
|
|
8
|
-
"label": "
|
|
8
|
+
"label": "${'CustomAction.flows.del' | t}",
|
|
9
9
|
"id": "u:del",
|
|
10
10
|
"editorState": "default",
|
|
11
11
|
"level": "danger",
|
|
@@ -18,7 +18,7 @@ amis_schema: |-
|
|
|
18
18
|
"actionType": "dialog",
|
|
19
19
|
"dialog": {
|
|
20
20
|
"type": "dialog",
|
|
21
|
-
"title": "
|
|
21
|
+
"title": "${'flows_action_del_dialog_title' | t}",
|
|
22
22
|
"body": [
|
|
23
23
|
{
|
|
24
24
|
"id": "u:f6977226303b",
|
|
@@ -30,7 +30,7 @@ amis_schema: |-
|
|
|
30
30
|
"body": [
|
|
31
31
|
{
|
|
32
32
|
"name": "flowName",
|
|
33
|
-
"label": "
|
|
33
|
+
"label": "${'flows_action_del_dialog_field_flowName' | t}",
|
|
34
34
|
"type": "input-text",
|
|
35
35
|
"id": "u:5c7f7b0c4f06",
|
|
36
36
|
"editorState": "default",
|
|
@@ -73,10 +73,7 @@ amis_schema: |-
|
|
|
73
73
|
"url": "/am/forms?methodOverride=DELETE",
|
|
74
74
|
"method": "post",
|
|
75
75
|
"requestAdaptor": "api.data = { 'Forms': [{ 'id': context._master.record.form }] }; return api;",
|
|
76
|
-
"adaptor": "",
|
|
77
|
-
"messages": {
|
|
78
|
-
"success": "操作成功"
|
|
79
|
-
},
|
|
76
|
+
"adaptor": "return payload.ChangeSet ? {data: {...payload}, status: 0, msg: t('flows_action_del_dialog_message_success')} : {...payload, status: 1, msg: t('flows_action_del_dialog_message_failed')};",
|
|
80
77
|
"sendOn": "${name === _master.record.name}"
|
|
81
78
|
}
|
|
82
79
|
}
|
|
@@ -86,13 +83,13 @@ amis_schema: |-
|
|
|
86
83
|
{
|
|
87
84
|
"type": "button",
|
|
88
85
|
"actionType": "cancel",
|
|
89
|
-
"label": "
|
|
86
|
+
"label": "${'Cancel' | t}",
|
|
90
87
|
"id": "u:cc2293523b91"
|
|
91
88
|
},
|
|
92
89
|
{
|
|
93
90
|
"type": "button",
|
|
94
91
|
"actionType": "confirm",
|
|
95
|
-
"label": "
|
|
92
|
+
"label": "${'OK' | t}",
|
|
96
93
|
"primary": true,
|
|
97
94
|
"id": "u:753881d2d453",
|
|
98
95
|
"editorState": "default",
|
|
@@ -103,7 +100,7 @@ amis_schema: |-
|
|
|
103
100
|
{
|
|
104
101
|
"ignoreError": false,
|
|
105
102
|
"actionType": "custom",
|
|
106
|
-
"script": "if (event.data._master.record.name != event.data._scoped.getComponentById('u:f6977226303b').props.data.flowName) {\n doAction({\n \"actionType\": \"toast\",\n \"args\": {\n \"msgType\": \"error\",\n \"msg\": \
|
|
103
|
+
"script": "if (event.data._master.record.name != event.data._scoped.getComponentById('u:f6977226303b').props.data.flowName) {\n doAction({\n \"actionType\": \"toast\",\n \"args\": {\n \"msgType\": \"error\",\n \"msg\": t('flows_action_del_dialog_error_not_same')\n }\n });\n event.stopPropagation();event.preventDefault();\n}\n\n",
|
|
107
104
|
"args": {}
|
|
108
105
|
}
|
|
109
106
|
]
|
|
@@ -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
|
|
@@ -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": [
|