fix:table排序
This commit is contained in:
@@ -811,6 +811,22 @@ const statsColumns: TableColumnType<KPIStats>[] = [
|
|||||||
key: 'title',
|
key: 'title',
|
||||||
width: '50%',
|
width: '50%',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t('views.perfManage.kpiOverView.totalValue'),
|
||||||
|
dataIndex: 'total',
|
||||||
|
key: 'total',
|
||||||
|
width: '12%',
|
||||||
|
sorter: (a: KPIStats, b: KPIStats) => a.total - b.total,
|
||||||
|
sortDirections: ['ascend', 'descend'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.perfManage.kpiOverView.avgValue'),
|
||||||
|
dataIndex: 'avg',
|
||||||
|
key: 'avg',
|
||||||
|
width: '12%',
|
||||||
|
sorter: (a: KPIStats, b: KPIStats) => a.avg - b.avg,
|
||||||
|
sortDirections: ['ascend', 'descend'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('views.perfManage.kpiOverView.maxValue'),
|
title: t('views.perfManage.kpiOverView.maxValue'),
|
||||||
dataIndex: 'max',
|
dataIndex: 'max',
|
||||||
@@ -824,25 +840,9 @@ const statsColumns: TableColumnType<KPIStats>[] = [
|
|||||||
dataIndex: 'min',
|
dataIndex: 'min',
|
||||||
key: 'min',
|
key: 'min',
|
||||||
width: '12%',
|
width: '12%',
|
||||||
sorter: (a: KPIStats, b: KPIStats) => a.min - b.min, // 添加排序函数
|
sorter: (a: KPIStats, b: KPIStats) => a.min - b.min,
|
||||||
sortDirections: ['ascend', 'descend'],
|
sortDirections: ['ascend', 'descend'],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: t('views.perfManage.kpiOverView.avgValue'), // 需要在语言包中添加对应的翻译
|
|
||||||
dataIndex: 'avg',
|
|
||||||
key: 'avg',
|
|
||||||
width: '12%',
|
|
||||||
sorter: (a: KPIStats, b: KPIStats) => a.avg - b.avg,
|
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.perfManage.kpiOverView.totalValue'),
|
|
||||||
dataIndex: 'total',
|
|
||||||
key: 'total',
|
|
||||||
width: '12%',
|
|
||||||
sorter: (a: KPIStats, b: KPIStats) => a.total - b.total,
|
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 将 selectedRow 改为 selectedRows 数组
|
// 将 selectedRow 改为 selectedRows 数组
|
||||||
|
|||||||
Reference in New Issue
Block a user