fix bug competency

This commit is contained in:
Warunee Tamkoo 2024-04-29 13:26:30 +07:00
parent c90d2a4f70
commit ce4b8e1c4a
10 changed files with 50 additions and 52 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, reactive,watch } from "vue";
import { ref, onMounted, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
@ -14,11 +14,9 @@ import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
NewPagination,
} from "@/modules/14_KPI/interface/index/Main";
import type { NewPagination } from "@/modules/14_KPI/interface/index/Main";
const total = ref<number>()
const total = ref<number>();
const store = useKPIDataStore();
const router = useRouter();
const $q = useQuasar();
@ -76,10 +74,10 @@ async function fetchList() {
await http
.get(
config.API.kpiCapacity +
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyType}`
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyTypeVal}`
)
.then(async (res) => {
total.value = res.data.result.total
total.value = res.data.result.total;
const data: ResDataCapacity[] = res.data.result.data;
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
rows.value = data;
@ -127,7 +125,7 @@ function fetchNewList() {
* function updatePagination
* @param newPagination อม Pagination ใหม
*/
function updatePagination(newPagination: NewPagination) {
function updatePagination(newPagination: NewPagination) {
formQuery.page = 1;
formQuery.pageSize = newPagination.rowsPerPage;
}
@ -147,7 +145,7 @@ onMounted(() => {
<template>
<q-toolbar style="padding: 0">
<q-select
v-model="store.competencyType"
v-model="store.competencyTypeVal"
outlined
label="ประเภทสมรรถนะ"
dense