fix:任务管理界面搜索栏重置功能修复
This commit is contained in:
@@ -104,7 +104,7 @@ const scrollConfig = computed(() => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const { columns, data, loading, getData, mobilePagination, searchParams, resetSearchParams } = useTable({
|
const { columns, data, loading, getData, mobilePagination, searchParams } = useTable({
|
||||||
apiFn: doGetjobList,
|
apiFn: doGetjobList,
|
||||||
apiParams: {
|
apiParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -427,6 +427,20 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
const handleReset = () => {
|
||||||
|
// 保存当前的 pageSize
|
||||||
|
const currentPageSize = searchParams.pageSize;
|
||||||
|
|
||||||
|
// 重置搜索参数
|
||||||
|
searchParams.jobName = '';
|
||||||
|
searchParams.jobGroup = '';
|
||||||
|
searchParams.status = '';
|
||||||
|
searchParams.pageNum = 1;
|
||||||
|
searchParams.pageSize = currentPageSize;
|
||||||
|
|
||||||
|
// 重新获取数据
|
||||||
|
getData();
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -469,7 +483,7 @@ onMounted(() => {
|
|||||||
<AFormItem class="m-0">
|
<AFormItem class="m-0">
|
||||||
<div class="w-full flex-y-center justify-end gap-8px">
|
<div class="w-full flex-y-center justify-end gap-8px">
|
||||||
<a-space :size="8">
|
<a-space :size="8">
|
||||||
<a-button @click="resetSearchParams">
|
<a-button @click="handleReset">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { enableStatusOptions } from '@/constants/business';
|
import { enableStatusOptions } from '@/constants/business';
|
||||||
import { SyncOutlined, SearchOutlined } from '@ant-design/icons-vue';
|
import { SyncOutlined, SearchOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'logSearch'
|
name: 'logSearch'
|
||||||
@@ -20,6 +21,12 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const model = defineModel<any>('model', { required: true });
|
const model = defineModel<any>('model', { required: true });
|
||||||
|
|
||||||
|
// 使用计算属性来处理双向绑定
|
||||||
|
const formModel = computed({
|
||||||
|
get: () => model.value,
|
||||||
|
set: (val) => model.value = val
|
||||||
|
});
|
||||||
|
|
||||||
/**记录开始结束时间 */
|
/**记录开始结束时间 */
|
||||||
let queryRangePicker = ref<[string, string]>(['', '']);
|
let queryRangePicker = ref<[string, string]>(['', '']);
|
||||||
|
|
||||||
@@ -53,24 +60,24 @@ function search() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ACard :title="$t('common.search')" :bordered="false" class="card-wrapper">
|
<ACard :title="$t('common.search')" :bordered="false" class="card-wrapper">
|
||||||
<AForm :model="model" :label-width="80">
|
<AForm :model="formModel" :label-width="80">
|
||||||
<ARow :gutter="[16, 16]" wrap>
|
<ARow :gutter="[16, 16]" wrap>
|
||||||
<ACol :lg="6" :md="12" :xs="24">
|
<ACol :lg="6" :md="12" :xs="24">
|
||||||
<AFormItem label="Name" name="operIp" class="m-0">
|
<AFormItem label="Name" name="jobName" class="m-0">
|
||||||
<AInput v-model:value="model.operIp" />
|
<AInput v-model:value="formModel.jobName" />
|
||||||
</AFormItem>
|
</AFormItem>
|
||||||
</ACol>
|
</ACol>
|
||||||
|
|
||||||
<ACol :lg="6" :md="12" :xs="24">
|
<ACol :lg="6" :md="12" :xs="24">
|
||||||
<AFormItem label="Group" name="title" class="m-0">
|
<AFormItem label="Group" name="jobGroup" class="m-0">
|
||||||
<AInput v-model:value="model.title" />
|
<AInput v-model:value="formModel.jobGroup" />
|
||||||
</AFormItem>
|
</AFormItem>
|
||||||
</ACol>
|
</ACol>
|
||||||
|
|
||||||
|
|
||||||
<ACol :lg="6" :md="12" :xs="24">
|
<ACol :lg="6" :md="12" :xs="24">
|
||||||
<AFormItem :label="$t('page.manage.user.status')" name="status" class="m-0">
|
<AFormItem :label="$t('page.manage.user.status')" name="status" class="m-0">
|
||||||
<ASelect v-model:value="model.status" :placeholder="$t('page.manage.user.form.status')" allow-clear>
|
<ASelect v-model:value="formModel.status" :placeholder="$t('page.manage.user.form.status')" allow-clear>
|
||||||
<ASelectOption v-for="option in enableStatusOptions" :key="option.value" :value="option.value">
|
<ASelectOption v-for="option in enableStatusOptions" :key="option.value" :value="option.value">
|
||||||
{{ $t(option.label) }}
|
{{ $t(option.label) }}
|
||||||
</ASelectOption>
|
</ASelectOption>
|
||||||
|
|||||||
Reference in New Issue
Block a user