From 282c4247865a38243a0fb6d58b579fd657b96202 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Mon, 11 Sep 2023 10:22:45 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20function=20=E0=B8=A5=E0=B8=9A=20=E0=B8=A3=E0=B8=AD?= =?UTF-8?q?=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../10_order/components/step/step03.vue | 5 +--- src/views/MainLayout.vue | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/modules/10_order/components/step/step03.vue b/src/modules/10_order/components/step/step03.vue index 1beea1c09..1e82f8402 100644 --- a/src/modules/10_order/components/step/step03.vue +++ b/src/modules/10_order/components/step/step03.vue @@ -302,10 +302,7 @@ const clickAdd = async () => { }; const clickDelete = (id: string) => { - dialogRemove( - $q, - () => deleteData(id), - ); + dialogRemove($q, () => deleteData(id)); }; const nodeTree = async () => { diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 0f9fb6ebc..b0f11fb8f 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -31,7 +31,7 @@ const mixin = useCounterMixin(); //เรียกฟังก์ชันกล const { showLoader, hideLoader, - dialogMessage, + dialogRemove, success, messageError, date2Thai, @@ -403,6 +403,26 @@ if (keycloak.tokenParsed != null) { fullname.value = keycloak.tokenParsed.name; role.value = keycloak.tokenParsed.role; } + +const deleteData = async (id: string) => { + await http; + // .delete(config.API.copyOrderId(id)) + // .then((res) => { + // // const data = res.data.result; + // // console.log(res); + // success($q, "ลบข้อมูลสำเร็จ"); + // }) + // .catch((e) => { + // messageError($q, e); + // }) + // .finally(async () => { + // // hideLoader(); + // }); +}; + +const clickDelete = (id: string) => { + dialogRemove($q, () => deleteData(id)); +}; @@ -489,6 +509,7 @@ if (keycloak.tokenParsed != null) { dense icon="mdi-close" class="mybtn q-mx-xs" + @click="clickDelete" > From a658945b7c64c46e2ac79c8e06597611e902df0f Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 11 Sep 2023 10:31:02 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=20(=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B9=81=E0=B8=A3=E0=B8=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/response/dashboard/dashboard.ts | 1 + src/views/Dashboard.vue | 56 ++++++++++++++----- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/interface/response/dashboard/dashboard.ts b/src/interface/response/dashboard/dashboard.ts index e6320ecfa..5f144bb2b 100644 --- a/src/interface/response/dashboard/dashboard.ts +++ b/src/interface/response/dashboard/dashboard.ts @@ -21,6 +21,7 @@ interface DataInbox { subject: string; timereceive: Date; body: string; + payload: string; ratingModel: number; } diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index a6c72593d..917097a25 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -20,6 +20,7 @@ const { success, messageError, date2Thai, + dialogRemove } = mixin; const iteminbox = ref([]); @@ -53,6 +54,7 @@ const data = ref([ // ratingModel: 0, // }, ]); +const payLoadtext = ref() const btnReply = ref(true); const listpayload = ref([]); const listpayloadNolink = ref([]); @@ -85,7 +87,7 @@ const getData = async () => { .get(config.API.msgInbox) .then((res: any) => { const response = res.data.result; - // console.log(response); + console.log(response); let list: DataInbox[] = []; response.map((e: ResponseInbox) => { list.push({ @@ -97,6 +99,7 @@ const getData = async () => { subject: e.subject ?? "", timereceive: new Date(e.createdAt), body: e.body ?? "", + payload: e.payload, ratingModel: 0, }); }); @@ -114,6 +117,28 @@ const selectInbox = (id: string) => { link.value = id; data.value = inboxList.value.filter((r) => r.no == id); }; +const deleteData = (id:string) => { + dialogRemove($q, () => removeData(id)) +} + +//รอ api ลบ +const removeData = async (id:string) => { + console.log("delete=",id) + +// showLoader(); +// await http +// .delete(config.API.) +// .then((res) => { +// success($q, "ลบข้อมูลสำเร็จ"); +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// getData() +// hideLoader() +// }) +} @@ -143,7 +168,7 @@ const selectInbox = (id: string) => { > { }} - + /> --> + { bordered :style="$q.screen.gt.xs ? 'height: 80vh' : 'height: auto;'" > -
+
@@ -243,30 +270,31 @@ const selectInbox = (id: string) => { date2Thai(d.timereceive) }}
- + /> --> - + /> -->
@@ -281,19 +309,19 @@ const selectInbox = (id: string) => { >
-
+
- เอกสารแนบ (10 MB) + เอกสารแนบ
- + /> -->