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

@ -217,6 +217,11 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
"organization",
]);
/**
* option
* @param val API
* @returns name id
*/
function convertComplaintType(val: string) {
const result = complainantoptionsMain.value.find(
(x: any) => x.id == val
@ -224,7 +229,11 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
return result ? result : "-";
}
/** function ลักษณะความผิด*/
/**
* status text
* @param val status
* @returns text
*/
function convertFault(val: string) {
switch (val) {
case "NOT_SPECIFIED":
@ -238,7 +247,11 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
}
}
/** function สถานะ*/
/**
* status text
* @param val status
* @returns text
*/
function convertStatus(val: string) {
switch (val) {
case "NEW":
@ -252,12 +265,22 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
}
}
/**
* option
* @param val API
* @returns name id
*/
function convertOffenseDetailst(val: string) {
return (
offenseDetailstOptions.value.find((x: any) => x.id == val)?.name ?? "-"
);
}
/**
* option
* @param val API
* @returns name id
*/
function convertStatusResult(val: string) {
const result = statusResultOptions.value.find(
(x: any) => x.id == val
@ -265,7 +288,10 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
return result ? result : "-";
}
/**
* POPUP
* @param data
*/
function fetchData(data: ArrayPersonAdd[]) {
rowsAdd.value = data;
}