ปรับ fe sprint2

This commit is contained in:
Kittapath 2023-06-19 15:50:50 +07:00
parent 8576f3c387
commit 0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions

View file

@ -274,7 +274,7 @@ const subdistrictCOptions = ref<DataOption[]>([]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits(["update:form"]);
watch(myform, async (count: any, prevCount: any) => {
@ -319,7 +319,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -381,7 +381,7 @@ const fetchDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -409,7 +409,7 @@ const fetchSubDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -213,15 +213,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const {
dateThaiRange,
modalDelete,
modalConfirm,
dateToISO,
success,
showLoader,
hideLoader,
} = mixin;
const { dateThaiRange, modalDelete, modalConfirm, dateToISO, success } = mixin;
const store = useExamDataStore();
const { examData, changeExamColumns } = store;
const id = ref<string>("");
@ -326,7 +318,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateCareer(candidateId.value))
.then((res) => {
@ -344,7 +336,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -423,7 +415,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateAdminCareer(rawItem.value.id))
.then(() => {
@ -459,7 +451,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.candidateAdminCareer(candidateId.value), {
name: location.value,
@ -484,7 +476,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateAdminCareer(id.value), {
name: location.value,

View file

@ -168,7 +168,7 @@ const name = ref<string>("");
const files = ref<UploadType[]>([]);
const file = ref<File[]>([]);
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
onMounted(async () => {
await getData();
@ -180,7 +180,7 @@ const fileAdd = async (val: any) => {
};
const getData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateUpload(candidateId.value))
.then((res) => {
@ -191,7 +191,7 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -199,7 +199,7 @@ const deleteData = async (id: string) => {
const params = {
documentId: id,
};
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateUpload(candidateId.value), {
params,
@ -211,7 +211,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
await getData();
});
};
@ -223,7 +223,7 @@ const uploadData = async () => {
});
const formData = new FormData();
formData.append("", newFile);
showLoader();
loaderPage(true);
await http
.put(config.API.candidateUpload(candidateId.value), formData)
.then((res) => {
@ -233,7 +233,7 @@ const uploadData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
name.value = "";
uploader.value.reset();
await getData();

View file

@ -240,7 +240,7 @@ const rows = ref<RequestItemsObject[]>([]);
const route = useRoute();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const candidateId = ref<string>(route.params.candidateId.toString());
const filter = ref<string>(""); //search data table
@ -324,7 +324,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateEducation(candidateId.value))
.then((res) => {
@ -343,12 +343,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetcheducationLevel = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.educationLevel)
.then((res) => {
@ -363,7 +363,7 @@ const fetcheducationLevel = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -444,7 +444,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
showLoader();
loaderPage(true);
await http
.delete(config.API.candidateAdminEducation(rawItem.value.id))
.then(() => {
@ -480,7 +480,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.candidateAdminEducation(candidateId.value), {
educationLevelId: educationLevelId.value,
@ -505,7 +505,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.candidateAdminEducation(id.value), {
educationLevelId: educationLevelId.value,

View file

@ -113,7 +113,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const { messageError, date2Thai } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const fullName = ref<string>("");
@ -136,7 +136,7 @@ onMounted(async () => {
});
const fetchCard = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateCard(props.candidateId))
.then((res) => {
@ -178,7 +178,7 @@ const fetchCard = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -302,7 +302,7 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const edit = ref<boolean>(true);
const myform = ref<any>({});
const route = useRoute();
@ -323,7 +323,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateFamily(candidateId.value))
.then((res) => {
@ -350,7 +350,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -430,8 +430,7 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, calAge, modalError, success, showLoader, hideLoader } =
mixin;
const { date2Thai, calAge, modalError, success } = mixin;
const districtOptions = ref<DataOption[]>([]);
const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
@ -464,7 +463,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateInformation(candidateId.value))
.then((res) => {
@ -495,12 +494,12 @@ const fetchData = async () => {
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name;
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchImgData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateProfile(candidateId.value))
.then((res) => {
@ -511,7 +510,7 @@ const fetchImgData = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
});
};
@ -543,7 +542,7 @@ const selectProvince = (val: string) => {
};
const fetchDistrict = async (id: string) => {
showLoader();
loaderPage(true);
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -558,7 +557,7 @@ const fetchDistrict = async (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -283,7 +283,7 @@ const candidateId = ref<string>(route.params.candidateId.toString());
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits(["update:form"]);
@ -300,7 +300,7 @@ onMounted(async () => {
});
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.candidateOccupation(candidateId.value))
.then((res) => {
@ -327,7 +327,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};

View file

@ -21,11 +21,7 @@
<q-separator class="q-my-lg bg-gray" size="5px" />
<div class="q-px-sm">
<Family
:prefixOptions="prefixOptions"
:status="status"
v-model:form="formFamily"
/>
<Family :prefixOptions="prefixOptions" :status="status" v-model:form="formFamily" />
</div>
<q-separator class="q-my-lg bg-gray" size="5px" />
@ -60,9 +56,9 @@ import Occupation from "@/modules/03_recruiting/components/Occupation.vue";
import Education from "@/modules/03_recruiting/components/Education.vue";
import Career from "@/modules/03_recruiting/components/Career.vue";
import Document from "@/modules/03_recruiting/components/Document.vue";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useManageDataStore } from "@/modules/01_metadata/store";
const props = defineProps({
status: {
@ -88,9 +84,8 @@ const props = defineProps({
});
const $q = useQuasar();
const store = useManageDataStore();
const { getPrefix } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const prefixOptions = ref<DataOption[]>([]);
const relationshipOptions = ref<DataOption[]>([]);
const provinceOptions = ref<DataOption[]>([]);
@ -99,7 +94,7 @@ const formAddress = ref<any>({});
const formFamily = ref<any>({});
const formOccupation = ref<any>({});
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const emit = defineEmits([
"update:formInformation",
@ -125,26 +120,34 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
});
onMounted(() => {
hideLoader();
loaderPage(false);
fetchPrefix();
fetchRelationship();
fetchProvince();
});
const fetchPrefix = async () => {
const result = await getPrefix(true, false);
const data = result.data;
let option: DataOption[] = [];
if (data.length > 0) {
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
loaderPage(true);
await http
.get(config.API.prefix)
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
prefixOptions.value = option;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
prefixOptions.value = option;
};
const fetchRelationship = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.relationship)
.then((res) => {
@ -159,12 +162,12 @@ const fetchRelationship = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchProvince = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.province)
.then((res) => {
@ -179,7 +182,7 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
</script>

View file

@ -106,9 +106,9 @@
:virtual-scroll-sticky-size-start="48"
dense
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="[0]"
>
<!-- :pagination="initialPagination"
:rows-per-page-options="[0]" -->
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">

View file

@ -47,7 +47,7 @@
<q-list style="min-width: 100px">
<q-item clickable v-close-popup @click="downloadFile()">
<q-item-section class="text-blue"
>ดาวนโหลดอมสมคร(แบบย)</q-item-section
>ดาวนโหลดดการรายชสมคร</q-item-section
>
</q-item>
<q-item clickable v-close-popup @click="downloadFileDetail()">
@ -155,7 +155,7 @@ const table = ref<any>(null);
const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const { messageError, showLoader, hideLoader } = mixin;
const { messageError } = mixin;
const props = defineProps({
inputfilter: String,
inputvisible: Array,
@ -278,7 +278,7 @@ const uploadFile = async () => {
};
const uploadDataSeat = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -290,14 +290,14 @@ const uploadDataSeat = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
files.value = [];
props.fetchData();
});
};
const uploadDataPoint = async () => {
showLoader();
loaderPage(true);
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -310,14 +310,14 @@ const uploadDataPoint = async () => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
loaderPage(false);
files.value = [];
props.fetchData();
});
};
const downloadFile = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamDownload(examId.value), {
responseType: "blob",
@ -330,12 +330,12 @@ const downloadFile = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const downloadFileDetail = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.periodExamDownloadDetail(examId.value), {
responseType: "blob",
@ -348,7 +348,7 @@ const downloadFileDetail = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};