UI - ข้อมูลพื้นฐาน ช่องทางการร้องเรียน
ปรับ column row ลงใน store
This commit is contained in:
parent
ebe890f069
commit
94de8b1035
3 changed files with 84 additions and 61 deletions
54
src/modules/11_discipline/store/ChannelStore.ts
Normal file
54
src/modules/11_discipline/store/ChannelStore.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import type { ChannelRows } from "@/modules/11_discipline/interface/response/channel";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
// store ระบบวินัย >> ข้อมูลพื้นฐาน >> กรรมการ
|
||||
export const useDisciplineChannelDataStore = defineStore(
|
||||
"disciplineChannel",
|
||||
() => {
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"subject",
|
||||
"interrogated",
|
||||
"fault",
|
||||
"status",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "subject",
|
||||
align: "left",
|
||||
label: "ชื่อประเภท",
|
||||
sortable: true,
|
||||
field: "subject",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลในตาราง
|
||||
const rows = ref<ChannelRows[]>([]);
|
||||
function fetchData(data: ChannelRows[]) {
|
||||
rows.value = data;
|
||||
}
|
||||
|
||||
return {
|
||||
visibleColumns,
|
||||
columns,
|
||||
rows,
|
||||
fetchData,
|
||||
};
|
||||
}
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue