Merge branch 'develop' into devTee
This commit is contained in:
commit
22688d40d0
3 changed files with 122 additions and 27 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
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<any>(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();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -163,7 +168,7 @@ onMounted(async () => {
|
|||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
|
|
@ -181,7 +186,7 @@ onMounted(async () => {
|
|||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue