Compare commits
12 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bb19e16d6 | |||
| 3e05ba5dde | |||
| 2e84247ae6 | |||
|
|
fc5aa31b35 | ||
|
|
e00d3aaddb | ||
|
|
26d00e58d5 | ||
|
|
fc273ad5a2 | ||
|
|
3195be48e2 | ||
|
|
59355bd368 | ||
|
|
5511ded611 | ||
|
|
9c43137034 | ||
|
|
215124bb59 |
2 changed files with 36 additions and 2 deletions
|
|
@ -758,7 +758,6 @@ onMounted(async () => {
|
|||
table-class="text-grey-9"
|
||||
row-key="id"
|
||||
dense
|
||||
hide-bottom
|
||||
bordered
|
||||
separator="vertical"
|
||||
class="custom-header-table-expand"
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ async function getDataNotification(index: number, type: string) {
|
|||
.get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`)
|
||||
.then((res) => {
|
||||
const response = res.data.result.data;
|
||||
totalInbox.value = res.data.result.total;
|
||||
totalInbox.value = res.data.result.total || 0;
|
||||
let list: notiType[] = [];
|
||||
if (type === "DEL") {
|
||||
notiList.value = [];
|
||||
|
|
@ -405,6 +405,26 @@ onBeforeMount(async () => {
|
|||
}
|
||||
});
|
||||
|
||||
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();
|
||||
}
|
||||
},
|
||||
"ยืนยันการล้างการแจ้งเตือนทั้งหมด",
|
||||
`ต้องการล้างการแจ้งเตือนทั้งหมด (${totalInbox.value} รายการ) ใช่หรือไม่? การกระทำนี้ไม่สามารถย้อนกลับได้`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อเริ่มต้นโปรแกรมให้ฟัง event resize และ function myEventHandler
|
||||
* set function myEventHandler เพราะ state ยังไม่เซ็ท , state เซ็ทเมื่อ หน้าจอเริ่ม ขยับหน้าจอ
|
||||
|
|
@ -510,6 +530,21 @@ onUnmounted(() => {
|
|||
<div class="text-grey-5" style="font-size: 12px">
|
||||
ทั้งหมด {{ totalInbox }} ข้อความ
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="totalInbox !== 0"
|
||||
flat
|
||||
dense
|
||||
no-caps
|
||||
size="12px"
|
||||
color="red-7"
|
||||
icon="mdi-trash-can-outline"
|
||||
label="ล้างทั้งหมด"
|
||||
class="q-ml-sm"
|
||||
aria-label="ล้างการแจ้งเตือนทั้งหมด"
|
||||
@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