fix: fix the bug of the same key

This commit is contained in:
liufree 2025-06-07 01:00:06 +08:00
parent 76da314a45
commit 69fa85fb83

View file

@ -66,13 +66,14 @@ const TableView: React.FC<ViewProps> = ({app, source}) => {
const rows: Array<Record<string, any>> = [];
value.values.forEach((row: any) => {
value.values.forEach((row: any,rowIndex: number) => {
const values: Record<string, any> = {};
headers.forEach((header, index) => {
const value = row[index];
const resValue = formatValue(value);
values[header] = resValue;
});
values['key'] = rowIndex; // Add a unique key for each row
rows.push(values);
});
@ -138,6 +139,7 @@ const TableView: React.FC<ViewProps> = ({app, source}) => {
// console.log('value: ', value);
},
}}
rowKey={(record) => record.key}
search={{
labelWidth: 'auto',
}}