@steedos-labs/plugin-workflow 3.0.79 → 3.0.80
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.
|
@@ -9,45 +9,125 @@ amis_schema: |-
|
|
|
9
9
|
"id": "u:instance_delete",
|
|
10
10
|
"onEvent": {
|
|
11
11
|
"click": {
|
|
12
|
+
"weight": 0,
|
|
12
13
|
"actions": [
|
|
13
14
|
{
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
15
|
+
"actionType": "dialog",
|
|
16
|
+
"dialog": {
|
|
17
|
+
"type": "dialog",
|
|
18
|
+
"title": "${'CustomLabels.alert_info' | t}",
|
|
19
|
+
"body": [
|
|
20
|
+
{
|
|
21
|
+
"type": "tpl",
|
|
22
|
+
"tpl": "${'CustomLabels.confirm_delete' | t}",
|
|
23
|
+
"wrapperComponent": "",
|
|
24
|
+
"inline": false,
|
|
25
|
+
"visibleOn": "${!deleting}",
|
|
26
|
+
"id": "u:0c42a6d112ab"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "wrapper",
|
|
30
|
+
"className": "flex items-center gap-2 text-gray-600",
|
|
31
|
+
"visibleOn": "${deleting}",
|
|
32
|
+
"body": [
|
|
33
|
+
{ "type": "spinner", "show": true, "size": "sm" },
|
|
34
|
+
{ "type": "tpl", "tpl": "正在删除,请稍候..." }
|
|
35
|
+
]
|
|
21
36
|
}
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
],
|
|
38
|
+
"showCloseButton": true,
|
|
39
|
+
"showErrorMsg": true,
|
|
40
|
+
"showLoading": true,
|
|
41
|
+
"closeOnEsc": false,
|
|
42
|
+
"className": "app-popover",
|
|
43
|
+
"id": "u:42923ccc1c7f",
|
|
44
|
+
"actions": [
|
|
45
|
+
{
|
|
46
|
+
"type": "button",
|
|
47
|
+
"label": "${'Cancel' | t}",
|
|
48
|
+
"onEvent": {
|
|
49
|
+
"click": {
|
|
50
|
+
"actions": [
|
|
51
|
+
{
|
|
52
|
+
"actionType": "closeDialog"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"id": "u:452a4266d210"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "button",
|
|
61
|
+
"label": "${'OK' | t}",
|
|
62
|
+
"level": "danger",
|
|
63
|
+
"id": "u:fa92a7ba67ee",
|
|
64
|
+
"loadingOn": "${deleting}",
|
|
65
|
+
"onEvent": {
|
|
66
|
+
"click": {
|
|
67
|
+
"actions": [
|
|
68
|
+
{
|
|
69
|
+
"actionType": "setValue",
|
|
70
|
+
"componentId": "u:42923ccc1c7f",
|
|
71
|
+
"args": { "value": { "deleting": true } }
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"actionType": "ajax",
|
|
75
|
+
"outputVar": "deleteResult",
|
|
76
|
+
"args": {
|
|
77
|
+
"options": {},
|
|
78
|
+
"messages": {},
|
|
79
|
+
"api": {
|
|
80
|
+
"url": "/api/workflow/v2/remove",
|
|
81
|
+
"method": "post",
|
|
82
|
+
"requestAdaptor": "api.data = {\n instance: {\n _id: context.context._id\n }\n}\n\nreturn api;",
|
|
83
|
+
"data": {
|
|
84
|
+
"record_id": "$record_id"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"actionType": "setValue",
|
|
91
|
+
"componentId": "u:42923ccc1c7f",
|
|
92
|
+
"args": { "value": { "deleting": false } }
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"actionType": "closeDialog",
|
|
96
|
+
"expression": "${event.data.deleteResult.responseStatus===0}"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"ignoreError": false,
|
|
100
|
+
"actionType": "custom",
|
|
101
|
+
"expression": "${event.data.deleteResult.responseStatus===0}",
|
|
102
|
+
"script": "try { sessionStorage.removeItem('flowId'); sessionStorage.removeItem('categoryId'); } catch(e) {}\ntry { if (window.SteedosWorkflow && window.SteedosWorkflow.Instance) { window.SteedosWorkflow.Instance.changed = false; } } catch(e) {}\nvar params = new URLSearchParams(window.location.search);\nvar sideListviewId = params.get('side_listview_id') || 'draft';\nvar appId = (event.data && event.data.appId) || 'approve_workflow';\nnavigate('/app/' + appId + '/instances/view/none?side_object=instances&side_listview_id=' + sideListviewId + '&additionalFilters=&flowId=&categoryId=');"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"actionType": "wait",
|
|
106
|
+
"expression": "${event.data.deleteResult.responseStatus===0}",
|
|
107
|
+
"args": {
|
|
108
|
+
"time": 500
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"actionType": "custom",
|
|
113
|
+
"expression": "${event.data.deleteResult.responseStatus===0}",
|
|
114
|
+
"script": "try { window.$('.list-view-btn-reload').click(); } catch(e) {}"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"actionType": "custom",
|
|
118
|
+
"expression": "${event.data.deleteResult.responseStatus===0}",
|
|
119
|
+
"script": "try { window.postMessage({ type: 'approval-tree-menu:reload' }, '*'); } catch(e) {}"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
48
129
|
}
|
|
49
130
|
},
|
|
50
|
-
"confirmText": "${'CustomLabels.confirm_delete' | t}",
|
|
51
131
|
"hiddenOn": "(window.Builder && window.Builder.settings && window.Builder.settings.STEEDOS_PUBLIC_WORKFLOW_READONLY === 'true') || !(record.box == 'draft' || (record.box == 'monitor' && 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 || (record.box == 'inbox' && record.state == 'draft' && record.forward_from_instance))"
|
|
52
132
|
}
|
|
53
133
|
],
|
|
@@ -64,4 +144,4 @@ label: 删除
|
|
|
64
144
|
'on': record_only
|
|
65
145
|
type: amis_button
|
|
66
146
|
visible: true
|
|
67
|
-
sort: 2500
|
|
147
|
+
sort: 2500
|
|
@@ -27,7 +27,17 @@ amis_schema: |-
|
|
|
27
27
|
"tpl": "${'CustomLabels.confirm_delete' | t}",
|
|
28
28
|
"wrapperComponent": "",
|
|
29
29
|
"inline": false,
|
|
30
|
+
"visibleOn": "${!deleting}",
|
|
30
31
|
"id": "u:0c42a6d112aa"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "wrapper",
|
|
35
|
+
"className": "flex items-center gap-2 text-gray-600",
|
|
36
|
+
"visibleOn": "${deleting}",
|
|
37
|
+
"body": [
|
|
38
|
+
{ "type": "spinner", "show": true, "size": "sm" },
|
|
39
|
+
{ "type": "tpl", "tpl": "正在删除,请稍候..." }
|
|
40
|
+
]
|
|
31
41
|
}
|
|
32
42
|
],
|
|
33
43
|
"showCloseButton": true,
|
|
@@ -54,9 +64,15 @@ amis_schema: |-
|
|
|
54
64
|
{
|
|
55
65
|
"type": "button",
|
|
56
66
|
"label": "${'OK' | t}",
|
|
67
|
+
"loadingOn": "${deleting}",
|
|
57
68
|
"onEvent": {
|
|
58
69
|
"click": {
|
|
59
70
|
"actions": [
|
|
71
|
+
{
|
|
72
|
+
"actionType": "setValue",
|
|
73
|
+
"componentId": "u:42923ccc1c7e",
|
|
74
|
+
"args": { "value": { "deleting": true } }
|
|
75
|
+
},
|
|
60
76
|
{
|
|
61
77
|
"actionType": "ajax",
|
|
62
78
|
"outputVar": "responseResult",
|
|
@@ -78,6 +94,11 @@ amis_schema: |-
|
|
|
78
94
|
}
|
|
79
95
|
}
|
|
80
96
|
},
|
|
97
|
+
{
|
|
98
|
+
"actionType": "setValue",
|
|
99
|
+
"componentId": "u:42923ccc1c7e",
|
|
100
|
+
"args": { "value": { "deleting": false } }
|
|
101
|
+
},
|
|
81
102
|
{
|
|
82
103
|
"actionType": "closeDialog",
|
|
83
104
|
"expression": "${event.data.responseResult.responseStatus===0}"
|