From b8b66fe6109a1808849fcb1ad181d42b70a669df Mon Sep 17 00:00:00 2001 From: zhongzm Date: Thu, 28 Nov 2024 20:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:table=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/perfManage/kpiOverView/index.vue | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/views/perfManage/kpiOverView/index.vue b/src/views/perfManage/kpiOverView/index.vue index c1243128..d67c657b 100644 --- a/src/views/perfManage/kpiOverView/index.vue +++ b/src/views/perfManage/kpiOverView/index.vue @@ -811,6 +811,22 @@ const statsColumns: TableColumnType[] = [ key: 'title', 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'), dataIndex: 'max', @@ -824,25 +840,9 @@ const statsColumns: TableColumnType[] = [ dataIndex: 'min', key: 'min', width: '12%', - sorter: (a: KPIStats, b: KPIStats) => a.min - b.min, // 添加排序函数 + sorter: (a: KPIStats, b: KPIStats) => a.min - b.min, 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 数组