2
0

fix:终端设备界面搜索栏重置功能修复

This commit is contained in:
zhongzm
2025-02-14 11:59:42 +08:00
parent f587e4f673
commit bf149afbbb
2 changed files with 34 additions and 22 deletions

View File

@@ -58,7 +58,7 @@ import { useElementSize } from '@vueuse/core';
import { fetchTerminalList } from '@/service/api/auth';
import { Card as ACard, Table as ATable, Tag as ATag } from 'ant-design-vue';
import TerminalSearch from './modules/terminal-search.vue';
import { formatStorage, formatTime } from '@/utils/units';
import { formatStorage } from '@/utils/units';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
@@ -115,7 +115,6 @@ const {
getData,
mobilePagination,
searchParams,
resetSearchParams
} = useTable({
apiFn: async (params: Api.Device.TerminalDeviceParams) => {
try {
@@ -256,9 +255,19 @@ const handleSearch = () => {
getData();
};
// 添加重置处理函数
// 修改重置处理函数
const handleReset = () => {
resetSearchParams();
// 保存当前的 pageSize
const currentPageSize = searchParams.pageSize;
// 重置搜索参数
searchParams.clientName = '';
searchParams.clientDeviceType = '';
searchParams.clientMac = '';
searchParams.pageNum = 1;
searchParams.pageSize = currentPageSize;
// 重新获取数据
getData();
};
</script>