修改分页

This commit is contained in:
yangjun 2023-08-15 09:17:44 +08:00
parent e4eaaefe40
commit 5b8c59e4cc
1 changed files with 17 additions and 2 deletions

View File

@ -73,6 +73,7 @@
</div>
</a-col>
</a-row>
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="8" style="text-align: right;"/>
<!-- 报错列表 -->
<ktsbDetailModal ref="ktsbDetailModalPage"></ktsbDetailModal>
</div>
@ -83,10 +84,17 @@ import { ref,onMounted ,defineExpose} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { getUserId } from '/@/views/site/utils/index';
import ktsbDetailModal from '/@/views/site/ktsb/components/ktsbDetailModal.vue';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
let listData = ref<any>([]);
const list = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/getKtsbMorelist', params });
const ktsbDetailModalPage = ref();
const APagination = Pagination;
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const queryParams = ref<any>({});
onMounted(() => {
// let userid = getUserId();
// list({ userid: userid}).then(res => {
@ -95,10 +103,14 @@ onMounted(() => {
onSearch({});
})
function onSearch(queryParam){
queryParams.value = queryParam
let userid = getUserId();
list({ userid: userid,startTime:queryParam.startTime,endTime:queryParam.endTime,pageSize:12}).then(res => {
list({ userid: userid,startTime:queryParam.startTime,endTime:queryParam.endTime,pageSize:8,pageNo:pageNo.value}).then(res => {
console.log(`🚀 ~ file: ktsbList.vue:99 ~ list ~ res:`, res)
listData.value = res.records
total.value = res.total;
current.value = res.pages;
})
}
@ -107,7 +119,10 @@ function tingkebiji(record){
ktsbDetailModalPage.value.edit(record);
}
function handlePageChange(record){
pageNo.value = Number(record);
onSearch(queryParams.value)
}
defineExpose({
onSearch