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

@ -1,10 +1,11 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import axios from "axios";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import axios from "axios";
import http from "@/plugins/http";
import config from "@/app.config";
@ -25,13 +26,11 @@ const {
success,
} = mixin;
const page = ref<number>(1);
const numOfPages = ref<number>(0);
const modalView = ref<boolean>(false);
const AnnouncementStartDate = ref<string | null>();
const AnnouncementEndDate = ref<string | null>();
const id = ref<string>(route.params.id as string);
const pdfSrc = ref<any>();
const id = ref<string>(route.params.id as string); //id
const author = ref<string>(""); //
const subject = ref<string>(""); //
const AnnouncementStartDate = ref<string | null>(); //
const AnnouncementEndDate = ref<string | null>(); //
const fileEvaluation5 = ref<any>();
const fileEvaluation5Ref = ref<any>();
const files = [
@ -59,7 +58,9 @@ const files = [
},
];
/** function บันทึกแจ้งผลการประกาศคัดเลือก*/
/**
* function นทกแจงผลการประกาศคดเลอก
*/
async function save() {
download10Url.value === ""
? (fileEvaluation5.value = "")
@ -70,7 +71,7 @@ async function save() {
download10Url.value !== ""
) {
dialogConfirm($q, async () => {
await showLoader();
showLoader();
http
.put(config.API.evaluationNext5To6(id.value))
.then(() => {
@ -144,20 +145,6 @@ function fileUpLoad(url: string) {
});
}
/** ไปหน้าต่อไปของรายงาน */
function nextPage() {
if (page.value < numOfPages.value) {
page.value++;
}
}
/** กลับหน้าก่อนหน้าของรายงาน */
function backPage() {
if (page.value !== 1) {
page.value--;
}
}
/**
* function ดลอก URL
* @param name อไฟล
@ -175,7 +162,9 @@ async function copyLink(name: string) {
});
}
/** function เรียกข้อมูลวันที่ประกาศ*/
/**
* function เรยกขอมลวนทประกาศ
*/
async function getDate() {
showLoader();
await http
@ -196,7 +185,9 @@ async function getDate() {
}
const download10Url = ref<string>("");
/** function เช็คไฟล์อัปโหลด*/
/**
* function เชคไฟลปโหลด
*/
async function checkDocResult() {
showLoader();
await http
@ -217,9 +208,9 @@ async function checkDocResult() {
});
}
const author = ref<string>("");
const subject = ref<string>("");
/** function เรียกข้อมูลผลงาน*/
/**
* function เรยกขอมลผลงาน
*/
async function fetchDataSigner() {
showLoader();
await http
@ -281,16 +272,6 @@ onMounted(async () => {
<q-item-section avatar>
<div class="row">
<div>
<!-- <q-btn
:href="file.pathName"
target="_blank"
flat
round
color="blue-6"
icon="mdi-download"
>
<q-tooltip>ดลอกลงค</q-tooltip>
</q-btn> -->
<q-btn
flat
round
@ -309,7 +290,7 @@ onMounted(async () => {
</q-card>
</div>
<div class="col-12">
<div class="col-12" v-if="download10Url != ''">
<q-card bordered style="border: 1px solid #d6dee1">
<div
class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center"
@ -318,7 +299,6 @@ onMounted(async () => {
<q-space />
<div>
<q-btn
v-if="download10Url != ''"
:href="download10Url"
target="_blank"
class="col-12"
@ -384,93 +364,6 @@ onMounted(async () => {
</div>
</div>
</div>
<q-dialog
v-model="modalView"
persistent
:maximized="true"
transition-show="slide-up"
transition-hide="slide-down"
>
<q-card class="bg-white">
<div class="flex justify-end items-center align-center q-mr-md q-mt-sm">
<q-btn
icon="close"
unelevated
round
dense
style="color: #ff8080; background-color: #ffdede"
size="12px"
v-close-popup
/>
</div>
<div class="q-pa-md">
<div class="row items-start items-center">
<div class="col">
<q-btn
padding="xs"
icon="mdi-chevron-left"
color="grey-2"
text-color="grey-5"
size="md"
class="my-auto"
@click="backPage"
:disable="page == 1"
/>
</div>
<div class="col-12 col-md-auto">
<div class="q-pa-md flex">
หนาท {{ page }} จาก {{ numOfPages }}
</div>
</div>
<div class="col text-right">
<q-btn
padding="xs"
icon="mdi-chevron-right"
color="grey-2"
text-color="grey-5"
size="md"
@click="nextPage"
:disable="page === numOfPages"
/>
</div>
</div>
<div class="row items- items-center">
<VuePDF ref="vuePDFRef" :pdf="pdfSrc" :page="page" fit-parent />
</div>
<div class="row items- items-end">
<div class="col">
<q-btn
padding="xs"
icon="mdi-chevron-left"
color="grey-2"
text-color="grey-5"
size="md"
class="my-auto"
@click="backPage"
:disable="page == 1"
/>
</div>
<div class="col-12 col-md-auto">
<div class="q-pa-md flex">
หนาท {{ page }} จาก {{ numOfPages }}
</div>
</div>
<div class="col text-right">
<q-btn
padding="xs"
icon="mdi-chevron-right"
color="grey-2"
text-color="grey-5"
size="md"
@click="nextPage"
:disable="page === numOfPages"
/>
</div>
</div>
</div>
</q-card>
</q-dialog>
</template>
<style scoped></style>