From aa9b5189d1cb65b9823baf81662613d6f5f7ae42 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:20:19 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B9=80=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88=E0=B8=A2?= =?UTF-8?q?=E0=B8=99=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B9=80=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B9=89=E0=B8=A7=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=82?= =?UTF-8?q?=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1=E0=B9=84?= =?UTF-8?q?=E0=B8=A1=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../00_support/components/FormChat.vue | 21 +++++++++++++------ src/modules/00_support/store/Main.ts | 7 +++++-- src/modules/00_support/views/MainPage.vue | 8 ++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/modules/00_support/components/FormChat.vue b/src/modules/00_support/components/FormChat.vue index 947ce8dad..b882a6950 100644 --- a/src/modules/00_support/components/FormChat.vue +++ b/src/modules/00_support/components/FormChat.vue @@ -12,7 +12,7 @@ const content = ref(""); const searchInput = ref(""); const currentIssuePage = ref(1); const totalPageIssue = ref(); -const createdByUser = ref(""); + const { scrollContainer } = storeToRefs(store); function dateIssue(timestamp: string): string { @@ -43,6 +43,9 @@ function getOnlineStatus(option: "icon" | "status", userId: string) { } onMounted(async () => { + if (store.currentIssue) { + await store.fetchIssue(); + } await store.fetchIssue(); totalPageIssue.value = Math.ceil((store.currentTotalIssue || 0) / 30); }); @@ -66,8 +69,9 @@ const onLoad = (async (_: any, done: any) => { size="16px" color="primary" class="button-link-no-deco q-px-md" + @click="$router.push('/support/category')" > - จัดการประเภทของปัญหา + จัดการประเภทของปัญหา

@@ -112,9 +116,9 @@ const onLoad = (async (_: any, done: any) => { - {{ getOnlineStatus("status", createdByUser) }} + {{ getOnlineStatus("status", store.createdByUser) }} @@ -148,7 +152,7 @@ const onLoad = (async (_: any, done: any) => { store.currentTitle = item.title; store.correntStatusIssue = item.status; store.currentCategory = item.category.name; - createdByUser = item.createdByUserId; + store.createdByUser = item.createdByUserId; store.issue ? (store.issue.result = store.issue.result.map((v) => { if (v.id === item.id) { @@ -171,7 +175,12 @@ const onLoad = (async (_: any, done: any) => {
- + + + {{ item.category.name }} + + + {{ item.title }} diff --git a/src/modules/00_support/store/Main.ts b/src/modules/00_support/store/Main.ts index d5a456b47..549465a41 100644 --- a/src/modules/00_support/store/Main.ts +++ b/src/modules/00_support/store/Main.ts @@ -33,6 +33,7 @@ export const useSupportStore = defineStore("supportServiceStore", () => { const currentPageIssue = ref(); const currentTotalIssue = ref(); const currentCategory = ref(); + const createdByUser = ref(""); const rowsCategory = ref(); @@ -106,9 +107,10 @@ export const useSupportStore = defineStore("supportServiceStore", () => { }); function sendMessage(content: string, to: string) { - console.log(to); - socket.emit("message", { to, content }); + + console.log(socket); + scrollToEnd(); } @@ -311,6 +313,7 @@ export const useSupportStore = defineStore("supportServiceStore", () => { currentCategory, rowsCategory, userStatus, + createdByUser, fetchIssue, fetchMessage, fetchMessageStatus, diff --git a/src/modules/00_support/views/MainPage.vue b/src/modules/00_support/views/MainPage.vue index b60ce91d6..636d05a31 100644 --- a/src/modules/00_support/views/MainPage.vue +++ b/src/modules/00_support/views/MainPage.vue @@ -1,11 +1,17 @@