From 61add4dae7aed223a695b8ff4c743ac716aabea7 Mon Sep 17 00:00:00 2001
From: whyczyk <525500596@qq.com>
Date: 星期五, 04 六月 2021 09:40:11 +0800
Subject: [PATCH] 拓扑图提交

---
 src/pages/home/topoGraph.vue |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/src/pages/home/topoGraph.vue b/src/pages/home/topoGraph.vue
index c9ae2ed..8b68405 100644
--- a/src/pages/home/topoGraph.vue
+++ b/src/pages/home/topoGraph.vue
@@ -783,21 +783,58 @@
                 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)
 
             // 璁剧疆鍏呮斁鐢电殑绫诲瀷

--
Gitblit v1.9.1