refactor code ส่วนของเครื่องราชฯ
This commit is contained in:
parent
33c2b338a2
commit
1ed9faebf2
11 changed files with 326 additions and 149 deletions
|
|
@ -33,7 +33,7 @@ const stat = ref<any>({
|
|||
contain: 0,
|
||||
disclaim: 0,
|
||||
});
|
||||
|
||||
// เรียกข้อมูล Stat
|
||||
const getStat = async () => {
|
||||
const examIdString = Array.isArray(examId) ? examId[0] : examId;
|
||||
await http
|
||||
|
|
@ -76,7 +76,7 @@ onMounted(async () => {
|
|||
|
||||
const fetchPlacementData = async () => {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.MainDetail(0))
|
||||
.then(async (res) => {
|
||||
DataStore.DataMainOrig = res.data.result;
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ const closeModal = () => {
|
|||
closeAndClear();
|
||||
}
|
||||
};
|
||||
|
||||
// clean ข้อมูล
|
||||
const closeAndClear = async () => {
|
||||
await props.close();
|
||||
editDataStatus.value = false;
|
||||
|
|
@ -346,7 +346,7 @@ const checkPosition = (val: string) => {
|
|||
};
|
||||
const personal = ref<any>();
|
||||
const expanded = ref<string[]>([]);
|
||||
|
||||
// เมื่อ props เปลี่ยนแปลงจะโหลดหน่วยงาน
|
||||
watch(props, () => {
|
||||
expanded.value = [];
|
||||
const dataPersonal = props.personal;
|
||||
|
|
@ -361,10 +361,10 @@ watch(props, () => {
|
|||
personal.value.draft === false &&
|
||||
personal.value.positionNumber !== null
|
||||
) {
|
||||
let findData: any = null;
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
|
||||
// ถ้ามีตำแต่งจะทำการ expandedTree
|
||||
if (findData != null) {
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
|
|
@ -374,7 +374,7 @@ watch(props, () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
// หาตำหน่วยงานที่เลือก
|
||||
// หาหน่วยงานที่เลือก
|
||||
function findByPerson(element: any): any {
|
||||
if (
|
||||
element.positionNumId &&
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { showLoader, hideLoader, date2Thai } = mixin;
|
||||
const { showLoader, hideLoader, date2Thai, messageError } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -78,13 +78,13 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const myForm = ref<any>([]);
|
||||
const personalForm = ref<any>([]);
|
||||
const selection = ref<any>([]);
|
||||
|
||||
// เมื่อ props.Modal จะเรียกข้อมูลการศึกษา
|
||||
watch(props, () => {
|
||||
if (props.Modal === true) {
|
||||
fetchData();
|
||||
}
|
||||
});
|
||||
|
||||
// ข้อมูลการศึกษา
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -101,7 +101,7 @@ const fetchData = async () => {
|
|||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log("e", e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -120,7 +120,7 @@ const formBmaofficer = (val: string) => {
|
|||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
// ปิด POPUP ข้อมูล
|
||||
const close = async () => {
|
||||
props.close();
|
||||
selection.value = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue