mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:29:16 +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',
|
type: 'array',
|
||||||
'x-component': 'TableV2',
|
'x-component': 'TableV2',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
rowKey: 'id',
|
|
||||||
scroll: { y: 300 },
|
scroll: { y: 300 },
|
||||||
},
|
},
|
||||||
default: dataSet,
|
default: dataSet,
|
||||||
@ -63,6 +62,14 @@ export default ({ queryId, fields }: { queryId: number; fields }) => {
|
|||||||
<Spin />
|
<Spin />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
//对dataset中引用类型数据类型进行序列化处理
|
||||||
|
dataSet.forEach((item) => {
|
||||||
|
for (const key in item) {
|
||||||
|
if (item[key] && item[key] instanceof Object) {
|
||||||
|
item[key] = JSON.stringify(item[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<SchemaComponentProvider scope={{ dataSet }} components={{ TableV2, Input, FormItem }}>
|
<SchemaComponentProvider scope={{ dataSet }} components={{ TableV2, Input, FormItem }}>
|
||||||
<BlockSchemaComponentProvider>
|
<BlockSchemaComponentProvider>
|
||||||
|
Loading…
Reference in New Issue
Block a user