ui รายการสืบสวนข้อเท็จจริง

This commit is contained in:
setthawutttty 2023-10-16 18:13:03 +07:00
parent 6c84ac69d9
commit 6d3b36e45e
4 changed files with 749 additions and 4 deletions

View file

@ -0,0 +1,53 @@
import { defineStore } from "pinia";
import { ref } from "vue";
export const useInvestigateFactStore = defineStore("InvestigateFact", () => {
const rows = ref<any>([])
async function fecthList(data: any) {
let datalist = data.map((e: any) => ({
subject: e.subject,
interrogated: e.interrogated,
fault: convertFault(e.fault),
status: convertSatatus(e.status),
active: activeStatus(e.active)
}))
rows.value = datalist
console.log(rows.value)
}
function convertFault(val: string) {
switch (val) {
case "0":
return "ความผิดวินัยยังไม่ระบุ"
case "1":
return "ความผิดวินัยไม่ร้ายแรง"
case "2":
return "ความผิดวินัยร้ายแรง"
}
}
function convertSatatus(val: string) {
switch (val) {
case "0":
return "ยังไม่ระบุ"
case "1":
return "ร้ายแรง"
case "2":
return "ไม่ร้ายแรง"
case "3":
return "ยุติเรื่อง"
}
}
function activeStatus(val: string) {
switch (val) {
case "0":
return "ยังไม่ได้ยืนยันผล"
case "1":
return "ยืนยันผลเเล้ว"
}
}
return {
fecthList,
rows,
};
})