mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
fix(charts): improve chart table preview with object type (#1555)
This commit is contained in:
parent
ea4d4ac062
commit
1c2711920a
@ -40,7 +40,6 @@ export default ({ queryId, fields }: { queryId: number; fields }) => {
|
||||
type: 'array',
|
||||
'x-component': 'TableV2',
|
||||
'x-component-props': {
|
||||
rowKey: 'id',
|
||||
scroll: { y: 300 },
|
||||
},
|
||||
default: dataSet,
|
||||
@ -63,6 +62,14 @@ export default ({ queryId, fields }: { queryId: number; fields }) => {
|
||||
<Spin />
|
||||
</>
|
||||
);
|
||||
//对dataset中引用类型数据类型进行序列化处理
|
||||
dataSet.forEach((item) => {
|
||||
for (const key in item) {
|
||||
if (item[key] && item[key] instanceof Object) {
|
||||
item[key] = JSON.stringify(item[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
return (
|
||||
<SchemaComponentProvider scope={{ dataSet }} components={{ TableV2, Input, FormItem }}>
|
||||
<BlockSchemaComponentProvider>
|
||||
|
Loading…
Reference in New Issue
Block a user