perf: 表格自定义字段调整

This commit is contained in:
rd
2025-07-07 10:01:59 +08:00
parent 1dae78f770
commit 5d237ec618
7 changed files with 140 additions and 130 deletions

View File

@ -22,7 +22,7 @@
v-model:query="query"
:isAccountTab="isAccountTab"
@onSearch="getData"
@onReset="handleReset"
@onReset="init"
/>
</div>
<div
@ -84,6 +84,19 @@ const pageInfo = ref(cloneDeep(INITIAL_PAGE_INFO));
const isAccountTab = computed(() => activeTab.value === '1');
const init = () => {
query.value = cloneDeep(INITIAL_QUERY);
dataSource.value = [];
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
selectedRowKeys.value = [];
accountTableRef.value?.resetTable();
const data_time = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')];
query.value.data_time = data_time;
getData();
};
const getData = async () => {
const _fn = isAccountTab.value ? getPlacementAccountData : getPlacementAccountDataList;
const { page, page_size } = pageInfo.value;
@ -113,14 +126,6 @@ const reload = () => {
getData();
};
const handleReset = () => {
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
selectedRowKeys.value = [];
accountTableRef.value?.resetTable();
query.value = cloneDeep(INITIAL_QUERY);
reload();
};
const handleSorterChange = (column, order) => {
query.value.column = column;
query.value.order = order;
@ -132,8 +137,7 @@ const handleSelectionChange = (selectedRows) => {
const handleTabClick = (key) => {
activeTab.value = key;
dataSource.value = [];
handleReset();
init();
};
const handleExport = () => {
@ -153,7 +157,7 @@ const handleOpenGroupModal = () => {
};
onMounted(() => {
getData();
init();
});
</script>