diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index fc908a03d..62738cb55 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -1,5 +1,5 @@ @@ -352,13 +442,13 @@ onMounted(() => { active-bg-color="teal-1" active-class="text-primary" > - + - + { วันที่สืบสวน -import { ref, useAttrs, onMounted,watch } from "vue"; +import { ref, useAttrs, onMounted, watch } from "vue"; import router from "@/router"; import { useQuasar } from "quasar"; @@ -10,7 +10,6 @@ import http from "@/plugins/http"; import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore"; const dataInvestigate = useInvestigateFactStore(); -const { fecthList } = dataInvestigate; const mixin = useCounterMixin(); const { date2Thai, @@ -47,16 +46,22 @@ const pagination = ref({ rowsPerPage: rowsPerPage.value, }); -watch(() => currentPage.value,() => { - rowsPerPage.value = pagination.value.rowsPerPage; - getList(); -}); +watch( + () => currentPage.value, + () => { + rowsPerPage.value = pagination.value.rowsPerPage; + getList(); + } +); -watch(()=>pagination.value.rowsPerPage,()=>{ - rowsPerPage.value = pagination.value.rowsPerPage; - currentPage.value = 1 - getList(); -}) +watch( + () => pagination.value.rowsPerPage, + () => { + rowsPerPage.value = pagination.value.rowsPerPage; + currentPage.value = 1; + getList(); + } +); async function getList() { showLoader(); await http @@ -69,7 +74,7 @@ async function getList() { ) .then((res) => { maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); - const data = res.data.result.data + const data = res.data.result.data; dataInvestigate.fecthList(data); }) .catch((e) => { @@ -82,7 +87,6 @@ async function getList() { const attrs = ref(useAttrs()); - /**ไปยังหน้าเพิ่มข้อมูล */ const clickAdd = () => { router.push(`/discipline/investigatefacts/add`); @@ -92,15 +96,16 @@ const clickAdd = () => { * ไปหน้าแก้ไข * @param id ไอดีเฉพาะ รายบุคคล */ -function editPage(id: string) { +async function editPage(id: string) { + dataInvestigate.tabMenu = await "investigatefacts"; router.push(`/discipline/investigatefacts/${id}`); } -/**เมื่อเริ่มโหลดหน้า +/**เมื่อเริ่มโหลดหน้า * ส่งข้อมูลจำลองไปยัง store */ onMounted(async () => { - getList() + getList(); }); @@ -163,7 +168,7 @@ onMounted(async () => { class="col-xs-12 col-sm-3 col-md-2" /> - + { v-model:pagination="pagination" :rows-per-page-options="[10, 25, 50, 100]" > - +