Commit 71c84858474cc58dfd7c7187fbaad814f6b3d03f

Authored by ww
1 parent 990fecce

fix: 设备详情表格排序不生效

@@ -17,7 +17,7 @@ export const getDeviceHistoryInfo = (params: Recordable, orderBy = OrderByEnum.D @@ -17,7 +17,7 @@ export const getDeviceHistoryInfo = (params: Recordable, orderBy = OrderByEnum.D
17 return defHttp.get<HistoryData>( 17 return defHttp.get<HistoryData>(
18 { 18 {
19 url: `/plugins/telemetry/DEVICE/${params.entityId}/values/timeseries`, 19 url: `/plugins/telemetry/DEVICE/${params.entityId}/values/timeseries`,
20 - params: { orderBy, ...params, entityId: null }, 20 + params: { ...params, entityId: null, orderBy },
21 }, 21 },
22 { 22 {
23 joinPrefix: false, 23 joinPrefix: false,
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 import { ColEx } from '/@/components/Form/src/types'; 14 import { ColEx } from '/@/components/Form/src/types';
15 import { useHistoryData } from '../../hook/useHistoryData'; 15 import { useHistoryData } from '../../hook/useHistoryData';
16 import { formatToDateTime } from '/@/utils/dateUtil'; 16 import { formatToDateTime } from '/@/utils/dateUtil';
17 - import { useTable, BasicTable, BasicColumn } from '/@/components/Table'; 17 + import { useTable, BasicTable, BasicColumn, SorterResult } from '/@/components/Table';
18 import { 18 import {
19 ModeSwitchButton, 19 ModeSwitchButton,
20 TABLE_CHART_MODE_LIST, 20 TABLE_CHART_MODE_LIST,
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 } 64 }
65 65
66 const sortOrder = ref<any>('descend'); 66 const sortOrder = ref<any>('descend');
67 - const columns: BasicColumn[] | any = computed(() => { 67 + const columns = computed<BasicColumn[]>(() => {
68 return [ 68 return [
69 { 69 {
70 title: '属性', 70 title: '属性',
@@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
119 loading.value = false; 119 loading.value = false;
120 }; 120 };
121 121
122 - const handleTableChange = async (_pag, _filters, sorter: any) => { 122 + const handleTableChange = async (_pag, _filters, sorter: SorterResult) => {
123 sortOrder.value = sorter.order; 123 sortOrder.value = sorter.order;
124 await setColumns(unref(columns)); 124 await setColumns(unref(columns));
125 if (sorter.field == 'ts') { 125 if (sorter.field == 'ts') {