分页问题修改

xjl
徐景良 2024-05-07 15:06:41 +08:00
parent 8c6108e16e
commit 64dcb7c443
3 changed files with 40 additions and 18 deletions

View File

@ -72,6 +72,24 @@
try {
const values = await validate();
let query = values;
if(query.orgs){
query.orgs.forEach((it,idx)=>{
query.orgs[idx] = it.toString();
})
}
if(query.recipientUserId){
query.recipientUserId.forEach((it,idx)=>{
query.recipientUserId[idx] = it.toString();
})
}
if(query.roles){
query.roles.forEach((it,idx)=>{
query.roles[idx] = it.toString();
})
}
// delete query.orgs;
// delete query.recipientUserId;
// delete query.roles;
//
if (!unref(isUpdate)) {
const data = await addNotice(query);

View File

@ -98,10 +98,10 @@
if (rows.length == 0) {
return createMessage.warn('请选择一条通知进行删除');
}
const query = [];
rows.forEach((item,index)=>{
query.push(item.Id);
})
const query = "?id="+rows[0].Id;
// rows.forEach((item,index)=>{
// query.push(item.Id);
// })
createConfirm({
iconType: 'info',

View File

@ -1,5 +1,5 @@
<template>
<a-table :columns="columns.col" :data-source="columns.data" size="small" height="300px" bordered :pagination="pagination.pagination">
<a-table :columns="columns.col" :data-source="columns.data" size="small" height="500" bordered :pagination="pagination.pagination">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<a @click="viewDetail(record)"></a>
@ -33,7 +33,7 @@ const props = defineProps<{
currentListQuery:Object
}>()
const caseId = ref('');
let columns = reactive({data:[{},{},{}],col:[{
let columns = reactive({data:[],col:[{
title: '案件编号',
dataIndex: 'case_no',
},
@ -74,16 +74,10 @@ function viewDetail(record) {
openModal();
}
let pageSize = ref(props.currentListQuery.limit)
let current = ref(props.currentListQuery.page)
let current = ref(1)
let pageSize = ref(10)
function handlePageChange(page,pageSize){
props.currentListQuery.page = page;
props.currentListQuery.limit = pageSize;
pageSize.value = pageSize;
current.value = page;
handleGetList()
}
let pagination = reactive({
pagination: {
@ -98,20 +92,25 @@ let pagination = reactive({
}
})
function handlePageChange(page,pageSize){
props.currentListQuery.page = page;
props.currentListQuery.limit = pageSize;
pagination.pagination.pageSize = pageSize;
pagination.pagination.current = page;
}
watch(()=>props.currentListQuery,(newValue,oldValue)=>{
pagination.pagination.pageSize = newValue.limit;
pagination.pagination.current = newValue.page;
handleGetList();
},{immediate:true,deep:true})
function handleGetList(){
getCaseInfoList(props.currentListQuery).then(res=>{
columns.data = res.items;
total.value = res.total;
})
}
</script>
@ -119,4 +118,9 @@ function handleGetList(){
.editable-row-operations a {
margin-right: 8px;
}
::v-deep .ant-table {
height: calc( 100vh - 230px)!important;
overflow-x: auto !important;
}
</style>