clear code + comment

This commit is contained in:
STW_TTTY\stwtt 2024-04-30 14:31:55 +07:00
parent a9609d2d7f
commit ac70090e22
19 changed files with 231 additions and 166 deletions

View file

@ -119,6 +119,7 @@ const formQuery = reactive({
const totalList = ref<number>(1); //
const maxPage = ref<number>(1);
/** ดึงข้อมูล */
function fetchList() {
showLoader();
http
@ -141,11 +142,13 @@ function fetchList() {
});
}
/** ฟังชั่นดึงข้อมูล รายการ ใหม่ */
function fetchNewList() {
formQuery.page = 1;
fetchList();
}
/** ย้ายไป หน้า เพิ่ม หรือ แก้ไข */
function onClickAddOrView(status: boolean = false, id: string = "") {
status
? router.push(`/development/scholarship/${id}`)
@ -161,13 +164,7 @@ function updatePagination(newPagination: NewPagination) {
formQuery.pageSize = newPagination.rowsPerPage;
}
watch(
() => formQuery.pageSize,
() => {
fetchNewList();
}
);
/** download file */
function onDownload() {
showLoader();
http
@ -184,6 +181,15 @@ function onDownload() {
});
}
/** เช็ค เมื่อมีการเปลี่ยนค่าของ ข้อมูลในเเถว */
watch(
() => formQuery.pageSize,
() => {
fetchNewList();
}
);
/** ดึงข้อมูลเมื่ออยู่ในหน้า */
onMounted(() => {
fetchList();
});