perf: 更新搜索

This commit is contained in:
rd
2025-07-05 09:48:15 +08:00
parent b6c7f74a90
commit 6e32de357f
6 changed files with 29 additions and 13 deletions

View File

@ -22,7 +22,7 @@
<a-input <a-input
v-model="loginForm.mobile" v-model="loginForm.mobile"
placeholder="输入手机号" placeholder="输入手机号"
class="form-input border border-solid border-#d7d7d9 rounded-8px w-100% h-48px text-14 rounded-4px color-#333 bg-#fff" class="form-input border border-solid border-#d7d7d9 x w-100% h-48px text-14 rounded-4px color-#333 bg-#fff"
clearable clearable
allow-clear allow-clear
@blur="validateField('mobile')" @blur="validateField('mobile')"
@ -31,7 +31,7 @@
</a-form-item> </a-form-item>
<a-form-item field="captcha" hide-label> <a-form-item field="captcha" hide-label>
<div <div
class="form-input border border-solid border-#d7d7d9 rounded-8px w-100% h-48px text-14 rounded-4px color-#333 bg-#fff flex justify-between items-center rounded-8px" class="form-input border border-solid border-#d7d7d9 w-100% h-48px text-14 rounded-4px color-#333 bg-#fff flex justify-between items-center"
> >
<a-input <a-input
v-model="loginForm.captcha" v-model="loginForm.captcha"

View File

@ -79,12 +79,14 @@ const props = defineProps({
const emits = defineEmits('onSearch', 'onReset', 'update:query'); const emits = defineEmits('onSearch', 'onReset', 'update:query');
const tags = ref([]);
const groups = ref([]); const groups = ref([]);
const operators = ref([]); const operators = ref([]);
const handleSearch = () => { const handleSearch = () => {
emits('onSearch', props.query); emits('update:query', props.query);
nextTick(() => {
emits('onSearch');
});
}; };
const handleReset = () => { const handleReset = () => {

View File

@ -49,7 +49,7 @@
show-jumper show-jumper
show-page-size show-page-size
:current="pageInfo.page" :current="pageInfo.page"
:page-size="pageInfo.pageSize" :page-size="pageInfo.page_size"
@change="onPageChange" @change="onPageChange"
@page-size-change="onPageSizeChange" @page-size-change="onPageSizeChange"
/> />
@ -76,7 +76,7 @@ const selectedRowKeys = ref([]);
const accountTableRef = ref(null); const accountTableRef = ref(null);
const pageInfo = ref({ const pageInfo = ref({
page: 1, page: 1,
pageSize: 20, page_size: 20,
total: 0, total: 0,
}); });
@ -88,7 +88,12 @@ const getOverviewData = async () => {
}; };
const getData = async () => { const getData = async () => {
const { code, data } = await getAccountBoardList(query.value); const { page, page_size } = pageInfo.value;
const { code, data } = await getAccountBoardList({
...query.value,
page,
page_size,
});
if (code === 200) { if (code === 200) {
dataSource.value = data?.data ?? []; dataSource.value = data?.data ?? [];
pageInfo.value.total = data.total; pageInfo.value.total = data.total;
@ -101,12 +106,12 @@ const onPageChange = (current) => {
}; };
const onPageSizeChange = (pageSize) => { const onPageSizeChange = (pageSize) => {
pageInfo.value.pageSize = pageSize; pageInfo.value.page_size = pageSize;
reload(); reload();
}; };
const handleSearch = () => { const handleSearch = () => {
getData(); reload();
}; };
const reload = () => { const reload = () => {
@ -117,7 +122,7 @@ const reload = () => {
const handleReset = () => { const handleReset = () => {
selectedRowKeys.value = []; selectedRowKeys.value = [];
pageInfo.value.page = 1; pageInfo.value.page = 1;
pageInfo.value.pageSize = 20; pageInfo.value.page_size = 20;
pageInfo.value.total = 0; pageInfo.value.total = 0;
query.value = cloneDeep(INITIAL_QUERY); query.value = cloneDeep(INITIAL_QUERY);
accountTableRef.value?.resetTable(); accountTableRef.value?.resetTable();

View File

@ -99,7 +99,10 @@ const groups = ref([]);
const operators = ref([]); const operators = ref([]);
const handleSearch = () => { const handleSearch = () => {
emits('onSearch', props.query); emits('update:query', props.query);
nextTick(() => {
emits('onSearch');
});
}; };
const handleReset = () => { const handleReset = () => {

View File

@ -90,7 +90,10 @@ const groups = ref([]);
const operators = ref([]); const operators = ref([]);
const handleSearch = () => { const handleSearch = () => {
emits('onSearch', props.query); emits('update:query', props.query);
nextTick(() => {
emits('onSearch');
});
}; };
const handleReset = () => { const handleReset = () => {

View File

@ -82,7 +82,10 @@ const emits = defineEmits('onSearch', 'onReset', 'update:query');
const operators = ref([]); const operators = ref([]);
const handleSearch = () => { const handleSearch = () => {
emits('onSearch', props.query); emits('update:query', props.query);
nextTick(() => {
emits('onSearch');
});
}; };
const handleReset = () => { const handleReset = () => {