From e9b0d2fbfc0403b668e0fd06eb23fa6dbf87dcda Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 4 Mar 2024 09:57:38 +0700 Subject: [PATCH] =?UTF-8?q?Dashboard=20=3D>=20=E0=B8=A5=E0=B8=9A=E0=B8=82?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Dashboard.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index ad9e3bb3c..09bb224d8 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -95,14 +95,22 @@ const removeData = async (id: string) => { showLoader(); await http .delete(config.API.msgInboxDelete(id)) - .then((res) => { + .then(() => { success($q, "ลบข้อมูลสำเร็จ"); + const position = inboxList.value.findIndex((item) => item.no === id); + if (position !== -1) { + inboxList.value.splice(position, 1); + data.value = []; + } }) .catch((e) => { messageError($q, e); }) .finally(() => { - // getData(); + if (inboxList.value.length === 6) { + inboxList.value = []; + getData(1); + } hideLoader(); }); }; @@ -122,6 +130,7 @@ function modalReplyClose() { const scrollTargetRef = ref(null); const totalInbox = ref(0); + function onLoad(index: number, done: any) { const num = index === 1 ? 0 : index++; if (inboxList.value.length < totalInbox.value && isLoadInbox) { @@ -157,7 +166,9 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
กล่องข้อความ
-
ทั้งหมด {{ totalInbox }} ข้อความ
+
+ ทั้งหมด {{ totalInbox }} ข้อความ +
@@ -172,10 +183,7 @@ const thaiOptions: Intl.DateTimeFormatOptions = { class="q-pa-sm" :scroll-target="scrollTargetRef" > - +