From 17e4531c38e536f1dcab103892731cf9e554c213 Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Fri, 30 Jun 2023 00:30:58 +0800 Subject: [PATCH] =?UTF-8?q?2023=E5=B9=B46=E6=9C=8830=E6=97=A5=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/site/kxstkkt/rkb.vue | 24 +++++++++++++++--------- src/views/site/kxstkkt/xyjk.vue | 21 +++++++++++---------- src/views/site/kxstkkt/zzsk.vue | 19 ++++++++++--------- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/views/site/kxstkkt/rkb.vue b/src/views/site/kxstkkt/rkb.vue index 251b501..b37fb22 100644 --- a/src/views/site/kxstkkt/rkb.vue +++ b/src/views/site/kxstkkt/rkb.vue @@ -77,9 +77,10 @@ const tingKeZuJiAddModal = ref(); const route = useRouter(); -let pageNo = 1 -let current = 0 -let total = 0 +const pageNo = ref(1); +const current = ref(0); +const total = ref(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("没有更多数据了!"); diff --git a/src/views/site/kxstkkt/xyjk.vue b/src/views/site/kxstkkt/xyjk.vue index cdef3e9..0eaddd7 100644 --- a/src/views/site/kxstkkt/xyjk.vue +++ b/src/views/site/kxstkkt/xyjk.vue @@ -24,7 +24,7 @@ -
+
@@ -65,9 +65,10 @@ const tingKeZuJiAddModal = ref(); const route = useRouter(); -let pageNo = 1 -let current = 0 -let total = 0 +const pageNo = ref(1); +const current = ref(0); +const total = ref(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("没有更多数据了!"); diff --git a/src/views/site/kxstkkt/zzsk.vue b/src/views/site/kxstkkt/zzsk.vue index d69ba22..5509cb0 100644 --- a/src/views/site/kxstkkt/zzsk.vue +++ b/src/views/site/kxstkkt/zzsk.vue @@ -65,9 +65,10 @@ const tingKeZuJiAddModal = ref(); const route = useRouter(); -let pageNo = 1 -let current = 0 -let total = 0 +const pageNo = ref(1); +const current = ref(0); +const total = ref(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("没有更多数据了!");