UI รอบการปฏิบัติงาน

This commit is contained in:
setthawutttty 2023-10-27 15:52:47 +07:00
parent aa4fa5b989
commit ad1545ac2e
6 changed files with 274 additions and 455 deletions

View file

@ -1,6 +1,6 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { RoundRows } from "@/modules/09_leave/interface/response/round.ts";
import type { dataRowRound } from "@/modules/09_leave/interface/response/round.ts";
import type { QTableProps } from "quasar";
// store ลา >> รอบการปฏิบัติงาน
@ -9,7 +9,6 @@ export const useRoundDataStore = defineStore(
() => {
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const visibleColumns = ref<string[]>([
"no",
"round",
"am",
"amOut",
@ -21,15 +20,6 @@ export const useRoundDataStore = defineStore(
// หัวตาราง
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "round",
align: "left",
@ -86,7 +76,7 @@ export const useRoundDataStore = defineStore(
},
{
name: "status",
align: "left",
align: "center",
label: "สถานะการใช้งาน",
sortable: true,
field: "status",
@ -96,10 +86,21 @@ export const useRoundDataStore = defineStore(
]);
// ข้อมูลในตาราง
const rows = ref<RoundRows[]>([]);
function fetchData(data: RoundRows[]) {
rows.value = data
}
const rows = ref<dataRowRound[]>([]);
function fetchData(data: dataRowRound[]) {
let datalist: dataRowRound[] = data.map((e: dataRowRound) => {
return {
round:`${e.am}-${e.pmOut}`,
am: e.am,
amOut: e.amOut,
pm: e.pm,
pmOut: e.pmOut,
note: e.note === '' ? '-':e.note,
status: e.status,
};
});
rows.value = datalist;
}
return {
visibleColumns,