fix: 自建台站ROI框移动时超出范围的问题

This commit is contained in:
Xu Zhimeng 2024-08-07 10:45:47 +08:00
parent 79f47eacb6
commit 6803f4936a
2 changed files with 23 additions and 3 deletions

View File

@ -548,6 +548,7 @@ export default {
handleBoundaryChange(evt) {
const { index, start, end } = evt
this.$set(this.roiParamList, index, [start, end])
this.$refs.betaChartRef.setBoundaryList(cloneDeep(this.roiParamList))
},
//

View File

@ -535,8 +535,18 @@ export default {
this.currBoundaryItem.width = nextLeft - this.boundaryRight
this.direction = 'right'
} else {
this.currBoundaryItem.left = nextLeft
this.currBoundaryItem.width = nextWidth
// 线
if (nextLeft < 0) {
this.currBoundaryItem.left = 0
this.currBoundaryItem.width = nextWidth + nextLeft
this.handleBorderMouseLeave()
return
}
//
else {
this.currBoundaryItem.left = nextLeft
this.currBoundaryItem.width = nextWidth
}
this.direction = 'left'
}
}
@ -549,7 +559,16 @@ export default {
this.currBoundaryItem.left = prevLeft + nextWidth
this.currBoundaryItem.width = -nextWidth
} else {
this.currBoundaryItem.width = nextWidth
// 线
if (this.currBoundaryItem.left + nextWidth > this.boundaryContainerPosition.width) {
this.currBoundaryItem.width = this.boundaryContainerPosition.width - this.currBoundaryItem.left
this.handleBorderMouseLeave()
return
}
//
else {
this.currBoundaryItem.width = nextWidth
}
this.direction = 'right'
}
}