fix: 恢复dashboard滚动条监听事件
This commit is contained in:
@@ -76,16 +76,15 @@
|
|||||||
<i class="nz-icon-create-square nz-icon"></i>
|
<i class="nz-icon-create-square nz-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!--<happy-scroll color="rgba(0,0,0,1)" size="15">-->
|
</div>
|
||||||
<!--<el-scrollbar style="height: 100%">-->
|
<div class="table-list" id="tableList">
|
||||||
<div class="table-list" @scroll="onScroll" id="tableList">
|
<el-scrollbar style="height: 100%" ref="dashboardScrollbar">
|
||||||
<el-scrollbar style="height: 100%">
|
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<chart-list @on-edit-chart="editData" @on-refresh-time="refreshTime" @on-remove-chart="removeData"
|
<chart-list @on-edit-chart="editData" @on-refresh-time="refreshTime" @on-remove-chart="removeData"
|
||||||
ref="chartList"></chart-list>
|
ref="chartList"></chart-list>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div><!--</happy-scroll>--><!--</el-scrollbar>-->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<panel-box :panel="panel" @reload="panelReload" @reloadForDel="panelReloadForDel" ref="panelBox"></panel-box>
|
<panel-box :panel="panel" @reload="panelReload" @reloadForDel="panelReloadForDel" ref="panelBox"></panel-box>
|
||||||
@@ -548,13 +547,20 @@
|
|||||||
},
|
},
|
||||||
// 滚动事件触发下拉加载
|
// 滚动事件触发下拉加载
|
||||||
onScroll() {
|
onScroll() {
|
||||||
let dom = document.getElementById('tableList');
|
let _self = this;
|
||||||
|
let scrollbarWrap = this.$refs.dashboardScrollbar.wrap;
|
||||||
|
scrollbarWrap.onscroll = function() {
|
||||||
|
if (scrollbarWrap.scrollHeight - scrollbarWrap.scrollTop - scrollbarWrap.offsetHeight < 20) {
|
||||||
|
_self.$refs.chartList.pageDataList(true, _self.showPanel.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*let dom = document.getElementById('tableList');
|
||||||
let scrollHeight = dom.scrollHeight;//整个可滑动区域高度
|
let scrollHeight = dom.scrollHeight;//整个可滑动区域高度
|
||||||
let clientHeight = dom.clientHeight;//可视高度
|
let clientHeight = dom.clientHeight;//可视高度
|
||||||
let scrollTop = dom.scrollTop;//滚动条顶部与整个scrollHeight顶部的距离
|
let scrollTop = dom.scrollTop;//滚动条顶部与整个scrollHeight顶部的距离
|
||||||
if (scrollHeight - clientHeight - scrollTop <= 20) {//滚动到底部,才加载新数据
|
if (scrollHeight - clientHeight - scrollTop <= 20) {//滚动到底部,才加载新数据
|
||||||
this.$refs.chartList.pageDataList(true, this.showPanel.id);
|
this.$refs.chartList.pageDataList(true, this.showPanel.id);
|
||||||
}
|
}*/
|
||||||
},
|
},
|
||||||
focusInput:function(){
|
focusInput:function(){
|
||||||
let classVal=document.getElementById('queryPanel').parentElement.getAttribute("class");
|
let classVal=document.getElementById('queryPanel').parentElement.getAttribute("class");
|
||||||
@@ -579,6 +585,7 @@
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
this.onScroll();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
refreshPanel() {
|
refreshPanel() {
|
||||||
|
|||||||
Reference in New Issue
Block a user