checkload

This commit is contained in:
STW_TTTY\stwtt 2024-09-26 12:04:46 +07:00
parent 13317f94f2
commit 5ffc84daf3
6 changed files with 33 additions and 24 deletions

View file

@ -1,5 +1,8 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import type { FormPlacementMainData } 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", () => {
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const { hideLoader } = mixin;
interface placement {
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 {
placementData,
changePlacementColumns,
@ -189,6 +203,7 @@ export const usePlacementDataStore = defineStore("placement", () => {
DataMainYearSet,
DataMain,
DataUpdateMain,
checkLoad,
};
});
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
@ -330,6 +345,7 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
return " ";
}
};
return {
statusText,
statusProbationMain,