81 lines
2.1 KiB
TypeScript
81 lines
2.1 KiB
TypeScript
import { defineStore } from "pinia";
|
|
import { ref } from "vue";
|
|
import type { DirectorRows } from "@/modules/11_discipline/interface/response/director";
|
|
import type { QTableProps } from "quasar";
|
|
|
|
// store ระบบวินัย >> ข้อมูลพื้นฐาน >> กรรมการ
|
|
export const useDisciplineDirectorDataStore = defineStore(
|
|
"disciplineDirector",
|
|
() => {
|
|
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
|
const visibleColumns = ref<string[]>([
|
|
"no",
|
|
"name",
|
|
"position",
|
|
"email",
|
|
"phone",
|
|
]);
|
|
|
|
// หัวตาราง
|
|
const columns = ref<QTableProps["columns"]>([
|
|
{
|
|
name: "no",
|
|
align: "left",
|
|
label: "ลำดับ",
|
|
sortable: false,
|
|
field: "no",
|
|
headerStyle: "font-size: 14px",
|
|
style: "font-size: 14px",
|
|
},
|
|
{
|
|
name: "name",
|
|
align: "left",
|
|
label: "ชื่อ-นามสกุล",
|
|
sortable: true,
|
|
field: "name",
|
|
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: "email",
|
|
align: "left",
|
|
label: "อีเมล",
|
|
sortable: true,
|
|
field: "email",
|
|
headerStyle: "font-size: 14px",
|
|
style: "font-size: 14px",
|
|
},
|
|
{
|
|
name: "phone",
|
|
align: "left",
|
|
label: "เบอร์โทรศัพท์",
|
|
sortable: true,
|
|
field: "phone",
|
|
headerStyle: "font-size: 14px",
|
|
style: "font-size: 14px",
|
|
},
|
|
]);
|
|
|
|
// ข้อมูลในตาราง
|
|
const rows = ref<DirectorRows[]>([]);
|
|
function fetchData(data: DirectorRows[]) {
|
|
rows.value = data
|
|
}
|
|
|
|
return {
|
|
visibleColumns,
|
|
columns,
|
|
rows,
|
|
fetchData
|
|
};
|
|
}
|
|
);
|