From f2023a2b516d84ba5d69b8b054d974305e534742 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Thu, 27 Jun 2024 11:17:39 +0700 Subject: [PATCH] no message --- .../06_evaluate/components/ExpertPage.vue | 128 ------------------ 1 file changed, 128 deletions(-) diff --git a/src/modules/06_evaluate/components/ExpertPage.vue b/src/modules/06_evaluate/components/ExpertPage.vue index e8e3100..54e7137 100644 --- a/src/modules/06_evaluate/components/ExpertPage.vue +++ b/src/modules/06_evaluate/components/ExpertPage.vue @@ -4,7 +4,6 @@ import { useRouter, useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import type { FormRef } from "@/modules/06_evaluate/interface/evalute"; -import axios from "axios"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -12,8 +11,6 @@ import genReport from "@/plugins/genreport"; const router = useRouter(); const route = useRoute(); - -const evaluateId = ref(route.params.id as string); const profile = ref(); const $q = useQuasar(); const mixin = useCounterMixin(); @@ -26,27 +23,6 @@ const { success, } = mixin; -interface FormCommand { - commanderFullname: string; - commanderPosition: string; - commanderAboveFullname: string; - commanderAbovePosition: string; - author: string; - subject: string; - assignedPosition: string; -} - -/** form ผู้เซ็นเอกสาร*/ -const formCommand = reactive({ - commanderFullname: "", - commanderPosition: "", - commanderAboveFullname: "", - commanderAbovePosition: "", - author: "", - subject: "", - assignedPosition: "", -}); - const formData = reactive({ subject: "", author: "", @@ -56,21 +32,6 @@ const formData = reactive({ commanderAbovePosition: "", }); -const downloadFile1 = ref(""); -const downloadFile2 = ref(""); -const downloadFile3 = ref(""); -const downloadFile4 = ref(""); -const downloadFile5 = ref(""); -const downloadFile6 = ref(""); - -/** ตัวแปร file*/ -const fileEvaluation1 = ref(); -const fileEvaluation2 = ref(); -const fileEvaluation3 = ref(); -const fileEvaluation4 = ref(); -const fileEvaluation5 = ref(); -const fileEvaluation6 = ref(); - const subjectRef = ref(null); const authorRef = ref(null); const commanderFullnameRef = ref(null); @@ -142,26 +103,6 @@ const files = [ }, ]; -/** - * function ดาวน์โหลดไฟล์ - * @param name ชื้อไฟล์ - */ -async function downloadFile(name: string) { - // showLoader(); - // await http - // .get(config.API.evaluationFilebyId("เล่ม 1", id.value, name)) - // .then((res) => { - // const link = res.data.downloadUrl; - // const type = res.data.fileType; - // const fileName = res.data.fileName; - // getPDF(link, type, fileName); - // }) - // .catch((e) => {}) - // .finally(() => { - // hideLoader(); - // }); -} - function onSubmit() { dialogConfirm($q, () => { showLoader(); @@ -290,75 +231,6 @@ async function onClickDowloadFile( await genReport(body, fileName); //สร้างไฟล์ต้นแบบ } -/** - * function fetch ลิงก์อัปโหลดไฟล์ - * @param volume เล่ม - * @param id evaluate ID - * @param type ประเภทไฟล์ - * @param file ไฟล์ - */ -async function fetchPathUpload( - volume: string, - id: string | undefined, - type: string, - file: any -) { - const body = { - fileList: { - fileName: type, - metadata: { - subject: formCommand.subject, - author: formCommand.author, - }, - }, - }; - - if (id && file) { - showLoader(); - await http - .post(config.API.loadPathDocument(volume, id), body) - .then((res) => { - const foundKey: string | undefined = Object.keys(res.data).find( - (key) => - res.data[key]?.fileName !== undefined && - res.data[key]?.fileName !== "" - ); - foundKey && uploadfile(res.data[foundKey]?.uploadUrl, file); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - downloadFile(type); - hideLoader(); - }); - } -} - -/** - * functoin อัปโหลดไฟล์ - * @param uploadUrl link อัปโหลด - * @param file ไฟล์ - */ -async function uploadfile(uploadUrl: string, file: any) { - showLoader(); - await axios - .put(uploadUrl, file, { - headers: { - "Content-Type": file.type, - }, - }) - .then(() => { - success($q, "อัปโหลไฟล์สำเร็จ"); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); -} -