fix:话单管理界面添加排序
This commit is contained in:
@@ -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();
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -191,11 +203,7 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP
|
||||
}"
|
||||
:scroll="scrollConfig"
|
||||
class="h-full"
|
||||
@change="(pagination) => {
|
||||
searchParams.pageNum = pagination.current;
|
||||
searchParams.pageSize = pagination.pageSize;
|
||||
getData();
|
||||
}"
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
</ACard>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user