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

@ -253,11 +253,20 @@ export const useInvestigateDisStore = defineStore(
}
]);
/**
* status id
* @param val id API find id
* @returns name
*/
function convertStatus(val: string) {
const result = statusOps.value.find((x: any) => x.id == val)?.name;
return result ? result : "-";
}
/**
* API
* @param data API
*/
async function fetchList(data: investigateDisDataRowType[]) {
let datalist: any[] = data.map((e: any) => ({
id: e.id,
@ -274,6 +283,10 @@ export const useInvestigateDisStore = defineStore(
rows.value = datalist;
}
/**
* API
* @param data API
*/
async function fecthDirector(data: directorType[]) {
let datalistDirector: responseType[] = data.map((e: directorType) => ({
id: e.id,
@ -290,6 +303,11 @@ export const useInvestigateDisStore = defineStore(
// console.log(rows2.value);
}
/**
* status text
* @param val status
* @returns text
*/
function convertRespondentType(val: string) {
switch (val) {
case "PERSON":
@ -301,6 +319,11 @@ export const useInvestigateDisStore = defineStore(
}
}
/**
* status text
* @param val status
* @returns text
*/
function convertFault(val: string) {
switch (val) {
case "NOT_SPECIFIED":
@ -314,6 +337,12 @@ export const useInvestigateDisStore = defineStore(
}
}
/**
* input
* @param val input
* @param update function quasar
* @param type type input
*/
function filterFnOptionsType(
val: string | number,
update: any,