ปรับ 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

@ -2,16 +2,23 @@
import { ref, onMounted, watch, defineProps } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
const router = useRouter();
/** importComponents*/
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const route = useRoute();
const id = ref<string>(route.params.id as string);
const mixin = useCounterMixin();
const $q = useQuasar();
/** props*/
const props = defineProps({
data: {
type: Array,
@ -20,11 +27,17 @@ const props = defineProps({
fetchdata: {
type: Function,
default: () => "",
}
},
});
const { showLoader, hideLoader, messageError, dialogConfirm, date2Thai, success } =
mixin;
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
date2Thai,
success,
} = mixin;
const columns = ref<QTableProps["columns"]>([
{
@ -90,8 +103,6 @@ function onClickClose() {
modalAdd.value = false;
}
async function fetchListMeet() {}
/**
* function ดเดท Paging กรรมการ
* @param rpp อหน
@ -115,32 +126,25 @@ function returnData(data: any) {
meetings: dataList,
})
.then((res) => {
success($q, "บันทึกสำเร็จ")
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fetchdata()
props.fetchdata();
onClickClose();
hideLoader();
});
});
}
/** function เรียกข้อมูลการประชุม*/
async function getList() {
showLoader();
await http
.get(
config.API
.meeting
// currentPage.value,
// rowsPerPage.value,
// filterKeyword.value
()
)
.get(config.API.meeting())
.then((res) => {
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
const data = res.data.result;
listMeet.value = data.map((item: any) => ({
id: item.id,
@ -168,15 +172,11 @@ async function getList() {
hideLoader();
});
}
onMounted(() => {
getList();
});
watch(
() => props.data,
() => {
if (props.data) {
console.log(props.data)
rows.value = props.data.map((item: any) => ({
id: item.id,
date: `${date2Thai(item.dateStart as Date, false, true)} - ${date2Thai(
@ -192,6 +192,10 @@ watch(
}
}
);
onMounted(async () => {
await getList();
});
</script>
<template>
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
@ -253,7 +257,6 @@ watch(
:clickClose="onClickClose"
:rows2="listMeet"
v-model:filterKeyword2="filter"
:get-list="fetchListMeet"
:rowsPerPage="rowsPerPage"
:page="page"
:maxPage="maxPage"