feat(notification): add delete notification feature
This commit is contained in:
parent
63f307c70d
commit
c49669021a
2 changed files with 32 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue