mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(fix)(chat-sdk) rm table defaultSortOrder (#2295)
This commit is contained in:
@@ -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 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user