Skip to content

Commit

Permalink
#387 记录服务组件默认加上边距样式,支持配置style属性
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed Apr 14, 2023
1 parent d551f5b commit 4796984
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/@steedos-widgets/amis-lib/src/lib/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: [email protected]
* @Date: 2022-07-05 15:55:39
* @LastEditors: 殷亮辉 [email protected]
* @LastEditTime: 2023-04-12 23:24:23
* @LastEditTime: 2023-04-14 11:10:07
* @Description:
*/
import { fetchAPI, getUserId } from "./steedos.client";
Expand Down Expand Up @@ -514,6 +514,10 @@ export async function getRecordServiceSchema(objectName, appId, props = {}) {
"_master.objectName": "${objectName}",
"_master.recordId": "${recordId}"
},
"style": {
"padding": "var(--Page-body-padding)",
...props.style
},
onEvent: {
"recordLoaded": {
"actions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
* @Author: [email protected]
* @Date: 2022-12-08 10:32:17
* @LastEditors: 殷亮辉 [email protected]
* @LastEditTime: 2023-04-12 23:59:26
* @LastEditTime: 2023-04-14 11:30:21
* @Description:
*/

import { getRecordServiceSchema } from '@steedos-widgets/amis-lib'

export const AmisRecordService = async (props) => {
// console.log(`AmisRecordService======>`, props)
const { className, $schema, appId, objectApiName = "space_users", recordId, fields, body } = props;
const { className, $schema, appId, objectApiName = "space_users", recordId, fields, body, style } = props;
const schema = (await getRecordServiceSchema(objectApiName, appId)).amisSchema;
schema.className = className;
if (body) {
schema.body = body;
}
if(className){
schema.className = className;
}
if (style) {
Object.assign(schema.style, style);
}
return schema
}

0 comments on commit 4796984

Please sign in to comment.