Merge branch 'NiceDev' into develop
This commit is contained in:
parent
37bef4e836
commit
0b8b5d497c
13 changed files with 168 additions and 357 deletions
|
|
@ -1,27 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
/** importStroe*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const store = useEvaluateStore();
|
||||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
/** id ประเมิน*/
|
||||
const evaluateId = ref<string>(route.params.id.toString());
|
||||
|
||||
// const props = defineProps({
|
||||
// evaluateId: {
|
||||
// type: String,
|
||||
// },
|
||||
// });
|
||||
/** emit*/
|
||||
const emit = defineEmits(["update:file"]);
|
||||
|
||||
const selectedItem = ref(1);
|
||||
|
|
@ -34,13 +33,22 @@ const fileName = ref([
|
|||
"6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
]);
|
||||
|
||||
/**
|
||||
* function กดเลือกแสดงเอกสาน
|
||||
* @param itemNumber เอกสาร
|
||||
*/
|
||||
function handleItemClick(itemNumber: number) {
|
||||
store.tabPanels = itemNumber.toString();
|
||||
selectedItem.value = itemNumber;
|
||||
fetchDocument(fileName.value[itemNumber - 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* function เรีกยเอกสาร
|
||||
* @param fileName ชื่อเอกสาร
|
||||
*/
|
||||
async function fetchDocument(fileName: string) {
|
||||
// showLoader();
|
||||
showLoader();
|
||||
evaluateId.value &&
|
||||
(await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", evaluateId.value, fileName))
|
||||
|
|
@ -52,6 +60,10 @@ async function fetchDocument(fileName: string) {
|
|||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* function ดาวน์โหลดไฟล์
|
||||
* @param url ลิงก์ดาวน์โหลดไฟล์
|
||||
*/
|
||||
async function downloadFile(url: string) {
|
||||
await axios
|
||||
.get(url, {
|
||||
|
|
@ -77,6 +89,7 @@ async function downloadFile(url: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** HooK lifecycle*/
|
||||
onMounted(async () => {
|
||||
await fetchDocument(fileName.value[selectedItem.value - 1]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue