refactor code (ยังไม่หมด)
This commit is contained in:
parent
ab4189e6ed
commit
32d4de7075
21 changed files with 309 additions and 109 deletions
|
|
@ -20,6 +20,10 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
{ id: "DEADLY", name: "ร้ายแรง" },
|
||||
]);
|
||||
|
||||
/**
|
||||
* จัดเรียงข้อมูลจาก API
|
||||
* @param data ข้อมูลจาก API
|
||||
*/
|
||||
function getData(data: listData[]) {
|
||||
console.log(data)
|
||||
const dataList: dataType[] = data.map((item: listData) => ({
|
||||
|
|
@ -49,6 +53,11 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
rows.value = dataList
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง status เป็น text
|
||||
* @param val status
|
||||
* @returns text
|
||||
*/
|
||||
const statusTothai = (val: string) => {
|
||||
switch (val) {
|
||||
case "WAITTING":
|
||||
|
|
@ -68,10 +77,6 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
return "-";
|
||||
}
|
||||
};
|
||||
function convertOffenseDetails(val: string) {
|
||||
const result = offenseDetailsOps.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
return {
|
||||
rows,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue