ปรับ code ประเมิน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-15 10:07:03 +07:00
parent ab4189e6ed
commit 53cd8e593c
10 changed files with 171 additions and 226 deletions

View file

@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { OptionStatus } from "@/modules/12_evaluatePersonal/interface/index/Main";
/** importStore*/
@ -18,6 +19,7 @@ const mixin = useCounterMixin();
const store = useEvalutuonStore();
const { showLoader, hideLoader, messageError } = mixin;
/** request body*/
const currentPage = ref<number>(1);
const maxPage = ref<number>(0);
const page = ref<number>(1);
@ -92,13 +94,13 @@ function resetFilter() {
/** function เรียกรายการคำขอประเมิน*/
async function fetchEvaluteList() {
showLoader();
const body = {
page: currentPage.value,
pageSize: pageSize.value,
keyword: filter.value,
status: selectedStatus.value,
};
showLoader();
await http
.put(config.API.evaluationMain(), body)
.then(async (res) => {
@ -109,7 +111,7 @@ async function fetchEvaluteList() {
store.fetchData(data);
})
.catch((e) => {
// messageError($q, e);
messageError($q, e);
})
.finally(() => {
hideLoader();
@ -269,47 +271,15 @@ onMounted(async () => {
:rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination"
>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="currentPage"
active-color="primary"
color="dark"
:max="Number(maxPage)"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width></q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<!-- <q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ (page - 1) * rowsPerPage + props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value }}
</div>
</q-td> -->
<q-td auto-width>
<q-icon
v-if="props.row.isDefault === true"
name="mdi-bookmark"
size="xs"
color="primary"
>
<q-tooltip>เวลา Default</q-tooltip>
</q-icon>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
@ -325,6 +295,18 @@ onMounted(async () => {
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="currentPage"
active-color="primary"
color="dark"
:max="Number(maxPage)"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</d-table>
</div>
</q-card>