จัดโค้ดบรรจุ รายชื่อผู้สอบผ่าน

This commit is contained in:
setthawutttty 2023-11-13 13:32:26 +07:00
parent eb80e5e267
commit 9f9879202e
9 changed files with 527 additions and 411 deletions

View file

@ -3,19 +3,21 @@ import { onMounted, ref } from "vue";
import { defineAsyncComponent } from "@vue/runtime-core";
import { useRouter, useRoute } from "vue-router";
import cardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { usePlacementDataStore } from "@/modules/05_placement/store";
const DataStore = usePlacementDataStore();
let roleAdmin = ref<boolean>(false);
const $q = useQuasar;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
let roleAdmin = ref<boolean>(false);
const router = useRouter();
const route = useRoute();
const examId = route.params.examId;
@ -33,8 +35,9 @@ const stat = ref<any>({
contain: 0,
disclaim: 0,
});
// Stat
const getStat = async () => {
/** เรียกข้อมูล Stat */
async function getStat() {
const examIdString = Array.isArray(examId) ? examId[0] : examId;
await http
.get(config.API.getStatCard(examIdString))
@ -52,8 +55,27 @@ const getStat = async () => {
.catch((e) => {
messageError($q, e);
});
};
}
/** get รายละเอียด ของการสอบ */
async function fetchPlacementData() {
showLoader();
await http
.get(config.API.MainDetail(0))
.then(async (res) => {
DataStore.DataMainOrig = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** get stat
* เเละหา อรอบ รอบ
*/
onMounted(async () => {
if (DataStore.DataMainOrig.length == 0) {
await fetchPlacementData();
@ -73,21 +95,6 @@ onMounted(async () => {
round.value = examData.value == null ? null : examData.value.examOrder;
year.value = examData.value == null ? null : examData.value.fiscalYear;
});
const fetchPlacementData = async () => {
showLoader();
await http
.get(config.API.MainDetail(0))
.then(async (res) => {
DataStore.DataMainOrig = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
</script>
<template>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 row">