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'], } ];