2023年6月30日 修复错误

This commit is contained in:
bai 2023-06-30 00:30:58 +08:00
parent e1332a8bfc
commit 17e4531c38
3 changed files with 36 additions and 28 deletions

View File

@ -77,9 +77,10 @@ const tingKeZuJiAddModal = ref();
const route = useRouter();
let pageNo = 1
let current = 0
let total = 0
const pageNo = ref<number>(1);
const current = ref<number>(0);
const total = ref<number>(0);
const emit = defineEmits(['setTotal']);
const { createMessage } = useMessage();
@ -105,7 +106,7 @@ onMounted(() => {
//
function loadData(num?) {
if(num == 1){
pageNo = 1
pageNo.value = 1
listData.value = [];
}
queryParam.value.pageSize = '4'
@ -126,8 +127,13 @@ function loadData(num?) {
list(queryParam.value).then(res => {
// console.log(`🚀 ~ file: index.vue:104 ~ list ~ res:`, res)
listData.value.push(...res.records)
current = res.pages
total = res.total
current.value = res.pages
total.value = res.total
console.log(`🚀 ---------------------------------------------🚀`);
console.log(`🚀 ~ file: rkb.vue:132 ~ list ~ total:`, total.value);
console.log(`🚀 ---------------------------------------------🚀`);
// listData.value = res.records;
// console.log(`🚀 ~ file: kclbList.vue:113 ~ list ~ listData.value:`, listData.value)
})
@ -176,7 +182,7 @@ function handleBaocuo(item) {
*/
function funShouqi(){
listData.value = []
pageNo = 1
pageNo.value = 1
loadData()
}
/**
@ -184,8 +190,8 @@ function handleBaocuo(item) {
*/
function funMore(){
console.log(`🚀 ~ file: index.vue:83 ~ funMore ~ current>pageNo:`, current,pageNo)
if(current>pageNo){
pageNo ++;
if(current.value > pageNo.value){
pageNo.value ++;
loadData()
}else{
createMessage.error("没有更多数据了!");

View File

@ -24,7 +24,7 @@
<itemPage :data="item" @to-live-page="toLivePage" @funpingjia="funpingjia"></itemPage>
</a-col>
<a-col :span="25" style="line-height: 50px;">
<div v-show="1 == pageNo && current > 0 && total < 4 ">
<div v-show="1 == pageNo && current > 0 && total > 4 ">
<div style="text-align: center;"><a @click="funMore">更多...</a></div>
</div>
<div v-show="current==0">
@ -65,9 +65,10 @@ const tingKeZuJiAddModal = ref();
const route = useRouter();
let pageNo = 1
let current = 0
let total = 0
const pageNo = ref<number>(1);
const current = ref<number>(0);
const total = ref<number>(0);
const emit = defineEmits(['setTotal']);
const { createMessage } = useMessage();
@ -93,7 +94,7 @@ onMounted(() => {
//
function loadData(num?) {
if(num == 1){
pageNo = 1
pageNo.value = 1
listData.value = [];
}
@ -111,8 +112,8 @@ function loadData(num?) {
list(queryParam.value).then(res => {
// console.log(`🚀 ~ file: index.vue:104 ~ list ~ res:`, res)
listData.value.push(...res.records)
current = res.pages
total = res.total
current.value = res.pages
total.value = res.total
// pageNo = res.pages
// if(res.total){
@ -168,7 +169,7 @@ function handleBaocuo(item) {
*/
function funShouqi(){
listData.value = []
pageNo = 1
pageNo.value = 1
loadData()
}
/**
@ -176,8 +177,8 @@ function handleBaocuo(item) {
*/
function funMore(){
console.log(`🚀 ~ file: index.vue:83 ~ funMore ~ current>pageNo:`, current,pageNo)
if(current>pageNo){
pageNo ++;
if(current.value > pageNo.value){
pageNo.value ++;
loadData()
}else{
createMessage.error("没有更多数据了!");

View File

@ -65,9 +65,10 @@ const tingKeZuJiAddModal = ref();
const route = useRouter();
let pageNo = 1
let current = 0
let total = 0
const pageNo = ref<number>(1);
const current = ref<number>(0);
const total = ref<number>(0);
const emit = defineEmits(['setTotal']);
const { createMessage } = useMessage();
@ -93,7 +94,7 @@ onMounted(() => {
//
function loadData(num?) {
if(num == 1){
pageNo = 1
pageNo.value = 1
listData.value = [];
}
queryParam.value.pageSize = '4'
@ -110,8 +111,8 @@ function loadData(num?) {
list(queryParam.value).then(res => {
console.log(`🚀 ~ file: index.vue:104 ~ list ~ res:`, res)
listData.value.push(...res.records)
current = res.pages
total = res.total
current.value = res.pages
total.value = res.total
// listData.value = res.records;
// console.log(`🚀 ~ file: kclbList.vue:113 ~ list ~ listData.value:`, listData.value)
})
@ -160,7 +161,7 @@ function handleBaocuo(item) {
*/
function funShouqi(){
listData.value = []
pageNo = 1
pageNo.value = 1
loadData()
}
/**
@ -168,8 +169,8 @@ function handleBaocuo(item) {
*/
function funMore(){
console.log(`🚀 ~ file: index.vue:83 ~ funMore ~ current>pageNo:`, current,pageNo)
if(current>pageNo){
pageNo ++;
if(current.value > pageNo.value){
pageNo.value ++;
loadData()
}else{
createMessage.error("没有更多数据了!");