ทั้งหมดรายการ

This commit is contained in:
STW_TTTY\stwtt 2024-04-26 10:05:07 +07:00
parent 9f90e4575f
commit b6809d98c2
4 changed files with 12 additions and 0 deletions

View file

@ -18,6 +18,7 @@ import type {
NewPagination,
} from "@/modules/14_KPI/interface/index/Main";
const total = ref<number>()
const store = useKPIDataStore();
const router = useRouter();
const $q = useQuasar();
@ -78,6 +79,7 @@ async function fetchList() {
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyType}`
)
.then(async (res) => {
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;
@ -254,6 +256,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formQuery.page"
active-color="primary"

View file

@ -13,6 +13,7 @@ import type { ResponseObject } from "@/modules/14_KPI/interface/response/KpiGrou
import http from "@/plugins/http";
import config from "@/app.config";
const total = ref<number>()
const modal = ref<boolean>(false);
const rows = ref<ResponseObject[]>([]);
const groupName = ref<string>("");
@ -84,6 +85,7 @@ async function fetchData() {
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
)
.then(async (res) => {
total.value = res.data.result.total
const data = res.data.result;
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
rows.value = data.data;
@ -300,6 +302,7 @@ onMounted(async () => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formQuery.page"
active-color="primary"

View file

@ -15,6 +15,7 @@ import type { ListGroup } from "@/modules/14_KPI/interface/request/Main";
import http from "@/plugins/http";
import config from "@/app.config";
const total = ref<number>()
const id = ref<string>("");
const modal = ref<boolean>(false);
const rows = ref<any>([]);
@ -98,6 +99,7 @@ async function getData() {
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}`
)
.then((res) => {
total.value = res.data.result.total
const data = res.data.result;
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
rows.value = data.data;
@ -460,6 +462,7 @@ onMounted(async () => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formQuery.page"
active-color="primary"

View file

@ -11,6 +11,7 @@ import type { NewPagination } from "@/modules/14_KPI/interface/request/Main";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
/** use*/
const total = ref<number>()
const $q = useQuasar();
const router = useRouter();
const { showLoader, hideLoader, dialogRemove, success } = useCounterMixin();
@ -78,6 +79,7 @@ function fetchList() {
)
.then((res) => {
const data = res.data.result.data;
total.value = res.data.result.total
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
rows.value = data;
})
@ -390,6 +392,7 @@ onMounted(async () => {
@update:pagination="updatePageSize"
>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formFilter.page"
active-color="primary"