Explorar o código

编辑器编辑页 将fengmap挂到window

haojianlong %!s(int64=4) %!d(string=hai) anos
pai
achega
477bc769b4

+ 7 - 7
src/components/baseEditer.vue

@@ -27,7 +27,7 @@ import store from "../store";
 import { Loading } from "element-ui";
 import { Message } from "element-ui";
 import { SCircleItem } from "@/lib/items/SCircleItem"
-let fengmap = null;
+window.FENGMAP = null;
 //// 底图空间增加字段 isExtracted:boolean true 已被提取过
 export default {
   props: {
@@ -103,7 +103,7 @@ export default {
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
       this.scene = new EditScence();
-      fengmap = new SFengParser(
+      window.FENGMAP = new SFengParser(
         "fengMap",
         this.mapServerURL + "/fmap/" + this.urlMsg.fmapID,
         this.key,
@@ -112,9 +112,9 @@ export default {
         this.mapthemeUrl
       );
       const floorid = this.urlMsg.FloorID;
-      fengmap.loadMap(this.urlMsg.fmapID, resp => {
+      window.FENGMAP.loadMap(this.urlMsg.fmapID, resp => {
         this.floorList = resp;
-        fengmap
+        window.FENGMAP
           .loadTheme(
             `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${this.urlMsg.fmapID}.theme`
           )
@@ -134,10 +134,10 @@ export default {
     parserData(floor) {
       if (floor == "g80") {
         // 屋顶
-        if (fengmap.frImg) {
+        if (window.FENGMAP.frImg) {
           const imgItem = new SImageItem(
             null,
-            `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${fengmap.frImg}`
+            `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${window.FENGMAP.frImg}`
           );
           this.scene.addItem(imgItem);
           this.view.scene = this.scene;
@@ -147,7 +147,7 @@ export default {
         }
       } else {
         if (this.floorList[floor]) {
-          fengmap.parseData(this.floorList[floor], res => {
+          window.FENGMAP.parseData(this.floorList[floor], res => {
             if (res.err) {
               console.log(res.err);
               return;

+ 2 - 0
src/components/edit/attr_select.vue

@@ -499,6 +499,8 @@ export default {
   },
   watch: {
     focusItemList: function(newval) {
+      console.log('------------')
+      console.log(FENGMAP)
       const Item = newval.itemList[0];
       this.getmajorId = Item.data.Properties.InfoSystemId;
       this.imageNum = 1; //切换item初始化

+ 4 - 0
src/components/mapClass/EditScence.ts

@@ -1218,6 +1218,7 @@ export class EditScence extends SGraphScene {
         let minAnchor = null;
         let len: number = -1;
         this.Nodes.forEach(image => {
+            image.showAnchor = false;
             if (image.anchorList && image.anchorList.length) {
                 image.anchorList.forEach(anchor => {
                     let anchorPoint = anchor.mapToScene(0, 0);
@@ -1240,6 +1241,9 @@ export class EditScence extends SGraphScene {
         console.log('-----------------------')
         console.log(minAnchor)
         console.log('-----------------------')
+        if (minAnchor&&minAnchor.parent) {
+            minAnchor.parent.showAnchor = true
+        }
         return minAnchor;
     }