API ประเมืน
This commit is contained in:
parent
0e5d15dc7c
commit
257b4a1424
16 changed files with 700 additions and 186 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -11,7 +11,7 @@ import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
|||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
|
|
@ -36,12 +36,11 @@ function handleItemClick(itemNumber: number) {
|
|||
fetchDocument(fileName.value[itemNumber - 1]);
|
||||
}
|
||||
async function fetchDocument(fileName: string) {
|
||||
showLoader();
|
||||
// showLoader();
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", props.evaluateId, fileName))
|
||||
.then((res) => {
|
||||
console.log(res.data.downloadUrl);
|
||||
downloadFile(res.data.downloadUrl);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -60,9 +59,6 @@ async function downloadFile(url: string) {
|
|||
.then((res) => {
|
||||
const blob = new Blob([res.data]);
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
console.log(blob);
|
||||
|
||||
console.log(objectUrl);
|
||||
|
||||
emit("update:file", objectUrl);
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue