ค้นหา keyword
This commit is contained in:
parent
e7b0bbc284
commit
4bcc414a4f
6 changed files with 81 additions and 33 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue