Compare commits

...

3 commits

Author SHA1 Message Date
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f054dd54a4 refactor: redirect to landing page on 404 permission error in messageError
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-07-20 10:15:32 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
34d39c7215 refactor(probation): replace Math.round with Math.trunc
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-07-13 17:57:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4dfc9bf4d6 refactor(probation): calculate score4 score5
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m43s
2026-07-13 15:01:41 +07:00
3 changed files with 24 additions and 14 deletions

View file

@ -214,21 +214,22 @@ const percent_sum: any = computed(() => {
});
const score4 = computed(() => {
return (
(Number(orientation.value) +
Number(orientation.value) +
Number(self_learning.value) +
Number(training_seminar.value) +
Number(other_training.value)) /
(isSelectionPartfour.value ? 4 : 3)
(isSelectionPartfour.value ? Number(other_training.value) : 0)
);
});
const score5 = computed(() => {
const total =
const rawTotal =
(Number(orientation_percent.value) +
Number(self_learning_percent.value) +
Number(training_seminar_percent.value) +
Number(other_training_percent.value)) /
(isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0;
return total;

View file

@ -241,21 +241,22 @@ const percent_sum: any = computed(() => {
});
const score4 = computed(() => {
return (
(Number(orientation.value) +
Number(orientation.value) +
Number(self_learning.value) +
Number(training_seminar.value) +
Number(other_training.value)) /
(isSelectionPartfour.value ? 4 : 3)
(isSelectionPartfour.value ? Number(other_training.value) : 0)
);
});
const score5 = computed(() => {
const total =
const rawTotal =
(Number(orientation_percent.value) +
Number(self_learning_percent.value) +
Number(training_seminar_percent.value) +
Number(other_training_percent.value)) /
(isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0;
return total;

View file

@ -362,13 +362,21 @@ export const useCounterMixin = defineStore("mixin", () => {
const messageError = (q: any, e: any = "", msg: string = "") => {
if (e.response !== undefined) {
if (e.response.data.status !== undefined) {
if (e.response.data.status == 401) {
if (
e.response.data.status == 401 ||
(e.response.data.status == 404 &&
e.response.data.message == "ไม่พบข้อมูลสิทธิ์")
) {
//invalid_token
const msg =
e.response.data.status == 401
? "ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง"
: e.response.data.message;
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง`,
message: msg,
icon: "warning",
color: "red",
onlycancel: true,