รายการลา => ปรับ paging

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-26 17:50:42 +07:00
parent acd1c97d77
commit 5d05c19c50
3 changed files with 11 additions and 0 deletions

View file

@ -33,6 +33,7 @@ const querySting = reactive<QuerySting>({
keyword: leaveStore.filter.keyword, //keyword
});
const maxPage = ref<number>(1);
const totalList = ref<number>(0);
//** API*/
async function fecthLeaveList() {
@ -50,6 +51,7 @@ async function fecthLeaveList() {
.then((res) => {
const data = res.data.result;
maxPage.value = Math.ceil(data.total / querySting.pageSize);
totalList.value = data.tatol;
fetchListLeaveReject(data.data); /** ส่งข้อมูลไป stores*/
})
.catch((err) => {
@ -96,6 +98,7 @@ onMounted(async () => {
:page="querySting.page"
:rowsPerPage="querySting.pageSize"
:maxPage="maxPage"
:totalList="totalList"
@update:querySting="updatePaging"
/>
</template>