แก้ UI การลา

This commit is contained in:
Warunee Tamkoo 2023-11-03 15:08:53 +07:00
parent d697086bb8
commit 494f9571b9
6 changed files with 211 additions and 381 deletions

View file

@ -1,10 +1,6 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { QTableProps } from "quasar";
import type {
investigateDisDataRowType,
DataOption,
} from "@/modules/11_discipline/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const { date2Thai } = mixin;
@ -14,10 +10,17 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
async function fecthList(data: any[]) {
let datalist: any[] = data.map((e: any) => ({
fullname: e.fullname,
date: date2Thai(new Date(e.date)),
date: date2Thai(new Date(e.date), false, true),
dateFix: date2Thai(new Date(e.dateFix)),
type: e.type,
reason: e.reason,
timeMorning:
e.startTimeMorning == null
? "-"
: e.startTimeMorning + " - " + e.endTimeMorning,
timeAfternoon:
e.startTimeAfternoon == null
? "-"
: e.startTimeAfternoon + " - " + e.endTimeAfternoon,
status: e.status,
}));
rows.value = datalist;
}
@ -27,8 +30,8 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
"fullname",
"date",
"dateFix",
"type",
"reason",
"timeMorning",
"timeAfternoon",
]);
const columns = ref<QTableProps["columns"]>([
@ -58,8 +61,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
field: "date",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateFix",
@ -69,32 +70,27 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
field: "dateFix",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "type",
name: "timeMorning",
align: "left",
label: "ประเภท",
label: "ช่วงเช้า",
sortable: true,
field: "type",
field: "timeMorning",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "reason",
name: "timeAfternoon",
align: "left",
label: "เหตุผล",
label: "ช่วงบ่าย",
sortable: true,
field: "reason",
field: "timeAfternoon",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
return {
fecthList,
rows,