@steedos/service-pages 3.0.0-beta.62 → 3.0.0-beta.64

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.
@@ -1,6 +1,189 @@
1
1
  name: disable
2
+ amis_schema: |-
3
+ {
4
+ "type": "service",
5
+ "body": [
6
+ {
7
+ "type": "button",
8
+ "label": "禁用",
9
+ "id": "u:disable",
10
+ "visibleOn": "${is_active && !is_system}",
11
+ "actionType": "ajax",
12
+ "api": {
13
+ "url": "${context.rootUrl}/service/api/page/disable",
14
+ "method": "post",
15
+ "requestAdaptor": "var recordId = context.recordId;\napi.data = {\n pageId: recordId\n}",
16
+ "adaptor": "",
17
+ "messages": {
18
+ "success": "页面已禁用。",
19
+ "failed": "操作失败"
20
+ }
21
+ },
22
+ "editorState": "default"
23
+ }
24
+ ],
25
+ "regions": [
26
+ "body"
27
+ ],
28
+ "data": {
29
+ "context": {},
30
+ "dataComponentId": "",
31
+ "record_id": "",
32
+ "record": {},
33
+ "permissions": {}
34
+ },
35
+ "bodyClassName": "p-0",
36
+ "dsType": "api",
37
+ "asideResizor": false,
38
+ "editorState": "default",
39
+ "pullRefresh": {
40
+ "disabled": true
41
+ }
42
+ }
43
+
44
+ amis_schema__: |-
45
+ {
46
+ "type": "service",
47
+ "body": [
48
+ {
49
+ "type": "button",
50
+ "label": "拒绝",
51
+ "id": "u:reject",
52
+ "onEvent": {
53
+ "click": {
54
+ "weight": 0,
55
+ "actions": [
56
+ {
57
+ "actionType": "confirmDialog",
58
+ "dialog": {
59
+ "type": "dialog",
60
+ "title": "拒绝数据",
61
+ "body": [
62
+ {
63
+ "type": "form",
64
+ "title": "拒绝理由",
65
+ "id": "u:reject_form",
66
+ "mode": "normal",
67
+ "body": [
68
+ {
69
+ "type": "textarea",
70
+ "name": "comment",
71
+ "description": "请填写拒绝理由",
72
+ "required": true,
73
+ "id": "u:6669c9012efd"
74
+ },
75
+ {
76
+ "type": "tpl",
77
+ "tpl": "确定要拒绝该填写任务中的数据吗?",
78
+ "id": "u:ddf84582ce78"
79
+ }
80
+ ],
81
+ "actions": [
82
+ {
83
+ "type": "submit",
84
+ "label": "提交",
85
+ "primary": true
86
+ }
87
+ ],
88
+ "feat": "Insert"
89
+ }
90
+ ],
91
+ "onEvent": {
92
+ "confirm": {
93
+ "actions": [
94
+ {
95
+ "actionType": "validate",
96
+ "componentId": "u:reject_form"
97
+ },
98
+ {
99
+ "actionType": "custom",
100
+ "script": "// 之前主动触发表单校验是因为dialog confirm事件执行完成后才会触发,这里判断校验失败就中断后续动作\nevent.data.comment = event.data.comment;\nif (event.data.validateResult && event.data.validateResult.error) { \n event.stopPropagation();\n}\n\n\n",
101
+ "args": {}
102
+ },
103
+ {
104
+ "actionType": "ajax",
105
+ "ignoreError": false,
106
+ "outputVar": "responseResult",
107
+ "options": {},
108
+ "api": {
109
+ "url": "${context.rootUrl}/api/builder6/b6_collect/actions/reject",
110
+ "method": "post",
111
+ "requestAdaptor": "var targets = [{\n id: context._id\n}];\napi.data = {\n targets,\n comment: context.comment\n}",
112
+ "adaptor": "",
113
+ "messages": {
114
+ "success": "已拒绝该填写任务中的数据!",
115
+ "failed": "很抱歉,提交过程中出现问题。请稍后重试或联系技术支持!"
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "actionType": "broadcast",
121
+ "args": {
122
+ "eventName": "@data.changed.b6_collect"
123
+ },
124
+ "data": {
125
+ "objectName": "b6_collect",
126
+ "displayAs": "${displayAs}",
127
+ "recordId": "notEmpty"
128
+ }
129
+ }
130
+ ]
131
+ }
132
+ },
133
+ "actionType": "confirmDialog",
134
+ "actions": [
135
+ {
136
+ "type": "button",
137
+ "actionType": "cancel",
138
+ "label": "取消",
139
+ "id": "u:6d0b193270fb"
140
+ },
141
+ {
142
+ "type": "button",
143
+ "actionType": "confirm",
144
+ "label": "确定",
145
+ "primary": true,
146
+ "id": "u:da420989ec0f"
147
+ }
148
+ ],
149
+ "showCloseButton": true,
150
+ "closeOnOutside": false,
151
+ "closeOnEsc": false,
152
+ "showErrorMsg": true,
153
+ "showLoading": true,
154
+ "draggable": false,
155
+ "id": "u:e84a743c78f2"
156
+ }
157
+ }
158
+ ]
159
+ }
160
+ },
161
+ "editorState": "default"
162
+ }
163
+ ],
164
+ "regions": [
165
+ "body"
166
+ ],
167
+ "data": {
168
+ "context": {},
169
+ "dataComponentId": "",
170
+ "record_id": "",
171
+ "record": {},
172
+ "permissions": {}
173
+ },
174
+ "id": "u:627b94b32af8",
175
+ "bodyClassName": "p-0",
176
+ "dsType": "api",
177
+ "asideResizor": false,
178
+ "editorState": "default",
179
+ "pullRefresh": {
180
+ "disabled": true
181
+ },
182
+ "definitions": {}
183
+ }
2
184
  is_enable: true
3
185
  label: 禁用
4
186
  'on': record_only
187
+ type: amis_button
5
188
  visible: true
6
189
  sort: 100
@@ -1,6 +1,48 @@
1
1
  name: enable
2
+ amis_schema: |-
3
+ {
4
+ "type": "service",
5
+ "body": [
6
+ {
7
+ "type": "button",
8
+ "label": "启用",
9
+ "id": "u:enable",
10
+ "visibleOn": "${!is_active && !record.is_system}",
11
+ "actionType": "ajax",
12
+ "api": {
13
+ "url": "${context.rootUrl}/service/api/page/enable",
14
+ "method": "post",
15
+ "requestAdaptor": "var recordId = context.recordId;\napi.data = {\n pageId: recordId\n}",
16
+ "adaptor": "",
17
+ "messages": {
18
+ "success": "页面已启用。",
19
+ "failed": "操作失败"
20
+ }
21
+ },
22
+ "editorState": "default"
23
+ }
24
+ ],
25
+ "regions": [
26
+ "body"
27
+ ],
28
+ "data": {
29
+ "context": {},
30
+ "dataComponentId": "",
31
+ "record_id": "",
32
+ "record": {},
33
+ "permissions": {}
34
+ },
35
+ "bodyClassName": "p-0",
36
+ "dsType": "api",
37
+ "asideResizor": false,
38
+ "editorState": "default",
39
+ "pullRefresh": {
40
+ "disabled": true
41
+ }
42
+ }
2
43
  is_enable: true
3
44
  label: 启用
4
45
  'on': record_only
46
+ type: amis_button
5
47
  visible: true
6
48
  sort: 100
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "3.0.0-beta.62",
3
+ "version": "3.0.0-beta.64",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "9ad8eb93caa39e1bd9fb80b1292540def6dabd5a",
11
+ "gitHead": "c15ab7106a7d41089ffa0d57f580ef64ab96cc40",
12
12
  "dependencies": {
13
13
  "clone": "^2.1.2",
14
14
  "ejs": "^3.1.8"
@@ -1,36 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2022-03-29 19:19:01
4
- * @Description:
5
- */
6
- module.exports = {
7
- disable: function (object_name, record_id) {
8
- $(document.body).addClass('loading');
9
- let url = `/service/api/page/disable`;
10
- let options = {
11
- type: 'post',
12
- async: true,
13
- data: JSON.stringify({ pageId: record_id }),
14
- success: function (data) {
15
- SteedosUI.notification.success({
16
- message: '页面已禁用。'
17
- });
18
- SteedosUI.reloadRecord(object_name, record_id);
19
- FlowRouter.reload();
20
- $(document.body).removeClass('loading');
21
- },
22
- error: function (XMLHttpRequest, textStatus, errorThrown) {
23
- SteedosUI.notification.error({
24
- message: '操作失败',
25
- description: t(XMLHttpRequest.responseJSON.error),
26
- });
27
- $(document.body).removeClass('loading');
28
- }
29
- };
30
- Steedos.authRequest(url, options);
31
- },
32
- disableVisible: function (object_name, record_id, permission, data) {
33
- var record = data && data.record;
34
- return record && record.is_active && !record.is_system
35
- }
36
- }
@@ -1,31 +0,0 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2022-03-29 19:19:01
4
- * @Description:
5
- */
6
- module.exports = {
7
- enable: function (object_name, record_id) {
8
- $(document.body).addClass('loading');
9
- let url = `/service/api/page/enable`;
10
- let options = {
11
- type: 'post',
12
- async: true,
13
- data: JSON.stringify({ pageId: record_id }),
14
- success: function (data) {
15
- toastr.success('页面已启用。');
16
- SteedosUI.reloadRecord(object_name, record_id);
17
- FlowRouter.reload();
18
- $(document.body).removeClass('loading');
19
- },
20
- error: function (XMLHttpRequest, textStatus, errorThrown) {
21
- toastr.error(t(XMLHttpRequest.responseJSON.error))
22
- $(document.body).removeClass('loading');
23
- }
24
- };
25
- Steedos.authRequest(url, options);
26
- },
27
- enableVisible: function (object_name, record_id, permission, data) {
28
- var record = data && data.record;
29
- return record && !record.is_active && !record.is_system
30
- }
31
- }