From 4dab304a7536520c6c0ba2940068f059702603e2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 17 Jan 2024 16:51:32 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=82=E0=B9=89?= =?UTF-8?q?=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/components/PopupDetailInbox.vue | 138 ++++++++ src/modules/01_dashboard/views/Dashboard.vue | 138 +++++++- .../06_evaluate/components/step/step2.vue | 333 +++++++++--------- .../06_evaluate/components/step/step8.vue | 34 +- src/views/MainLayout.vue | 82 ++++- 5 files changed, 529 insertions(+), 196 deletions(-) create mode 100644 src/components/PopupDetailInbox.vue diff --git a/src/components/PopupDetailInbox.vue b/src/components/PopupDetailInbox.vue new file mode 100644 index 0000000..29e7647 --- /dev/null +++ b/src/components/PopupDetailInbox.vue @@ -0,0 +1,138 @@ + + + + diff --git a/src/modules/01_dashboard/views/Dashboard.vue b/src/modules/01_dashboard/views/Dashboard.vue index a5439b2..dc6608c 100644 --- a/src/modules/01_dashboard/views/Dashboard.vue +++ b/src/modules/01_dashboard/views/Dashboard.vue @@ -7,6 +7,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import PopupReplyInbox from "@/components/PopupReplyInbox.vue"; +import PopupDetailInbox from "@/components/PopupDetailInbox.vue"; const $q = useQuasar(); const mixin = useCounterMixin(); @@ -82,14 +83,15 @@ const items = ref([ }, ]); onMounted(async () => { - await fetchlistInbox(); + await fetchlistInbox(1); }); -const fetchlistInbox = async () => { - showLoader(); +const fetchlistInbox = async (index: number) => { + index === 1 && showLoader(); await http - .get(config.API.msgInbox) + .get(config.API.msgInbox + `?page=${index}&pageSize=${10}`) .then((res) => { - let data = res.data.result; + let data = res.data.result.data; + totalInbox.value = res.data.result.total; let listItem: any = []; data.map((e: any) => { listItem.push({ @@ -100,11 +102,13 @@ const fetchlistInbox = async () => { : e.createdFullName, subject: e.subject ?? "", timereceive: date2Thai(e.createdAt), - body: e.body ?? "", + body: e.body ?? "-", ratingModel: 0, + receiveDate: date2Thai(e.receiveDate), + payload: e.payload, }); }); - inboxList.value = listItem; + inboxList.value.push(...listItem); }) .catch((err) => { console.log(err); @@ -130,6 +134,38 @@ function modalReplyClose() { contactNo.value = ""; modalReply.value = false; } + +const dataInbox = ref(); +const modalDetial = ref(false); +function onClickOpenPopupDetail(data: any) { + dataInbox.value = data; + link.value = data.no; + modalDetial.value = !modalDetial.value; +} + +function updateModalDetail(val: boolean) { + modalDetial.value = val; +} + +const scrollTargetRef = ref(null); +const totalInbox = ref(0); +function onLoad(index: number, done: any) { + if (inboxList.value.length < totalInbox.value) { + setTimeout(() => { + fetchlistInbox(index + 1); + done(); + }, 2000); + } +} + +// function onLoadRef(index: number, done: any) { +// if (inboxList.value.length < totalInbox.value) { +// setTimeout(() => { +// fetchlistInbox(index + 1); +// done(); +// }, 2000); +// } +// }