|
@@ -20,7 +20,7 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<p style="margin:15px 0;">共有{{total}}条阅读记录</p>
|
|
|
- <el-table :data="newList" border style="marginBottom:40px;" height="350">
|
|
|
+ <el-table :data="newList" border style="marginBottom:40px;" height="350" ref="reportTableRef">
|
|
|
<el-table-column align="center" label="标题">
|
|
|
<template slot-scope="scope">{{scope.row.ResearchReportName}}</template>
|
|
|
</el-table-column>
|
|
@@ -78,6 +78,10 @@ export default {
|
|
|
this.getReportList();
|
|
|
},
|
|
|
valueType(){
|
|
|
+ this.newList = [];
|
|
|
+ if(this.$refs.reportTableRef.bodyWrapper) {
|
|
|
+ this.$refs.reportTableRef.bodyWrapper.scrollTop = 0;
|
|
|
+ }
|
|
|
this.getReportList()
|
|
|
}
|
|
|
},
|
|
@@ -116,25 +120,31 @@ export default {
|
|
|
label: 'ficc'
|
|
|
},
|
|
|
],
|
|
|
- total:0
|
|
|
+ total:0,
|
|
|
+
|
|
|
+ haveMore: false,
|
|
|
+ page_no: 1,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
cancelHandle() {
|
|
|
this.valueType=''
|
|
|
this.type = '';
|
|
|
- this.newList = this.readList;
|
|
|
+ this.newList = [];
|
|
|
this.$emit('cancelRead');
|
|
|
},
|
|
|
getReportList() {
|
|
|
customInterence.readList({
|
|
|
UserId:Number(this.readId),
|
|
|
TxtType:this.valueType?Number(this.valueType):0,
|
|
|
+ LastViewTime: this.newList.length?this.newList[this.newList.length-1].CreatedTime:''
|
|
|
}).then(res => {
|
|
|
if(res.Ret === 200) {
|
|
|
this.total=res.Data.Total
|
|
|
- this.readList = res.Data.List?res.Data.List:[];
|
|
|
- this.newList = res.Data.List?res.Data.List:[];
|
|
|
+ this.haveMore = res.Data.List.length ? true : false;
|
|
|
+ this.newList = [...this.newList,...res.Data.List]
|
|
|
+
|
|
|
+ if(this.page_no===1) this.$refs.reportTableRef.bodyWrapper.addEventListener('scroll',this.loadMoreList);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -146,7 +156,15 @@ export default {
|
|
|
}else {
|
|
|
this.newList = this.readList;
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ loadMoreList:_.throttle(function(){
|
|
|
+ const {scrollTop,clientHeight,scrollHeight} = this.$refs.reportTableRef.bodyWrapper
|
|
|
+ if(scrollTop + clientHeight >= scrollHeight-10 && this.haveMore){
|
|
|
+ this.page_no++;
|
|
|
+ this.getReportList();
|
|
|
+ }
|
|
|
+ },300)
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {},
|