@steedos/service-plugin-amis 2.5.20-beta.9 → 2.5.21
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,600 +1,178 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "page",
|
|
3
3
|
"body": [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
{
|
|
5
|
+
"type": "steedos-object-form",
|
|
6
|
+
"label": "对象表单",
|
|
7
|
+
"objectApiName": "object_listviews",
|
|
8
|
+
"recordId": "${recordId}",
|
|
9
|
+
"className": "sm:rounded sm:border-gray-300 bg-white",
|
|
10
|
+
"id": "u:f0b602f267d1",
|
|
11
|
+
"mode": "edit",
|
|
12
|
+
"enableTabs": true,
|
|
13
|
+
"tabsMode": "line",
|
|
14
|
+
"fieldsExtend": {
|
|
15
|
+
"sort": {
|
|
16
|
+
"label": "",
|
|
17
|
+
"amis": {
|
|
18
|
+
"type": "tabs-transfer",
|
|
19
|
+
"options": [
|
|
20
|
+
],
|
|
21
|
+
"id": "u:32f3e4e73115",
|
|
22
|
+
"strictMode": true,
|
|
23
|
+
"source": {
|
|
24
|
+
"method": "get",
|
|
25
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/sortFields/options",
|
|
26
|
+
"headers": {
|
|
27
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
28
|
+
},
|
|
29
|
+
"data": null,
|
|
30
|
+
"requestAdaptor": "",
|
|
31
|
+
"adaptor": "",
|
|
32
|
+
"sendOn": "!!this.object_name"
|
|
33
|
+
},
|
|
34
|
+
"visibleOn": "!!this.object_name",
|
|
35
|
+
"sortable": true,
|
|
36
|
+
"className": "col-span-2 m-0",
|
|
37
|
+
"searchable": true,
|
|
38
|
+
"checkAll": false,
|
|
39
|
+
"clearValueOnHidden": false,
|
|
40
|
+
"joinValues": false,
|
|
41
|
+
"extractValue": true,
|
|
42
|
+
"en-US": {
|
|
43
|
+
"label": "Default Sort Order"
|
|
44
|
+
},
|
|
45
|
+
"multiple": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"filters": {
|
|
49
|
+
"label": "",
|
|
50
|
+
"amis": {
|
|
51
|
+
"type": "group",
|
|
52
|
+
"body": [
|
|
7
53
|
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"title": "",
|
|
16
|
-
"api": {
|
|
17
|
-
"method": "post",
|
|
18
|
-
"url": "${context.rootUrl}/graphql",
|
|
19
|
-
"data": {
|
|
20
|
-
"objectName": "${objectName}",
|
|
21
|
-
"$": "$$",
|
|
22
|
-
"recordId": "${recordId}",
|
|
23
|
-
"modalName": "${modalName}"
|
|
24
|
-
},
|
|
25
|
-
"requestAdaptor": "const formData = api.data.$;\nconst objectName = api.data.objectName;\nconst fieldsName = Object.keys(formData);\ndelete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.columns = lodash.map(formData.columns, (item) => {\n return { field: item };\n});\n\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1]};\n});\n\nformData.mobile_columns = lodash.map(formData.mobile_columns, (item) => {\n return { field: item };\n});\n\nformData.searchable_fields = lodash.map(formData.searchable_fields, (item) => {\n return { field: item };\n});\n\nif (!formData._filters_type_controller) {\n formData._filters_type_controller = 'conditions';\n}\n\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData._filters_conditions);\n // formData.filters = JSON.stringify(window.amisConvert.conditionsToFilters(formData._filters_conditions), null, 4);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n\nlet query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif (formData.recordId) {\n query = `mutation{record: ${objectName}__update(id: \"${formData.recordId}\", doc: {__saveData}){_id}}`;\n};\ndelete formData._id;\nlet __saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = { query: query.replace('{__saveData}', __saveData) };\nreturn api;",
|
|
26
|
-
"adaptor": "if (payload.errors) {\n payload.status = 2;\n payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;\n}\nreturn payload;",
|
|
27
|
-
"responseData": {
|
|
28
|
-
"recordId": "${record._id}"
|
|
29
|
-
},
|
|
30
|
-
"headers": {
|
|
31
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
32
|
-
},
|
|
33
|
-
"messages": {}
|
|
34
|
-
},
|
|
35
|
-
"initFetch": true,
|
|
36
|
-
"body": [
|
|
37
|
-
{
|
|
38
|
-
"type": "fieldSet",
|
|
39
|
-
"title": "通用",
|
|
40
|
-
"en-US": {
|
|
41
|
-
"title": "Common"
|
|
42
|
-
},
|
|
43
|
-
"collapsable": true,
|
|
44
|
-
"body": [
|
|
45
|
-
{
|
|
46
|
-
"name": "label",
|
|
47
|
-
"label": "显示名称",
|
|
48
|
-
"required": true,
|
|
49
|
-
"type": "input-text",
|
|
50
|
-
"className": "m-0",
|
|
51
|
-
"labelClassName": "text-left",
|
|
52
|
-
"en-US": {
|
|
53
|
-
"label": "Label"
|
|
54
|
-
},
|
|
55
|
-
"id": "u:a45229ed29f8"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "name",
|
|
59
|
-
"label": "API 名称",
|
|
60
|
-
"labelRemark": "API 名称只能包含小写字母、数字,必须以字母开头,不能以下划线字符结尾或包含两个连续的下划线字符",
|
|
61
|
-
"requiredOn": "${!!recordId}",
|
|
62
|
-
"type": "input-text",
|
|
63
|
-
"className": "m-0",
|
|
64
|
-
"labelClassName": "text-left",
|
|
65
|
-
"en-US": {
|
|
66
|
-
"label": "API Name",
|
|
67
|
-
"labelRemark": "Can only contain lowercase letters and numbers, must start with a letter,cannot end with an underscore character or contain two consecutive underscore characters"
|
|
68
|
-
},
|
|
69
|
-
"id": "u:ff927884ec36"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"name": "object_name",
|
|
73
|
-
"label": "对象",
|
|
74
|
-
"required": true,
|
|
75
|
-
"type": "select",
|
|
76
|
-
"joinValues": false,
|
|
77
|
-
"extractValue": true,
|
|
78
|
-
"labelField": "label",
|
|
79
|
-
"valueField": "value",
|
|
80
|
-
"autoComplete": {
|
|
81
|
-
"method": "get",
|
|
82
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
83
|
-
"headers": {
|
|
84
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"className": "m-0",
|
|
88
|
-
"labelClassName": "text-left",
|
|
89
|
-
"checkAll": false,
|
|
90
|
-
"searchable": true,
|
|
91
|
-
"source": {
|
|
92
|
-
"method": "get",
|
|
93
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
94
|
-
"headers": {
|
|
95
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"en-US": {
|
|
99
|
-
"label": "Object"
|
|
100
|
-
},
|
|
101
|
-
"id": "u:1427b8edc8f5",
|
|
102
|
-
"multiple": false
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"name": "filter_scope",
|
|
106
|
-
"label": "过滤范围",
|
|
107
|
-
"required": true,
|
|
108
|
-
"type": "select",
|
|
109
|
-
"joinValues": false,
|
|
110
|
-
"extractValue": true,
|
|
111
|
-
"labelField": "label",
|
|
112
|
-
"valueField": "value",
|
|
113
|
-
"options": [
|
|
114
|
-
{
|
|
115
|
-
"label": "我的",
|
|
116
|
-
"value": "mine",
|
|
117
|
-
"en-US": {
|
|
118
|
-
"label": "Mine"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"label": "工作区",
|
|
123
|
-
"value": "space",
|
|
124
|
-
"en-US": {
|
|
125
|
-
"label": "Space"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
"value": "space",
|
|
130
|
-
"className": "m-0",
|
|
131
|
-
"labelClassName": "text-left",
|
|
132
|
-
"en-US": {
|
|
133
|
-
"label": "Filter Scope"
|
|
134
|
-
},
|
|
135
|
-
"id": "u:5f00b15822d5"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "shared",
|
|
139
|
-
"type": "checkbox",
|
|
140
|
-
"tpl": null,
|
|
141
|
-
"className": "m-0",
|
|
142
|
-
"labelClassName": "text-left",
|
|
143
|
-
"label": "共享视图到工作区",
|
|
144
|
-
"en-US": {
|
|
145
|
-
"label": "Shared to All Users"
|
|
146
|
-
},
|
|
147
|
-
"id": "u:3ba5090f7fd0"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"name": "show_count",
|
|
151
|
-
"type": "checkbox",
|
|
152
|
-
"tpl": null,
|
|
153
|
-
"className": "m-0",
|
|
154
|
-
"labelClassName": "text-left",
|
|
155
|
-
"label": "显示条目数",
|
|
156
|
-
"en-US": {
|
|
157
|
-
"label": "Show Record Count"
|
|
158
|
-
},
|
|
159
|
-
"id": "u:811f0c5d03ad"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"name": "sort_no",
|
|
163
|
-
"label": "排序号",
|
|
164
|
-
"type": "input-number",
|
|
165
|
-
"precision": 0,
|
|
166
|
-
"className": "m-0",
|
|
167
|
-
"labelClassName": "text-left",
|
|
168
|
-
"en-US": {
|
|
169
|
-
"label": "Sort NO."
|
|
170
|
-
},
|
|
171
|
-
"id": "u:25a6ee957503"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"name": "is_enable",
|
|
175
|
-
"label": "启用",
|
|
176
|
-
"type": "switch",
|
|
177
|
-
"precision": 0,
|
|
178
|
-
"className": "m-0",
|
|
179
|
-
"labelClassName": "text-left",
|
|
180
|
-
"en-US": {
|
|
181
|
-
"label": "Sort NO."
|
|
182
|
-
},
|
|
183
|
-
"id": "u:25a6ee957503"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"label": "显示模式",
|
|
187
|
-
"name": "crud_mode",
|
|
188
|
-
"type": "select",
|
|
189
|
-
"value": "table",
|
|
190
|
-
"en-US": {
|
|
191
|
-
"label": "Crud Mode"
|
|
192
|
-
},
|
|
193
|
-
"options": [
|
|
194
|
-
{
|
|
195
|
-
"label": "表格",
|
|
196
|
-
"value": "table",
|
|
197
|
-
"en-US": {
|
|
198
|
-
"label": "Table"
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"label": "卡片",
|
|
203
|
-
"value": "cards",
|
|
204
|
-
"en-US": {
|
|
205
|
-
"label": "Cards"
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"label": "显示的列",
|
|
212
|
-
"type": "transfer",
|
|
213
|
-
"name": "columns",
|
|
214
|
-
"options": [],
|
|
215
|
-
"multiple": true,
|
|
216
|
-
"id": "u:92c0b3cccca0",
|
|
217
|
-
"required": true,
|
|
218
|
-
"placeholder": "-",
|
|
219
|
-
"className": "col-span-2 m-0",
|
|
220
|
-
"visibleOn": "!!this.object_name",
|
|
221
|
-
"checkAll": false,
|
|
222
|
-
"searchable": true,
|
|
223
|
-
"sortable": true,
|
|
224
|
-
"en-US": {
|
|
225
|
-
"label": "Columns"
|
|
226
|
-
},
|
|
227
|
-
"source": {
|
|
228
|
-
"method": "get",
|
|
229
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
230
|
-
"headers": {
|
|
231
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
232
|
-
},
|
|
233
|
-
"requestAdaptor": "",
|
|
234
|
-
"adaptor": "",
|
|
235
|
-
"sendOn": "!!this.object_name"
|
|
236
|
-
},
|
|
237
|
-
"joinValues": false,
|
|
238
|
-
"extractValue": true
|
|
239
|
-
}
|
|
240
|
-
],
|
|
241
|
-
"id": "u:7f7b2d3ea064"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"type": "fieldSet",
|
|
245
|
-
"title": "过滤",
|
|
246
|
-
"collapsable": true,
|
|
247
|
-
"body": [
|
|
248
|
-
{
|
|
249
|
-
"label": "默认过滤字段",
|
|
250
|
-
"type": "transfer",
|
|
251
|
-
"name": "filter_fields",
|
|
252
|
-
"options": [],
|
|
253
|
-
"id": "u:ea994ad5816d",
|
|
254
|
-
"source": {
|
|
255
|
-
"method": "get",
|
|
256
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
257
|
-
"headers": {
|
|
258
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
259
|
-
},
|
|
260
|
-
"data": null,
|
|
261
|
-
"requestAdaptor": "",
|
|
262
|
-
"adaptor": "",
|
|
263
|
-
"sendOn": "!!this.object_name"
|
|
264
|
-
},
|
|
265
|
-
"visibleOn": "false && !!this.object_name",
|
|
266
|
-
"className": "col-span-2 m-0",
|
|
267
|
-
"searchable": true,
|
|
268
|
-
"sortable": true,
|
|
269
|
-
"joinValues": false,
|
|
270
|
-
"extractValue": true,
|
|
271
|
-
"en-US": {
|
|
272
|
-
"label": "Default Filter Fields"
|
|
273
|
-
},
|
|
274
|
-
"multiple": true
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"type": "radios",
|
|
278
|
-
"label": "过滤器配置方式",
|
|
279
|
-
"name": "_filters_type_controller",
|
|
280
|
-
"options": [
|
|
281
|
-
{
|
|
282
|
-
"label": "条件组合",
|
|
283
|
-
"value": "conditions"
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"label": "js脚本",
|
|
287
|
-
"value": "function"
|
|
288
|
-
}
|
|
289
|
-
],
|
|
290
|
-
"id": "u:318671bc196c",
|
|
291
|
-
"joinValues": true,
|
|
292
|
-
"className": "col-span-2 m-0",
|
|
293
|
-
"language": "javascript",
|
|
294
|
-
"visibleOn": "false",
|
|
295
|
-
"en-US": {
|
|
296
|
-
"label": "Controller"
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"type": "condition-builder",
|
|
301
|
-
"label": "条件组件",
|
|
302
|
-
"name": "_filters_conditions",
|
|
303
|
-
"description": "",
|
|
304
|
-
"id": "u:a9f2232e30d7",
|
|
305
|
-
"source": {
|
|
306
|
-
"method": "get",
|
|
307
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${object_name}",
|
|
308
|
-
"dataType": "json",
|
|
309
|
-
"headers": {
|
|
310
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
"disabled": false,
|
|
314
|
-
"className": "col-span-2 m-0",
|
|
315
|
-
"visibleOn": "!!this.object_name",
|
|
316
|
-
"labelClassName": "",
|
|
317
|
-
"en-US": {
|
|
318
|
-
"label": "Filters Conditions"
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"type": "editor",
|
|
323
|
-
"label": "js脚本",
|
|
324
|
-
"name": "_filters_function",
|
|
325
|
-
"id": "u:84714ec9abba",
|
|
326
|
-
"visibleOn": "!!this.object_name && !!this._filters_type_controller && _filters_type_controller== 'function'",
|
|
327
|
-
"className": "col-span-2 m-0",
|
|
328
|
-
"labelClassName": "hidden"
|
|
329
|
-
}
|
|
330
|
-
],
|
|
331
|
-
"visibleOn": "!!this.object_name",
|
|
332
|
-
"collapsed": true,
|
|
333
|
-
"en-US": {
|
|
334
|
-
"title": "Filter"
|
|
335
|
-
},
|
|
336
|
-
"id": "u:7d4a03469ab2"
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
"type": "fieldSet",
|
|
340
|
-
"title": "排序",
|
|
341
|
-
"collapsable": true,
|
|
342
|
-
"body": [
|
|
343
|
-
{
|
|
344
|
-
"label": "默认排序规则",
|
|
345
|
-
"type": "tabs-transfer",
|
|
346
|
-
"name": "sort",
|
|
347
|
-
"options": [],
|
|
348
|
-
"id": "u:32f3e4e73115",
|
|
349
|
-
"strictMode": true,
|
|
350
|
-
"source": {
|
|
351
|
-
"method": "get",
|
|
352
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/sortFields/options",
|
|
353
|
-
"headers": {
|
|
354
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
355
|
-
},
|
|
356
|
-
"data": null,
|
|
357
|
-
"requestAdaptor": "",
|
|
358
|
-
"adaptor": "",
|
|
359
|
-
"sendOn": "!!this.object_name"
|
|
360
|
-
},
|
|
361
|
-
"visibleOn": "!!this.object_name",
|
|
362
|
-
"sortable": true,
|
|
363
|
-
"className": "col-span-2 m-0",
|
|
364
|
-
"searchable": true,
|
|
365
|
-
"checkAll": false,
|
|
366
|
-
"clearValueOnHidden": false,
|
|
367
|
-
"joinValues": false,
|
|
368
|
-
"extractValue": true,
|
|
369
|
-
"en-US": {
|
|
370
|
-
"label": "Default Sort Order"
|
|
371
|
-
},
|
|
372
|
-
"multiple": true
|
|
373
|
-
}
|
|
374
|
-
],
|
|
375
|
-
"visibleOn": "!!this.object_name",
|
|
376
|
-
"collapsed": true,
|
|
377
|
-
"en-US": {
|
|
378
|
-
"title": "Order"
|
|
379
|
-
},
|
|
380
|
-
"id": "u:82b56e7d9639"
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
"type": "fieldSet",
|
|
384
|
-
"title": "手机端",
|
|
385
|
-
"collapsable": true,
|
|
386
|
-
"body": [
|
|
387
|
-
{
|
|
388
|
-
"label": "手机端显示的列",
|
|
389
|
-
"type": "transfer",
|
|
390
|
-
"name": "mobile_columns",
|
|
391
|
-
"options": [],
|
|
392
|
-
"id": "u:e80d9f58dfd0",
|
|
393
|
-
"selectMode": "list",
|
|
394
|
-
"searchable": true,
|
|
395
|
-
"searchApi": "",
|
|
396
|
-
"sortable": true,
|
|
397
|
-
"mode": "normal",
|
|
398
|
-
"searchResultMode": "list",
|
|
399
|
-
"joinValues": false,
|
|
400
|
-
"extractValue": true,
|
|
401
|
-
"source": {
|
|
402
|
-
"method": "get",
|
|
403
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
404
|
-
"headers": {
|
|
405
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
406
|
-
},
|
|
407
|
-
"data": null,
|
|
408
|
-
"requestAdaptor": "",
|
|
409
|
-
"adaptor": "",
|
|
410
|
-
"sendOn": "!!this.object_name"
|
|
411
|
-
},
|
|
412
|
-
"visibleOn": "!!this.object_name",
|
|
413
|
-
"className": "col-span-2 m-0",
|
|
414
|
-
"en-US": {
|
|
415
|
-
"label": "Mobile Columns"
|
|
416
|
-
},
|
|
417
|
-
"multiple": true
|
|
418
|
-
}
|
|
419
|
-
],
|
|
420
|
-
"collapsed": true,
|
|
421
|
-
"visibleOn": "!!this.object_name",
|
|
422
|
-
"en-US": {
|
|
423
|
-
"title": "Mobile"
|
|
424
|
-
},
|
|
425
|
-
"id": "u:51174159a42e"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"type": "fieldSet",
|
|
429
|
-
"title": "搜索项",
|
|
430
|
-
"collapsable": true,
|
|
431
|
-
"body": [
|
|
432
|
-
{
|
|
433
|
-
"label": "默认可搜索字段",
|
|
434
|
-
"type": "transfer",
|
|
435
|
-
"name": "searchable_fields",
|
|
436
|
-
"options": [],
|
|
437
|
-
"selectMode": "list",
|
|
438
|
-
"searchable": true,
|
|
439
|
-
"searchApi": "",
|
|
440
|
-
"sortable": true,
|
|
441
|
-
"mode": "normal",
|
|
442
|
-
"searchResultMode": "list",
|
|
443
|
-
"joinValues": false,
|
|
444
|
-
"extractValue": true,
|
|
445
|
-
"source": {
|
|
446
|
-
"method": "get",
|
|
447
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
448
|
-
"headers": {
|
|
449
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
450
|
-
},
|
|
451
|
-
"data": null,
|
|
452
|
-
"requestAdaptor": "",
|
|
453
|
-
"adaptor": "",
|
|
454
|
-
"sendOn": "!!this.object_name"
|
|
455
|
-
},
|
|
456
|
-
"visibleOn": "!!this.object_name",
|
|
457
|
-
"className": "col-span-2 m-0",
|
|
458
|
-
"en-US": {
|
|
459
|
-
"label": "searchable fields"
|
|
460
|
-
},
|
|
461
|
-
"multiple": true,
|
|
462
|
-
"id": "u:adb91066539e"
|
|
463
|
-
}
|
|
464
|
-
],
|
|
465
|
-
"collapsed": true,
|
|
466
|
-
"visibleOn": "!!this.object_name",
|
|
467
|
-
"en-US": {
|
|
468
|
-
"title": "searchable"
|
|
469
|
-
},
|
|
470
|
-
"id": "u:bcdec77c787b"
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
"type": "fieldSet",
|
|
474
|
-
"title": "数据接口",
|
|
475
|
-
"description": "获取列表数据的 api",
|
|
476
|
-
"collapsable": true,
|
|
477
|
-
"body": [
|
|
478
|
-
{
|
|
479
|
-
"type": "editor",
|
|
480
|
-
"name": "requestAdaptor",
|
|
481
|
-
"label": "发送适配器",
|
|
482
|
-
"required": false,
|
|
483
|
-
"language": "javascript",
|
|
484
|
-
"description": "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。",
|
|
485
|
-
"className": "col-span-2 m-1",
|
|
486
|
-
"labelClassName": "text-left",
|
|
487
|
-
"id": "u:a0cbe76b01bd"
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
"type": "editor",
|
|
491
|
-
"name": "adaptor",
|
|
492
|
-
"label": "接收适配器",
|
|
493
|
-
"required": false,
|
|
494
|
-
"language": "javascript",
|
|
495
|
-
"description": "函数签名: (payload, response, api) => payload",
|
|
496
|
-
"className": "col-span-2 m-1",
|
|
497
|
-
"labelClassName": "text-left",
|
|
498
|
-
"id": "u:fe199993059a"
|
|
499
|
-
}
|
|
500
|
-
],
|
|
501
|
-
"collapsed": true,
|
|
502
|
-
"visibleOn": "!!this.object_name",
|
|
503
|
-
"en-US": {
|
|
504
|
-
"title": "API"
|
|
505
|
-
},
|
|
506
|
-
"id": "u:0521ee7143ab"
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
"type": "fieldSet",
|
|
510
|
-
"title": "高级",
|
|
511
|
-
"collapsable": true,
|
|
512
|
-
"body": [
|
|
513
|
-
{
|
|
514
|
-
"name": "enable_amis_schema",
|
|
515
|
-
"type": "checkbox",
|
|
516
|
-
"tpl": null,
|
|
517
|
-
"className": "m-0",
|
|
518
|
-
"labelClassName": "text-left",
|
|
519
|
-
"option": "使用 amis自定义列表",
|
|
520
|
-
"en-US": {
|
|
521
|
-
"option": "Enable amis_schema"
|
|
522
|
-
},
|
|
523
|
-
"id": "u:55ca7f7b7eb7"
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
"type": "editor",
|
|
527
|
-
"name": "amis_schema",
|
|
528
|
-
"label": "Amis Schema",
|
|
529
|
-
"required": false,
|
|
530
|
-
"language": "json",
|
|
531
|
-
"className": "col-span-2 m-1",
|
|
532
|
-
"labelClassName": "text-left",
|
|
533
|
-
"clearValueOnHidden": false,
|
|
534
|
-
"hidden": true,
|
|
535
|
-
"id": "u:d219f7b6d06f"
|
|
536
|
-
}
|
|
537
|
-
],
|
|
538
|
-
"collapsed": true,
|
|
539
|
-
"visibleOn": "!!this.object_name",
|
|
540
|
-
"en-US": {
|
|
541
|
-
"title": "Advanced"
|
|
542
|
-
},
|
|
543
|
-
"id": "u:9c349b88563b"
|
|
544
|
-
}
|
|
545
|
-
],
|
|
546
|
-
"panelClassName": "m-0",
|
|
547
|
-
"bodyClassName": "p-4",
|
|
548
|
-
"actions": false,
|
|
549
|
-
"actionsClassName": "p-sm b-t b-light text-center",
|
|
550
|
-
"className": "steedos-amis-form",
|
|
551
|
-
"language": "javascript",
|
|
552
|
-
"id": "listview_form",
|
|
553
|
-
"onEvent": {
|
|
554
|
-
"submitSucc": {
|
|
555
|
-
"weight": 0,
|
|
556
|
-
"actions": [
|
|
557
|
-
{
|
|
558
|
-
"actionType": "broadcast",
|
|
559
|
-
"args": {
|
|
560
|
-
"eventName": "@data.changed.object_listviews"
|
|
561
|
-
},
|
|
562
|
-
"data": {
|
|
563
|
-
"objectName": "object_listviews"
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
]
|
|
567
|
-
}
|
|
54
|
+
"type": "radios",
|
|
55
|
+
"label": "过滤器配置方式",
|
|
56
|
+
"name": "_filters_type_controller",
|
|
57
|
+
"options": [
|
|
58
|
+
{
|
|
59
|
+
"label": "条件组合",
|
|
60
|
+
"value": "conditions"
|
|
568
61
|
},
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
"
|
|
581
|
-
|
|
62
|
+
{
|
|
63
|
+
"label": "js脚本",
|
|
64
|
+
"value": "function"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"id": "u:318671bc196c",
|
|
68
|
+
"joinValues": true,
|
|
69
|
+
"className": "col-span-2 m-0",
|
|
70
|
+
"language": "javascript",
|
|
71
|
+
"visibleOn": "false",
|
|
72
|
+
"en-US": {
|
|
73
|
+
"label": "Controller"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "condition-builder",
|
|
78
|
+
"label": "",
|
|
79
|
+
"name": "_filters_conditions",
|
|
80
|
+
"description": "",
|
|
81
|
+
"id": "u:a9f2232e30d7",
|
|
82
|
+
"source": {
|
|
83
|
+
"method": "get",
|
|
84
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${object_name}",
|
|
85
|
+
"dataType": "json",
|
|
86
|
+
"headers": {
|
|
87
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"disabled": false,
|
|
91
|
+
"className": "col-span-2 m-0",
|
|
92
|
+
"visibleOn": "!!this.object_name",
|
|
93
|
+
"labelClassName": "",
|
|
94
|
+
"en-US": {
|
|
95
|
+
"label": "Filters Conditions"
|
|
96
|
+
}
|
|
582
97
|
},
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
98
|
+
{
|
|
99
|
+
"type": "editor",
|
|
100
|
+
"label": "js脚本",
|
|
101
|
+
"name": "_filters_function",
|
|
102
|
+
"id": "u:84714ec9abba",
|
|
103
|
+
"visibleOn": "!!this.object_name && !!this._filters_type_controller && _filters_type_controller== 'function'",
|
|
104
|
+
"className": "col-span-2 m-0",
|
|
105
|
+
"labelClassName": "hidden"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"mobile_columns": {
|
|
111
|
+
"amis": {
|
|
112
|
+
"type": "transfer",
|
|
113
|
+
"id": "u:e80d9f58dfd0",
|
|
114
|
+
"selectMode": "list",
|
|
115
|
+
"searchable": true,
|
|
116
|
+
"searchApi": "",
|
|
117
|
+
"sortable": true,
|
|
118
|
+
"mode": "normal",
|
|
119
|
+
"searchResultMode": "list",
|
|
120
|
+
"joinValues": false,
|
|
121
|
+
"extractValue": true,
|
|
122
|
+
"source": {
|
|
123
|
+
"method": "get",
|
|
124
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
125
|
+
"headers": {
|
|
126
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
587
127
|
},
|
|
128
|
+
"data": null,
|
|
129
|
+
"requestAdaptor": "",
|
|
130
|
+
"adaptor": "",
|
|
131
|
+
"sendOn": "!!this.object_name"
|
|
132
|
+
},
|
|
133
|
+
"visibleOn": "!!this.object_name",
|
|
134
|
+
"className": "col-span-2 m-0",
|
|
135
|
+
"en-US": {
|
|
136
|
+
"label": "Mobile Columns"
|
|
137
|
+
},
|
|
138
|
+
"multiple": true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"searchable_fields": {
|
|
142
|
+
"label":"",
|
|
143
|
+
"amis": {
|
|
144
|
+
"type": "transfer",
|
|
145
|
+
"options": [
|
|
146
|
+
],
|
|
147
|
+
"selectMode": "list",
|
|
148
|
+
"searchable": true,
|
|
149
|
+
"searchApi": "",
|
|
150
|
+
"sortable": true,
|
|
151
|
+
"mode": "normal",
|
|
152
|
+
"searchResultMode": "list",
|
|
153
|
+
"joinValues": false,
|
|
154
|
+
"extractValue": true,
|
|
155
|
+
"source": {
|
|
156
|
+
"method": "get",
|
|
157
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
588
158
|
"headers": {
|
|
589
|
-
|
|
159
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
590
160
|
},
|
|
591
|
-
"
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
"
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
161
|
+
"data": null,
|
|
162
|
+
"requestAdaptor": "",
|
|
163
|
+
"adaptor": "",
|
|
164
|
+
"sendOn": "!!this.object_name"
|
|
165
|
+
},
|
|
166
|
+
"visibleOn": "!!this.object_name",
|
|
167
|
+
"className": "col-span-2 m-0",
|
|
168
|
+
"multiple": true,
|
|
169
|
+
"id": "u:adb91066539e"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"initApiAdaptor": "\nvar data;\nif (recordId) {\n data = payload.data || { _filters_type_controller: 'conditions' };\n //数据格式转换\n if (data) {\n data.sort = lodash.map(data.sort, (item) => {\n return item.field_name + \":\" + item.order;\n });\n data.mobile_columns = lodash.map(data.mobile_columns, 'field');\n data.searchable_fields = lodash.map(data.searchable_fields, 'field');\n\n if (data.filters && lodash.isString(data.filters)) {\n try {\n data.filters = JSON.parse(data.filters);\n } catch (e) { }\n }\n\n if (data.filters && lodash.isString(data.filters)) {\n data._filters_type_controller = 'function';\n } else {\n data._filters_type_controller = 'conditions'\n }\n\n if (data._filters_type_controller === 'conditions') {\n data._filters_conditions = window.amisConvert.filtersToConditions(data.filters || []);\n } else {\n data._filters_function = data.filters;\n }\n }\n} else {\n const uiSchema = api.body.uiSchema;\n const defaultData = api.body.defaultData;\n let defaultValues = {};\n _.each(uiSchema && uiSchema.fields, function (field) {\n var value = SteedosUI.getFieldDefaultValue(field, api.body.global);\n if (!_.isNil(value)) {\n defaultValues[field.name] = value;\n }\n });\n if (defaultData && _.isObject(defaultData) && !_.isArray(defaultData)) {\n data = Object.assign({}, defaultValues, defaultData)\n }\n}\nfor (key in data) {\n if (data[key] === null) {\n delete data[key];\n }\n}\npayload.data = data;\ndelete payload.extensions; if (data.is_enable != false) { data.is_enable = true; };\nreturn payload;",
|
|
174
|
+
"apiRequestAdaptor": "delete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\n\nformData.mobile_columns = lodash.map(formData.mobile_columns, (item) => {\n return { field: item };\n});\n\nformData.searchable_fields = lodash.map(formData.searchable_fields, (item) => {\n return { field: item };\n});\n\nif (!formData._filters_type_controller) {\n formData._filters_type_controller = 'conditions';\n}\n\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData._filters_conditions);\n // formData.filters = JSON.stringify(window.amisConvert.conditionsToFilters(formData._filters_conditions), null, 4);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n\nquery = `mutation{record: object_listviews__insert(doc: {__saveData}){_id}}`;\nif (formData.recordId) {\n query = `mutation{record: object_listviews__update(id: \"` + formData._id + `\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = { query: query.replace('{__saveData}', __saveData) };\nreturn api;"
|
|
175
|
+
}
|
|
598
176
|
],
|
|
599
177
|
"regions": [
|
|
600
178
|
"body"
|
|
@@ -606,5 +184,17 @@
|
|
|
606
184
|
"name": "page_edit_${recordId}",
|
|
607
185
|
"initApi": null,
|
|
608
186
|
"initFetch": null,
|
|
609
|
-
"id": "u:6ada123f9d4a"
|
|
187
|
+
"id": "u:6ada123f9d4a",
|
|
188
|
+
"onEvent": {
|
|
189
|
+
"init": {
|
|
190
|
+
"weight": 0,
|
|
191
|
+
"actions": [
|
|
192
|
+
{
|
|
193
|
+
"actionType": "custom",
|
|
194
|
+
"script": "//初始化时给外层dialog加上类名,使过滤组件popover正常显示\n$('.steedos-object-listview-form-page').closest('.amis-dialog-widget.antd-Modal').addClass('steedos-overflow-visible-dialog');"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"className": "steedos-object-listview-form-page"
|
|
610
200
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.21",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "a0110bbac9ea4a4375d54ad2d028ec2f4dd5eae1",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|
|
@@ -128,10 +128,6 @@
|
|
|
128
128
|
margin-top: 0.75rem
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.mr-7 {
|
|
132
|
-
margin-right: 1.75rem
|
|
133
|
-
}
|
|
134
|
-
|
|
135
131
|
.mb-0 {
|
|
136
132
|
margin-bottom: 0px
|
|
137
133
|
}
|
|
@@ -184,11 +180,6 @@
|
|
|
184
180
|
height: 0px
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
.h-fit {
|
|
188
|
-
height: -moz-fit-content;
|
|
189
|
-
height: fit-content
|
|
190
|
-
}
|
|
191
|
-
|
|
192
183
|
.h-7 {
|
|
193
184
|
height: 1.75rem
|
|
194
185
|
}
|
|
@@ -213,11 +204,6 @@
|
|
|
213
204
|
width: 80%
|
|
214
205
|
}
|
|
215
206
|
|
|
216
|
-
.w-fit {
|
|
217
|
-
width: -moz-fit-content;
|
|
218
|
-
width: fit-content
|
|
219
|
-
}
|
|
220
|
-
|
|
221
207
|
.w-96 {
|
|
222
208
|
width: 24rem
|
|
223
209
|
}
|
|
@@ -231,10 +217,6 @@
|
|
|
231
217
|
min-width: 240px
|
|
232
218
|
}
|
|
233
219
|
|
|
234
|
-
.\!min-w-\[160px\] {
|
|
235
|
-
min-width: 160px !important
|
|
236
|
-
}
|
|
237
|
-
|
|
238
220
|
.min-w-\[200px\] {
|
|
239
221
|
min-width: 200px
|
|
240
222
|
}
|
|
@@ -437,10 +419,6 @@
|
|
|
437
419
|
font-weight: 700
|
|
438
420
|
}
|
|
439
421
|
|
|
440
|
-
.lowercase {
|
|
441
|
-
text-transform: lowercase
|
|
442
|
-
}
|
|
443
|
-
|
|
444
422
|
.italic {
|
|
445
423
|
font-style: italic
|
|
446
424
|
}
|
|
@@ -468,10 +446,6 @@
|
|
|
468
446
|
text-decoration-line: underline
|
|
469
447
|
}
|
|
470
448
|
|
|
471
|
-
.opacity-0 {
|
|
472
|
-
opacity: 0
|
|
473
|
-
}
|
|
474
|
-
|
|
475
449
|
.shadow-none {
|
|
476
450
|
--tw-shadow: 0 0 #0000;
|
|
477
451
|
--tw-shadow-colored: 0 0 #0000;
|