Commit 1a360f97 authored by 13841799530's avatar 13841799530

解润东

20220517
巡查记录分页
parent 8f0df435
Pipeline #8350 passed with stage
in 5 minutes and 5 seconds
......@@ -154,6 +154,7 @@ export default {
},
methods: {
tabChange(name,title){
console.log(title)
this.page=1
this.hdType=title
this.messageList=[]
......
......@@ -22,6 +22,13 @@
<!-- v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"-->
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model="Loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell-group inset @click="touchstart(item)" v-for="(item, index) in patrolList" :key="index">
<van-row gutte>
<van-col span="10">
......@@ -57,6 +64,8 @@
</div>
</van-overlay>
</van-cell-group>
</van-list>
</van-pull-refresh>
</div>
<!-- 暂无数据 -->
<!-- v-if="isHaveNews" -->
......@@ -100,6 +109,12 @@ export default {
return {
startTime:'',
endTime:'',
Loading: false,
finished: false,
refreshing:false,
total:0,//总条数
page:1,//页码
psize:5,//页数量
date: '',
id:'',//巡查周期id
text: this.$route.query.content?this.$route.query.content:"巡查记录",
......@@ -184,14 +199,24 @@ export default {
var obj={
cycle:this.id,
startTime:this.startTime,
endTime:this.endTime
endTime:this.endTime,
page:this.page,
psize:this.psize,
}
this.patrolList=[]
getFun('patrol/list',obj).then((res)=>{
this.patrolList=res.data
res.rows.forEach((item)=>{
this.patrolList.push(item)
})
this.patrolList.forEach((i)=>{
i.show=false
})
//防止分页超出操作
this.page++
this.total=res.rows.total
if (this.patrolList.length>=this.total) {
this.finished = true;
}
this.Loading = false
})
},
onSearch(val) {
......@@ -201,7 +226,22 @@ export default {
item.show = true
this.$forceUpdate()
},
//下拉页面刷新
onRefresh() {
// 清空列表数据
this.page=1
this.finished = false;
this.Loading=true
this.onLoad();
},
//上拉页面加载数据
onLoad() {
if (this.refreshing) {
this.patrolList=[]
this.refreshing = false;
}
this.loading()
},
// 详情
goDetail(data) {
console.log(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment