diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue index 1d22e8ab..f367f3ea 100644 --- a/src/views/charts/Panel.vue +++ b/src/views/charts/Panel.vue @@ -191,7 +191,6 @@ export default { this.scroll.prevent = true const clientHeight = e.target.clientHeight const currentScrollTop = e.target.scrollTop - console.info(this.scroll.prevScrollTop, currentScrollTop) if (currentScrollTop > this.scroll.prevScrollTop) { // 向下滚动,若top在clientHeight内,则整屏滚动下去 this.scroll.prevScrollTop = currentScrollTop @@ -205,11 +204,9 @@ export default { // 向上滚动,若top在clientHeight内,则滚动到最顶部 this.scroll.prevScrollTop = currentScrollTop if (currentScrollTop < clientHeight) { - // console.info('up', this.scroll.prevScrollTop, currentScrollTop) scrollToTop(e.target, 0, 200, 'up') setTimeout(() => { this.scroll.prevScrollTop = e.target.scrollTop - // console.info('up2', this.scroll.prevScrollTop, currentScrollTop) }, 210) } } diff --git a/src/views/charts/PanelChartList.vue b/src/views/charts/PanelChartList.vue index 1d0175fa..d3c226b3 100644 --- a/src/views/charts/PanelChartList.vue +++ b/src/views/charts/PanelChartList.vue @@ -101,6 +101,7 @@ export default { gridLayoutShow: false, rowHeight: 40, copyDataList: [], // 所有的图表 + normalCopyDataList: [], // 非整屏滚动的图表 noData: false, // no data tempDom: { height: '', width: '' }, stepWidth: null, @@ -148,6 +149,9 @@ export default { } }) this.copyDataList = [...this.copyDataList] + this.normalCopyDataList = this.copyDataList.filter(function (item) { + return item.y >= -1 + }) this.emitter.emit('groupParentCalcHeight', { chart, childrenList: this.copyDataList }) }, groupParentCalcHeight (chart, childrenList) { @@ -159,9 +163,13 @@ export default { // 第二个是空隙,第三个是标题的高度 parent.h = getGroupHeight(childrenList) + 0.4 + 1 this.copyDataList = [...this.copyDataList] + this.normalCopyDataList = this.copyDataList.filter(function (item) { + return item.y >= -1 + }) }, 100) } }, + computed: { anchorPoint () { return function (chart) { @@ -171,11 +179,6 @@ export default { return '' } } - }, - normalCopyDataList: function () { - return this.copyDataList.filter(function (item) { - return item.y >= 0 - }) } }, setup (props) { @@ -211,6 +214,9 @@ export default { }) this.$nextTick(() => { this.copyDataList = JSON.parse(JSON.stringify(tempList)) + this.normalCopyDataList = this.copyDataList.filter(function (item) { + return item.y >= -1 + }) setTimeout(() => { this.gridLayoutShow = true }) @@ -219,6 +225,9 @@ export default { if (isGroup(item.type) && !item.firstShow) { item.firstShow = true this.copyDataList = [...this.copyDataList] + this.normalCopyDataList = this.copyDataList.filter(function (item) { + return item.y >= -1 + }) this.emitter.emit('groupParentCalcHeight', { chart: item, childrenList: this.copyDataList }) } })