@steedos-labs/plugin-workflow 3.0.0-beta.21 → 3.0.0-beta.23
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/manager/push_manager.js +5 -5
- package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +14 -0
- package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +14 -0
- package/main/default/objects/flows/buttons/del.button.yml +7 -10
- package/main/default/objects/flows/buttons/distributeAdmin.button.yml +5 -5
- package/main/default/objects/forms/forms.object.yml +13 -2
- package/main/default/translations/en.translation.yml +1 -0
- package/main/default/translations/zh-CN.translation.yml +2 -1
- package/main/default/triggers/amis_form_design.trigger.js +2 -0
- package/main/default/utils/designerManager.js +2 -0
- package/package.json +1 -1
- package/src/rests/api_workflow_instance_batch_remove.js +4 -3
|
@@ -553,7 +553,7 @@ pushManager.checkMailFromNameLength = function (name) {
|
|
|
553
553
|
};
|
|
554
554
|
|
|
555
555
|
// TODO 手机推送
|
|
556
|
-
pushManager.send_message_by_raix_push = async function (data) {
|
|
556
|
+
pushManager.send_message_by_raix_push = async function (data, lang) {
|
|
557
557
|
if (process.env.STEEDOS_DEBUG_DISABLE_PUSHMANAGER || !data["data"]) {
|
|
558
558
|
return;
|
|
559
559
|
}
|
|
@@ -590,7 +590,7 @@ pushManager.send_message_by_raix_push = async function (data) {
|
|
|
590
590
|
}
|
|
591
591
|
let notificationDoc = {
|
|
592
592
|
name: notification.text,
|
|
593
|
-
body: '
|
|
593
|
+
body: t('CustomLabels.approval_workflow', {}, lang),
|
|
594
594
|
related_to: {
|
|
595
595
|
o: "instances",
|
|
596
596
|
ids: [notification.payload?.instance]
|
|
@@ -631,7 +631,7 @@ pushManager.send_message_by_raix_push = async function (data) {
|
|
|
631
631
|
};
|
|
632
632
|
|
|
633
633
|
//steedos_ids 必须为数组 ; body 如果有,则必须为Hash
|
|
634
|
-
pushManager.send_message = function (steedos_ids, body) {
|
|
634
|
+
pushManager.send_message = function (steedos_ids, body, current_user_info, lang) {
|
|
635
635
|
if (process.env.STEEDOS_DEBUG_DISABLE_PUSHMANAGER) {
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
@@ -651,7 +651,7 @@ pushManager.send_message = function (steedos_ids, body) {
|
|
|
651
651
|
data.data = body;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
pushManager.send_message_by_raix_push(data);
|
|
654
|
+
pushManager.send_message_by_raix_push(data, lang);
|
|
655
655
|
};
|
|
656
656
|
|
|
657
657
|
// TODO处理发送手机短信
|
|
@@ -780,7 +780,7 @@ pushManager.send_instance_notification = async function (send_from, instance, de
|
|
|
780
780
|
await pushManager.send_email_to_SMTP(title.email, content, to_user, from_user);
|
|
781
781
|
|
|
782
782
|
// Send Push Notification
|
|
783
|
-
await pushManager.send_message([to_user.steedos_id], push_body, current_user_info);
|
|
783
|
+
await pushManager.send_message([to_user.steedos_id], push_body, current_user_info, lang);
|
|
784
784
|
|
|
785
785
|
// Send SMS
|
|
786
786
|
if (['reassign_new_inbox_users', 'submit_pending_rejected_applicant_inbox', 'submit_pending_rejected_inbox', 'submit_pending_inbox', 'first_submit_inbox', 'return_pending_inbox'].includes(send_from)) {
|
|
@@ -288,6 +288,8 @@ actions:
|
|
|
288
288
|
label: Flow Designer
|
|
289
289
|
designForm:
|
|
290
290
|
label: Form Designer
|
|
291
|
+
design_form_layout:
|
|
292
|
+
label: Form Designer(New)
|
|
291
293
|
enableFlow:
|
|
292
294
|
label: Enable Flow
|
|
293
295
|
disableFlow:
|
|
@@ -310,8 +312,20 @@ actions:
|
|
|
310
312
|
label: Delete
|
|
311
313
|
addFormFields:
|
|
312
314
|
label: Add Fields
|
|
315
|
+
del:
|
|
316
|
+
label: Delete
|
|
313
317
|
CustomLabels:
|
|
314
318
|
import_flows_error_title: Import Error
|
|
315
319
|
import_flows_error_not_find_object: 'Not find object [ %s ]'
|
|
316
320
|
import_flows_error_not_allow_enable_workflow: 'object [ %s ] not enable workflow'
|
|
317
321
|
import_flows_error_not_find_fields: 'Missing field [ %s ]'
|
|
322
|
+
flows_action_del_dialog_title: Delete Flow
|
|
323
|
+
flows_action_del_dialog_field_flowName: For security reasons, please enter the name of the flow you want to delete (the relevant application form will also be deleted at the same time).
|
|
324
|
+
flows_action_del_dialog_error_not_same: Please confirm that the entered name is inconsistent with the flow name
|
|
325
|
+
flows_action_del_dialog_message_success: Operation successful
|
|
326
|
+
flows_action_del_dialog_message_failed: Operation failed
|
|
327
|
+
flows_action_distributeAdmin_dialog_error_not_find_step: Please first set the steps that allow distribution in the flow designer's steps
|
|
328
|
+
flows_action_distributeAdmin_dialog_field_distribute_optional_users_id: The selection range of distribution objects when the flow is distributed
|
|
329
|
+
flows_action_distributeAdmin_dialog_field_distribute_to_self: When distributing, you can give it to yourself
|
|
330
|
+
flows_action_distributeAdmin_dialog_field_distribute_end_notification: Remind the initiator after the distribution is completed
|
|
331
|
+
flows_action_distributeAdmin_dialog_field_upload_after_being_distributed: Is it allowed to upload attachments after being distributed
|
|
@@ -285,6 +285,8 @@ actions:
|
|
|
285
285
|
label: 流程设计器
|
|
286
286
|
designForm:
|
|
287
287
|
label: 表单设计器
|
|
288
|
+
design_form_layout:
|
|
289
|
+
label: 表单设计器(New)
|
|
288
290
|
enableFlow:
|
|
289
291
|
label: 启用
|
|
290
292
|
disableFlow:
|
|
@@ -307,8 +309,20 @@ actions:
|
|
|
307
309
|
label: 删除
|
|
308
310
|
addFormFields:
|
|
309
311
|
label: 添加字段
|
|
312
|
+
del:
|
|
313
|
+
label: 删除
|
|
310
314
|
CustomLabels:
|
|
311
315
|
import_flows_error_title: 导入失败
|
|
312
316
|
import_flows_error_not_find_object: '未找到对象[ %s ]'
|
|
313
317
|
import_flows_error_not_allow_enable_workflow: '对象[ %s ]未启用配置对象流程'
|
|
314
318
|
import_flows_error_not_find_fields: '缺少字段[ %s ]'
|
|
319
|
+
flows_action_del_dialog_title: 删除流程
|
|
320
|
+
flows_action_del_dialog_field_flowName: 为了确保安全,请输入您要删除的流程名(同时会删除相关的申请单)
|
|
321
|
+
flows_action_del_dialog_error_not_same: 请确认, 输入的名称与流程名称不一致
|
|
322
|
+
flows_action_del_dialog_message_success: 操作成功
|
|
323
|
+
flows_action_del_dialog_message_failed: 操作失败
|
|
324
|
+
flows_action_distributeAdmin_dialog_error_not_find_step: 请先在流程设计器的步骤中, 设置允许分发的步骤
|
|
325
|
+
flows_action_distributeAdmin_dialog_field_distribute_optional_users_id: 流程被分发时分发对象选择范围
|
|
326
|
+
flows_action_distributeAdmin_dialog_field_distribute_to_self: 分发时可分发给自己
|
|
327
|
+
flows_action_distributeAdmin_dialog_field_distribute_end_notification: 分发结束后提醒发起人
|
|
328
|
+
flows_action_distributeAdmin_dialog_field_upload_after_being_distributed: 被分发后是否允许上传附件
|
|
@@ -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
|
]
|
|
@@ -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
|
}
|
|
@@ -39,7 +39,7 @@ fields:
|
|
|
39
39
|
filterable: true
|
|
40
40
|
mode:
|
|
41
41
|
type: select
|
|
42
|
-
label: Mode
|
|
42
|
+
label: Form Mode
|
|
43
43
|
options:
|
|
44
44
|
- label: Normal
|
|
45
45
|
value: normal
|
|
@@ -48,7 +48,18 @@ fields:
|
|
|
48
48
|
- label: Inline
|
|
49
49
|
value: inline
|
|
50
50
|
readonly: true
|
|
51
|
-
name:
|
|
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
|
|
52
63
|
filterable: true
|
|
53
64
|
description:
|
|
54
65
|
type: textarea
|
|
@@ -526,8 +526,10 @@ module.exports = {
|
|
|
526
526
|
form.current.amis_schema = amis_schema;
|
|
527
527
|
form.current.style = formSchema.style;
|
|
528
528
|
form.current.mode = formSchema.mode;
|
|
529
|
+
form.current.wizard_mode = formSchema.wizard_mode;
|
|
529
530
|
form.style = formSchema.style;
|
|
530
531
|
form.mode = formSchema.mode;
|
|
532
|
+
form.wizard_mode = formSchema.wizard_mode;
|
|
531
533
|
form.description = formSchema.description;
|
|
532
534
|
|
|
533
535
|
// 以下为将解析字段存储的功能,为将解析字段存储至数据库forms表的功能
|
|
@@ -223,6 +223,7 @@ async function updateForm(formId, form, forms, flows, currentUserId) {
|
|
|
223
223
|
current.name_forumla = form["current"]["name_forumla"];
|
|
224
224
|
current.style = form["current"]["style"];
|
|
225
225
|
current.mode = form["current"]["mode"];
|
|
226
|
+
current.wizard_mode = form["current"]["wizard_mode"];
|
|
226
227
|
|
|
227
228
|
formUpdateObj.$set = {
|
|
228
229
|
'current': current,
|
|
@@ -232,6 +233,7 @@ async function updateForm(formId, form, forms, flows, currentUserId) {
|
|
|
232
233
|
'is_valid': form["is_valid"],
|
|
233
234
|
'style': form["style"],
|
|
234
235
|
'mode': form["mode"],
|
|
236
|
+
'wizard_mode': form["wizard_mode"],
|
|
235
237
|
'description': form["description"],
|
|
236
238
|
'help_text': form["help_text"],
|
|
237
239
|
'error_message': form["error_message"],
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: 孙浩林 sunhaolin@steedos.com
|
|
3
3
|
* @Date: 2023-11-04 18:16:15
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-09-01 16:23:40
|
|
6
6
|
* @FilePath: /steedos-platform-2.3/services/service-workflow/src/rests/api_workflow_instance_batch_remove.js
|
|
7
7
|
* @Description: 草稿箱列表删除按钮调用此接口批量删除草稿
|
|
8
8
|
*/
|
|
@@ -22,6 +22,7 @@ module.exports = {
|
|
|
22
22
|
|
|
23
23
|
const insObj = this.getObject('instances')
|
|
24
24
|
const insTaskObj = this.getObject('instance_tasks')
|
|
25
|
+
const lang = userSession.locale === 'zh-cn' ? 'zh-CN' : 'en';
|
|
25
26
|
|
|
26
27
|
// 先检查是否符合删除条件:1、状态为草稿,2、提交人人为当前用户。
|
|
27
28
|
const insDocs = await insObj.find({
|
|
@@ -62,7 +63,7 @@ module.exports = {
|
|
|
62
63
|
|
|
63
64
|
return {
|
|
64
65
|
'status': 0, // 返回 0,表示当前接口正确返回,否则按错误请求处理
|
|
65
|
-
'msg': '草稿已删除',
|
|
66
|
+
'msg': t('instance.draft_deleted_success', {}, lang),//'草稿已删除',
|
|
66
67
|
'data': {
|
|
67
68
|
}
|
|
68
69
|
}
|