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(); +};