ค้นหา keyword

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-24 18:12:56 +07:00
parent e7b0bbc284
commit 4bcc414a4f
6 changed files with 81 additions and 33 deletions

View file

@ -34,10 +34,12 @@ const filter = ref<string>('') //search data table
async function changePage(
pageVal: number,
pageSizeVal: number,
loading: false
loading: false,
key: string
) {
page.value = await pageVal
pageSize.value = await pageSizeVal
filter.value = await key
fetchlistHistory(loading)
}
@ -56,6 +58,7 @@ async function fetchlistHistory(loading = true) {
const data = res.data.result.data
total.value = res.data.result.total
maxPage.value = await Math.ceil(total.value / pageSize.value)
fetchHistoryList(data) // total
})
.catch((err) => {
@ -77,7 +80,7 @@ async function updateYear(y: number) {
/** Hook*/
onMounted(() => {
fetchlistHistory()
fetchlistHistory(true)
})
</script>
<template>