From 02255d5be364f1264e67c98a8b5b0d997687af51 Mon Sep 17 00:00:00 2001 From: zhongzm Date: Wed, 12 Feb 2025 15:25:28 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=AF=9D=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user-center/cdr/index.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/user-center/cdr/index.vue b/src/views/user-center/cdr/index.vue index 2a058c0..28c72a9 100644 --- a/src/views/user-center/cdr/index.vue +++ b/src/views/user-center/cdr/index.vue @@ -38,7 +38,6 @@ const doGetCdrInfo = async (params: SearchModel) => { console.log('API Response:', response); const rows = response.data?.rows || []; const total = response.data?.total || 0; - console.log('Processed data:', { rows, total }); return { data: { rows, @@ -102,6 +101,7 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP title: t('page.cdr.up'), align: 'center', width: 120, + sorter: (a, b) => a.trafficUp - b.trafficUp, customRender: ({ text }) => { const { value, unit } = formatStorage(text); return `${value.toFixed(2)} ${unit}`; @@ -113,6 +113,7 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP title: t('page.cdr.down'), align: 'center', width: 120, + sorter: (a, b) => a.trafficDown - b.trafficDown, customRender: ({ text }) => { const { value, unit } = formatStorage(text); return `${value.toFixed(2)} ${unit}`; @@ -146,10 +147,21 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP title: t('page.cdr.duration'), align: 'center', width: 120, + sorter: (a, b) => a.duration - b.duration, customRender: ({ text }) => formatDuration(text) }, ] }); + +const handleTableChange = ( + pagination: any, + filters: any, + sorter: any +) => { + searchParams.pageNum = pagination.current; + searchParams.pageSize = pagination.pageSize; + getData(); +};