แก้ไข loader

This commit is contained in:
Thanit Konmek 2023-08-04 10:04:59 +07:00
parent f072224851
commit b663eedb09
147 changed files with 3095 additions and 3256 deletions

View file

@ -202,7 +202,6 @@ import Table from "@/modules/03_recruiting/components/TableCan.vue";
import DialogHeader from "@/modules/03_recruiting/components/DialogHeader.vue";
import DialogFooter from "@/modules/03_recruiting/components/DialogFooter.vue";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
const props = defineProps({
status: {
@ -229,7 +228,7 @@ const modalEdit = ref<boolean>(false); //modal ที่แสดงใช้ส
const rawItem = ref<RequestItemsObject>(); // row
const rowIndex = ref<number>(0); //index row
const previous = ref<boolean>(); //
const dataStore = useDataStore();
const next = ref<boolean>(); //
const editRow = ref<boolean>(false); //
const checkValidate = ref<boolean>(false); //validate data
@ -237,8 +236,8 @@ const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table
const { messageError } = mixin;
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const visibleColumns = ref<String[]>([]);
examData.career.columns.length == 0
@ -318,7 +317,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateCareer(candidateId.value))
.then((res) => {
@ -336,7 +335,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -415,7 +414,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
loaderPage(true);
showLoader();
await http
.delete(config.API.candidateAdminCareer(rawItem.value.id))
.then(() => {
@ -451,7 +450,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.candidateAdminCareer(candidateId.value), {
name: location.value,
@ -477,7 +476,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateAdminCareer(id.value), {
name: location.value,