| | |
| | | let p = diagram.getEventPosition(e); |
| | | let clickX = p.x; |
| | | let clickY = p.y; |
| | | diagram.options.map(item => { |
| | | for (let i = 0; i < diagram.options.length; i++) { |
| | | let item = diagram.options[i]; |
| | | |
| | | if (item.method == "drawRadiusRect") { |
| | | let text = diagram.getZoomTextInfo(item.id); |
| | | let objLeft = text.point[0]; |
| | | let objRight = text.point[0] + text.width; |
| | | let objTop = text.point[1]; |
| | | let objBottom = text.point[1] + text.height; |
| | | // this['show' + item.id] = false; |
| | | this.showtext1 = false; |
| | | this.showtext2 = false; |
| | | this.showtext3 = false; |
| | | this.showtext4 = false; |
| | | this.showtext5 = false; |
| | | this.showtext6 = false; |
| | | this.showtext7 = false; |
| | | this.showtext8 = false; |
| | | this.showtext9 = false; |
| | | this.showtext10 = false; |
| | | if (clickX > objLeft && clickX < objRight && clickY > objTop && clickY < |
| | | objBottom) { |
| | | item.showPanel = !item.showPanel; |
| | | this['show' + item.id] = item.showPanel; |
| | | this['show' + item.id] = true; |
| | | break; |
| | | } |
| | | } else if (item.method == "drawImage") { |
| | | if (item.textId) { |
| | | let Xzoom = diagram.stc.clientWidth / diagram.width; |
| | | let Yzoom = diagram.stc.clientHeight / diagram.height; |
| | | let img = item; |
| | | let imgobjLeft = img.left[0] * Xzoom; |
| | | let imgobjRight = img.right[0] * Xzoom; |
| | | let imgobjTop = img.top[1] * Yzoom; |
| | | let imgobjBottom = img.bottom[1] * Yzoom; |
| | | this.showtext1 = false; |
| | | this.showtext2 = false; |
| | | this.showtext3 = false; |
| | | this.showtext4 = false; |
| | | this.showtext5 = false; |
| | | this.showtext6 = false; |
| | | this.showtext7 = false; |
| | | this.showtext8 = false; |
| | | this.showtext9 = false; |
| | | this.showtext10 = false; |
| | | |
| | | if (clickX > imgobjLeft && clickX < imgobjRight && clickY > imgobjTop && clickY < |
| | | imgobjBottom) { |
| | | this['show' + item.textId] = true; |
| | | break; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, false) |
| | | |
| | | // 设置充放电的类型 |