From 40f2a78717574a150fd138aa5c8ae3dcff1523a1 Mon Sep 17 00:00:00 2001 From: zhongzm Date: Wed, 13 Nov 2024 10:26:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/perfManage/kpiOverView/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/perfManage/kpiOverView/index.vue b/src/views/perfManage/kpiOverView/index.vue index 171727f7..8f9e65f6 100644 --- a/src/views/perfManage/kpiOverView/index.vue +++ b/src/views/perfManage/kpiOverView/index.vue @@ -13,7 +13,7 @@ import dayjs from 'dayjs'; import { OptionsType, WS } from '@/plugins/ws-websocket'; import { generateColorRGBA } from '@/utils/generate-utils'; import { LineOutlined } from '@ant-design/icons-vue'; - +import { TableColumnType } from 'ant-design-vue'; const { t, currentLocale } = useI18n(); //定义KPI接口 interface KPIBase{ @@ -352,8 +352,6 @@ const updateChart = () => { observer.observe(container); } }; -//chart可能为null判断 - //钩子函数 onMounted(async () => { @@ -513,7 +511,7 @@ const kpiStats = computed((): KPIStats[] => { }); // 添加表格列定义 -const statsColumns = [ +const statsColumns: TableColumnType[] = [ { title: '', key: 'icon', @@ -539,12 +537,16 @@ const statsColumns = [ dataIndex: 'max', key: 'max', width: '17%', + sorter: (a: KPIStats, b: KPIStats) => a.max - b.max, // 添加排序函数 + sortDirections: ['ascend', 'descend'], }, { title: t('views.perfManage.kpiOverView.minValue'), dataIndex: 'min', key: 'min', width: '17%', + sorter: (a: KPIStats, b: KPIStats) => a.min - b.min, // 添加排序函数 + sortDirections: ['ascend', 'descend'], } ];