@steedos/service-plugin-amis 2.4.0-beta.39 → 2.4.0-beta.40
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/pages/action_field_updates.page.amis.json +1 -1
- package/main/default/pages/apps_form.page.amis.json +1 -1
- package/main/default/pages/listview_form.page.amis.json +4 -3
- package/main/default/pages/object_layouts.page.amis.json +4 -3
- package/package.json +2 -2
- package/public/amis/amis.css +0 -1
- package/public/tailwind/tailwind-steedos.css +10 -40
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
"actionType": "custom",
|
|
248
|
-
"script": "\n const { recordId, listViewId } = context.props.data;\n const data = event.data;\n const appId = data.appId;\n const objectName = data.objectName;\n // 在记录详细界面时isRecordDetail为true\n // TODO: isRecordDetail这个判断需要优化\n const isRecordDetail =
|
|
248
|
+
"script": "\n const { recordId, listViewId } = context.props.data;\n const data = event.data;\n const appId = data.appId;\n const objectName = data.objectName;\n // 在记录详细界面时isRecordDetail为true\n // TODO: isRecordDetail这个判断需要优化\n const isRecordDetail = data._isRelated;\n if(recordId){\n // 编辑记录时,刷新主表单\n doAction({\n componentId: `detail_${recordId}`,\n actionType: \"reload\",\n expression: `!${listViewId}`\n });\n }\n else if(!isRecordDetail){\n // 在列表视图界面新建记录时跳转到详细页面\n const jumpTo = event.context.env && event.context.env.jumpTo;\n if(jumpTo){\n const newRecordId = data.result.data?.recordId;\n jumpTo(\"/app/\" + appId + \"/\" + objectName + \"/view/\" + newRecordId);\n }\n }\n "
|
|
249
249
|
}
|
|
250
250
|
]
|
|
251
251
|
}
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"method": "post",
|
|
32
32
|
"url": "${context.rootUrl}/graphql?rf=1653731141728",
|
|
33
33
|
"cache": 100,
|
|
34
|
-
"adaptor": "
|
|
34
|
+
"adaptor": "const recordId = api.body.recordId;\nvar data;\nif (recordId) {\n console.log('recordId==>', recordId)\n data = payload.data.data[0] || { _filters_type_controller: 'conditions' };\n //数据格式转换\n if (data) {\n data.columns = lodash.map(data.columns, 'field');\n data.sort = lodash.map(data.sort, (item) => {\n return `${item.field_name}:${item.order || 'asc'}`\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 defaultData = api.body.defaultData;\n let defaultValues = {};\n // TODO:字段默认值后期添加\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;\nreturn payload;",
|
|
35
35
|
"data": {
|
|
36
|
+
"recordId": "${recordId}",
|
|
37
|
+
"defaultData": "${defaultData}",
|
|
36
38
|
"query": "{data:object_listviews(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,label,name,object_name,requestAdaptor,adaptor,filter_scope,shared,show_count,columns,filter_fields,sort,filters,filter_logic,mobile_columns,searchable_fields,sort_no,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},enable_amis_schema,amis_schema,_display{shared,show_count,created,modified}}}"
|
|
37
39
|
},
|
|
38
|
-
"sendOn": "!!this.recordId",
|
|
39
40
|
"replaceData": false,
|
|
40
41
|
"responseData": {
|
|
41
42
|
"&": "$$"
|
|
@@ -298,7 +299,7 @@
|
|
|
298
299
|
"label": "js脚本",
|
|
299
300
|
"name": "_filters_function",
|
|
300
301
|
"id": "u:84714ec9abba",
|
|
301
|
-
"visibleOn": "!!this.object_name && _filters_type_controller == 'function'",
|
|
302
|
+
"visibleOn": "!!this.object_name && !!this._filters_type_controller && _filters_type_controller== 'function'",
|
|
302
303
|
"className": "col-span-2 m-0",
|
|
303
304
|
"labelClassName": "hidden"
|
|
304
305
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"recordId": "${recordId}",
|
|
18
18
|
"modalName": "${modalName}"
|
|
19
19
|
},
|
|
20
|
-
"requestAdaptor": "\n \n const formData = api.data.$;\n for (key in formData){\n // image、select等字段清空值后保存的空字符串转换为null。\n if(formData[key] === ''){\n formData[key] = null;\n }\n }\n const objectName = api.data.objectName;\n const fieldsName = Object.keys(formData);\n delete formData.created;\n delete formData.created_by;\n delete formData.modified;\n delete formData.modified_by;\n delete formData._display;\n delete formData.sort_order_options;\n delete formData.buttons_options;\n delete formData.fields_options;\n delete formData.field_groups_options;\n delete formData.related_lists_options;\n delete formData.related_object_fields_options;\n\n let query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\n if(formData.recordId){\n query = `mutation{record: ${objectName}__update(id: \"${formData.recordId}\", doc: {__saveData}){_id}}`;\n };\n delete formData._id;\n let __saveData = JSON.stringify(JSON.stringify(formData));\n \n api.data = {query: query.replace('{__saveData}', __saveData)};\n return api;\n ",
|
|
20
|
+
"requestAdaptor": "\n \n const formData = api.data.$;\n for (key in formData){\n // image、select等字段清空值后保存的空字符串转换为null。\n if(formData[key] === ''){\n formData[key] = null;\n }\n }\n const objectName = api.data.objectName;\n const fieldsName = Object.keys(formData);\n delete formData.created;\n delete formData.created_by;\n delete formData.modified;\n delete formData.modified_by;\n delete formData._display;\n delete formData.sort_order_options;\n delete formData.buttons_options;\n delete formData.fields_options;\n delete formData.field_groups_options;\n delete formData.related_lists_options;\n delete formData.related_object_fields_options;\n delete formData.isLookup;\n\n let query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\n if(formData.recordId){\n query = `mutation{record: ${objectName}__update(id: \"${formData.recordId}\", doc: {__saveData}){_id}}`;\n };\n delete formData._id;\n let __saveData = JSON.stringify(JSON.stringify(formData));\n \n api.data = {query: query.replace('{__saveData}', __saveData)};\n return api;\n ",
|
|
21
21
|
"responseData": {
|
|
22
22
|
"recordId": "${record._id}"
|
|
23
23
|
},
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"initApi": {
|
|
30
30
|
"method": "post",
|
|
31
31
|
"url": "${context.rootUrl}/graphql",
|
|
32
|
-
"sendOn": "!!this.recordId",
|
|
33
32
|
"cache": 100,
|
|
34
|
-
"adaptor": "
|
|
33
|
+
"adaptor": "const recordId = api.body.recordId;\nvar data;\nif (recordId) {\n data = payload.data.data[0];\n if (data) {\n data.object_name = data.object_name ? data.object_name.name : null;\n }\n}else{\n const defaultData = api.body.defaultData;\n let defaultValues = {};\n // TODO:字段默认值后期添加\n if (defaultData && _.isObject(defaultData) && !_.isArray(defaultData)) {\n data = Object.assign({}, defaultValues, defaultData)\n }\n}\n\n//初始化接口返回的字段移除字段值为null的字段\nfor (key in data){\n if(data[key] === null){\n delete data[key];\n }\n}\n\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n",
|
|
35
34
|
"data": {
|
|
35
|
+
"recordId": "${recordId}",
|
|
36
|
+
"defaultData": "${defaultData}",
|
|
36
37
|
"query": "{data:object_layouts(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,label,object_name:object_name__expand{name,label},profiles,buttons,fields,related_lists,field_groups,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{created,modified}}}"
|
|
37
38
|
},
|
|
38
39
|
"headers": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.4.0-beta.
|
|
3
|
+
"version": "2.4.0-beta.40",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@steedos-widgets/amis-lib": "^1.0.22"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "19fb1590a63241875e23e7b83217e09bdc52162e",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tailwindcss": "3.2.4"
|
|
22
22
|
}
|
package/public/amis/amis.css
CHANGED
|
@@ -69,10 +69,6 @@ body.steedos .top-0 {
|
|
|
69
69
|
top: 0px
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
body.steedos .bottom-0 {
|
|
73
|
-
bottom: 0px
|
|
74
|
-
}
|
|
75
|
-
|
|
76
72
|
body.steedos .z-40 {
|
|
77
73
|
z-index: 40
|
|
78
74
|
}
|
|
@@ -195,27 +191,19 @@ body.steedos .w-6\/12 {
|
|
|
195
191
|
width: 50%
|
|
196
192
|
}
|
|
197
193
|
|
|
198
|
-
body.steedos .w-72 {
|
|
199
|
-
width: 18rem
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
body.steedos .w-1\/2 {
|
|
203
|
-
width: 50%
|
|
204
|
-
}
|
|
205
|
-
|
|
206
194
|
body.steedos .min-w-max {
|
|
207
195
|
min-width: -moz-max-content;
|
|
208
196
|
min-width: max-content
|
|
209
197
|
}
|
|
210
198
|
|
|
211
|
-
body.steedos .flex-1 {
|
|
212
|
-
flex: 1 1 0%
|
|
213
|
-
}
|
|
214
|
-
|
|
215
199
|
body.steedos .flex-none {
|
|
216
200
|
flex: none
|
|
217
201
|
}
|
|
218
202
|
|
|
203
|
+
body.steedos .flex-1 {
|
|
204
|
+
flex: 1 1 0%
|
|
205
|
+
}
|
|
206
|
+
|
|
219
207
|
body.steedos .-translate-x-0 {
|
|
220
208
|
--tw-translate-x: -0px;
|
|
221
209
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
|
@@ -270,11 +258,6 @@ body.steedos .border-solid {
|
|
|
270
258
|
border-style: solid
|
|
271
259
|
}
|
|
272
260
|
|
|
273
|
-
body.steedos .border-slate-300 {
|
|
274
|
-
--tw-border-opacity: 1;
|
|
275
|
-
border-color: rgb(203 213 225 / var(--tw-border-opacity))
|
|
276
|
-
}
|
|
277
|
-
|
|
278
261
|
body.steedos .border-sky-500 {
|
|
279
262
|
--tw-border-opacity: 1;
|
|
280
263
|
border-color: rgb(14 165 233 / var(--tw-border-opacity))
|
|
@@ -285,9 +268,9 @@ body.steedos .border-slate-200 {
|
|
|
285
268
|
border-color: rgb(226 232 240 / var(--tw-border-opacity))
|
|
286
269
|
}
|
|
287
270
|
|
|
288
|
-
body.steedos .border-
|
|
271
|
+
body.steedos .border-slate-300 {
|
|
289
272
|
--tw-border-opacity: 1;
|
|
290
|
-
border-color: rgb(
|
|
273
|
+
border-color: rgb(203 213 225 / var(--tw-border-opacity))
|
|
291
274
|
}
|
|
292
275
|
|
|
293
276
|
body.steedos .bg-white {
|
|
@@ -295,11 +278,6 @@ body.steedos .bg-white {
|
|
|
295
278
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
|
296
279
|
}
|
|
297
280
|
|
|
298
|
-
body.steedos .bg-gray-100 {
|
|
299
|
-
--tw-bg-opacity: 1;
|
|
300
|
-
background-color: rgb(243 244 246 / var(--tw-bg-opacity))
|
|
301
|
-
}
|
|
302
|
-
|
|
303
281
|
body.steedos .p-0 {
|
|
304
282
|
padding: 0px
|
|
305
283
|
}
|
|
@@ -438,10 +416,6 @@ body.steedos .ease-in-out {
|
|
|
438
416
|
}
|
|
439
417
|
|
|
440
418
|
@media (min-width: 640px) {
|
|
441
|
-
body.steedos .sm\:m-3 {
|
|
442
|
-
margin: 0.75rem
|
|
443
|
-
}
|
|
444
|
-
|
|
445
419
|
body.steedos .sm\:mt-\[90px\] {
|
|
446
420
|
margin-top: 90px
|
|
447
421
|
}
|
|
@@ -450,20 +424,16 @@ body.steedos .ease-in-out {
|
|
|
450
424
|
width: 220px
|
|
451
425
|
}
|
|
452
426
|
|
|
453
|
-
body.steedos .sm\:rounded {
|
|
454
|
-
border-radius: 0.25rem
|
|
455
|
-
}
|
|
456
|
-
|
|
457
427
|
body.steedos .sm\:rounded-lg {
|
|
458
428
|
border-radius: 0.5rem
|
|
459
429
|
}
|
|
460
430
|
|
|
461
|
-
body.steedos .sm\:
|
|
462
|
-
border-
|
|
431
|
+
body.steedos .sm\:rounded {
|
|
432
|
+
border-radius: 0.25rem
|
|
463
433
|
}
|
|
464
434
|
|
|
465
|
-
body.steedos .sm\:
|
|
466
|
-
|
|
435
|
+
body.steedos .sm\:border {
|
|
436
|
+
border-width: 1px
|
|
467
437
|
}
|
|
468
438
|
|
|
469
439
|
body.steedos .sm\:shadow {
|