loading สรรหา

This commit is contained in:
setthawutttty 2025-07-07 15:18:37 +07:00
parent ee4428aac2
commit 360caae2e1
8 changed files with 98 additions and 156 deletions

View file

@ -32,6 +32,7 @@ const {
hideLoader,
date2Thai,
onSearchDataTable,
dialogRemove,
} = mixin;
const name = ref<string>("");
@ -212,7 +213,7 @@ function textDate(value: Date) {
}
/** ดึง list ข้อมูล */
async function fetchData() {
async function fetchData(actionType?: string) {
showLoader();
await http
.get(config.API.getDisableCandidates)
@ -237,6 +238,9 @@ async function fetchData() {
})
.finally(() => {
hideLoader();
if (actionType == "delete") {
success($q, "ลบข้อมูลการสอบสำเร็จ");
}
});
}
@ -302,32 +306,19 @@ async function clickHistory(id: string) {
/** ลบ รอบการคัดเลือก */
function clickDelete(id: string) {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
showLoader();
await http
.delete(config.API.deleteDisableCandidates(id))
.then((res) => {
success($q, "ลบข้อมูลการสอบสำเร็จ");
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
})
.onCancel(() => {})
.onDismiss(() => {});
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.deleteDisableCandidates(id))
.then((res) => {
fetchData("delete");
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
});
}
/** ไปหน้าเพิ่มข้อมูล */