From b49cdaf913a0582594fa9b58c382a0dd13cd0174 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 14 Nov 2023 11:18:52 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B9=80=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=80=E0=B8=A3=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/Form.vue | 217 +++++++++++++++--- .../interface/request/complaint.ts | 14 +- .../interface/response/complaint.ts | 24 +- .../11_discipline/store/ComplaintsStore.ts | 28 ++- .../store/InvestigateFactStore.ts | 2 +- 5 files changed, 243 insertions(+), 42 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index d12fdcb90..5ead0b113 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -2,12 +2,12 @@ import { ref, onMounted, reactive, watch } from "vue"; import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; - +import type { QTableProps } from "quasar"; /** import Type */ import type { DataOption } from "@/modules/11_discipline/interface/index/Main"; import type { FormData, - MyObjectComplaintsRef, + MyObjectComplaintsRef,DataAddRequest } from "@/modules/11_discipline/interface/request/complaint"; /** importStroe*/ @@ -109,6 +109,84 @@ const receivecomplaintstoptions = ref([ { id: "6", name: "บอกกล่าว" }, ]); +/** หัวตาราง */ +const columns = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "cardId", + align: "left", + label: "เลขบัตรประชาชน", + sortable: true, + field: "cardId", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "fullName", + align: "left", + label: "ชื่อ - นามสกุล", + sortable: true, + field: "fullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "position", + align: "left", + label: "ตำแหน่ง", + sortable: true, + field: "position", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "level", + align: "left", + label: "ระดับ", + sortable: true, + field: "level", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "degree", + align: "left", + label: "วุฒิการศึกษา", + sortable: true, + field: "degree", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "oc", + align: "left", + label: "สังกัด", + sortable: true, + field: "oc", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); + +/** หัวข้อที่เเสดงในตาราง */ +const visibleColumns = ref([ + "no", + "cardId", + "fullName", + "position", + "level", + "degree", + "oc", +]); + /** * รับค่าผู้ถูกร้องเรียน * @param val บุคคล หน่วยงาน กทม @@ -211,7 +289,48 @@ function onSubmit() { ); } -/** +/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */ +async function addDatainTable() { + console.log("test"); + const listData: DataAddRequest[] = [ + { + id: "001", + cardId: "0000000000001", + prefix: "นาง", + firstName: "ศิรินภา", + lastName: "คงน้อย", + position: "ตำเเหน่ง1", + level: "level1", + degree: "ป.ตรี", + oc: "สำนักงาน 1", + }, + { + id: "002", + cardId: "0000000000002", + prefix: "นาย", + firstName: "แก้ว", + lastName: "คำ", + position: "ตำแหน่ง2", + level: "level2", + degree: "ป.โท", + oc: "สำนักงาน 2", + }, + { + id: "003", + cardId: "0000000000003", + prefix: "นาย", + firstName: "ภัทรานุย", + lastName: "คงนอย", + position: "ตำแหน่ง2", + level: "level3", + degree: "ป.เอก", + oc: "สำนักงาน 3", + }, + ]; + await complainstStore.fetchComplainstAdd(listData); +} + +/** * เช็คข้อมูลจาก props * เมื่อมีข้อมูล * เก็บข้อมูลลง formData @@ -232,6 +351,11 @@ watch(props.data, async () => { formData.petitioner = props.data.petitioner; formData.files = props.data.files; }); + +onMounted(() => { + complainstStore.columns = columns.value; + complainstStore.visibleColumns = visibleColumns.value; +});