refactor code (ยังไม่หมด)

This commit is contained in:
setthawutttty 2024-01-15 17:52:25 +07:00
parent ab4189e6ed
commit 32d4de7075
21 changed files with 309 additions and 109 deletions

View file

@ -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,