filter keyword ประเมิน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-09 14:38:13 +07:00
parent f441925464
commit cb05d3275e
2 changed files with 13 additions and 4 deletions

View file

@ -128,7 +128,6 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
dense
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="store.visibleColumns"
:filter="store.filterKeyword"
v-model:pagination="pagination"
@update:pagination="updateRowsPerPagen"
>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { ref, watch, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
@ -58,7 +58,7 @@ async function fetchEvaluteList() {
await http
.get(
config.API.evaluationList() +
`?page=${page.value}&pageSize=${pageSize.value}`
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${store.filterKeyword}`
)
.then((res) => {
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
@ -84,6 +84,16 @@ async function updatePaging(newPagination: any, currentPage: number) {
await fetchEvaluteList();
}
watch(
() => store.filterKeyword,
async () => {
page.value = 1;
pageSize.value = pageSize.value;
await fetchEvaluteList();
}
);
/** hook lifecycle*/
onMounted(async () => {
await fetchEvaluteList();
@ -137,7 +147,7 @@ onMounted(async () => {
outlined
v-model="store.filterKeyword"
label="ค้นหา"
debounce="300"
debounce="500"
>
<template v-slot:append>
<q-icon name="search" />