KPI ==> ปรับ load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-27 15:28:06 +07:00
parent 70d0975463
commit 6797177b01
6 changed files with 91 additions and 188 deletions

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted, computed, watch, reactive } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted, computed, watch } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import DialogListCriteria from "@/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue";
@ -21,8 +21,7 @@ const dataListCriteria = ref<ListCriteria[]>([]);
const modalCriteria = ref<boolean>(false);
const $q = useQuasar();
const route = useRoute();
const { hideLoader, messageError, success, showLoader, dialogRemove } =
useCounterMixin();
const { messageError } = useCounterMixin();
const store = useKpiDataStore();
const evaluationId = ref<string>(route.params.id.toString());
@ -206,18 +205,13 @@ watch(
}
);
onMounted(() => {
showLoader(),
Promise.all([
getCriteria(),
fetchListPlanned(),
fetchListRole(),
fetchAssigned(),
]).finally(() => {
setTimeout(() => {
hideLoader();
}, 2500);
});
onMounted(async () => {
await Promise.all([
getCriteria(),
fetchListPlanned(),
fetchListRole(),
fetchAssigned(),
]);
});
</script>

View file

@ -1,16 +1,11 @@
<script setup lang="ts">
import { ref } from "vue";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import { useRoute } from "vue-router";
import Assessment from "@/modules/14_KPI/components/Tab/01_Assessment.vue";
import Evaluator from "@/modules/14_KPI/components/Tab/02_Evaluator.vue";
import CommanderAbove from "@/modules/14_KPI/components/Tab/03_CommanderAbove.vue";
import CommanderAboveOneStep from "@/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue";
import File from "@/modules/14_KPI/components/Tab/05_File.vue";
const store = useKpiDataStore();
const route = useRoute();
const itemsTab = ref<any>([
{

View file

@ -160,8 +160,8 @@ function onDelete(id: string) {
? config.API.kpiAchievement("special") + `/${id}`
: "";
await http.delete(url);
success($q, "ลบข้อมูลสำเร็จ");
props.fetchList?.();
await props.fetchList?.();
await success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
@ -304,7 +304,7 @@ const isEditStep3 = computed(() => {
<q-tr :props="props" class="cursor-pointer">
<q-td>
<q-btn
v-if="isEditStep1"
v-if="isEditStep1"
flat
round
icon="mdi-eye"
@ -374,7 +374,7 @@ const isEditStep3 = computed(() => {
<q-tooltip>รายงานความกาวหน</q-tooltip>
</q-btn>
<q-btn
v-if="!checkRoutePermisson"
v-if="!checkRoutePermisson"
flat
round
icon="warning"

View file

@ -220,9 +220,9 @@ function onDelete(id: string, type: string) {
showLoader();
http
.delete(config.API.kpiUserCapacity + `/${id}`)
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
getData(type);
.then(async () => {
await getData(type);
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -363,7 +363,9 @@ onMounted(() => {
<d-table
ref="table"
:columns="columns"
:rows="rows[item.id] && rows[item.id].length !== 0 ? rows[item.id] : []"
:rows="
rows[item.id] && rows[item.id].length !== 0 ? rows[item.id] : []
"
row-key="id"
flat
bordered

View file

@ -142,9 +142,9 @@ function onDelete(id: string) {
showLoader();
http
.delete(config.API.kpiAchievementDevelop + `/${id}`)
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
getDevelop();
.then(async () => {
await getDevelop();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);