จัดโค้ด

This commit is contained in:
setthawutttty 2023-11-17 18:00:02 +07:00
parent 50298e9976
commit 1e16bd7b2d
7 changed files with 174 additions and 86 deletions

View file

@ -35,7 +35,11 @@ const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
const evaluate = ref<any>([]);
const changeTab = (tabVal: string) => {
/**
* เปลยน tab
* @param tabVal type
*/
function changeTab(tabVal: string){
tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4));
};
@ -44,7 +48,11 @@ onMounted(() => {
fecthAssign(assignId.value);
});
const fecthAssign = async (id: string) => {
/**
* get data
* @param id person id
*/
async function fecthAssign(id: string){
showLoader();
await http
.get(config.API.createformCommader(id))
@ -62,7 +70,9 @@ const fecthAssign = async (id: string) => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
/** เปลี่ยน type file */
function downloadFile(response: any, filename: string){
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -72,7 +82,11 @@ const downloadFile = (response: any, filename: string) => {
document.body.removeChild(link);
};
const FileDownload = async (type: string) => {
/**
* download file
* @param type type
*/
async function FileDownload(type: string){
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
showLoader();
await http
@ -92,7 +106,9 @@ const FileDownload = async (type: string) => {
hideLoader();
});
};
const addData = () => {
/** เปลี่ยนหน้า เพิ่ม */
function addData(){
router.push(
`/probation/detail/addevalua/${personalId.value}/${assignId.value}`
);