Merge branch 'dev-chiangmai' of https://github.com/Frappet/bma-ehr-frontend into dev-chiangmai

# Conflicts:
#	src/api/05_placement/api.placement.ts
#	src/modules/05_placement/components/pass/TableDetail.vue
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-07-11 18:04:54 +07:00
commit 593576a7e6
10 changed files with 964 additions and 774 deletions

View file

@ -1,13 +1,16 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { defineAsyncComponent } from "@vue/runtime-core";
import { useRouter } from "vue-router";
import { useRouter ,useRoute} from "vue-router";
import cardTop from "@/modules/05_placement/components/pass/StatCard.vue";
import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http";
import config from "@/app.config";
let roleAdmin = ref<boolean>(false);
const router = useRouter();
const route = useRoute();
const examId = route.params.examId;
const year = ref<string>("2566");
const round = ref<string>("1");
const title = ref<string>("การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ");
@ -15,14 +18,38 @@ const AddTablePosition = defineAsyncComponent(
() => import("@/modules/05_placement/components/pass/Table.vue")
);
const stat = ref<any>({
total: 5,
unContain: 1,
prepareContain: 3,
contain: 1,
total: 0,
unContain: 0,
prepareContain: 0,
contain: 0,
disclaim: 0,
});
const getStat = async () => {
const examIdString = Array.isArray(examId) ? examId[0] : examId;
try {
const res = await http.get(config.API.getStatCard(examIdString));
const statCard = res.data.result;
// stat
stat.value = {
total: statCard.total,
unContain: statCard.unContain,
prepareContain: statCard.prepareContain,
contain: statCard.contain,
disclaim: statCard.disclaim,
};
console.log("🚀 ~ file: Table.vue:96 ~ getStatCard ~ data:", statCard);
} catch (error) {
console.error("Error retrieving data:", error);
//
}
};
onMounted(async () => {
await getStat()
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
}

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,9 @@ const mixin = useCounterMixin(); //เรียกฟังก์ชันกล
const modal = ref<boolean>();
const { success, showLoader, hideLoader, date2Thai, modalConfirm } = mixin;
const save = ref<boolean>(true);
const fullName = ref<any>()
const props = defineProps({
Modal: Boolean,
close: {
@ -27,12 +30,55 @@ const props = defineProps({
default: () => console.log("not function"),
},
});
// const getDetailbyId = (props.getdetail) => {
// showLoader();
// // personalId API
// try {
// const response = await http.get(config.API.personalId(id));
// const personalId = response.data.personalId;
// // personalId API
// const organizationResponse = await http.get(config.API.organizationName(personalId));
// const data = organizationResponse.data.result;
// // UI
// uid.value = data.personalId;
// idCard.value = data.idCard;
// fullName.value = "tee";
// dateOfBirth.value = new Date(data.dateOfBirth).toLocaleDateString();
// gender.value = data.gender;
// address.value = data.address;
// education.value = data.education;
// pointA.value = data.pointA;
// pointB.value = data.pointB;
// pointC.value = data.pointC;
// pointTotalA.value = data.pointTotalA;
// pointTotalB.value = data.pointTotalB;
// pointTotalC.value = data.pointTotalC;
// point.value = data.point;
// pointTotal.value = data.pointTotal;
// examNumber.value = data.examNumber;
// examRound.value = data.examRound;
// pass.value = data.pass;
// isProperty.value = data.isProperty;
// } catch (error) {
// messageError($q, error);
// } finally {
// hideLoader();
// }
// };
const rows = ref<any[]>([
// university: props.getdetail.university || "-",
// degree: props.getdetail.degree || "-",
// major: props.getdetail.major || "-",
// graduation: "2022-01-01",
]);
]);
//--------------------()------------------------------------//
// const graduationDate = new Date(graduationExample);
// rows.value[0].graduation = date2Thai(graduationDate, false, false);
//--------------------------------------------------------------------//
const columns = ref<QTableProps["columns"]>([
{
name: "university",
@ -77,54 +123,9 @@ const columns = ref<QTableProps["columns"]>([
]);
const myForm = ref<any>([]);
const personalForm = ref<any>([]);
// const checkValidate = ref<boolean>(false);
const selection = ref<any>([]);
// const checkboxItems: CheckboxItem[] = [
// { id: 1, label: "" },
// {
// id: 2,
// label:
// " ..",
// },
// {
// id: 3,
// label:
// " ",
// },
// { id: 4, label: "" },
// {
// id: 5,
// label:
// " ",
// },
// { id: 6, label: "" },
// {
// id: 7,
// label:
// " ",
// },
// {
// id: 8,
// label:
// " ",
// },
// {
// id: 9,
// label:
// " ",
// },
// {
// id: 10,
// label:
// " ",
// },
// {
// id: 11,
// label:
// " ",
// },
// ];
const $q = useQuasar();
function isRequired(val: any): boolean | string {
@ -304,6 +305,7 @@ const putpersonalForm = async () => {
virtual-scroll
:virtual-scroll-sticky-size-start="48"
dense
hide-bottom
>
</q-table>
</q-card>