CN-430 fix: 修复卡死报递归错误的问题

This commit is contained in:
chenjinsong
2022-04-14 14:36:12 +08:00
parent 5baf123056
commit 58e2d233d6
2 changed files with 14 additions and 8 deletions

View File

@@ -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)
}
}

View File

@@ -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 })
}
})