feat(notification): add delete notification feature

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-06-23 13:59:17 +07:00
parent 63f307c70d
commit c49669021a
2 changed files with 32 additions and 0 deletions

View file

@ -105,6 +105,7 @@ function onSubmit() {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
} else {
dialogConfirm($q, async () => {
showLoader();
const payload = selected.value.map((e: DataSpecialTime) => ({
recId: e.id,
checkInTime: e.checkInTime,

View file

@ -561,6 +561,26 @@ function getImg(id: string, pathName: string) {
function onViewDetailNoti(url: string) {
window.open(url, "_blank");
}
function handleDeleteNotification() {
dialogRemove(
$q,
async () => {
try {
showLoader();
await http.delete(config.API.msgNotificate);
await getDataNotification(1, "DEL");
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
},
"ยืนยันการลบข้อมูล",
"ต้องการยืนยันการลบรายการแจ้งเตือนทั้งหมดใช่หรือไม่?"
);
}
</script>
<!-- โครงเว -->
@ -642,6 +662,17 @@ function onViewDetailNoti(url: string) {
<div class="text-grey-5" style="font-size: 12px">
งหมด {{ totalInbox }} อความ
</div>
<q-btn
v-if="totalInbox !== 0"
flat
dense
round
color="red"
icon="delete"
@click.stop.prevent="handleDeleteNotification"
>
<q-tooltip>ลบการแจงเตอนทงหมด</q-tooltip>
</q-btn>
</div>
<q-infinite-scroll