ประเมินผล
This commit is contained in:
parent
257b4a1424
commit
95714e5ac2
3 changed files with 76 additions and 17 deletions
|
|
@ -8,7 +8,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
const mixins = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const { date2Thai, success, messageError } = mixins;
|
||||
const { date2Thai, success } = mixins;
|
||||
|
||||
const props = defineProps({
|
||||
evaluateId: {
|
||||
|
|
@ -34,22 +34,27 @@ const items = ref<any>([
|
|||
},
|
||||
]);
|
||||
|
||||
async function onClickfetchDocument(fileName: string) {
|
||||
const statusFile = ref<boolean>(false);
|
||||
|
||||
async function onClickfetchDocument(fileName: string, type: string) {
|
||||
props.evaluateId &&
|
||||
(await http
|
||||
.get(config.API.loadFileDocument("เล่ม 1", props.evaluateId, fileName))
|
||||
.then((res) => {
|
||||
const downloadUrl = res.data.downloadUrl;
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = downloadUrl;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
success($q, "คัดลอกลิ้งค์สำเร็จ");
|
||||
type === "COPPY" && coppyLink(downloadUrl);
|
||||
statusFile.value = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
}));
|
||||
.catch((err) => {}));
|
||||
}
|
||||
|
||||
async function coppyLink(link: string) {
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = link;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
success($q, "คัดลอกลิ้งค์สำเร็จ");
|
||||
}
|
||||
|
||||
async function fetchCheckDate() {
|
||||
|
|
@ -66,6 +71,7 @@ async function fetchCheckDate() {
|
|||
|
||||
onMounted(async () => {
|
||||
fetchCheckDate();
|
||||
await onClickfetchDocument("บันทึกแจ้งผลการประกาศคัดเลือก", "CHECK");
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -111,7 +117,44 @@ onMounted(async () => {
|
|||
round
|
||||
color="primary"
|
||||
icon="mdi-clipboard-outline"
|
||||
@click="onClickfetchDocument(item.fileName)"
|
||||
@click="onClickfetchDocument(item.fileName, 'COPPY')"
|
||||
>
|
||||
<q-tooltip>คัดลอกลิ้งค์</q-tooltip>
|
||||
</q-btn>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-12" v-if="statusFile">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
บันทึกแจ้งผลการประกาศคัดเลือก
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<q-list>
|
||||
<q-item>
|
||||
<q-item-section>
|
||||
<q-item-label>บันทึกแจ้งผลการประกาศคัดเลือก</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side top>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="mdi-clipboard-outline"
|
||||
@click="
|
||||
onClickfetchDocument(
|
||||
'บันทึกแจ้งผลการประกาศคัดเลือก',
|
||||
'COPPY'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>คัดลอกลิ้งค์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const stroe = useEvaluateStore();
|
||||
const link = ref<string>("https://bma-ehr-publish.frappet.synology.me/");
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const { success } = mixin;
|
||||
const link = ref<string>(
|
||||
`https://bma-ehr-publish.frappet.synology.me/${stroe.evaluateId}`
|
||||
);
|
||||
|
||||
async function onClickCopyLink() {
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = link.value;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
success($q, "คัดลอกลิ้งค์สำเร็จ");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -20,9 +35,10 @@ const link = ref<string>("https://bma-ehr-publish.frappet.synology.me/");
|
|||
<q-btn
|
||||
class="q-mt-md"
|
||||
outline
|
||||
icon-right="mdi-clipboard-outline"
|
||||
icon="mdi-clipboard-outline"
|
||||
label="คัดลอกลิ้งค์"
|
||||
color="primary"
|
||||
@click="onClickCopyLink"
|
||||
>
|
||||
<q-tooltip> คัดลอกลิ้งค์ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ async function fetchCheckStep(id: string) {
|
|||
? 9
|
||||
: 1;
|
||||
|
||||
store.currentStep = 8;
|
||||
store.step = 8;
|
||||
store.currentStep = step;
|
||||
store.step = step;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue