fix:add keyword filter
This commit is contained in:
parent
8d9059ad32
commit
7be8cd2446
3 changed files with 15 additions and 6 deletions
|
|
@ -75,8 +75,13 @@ function updatePagination(newPagination: any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList(enter?: any) {
|
||||||
props.fetchData?.();
|
if (enter) {
|
||||||
|
pagination.value.page = 1;
|
||||||
|
props.fetchData?.();
|
||||||
|
} else {
|
||||||
|
props.fetchData?.();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -187,7 +192,9 @@ watch(
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
style="max-width: 200px"
|
style="max-width: 200px"
|
||||||
@keydown.enter.prevent="props.onSearch?.()"
|
@keydown.enter.prevent="
|
||||||
|
nornmalData ? props.onSearch?.() : getList(true)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
||||||
mixin;
|
mixin;
|
||||||
|
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
page:1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
sortBy: "year",
|
sortBy: "year",
|
||||||
});
|
});
|
||||||
|
|
@ -355,9 +355,10 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.getExamResultById(importId.value), {
|
.post(config.API.getExamResultById(importId.value), {
|
||||||
examAttribute: "",
|
examAttribute: "",
|
||||||
|
keyword: filter.value,
|
||||||
examResult: "",
|
examResult: "",
|
||||||
page:initialPagination.value.page,
|
page: initialPagination.value.page,
|
||||||
pageSize:initialPagination.value.rowsPerPage,
|
pageSize: initialPagination.value.rowsPerPage,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let header = res.data.result.header;
|
let header = res.data.result.header;
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,7 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.getDisableExamResultById(importId.value), {
|
.post(config.API.getDisableExamResultById(importId.value), {
|
||||||
examAttribute: "",
|
examAttribute: "",
|
||||||
|
keyword: filter.value,
|
||||||
examResult: "",
|
examResult: "",
|
||||||
page: initialPagination.value.page,
|
page: initialPagination.value.page,
|
||||||
pageSize: initialPagination.value.rowsPerPage,
|
pageSize: initialPagination.value.rowsPerPage,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue