fix: 修改resize的问题

This commit is contained in:
zhangyu
2020-09-25 14:15:13 +08:00
parent 19df95c6be
commit 0c333b2c9b
2 changed files with 5 additions and 5 deletions

View File

@@ -284,7 +284,7 @@
methods: { methods: {
startResize(e) { startResize(e) {
let vm = this; let vm = this;
this.$chartResizeTool.start(vm, this.chartData, e); this.$chartResizeTool.start(vm, this.chartData, e,this.chartIndex);
}, },
setDivFirstShow(showDiv){ setDivFirstShow(showDiv){
this.divFirstShow = showDiv; this.divFirstShow = showDiv;

View File

@@ -1,5 +1,5 @@
import PerfectScrollbar from "perfect-scrollbar"; import PerfectScrollbar from "perfect-scrollbar";
import {getChart} from "./common";
//top置顶按钮公共方法 //top置顶按钮公共方法
export function toTop(type, wrap) { export function toTop(type, wrap) {
if (type == 'el') { if (type == 'el') {
@@ -380,7 +380,7 @@ export const chartResizeTool = {
} }
return height-this.chartBlankHeight; return height-this.chartBlankHeight;
}, },
start(vm, originalData, event) { start(vm, originalData, event, chartIndexs) {
let $self=this; let $self=this;
let data = JSON.parse(JSON.stringify(originalData)); //将初始对象复制,后续操作使用复制对象 let data = JSON.parse(JSON.stringify(originalData)); //将初始对象复制,后续操作使用复制对象
let shadow = vm.$refs.resizeShadow; //缩放时底部阴影dom let shadow = vm.$refs.resizeShadow; //缩放时底部阴影dom
@@ -443,7 +443,7 @@ export const chartResizeTool = {
document.removeEventListener("mousemove", moveListener); document.removeEventListener("mousemove", moveListener);
document.removeEventListener("mouseup", mouseupListener); document.removeEventListener("mouseup", mouseupListener);
} }
function boxStepHandler(width, height) { //param: 宽高变化量大于0放大小于0缩小 function boxStepHandler(width, height, chartIndex) { //param: 宽高变化量大于0放大小于0缩小
let widthChange = false; let widthChange = false;
let heightChange = false; let heightChange = false;
if (width > stepWidth/2) { //放大shadow宽 if (width > stepWidth/2) { //放大shadow宽
@@ -479,7 +479,7 @@ export const chartResizeTool = {
$self.timeouter=setTimeout(()=>{ $self.timeouter=setTimeout(()=>{
//step时chart重绘 //step时chart重绘
if (box.classList.contains("resize-box-echarts")) { //echarts类型 if (box.classList.contains("resize-box-echarts")) { //echarts类型
vm.echartStore.resize({width: shadow.offsetWidth-16, height: shadow.offsetHeight-titleHeight-vm.$refs.legendArea.offsetHeight}); getChart(chartIndexs).resize({width: shadow.offsetWidth-16, height: shadow.offsetHeight-titleHeight-vm.$refs.legendArea.offsetHeight});
} }
},500) },500)
//chart外层宽高调整 //chart外层宽高调整