checkload
This commit is contained in:
parent
13317f94f2
commit
5ffc84daf3
6 changed files with 33 additions and 24 deletions
|
|
@ -39,7 +39,6 @@ const modal = defineModel<boolean>("modal", { required: true });
|
||||||
* props
|
* props
|
||||||
*/
|
*/
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
closeModal: Function,
|
|
||||||
fetchData: Function,
|
fetchData: Function,
|
||||||
rows: Array,
|
rows: Array,
|
||||||
});
|
});
|
||||||
|
|
@ -209,6 +208,10 @@ function filterSelectOrder() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeModal() {
|
||||||
|
modal.value = false;
|
||||||
|
commandType.value = "";
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* เมื่อ props.modal เป็น true
|
* เมื่อ props.modal เป็น true
|
||||||
*
|
*
|
||||||
|
|
@ -314,7 +317,7 @@ watch(
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
row-key="id"
|
row-key="personalId"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ const orgRevisionId = ref<string>("");
|
||||||
|
|
||||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
||||||
async function fetchStructure() {
|
async function fetchStructure() {
|
||||||
const dataTree = await fetchStructureTree(route.meta.Key as string);
|
const dataTree = await fetchStructureTree(route.meta.Key as string,false);
|
||||||
if (dataTree) {
|
if (dataTree) {
|
||||||
orgRevisionId.value = storeTree.activeId;
|
orgRevisionId.value = storeTree.activeId;
|
||||||
nodes.value = dataTree;
|
nodes.value = dataTree;
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ async function getStat() {
|
||||||
contain: statCard.contain,
|
contain: statCard.contain,
|
||||||
disclaim: statCard.disclaim,
|
disclaim: statCard.disclaim,
|
||||||
};
|
};
|
||||||
|
DataStore.checkLoad(1)
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -60,18 +61,16 @@ async function getStat() {
|
||||||
* get รายละเอียด ของการสอบ
|
* get รายละเอียด ของการสอบ
|
||||||
*/
|
*/
|
||||||
async function fetchPlacementData() {
|
async function fetchPlacementData() {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.MainDetail(0))
|
.get(config.API.MainDetail(0))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
DataStore.DataMainOrig = res.data.result;
|
DataStore.DataMainOrig = await res.data.result;
|
||||||
|
DataStore.checkLoad(1)
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {});
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เมื่อเริ่มโหลดหน้า ให้ ใช้ฟังชั่น get stat
|
/** เมื่อเริ่มโหลดหน้า ให้ ใช้ฟังชั่น get stat
|
||||||
|
|
@ -96,7 +95,6 @@ onMounted(async () => {
|
||||||
title.value = examData.value == null ? null : examData.value.examRound;
|
title.value = examData.value == null ? null : examData.value.examRound;
|
||||||
round.value = examData.value == null ? null : examData.value.examOrder;
|
round.value = examData.value == null ? null : examData.value.examOrder;
|
||||||
year.value = examData.value == null ? null : examData.value.fiscalYear;
|
year.value = examData.value == null ? null : examData.value.fiscalYear;
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { useRoute, useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { tokenParsed } from "@/plugins/auth";
|
import { tokenParsed } from "@/plugins/auth";
|
||||||
|
import { usePlacementDataStore } from "@/modules/05_placement/store";
|
||||||
import avatar from "@/assets/avatar_user.jpg";
|
import avatar from "@/assets/avatar_user.jpg";
|
||||||
|
|
||||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||||
|
|
@ -24,6 +24,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogOrders from "@/modules/05_placement/components/PersonalList/DialogOrders.vue"; //ส่งไปออกคำสั่งขอโอน
|
import DialogOrders from "@/modules/05_placement/components/PersonalList/DialogOrders.vue"; //ส่งไปออกคำสั่งขอโอน
|
||||||
|
|
||||||
const $q = useQuasar(); // show dialog
|
const $q = useQuasar(); // show dialog
|
||||||
|
const DataStore = usePlacementDataStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
|
|
@ -387,15 +388,14 @@ async function getTable() {
|
||||||
e.nodeName !== null &&
|
e.nodeName !== null &&
|
||||||
e.reportingDate !== null
|
e.reportingDate !== null
|
||||||
);
|
);
|
||||||
|
DataStore.checkLoad(1);
|
||||||
// insertAvatar(rows.value);
|
// insertAvatar(rows.value);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
})
|
||||||
|
.finally(async () => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -742,10 +742,6 @@ function openModalOrder(val: boolean) {
|
||||||
modalOrder.value = val;
|
modalOrder.value = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeModal() {
|
|
||||||
modalOrder.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(containStatus, () => {
|
watch(containStatus, () => {
|
||||||
if (containStatus.value) {
|
if (containStatus.value) {
|
||||||
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
|
rows.value = rowsAll.value.filter((x: any) => x.statusId == "CONTAIN");
|
||||||
|
|
@ -1594,11 +1590,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
<DialogOrders
|
<DialogOrders v-model:modal="modalOrder" :rows="rowsOrder" />
|
||||||
v-model:modal="modalOrder"
|
|
||||||
:close-modal="closeModal"
|
|
||||||
:rows="rowsOrder"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
||||||
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
||||||
|
|
||||||
|
|
@ -81,6 +84,8 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
export const usePlacementDataStore = defineStore("placement", () => {
|
export const usePlacementDataStore = defineStore("placement", () => {
|
||||||
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
|
const { hideLoader } = mixin;
|
||||||
interface placement {
|
interface placement {
|
||||||
mappingPosition: { columns: String[] };
|
mappingPosition: { columns: String[] };
|
||||||
}
|
}
|
||||||
|
|
@ -180,6 +185,15 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let count = 0; // ตัวแปรนับจำนวนค่าที่รับ
|
||||||
|
function checkLoad(val: number) {
|
||||||
|
count += val;
|
||||||
|
if (count >= 3) {
|
||||||
|
hideLoader();
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
placementData,
|
placementData,
|
||||||
changePlacementColumns,
|
changePlacementColumns,
|
||||||
|
|
@ -189,6 +203,7 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
||||||
DataMainYearSet,
|
DataMainYearSet,
|
||||||
DataMain,
|
DataMain,
|
||||||
DataUpdateMain,
|
DataUpdateMain,
|
||||||
|
checkLoad,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
||||||
|
|
@ -330,6 +345,7 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
|
||||||
return " ";
|
return " ";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
statusText,
|
statusText,
|
||||||
statusProbationMain,
|
statusProbationMain,
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ export const useStructureTree = defineStore("structureTree", () => {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
} finally {
|
} finally {
|
||||||
hideLoader();
|
isLoad && hideLoader();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue