Refactoring code module 12_evaluatePersonal

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-20 13:13:43 +07:00
parent 381ec04492
commit 490f02309e
33 changed files with 598 additions and 1036 deletions

View file

@ -15,7 +15,6 @@ import type { FormData } from "@/modules/12_evaluatePersonal/interface/index/mee
/**
* use
*/
const route = useRoute();
const $q = useQuasar();
const {
@ -42,7 +41,7 @@ const props = defineProps({
});
const emit = defineEmits(["formDataReturn"]);
const id = ref<string>(route.params.id as string);
const id = ref<string>(route.params.id as string); //id
const routeName = ref<string>(route.name as string);
const isReadonly = computed(() =>
routeName.value === "evaluateMeetingdetail" ? true : false
@ -50,17 +49,16 @@ const isReadonly = computed(() =>
const formData = reactive<FormData>({
id: "",
rounded: "",
dateMeeting: "",
dateMeetingStart: null,
dateMeetingEnd: null,
consider: "",
period: "",
title: "",
rounded: "", //
dateMeetingStart: null, //
dateMeetingEnd: null, //
consider: "", //
period: "", //
title: "", //
});
const file = ref<any>();
const fileData = ref<any>([]);
const fileDataDownload = ref<any>([]);
const file = ref<any>(); //
const fileData = ref<any[]>([]); //
const fileDataDownload = ref<any>([]); ///
/** บันทึกข้อมูล */
function submit() {
@ -70,7 +68,7 @@ function submit() {
/**
* function fetch อมลไฟลเอกสารหลกฐาน
*/
function fetchDataFile() {
async function fetchDataFile() {
if (id.value != undefined) {
showLoader();
http
@ -145,18 +143,18 @@ function uploadFile() {
/**
* function ปโหลดไฟลเอกสารหลกฐาน
*/
function uploadfileURL(uploadUrl: string, file: any) {
function uploadfileURL(uploadUrl: string, newfile: any) {
axios
.put(uploadUrl, file, {
.put(uploadUrl, newfile, {
headers: {
"Content-Type": file.type,
"Content-Type": newfile.type,
},
})
.then(() => {
setTimeout(async () => {
await fetchDataFile();
await success($q, "อัปโหลไฟล์สำเร็จ");
file.value = null;
file.value = undefined;
}, 500);
})
.catch((err) => {

View file

@ -1,7 +1,8 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { checkPermission } from "@/utils/permissions";
import { useQuasar } from "quasar";
import { checkPermission } from "@/utils/permissions";
import router from "@/router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -56,13 +57,6 @@ function clickDelete(id: string) {
});
}
/**
* งขอมลจำลองไปย store
*/
onMounted(() => {
getList();
});
/**
* นหาในตาราง
*/
@ -83,6 +77,13 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
/**
* งขอมลจำลองไปย store
*/
onMounted(() => {
getList();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">รายการการประช</div>