(fix)(chat-sdk) rm table defaultSortOrder (#2295)

This commit is contained in:
FredTsang
2025-07-09 17:18:45 +08:00
committed by GitHub
parent e408204690
commit 32675387d7

View File

@@ -24,7 +24,6 @@ const Table: React.FC<Props> = ({ data, size, loading, question, onApplyAuth })
dataIndex: bizName, dataIndex: bizName,
key: bizName, key: bizName,
title: name || bizName, title: name || bizName,
defaultSortOrder: 'descend',
sorter: sorter:
showType === 'NUMBER' showType === 'NUMBER'
? (a, b) => { ? (a, b) => {
@@ -73,10 +72,11 @@ const Table: React.FC<Props> = ({ data, size, loading, question, onApplyAuth })
return index % 2 !== 0 ? `${prefixCls}-even-row` : ''; return index % 2 !== 0 ? `${prefixCls}-even-row` : '';
}; };
const dateColumn = queryColumns.find(column => column.type === 'DATE'); const dateColumn = queryColumns.find(column => column.type === 'DATE' || column.showType === 'DATE');
const dataSource = dateColumn const dataSource = dateColumn
? queryResults.sort((a, b) => moment(a[dateColumn.bizName]).diff(moment(b[dateColumn.bizName]))) ? queryResults.sort((a, b) => moment(a[dateColumn.bizName]).diff(moment(b[dateColumn.bizName])))
: queryResults; : queryResults;
return ( return (
<div className={prefixCls}> <div className={prefixCls}>
{question && ( {question && (