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 รายการ");
|
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
|
||||||
} else {
|
} else {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
showLoader();
|
||||||
const payload = selected.value.map((e: DataSpecialTime) => ({
|
const payload = selected.value.map((e: DataSpecialTime) => ({
|
||||||
recId: e.id,
|
recId: e.id,
|
||||||
checkInTime: e.checkInTime,
|
checkInTime: e.checkInTime,
|
||||||
|
|
|
||||||
|
|
@ -561,6 +561,26 @@ function getImg(id: string, pathName: string) {
|
||||||
function onViewDetailNoti(url: string) {
|
function onViewDetailNoti(url: string) {
|
||||||
window.open(url, "_blank");
|
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>
|
</script>
|
||||||
|
|
||||||
<!-- โครงเว็บ -->
|
<!-- โครงเว็บ -->
|
||||||
|
|
@ -642,6 +662,17 @@ function onViewDetailNoti(url: string) {
|
||||||
<div class="text-grey-5" style="font-size: 12px">
|
<div class="text-grey-5" style="font-size: 12px">
|
||||||
ทั้งหมด {{ totalInbox }} ข้อความ
|
ทั้งหมด {{ totalInbox }} ข้อความ
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<q-infinite-scroll
|
<q-infinite-scroll
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue