แก้ load ระบบ kpi

This commit is contained in:
Warunee Tamkoo 2024-05-02 16:13:34 +07:00
parent 1ae9e85af9
commit d642f663f3
4 changed files with 48 additions and 61 deletions

View file

@ -49,7 +49,8 @@ const commanderHighMainOp = ref<DataOptions[]>([]);
const evaluatorId = ref<any>(null);
const commanderId = ref<any>(null);
const commanderHighId = ref<any>(null);
const score = ref<number>(0);
const indicatorScore = ref<number>(0);
const competencyScore = ref<number>(0);
const formProfile = reactive<FormProfile>({
fullName: "",
@ -65,7 +66,6 @@ const formProfile = reactive<FormProfile>({
const router = useRouter();
function fetchEvaluation() {
showLoader();
http
.get(config.API.kpiEvaluation + `/${id.value}`)
.then((res) => {
@ -83,14 +83,13 @@ function fetchEvaluation() {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// .finally(() => {
// hideLoader();
// });
}
function getProfile() {
showLoader();
http
.get(config.API.profilePosition())
.then((res) => {
@ -106,14 +105,13 @@ function getProfile() {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// .finally(() => {
// hideLoader();
// });
}
async function fetchProfile(id: string) {
showLoader();
await http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
@ -123,9 +121,6 @@ async function fetchProfile(id: string) {
})
.catch(() => {
// profilePicture.value = avatar;
})
.finally(() => {
hideLoader();
});
}
@ -251,9 +246,10 @@ watch(
} else {
scoreTotal.value = true;
}
} else {
console.log(2);
}
// else {
// console.log(2);
// }
}
);
@ -296,8 +292,9 @@ async function getAll() {
await getOrgOp();
}
onMounted(() => {
getAll();
onMounted(async () => {
showLoader();
await getAll();
});
</script>
@ -441,7 +438,7 @@ onMounted(() => {
<div class="column">
<span class="text-grey-6">คะแนนประเม</span>
<span class="text-weight-medium text-primary">{{
score.toFixed(2)
(indicatorScore + competencyScore).toFixed(2)
}}</span>
</div>
</div>
@ -452,7 +449,10 @@ onMounted(() => {
</q-card>
<q-card class="q-mt-md rounded">
<TabMain v-model:score="score" />
<TabMain
v-model:indicatorScore="indicatorScore"
v-model:competencyScore="competencyScore"
/>
</q-card>
</div>
</div>