Procházet zdrojové kódy

编辑器添加顶楼

haojianlong před 4 roky
rodič
revize
256775fb14
4 změnil soubory, kde provedl 54 přidání a 35 odebrání
  1. 5 4
      package-lock.json
  2. 1 1
      package.json
  3. 47 29
      src/components/baseEditer.vue
  4. 1 1
      vue.config.js

+ 5 - 4
package-lock.json

@@ -1090,11 +1090,12 @@
       }
       }
     },
     },
     "@saga-web/feng-map": {
     "@saga-web/feng-map": {
-      "version": "1.0.10",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/feng-map/-/feng-map-1.0.10.tgz",
-      "integrity": "sha512-1eXrpI1fzohSxoGG/NZNHEfC4eH6HgApV6ahwik4JvpJdQvNoqJ7FVNr5puVTeqBC6RML3P+nOmGPn2cA/8axg==",
+      "version": "1.0.11",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/feng-map/-/feng-map-1.0.11.tgz",
+      "integrity": "sha512-aVKLu7TQWWajTl7w7DQ8JAayGHLiiU8phjBqDhCMwGsmUBdc+ep4F3+TQ1Zvz8NAsDBsbiEU1GNPp8zs433JTQ==",
       "requires": {
       "requires": {
-        "@saga-web/big": "1.0.39"
+        "@saga-web/big": "1.0.39",
+        "axios": "^0.18.0"
       }
       }
     },
     },
     "@saga-web/graph": {
     "@saga-web/graph": {

+ 1 - 1
package.json

@@ -11,7 +11,7 @@
     "@saga-web/base": "2.1.19",
     "@saga-web/base": "2.1.19",
     "@saga-web/big": "1.0.39",
     "@saga-web/big": "1.0.39",
     "@saga-web/draw": "2.1.94",
     "@saga-web/draw": "2.1.94",
-    "@saga-web/feng-map": "1.0.10",
+    "@saga-web/feng-map": "1.0.11",
     "@saga-web/graph": "2.1.82",
     "@saga-web/graph": "2.1.82",
     "@saga-web/topology": "1.0.84",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "ant-design-vue": "^1.6.0",

+ 47 - 29
src/components/baseEditer.vue

@@ -15,6 +15,7 @@ import bus from "@/bus";
 import { saveGroup, readGroup } from "@/api/editer.js";
 import { saveGroup, readGroup } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
 import { uuid } from "@/components/mapClass/until";
+import { SImageItem } from '@saga-web/graph/lib'
 import store from "../store";
 import store from "../store";
 
 
 let fengmap = null;
 let fengmap = null;
@@ -60,20 +61,24 @@ export default {
       document.getElementById(`canvas`).focus();
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
       this.clearGraphy();
       this.scene = new EditScence();
       this.scene = new EditScence();
-      console.log(this.urlMsg.fmapID,)
       fengmap = new SFengParser(
       fengmap = new SFengParser(
         "fengMap",
         "fengMap",
-        this.mapServerURL + "/" + this.urlMsg.fmapID,
+        this.mapServerURL + "/fmap/" + this.urlMsg.fmapID,
         this.key,
         this.key,
         this.appName,
         this.appName,
         null
         null
       );
       );
-      const floorid = "f1";
+      console.log(this.urlMsg.fmapID)
+      const floorid = this.urlMsg.FloorID;
       fengmap.loadMap(this.urlMsg.fmapID, resp => {
       fengmap.loadMap(this.urlMsg.fmapID, resp => {
         this.floorList = resp;
         this.floorList = resp;
-        this.parserData(floorid);
+        fengmap.loadTheme(`${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${this.urlMsg.fmapID}.theme`).then(response => {
+          console.log('获取rf成功', response)
+          this.parserData(floorid);
+        })
         this.view.fitSceneToView();
         this.view.fitSceneToView();
       });
       });
+      // 获取主题数据
       this.readGroup().then(data => {
       this.readGroup().then(data => {
         const parserData = new STopologyParser(null);
         const parserData = new STopologyParser(null);
         parserData.parseData(data.data.Data[0].Elements);
         parserData.parseData(data.data.Data[0].Elements);
@@ -114,31 +119,44 @@ export default {
       this.scene.emitChange = this.emitChange;
       this.scene.emitChange = this.emitChange;
     },
     },
     parserData(floor) {
     parserData(floor) {
-      if (this.floorList[floor]) {
-        fengmap.parseData(this.floorList[floor], res => {
-          if (res.err) {
-            console.log(res.err);
-            return;
-          }
-          this.fParser = new SFloorParser(null);
-          this.fParser.parseData(res);
-          this.fParser.spaceList.forEach(t => {
-            t.selectable = true;
-            this.scene.addItem(t);
-          });
-          this.fParser.wallList.forEach(t => this.scene.addItem(t));
-          this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
-          this.fParser.doorList.forEach(t => this.scene.addItem(t));
-          this.fParser.columnList.forEach(t => this.scene.addItem(t));
-          this.fParser.casementList.forEach(t => this.scene.addItem(t));
-          this.view.scene = this.scene;
-          this.view.fitSceneToView();
-          this.loading = false;
-          this.isQuerying = false;
-          console.log("success");
-        });
+      floor = 'g80'
+      if (floor == 'g80') {
+        // 屋顶
+        if (fengmap.frImg) {
+          const imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${fengmap.frImg}`)
+          this.scene.addItem(imgItem)
+          this.view.scene = this.scene
+          this.view.fitSceneToView()
+          this.loading = false
+          this.isQuerying = false
+        }
       } else {
       } else {
-        console.log("楼层不正确");
+        if (this.floorList[floor]) {
+          fengmap.parseData(this.floorList[floor], res => {
+            if (res.err) {
+              console.log(res.err);
+              return;
+            }
+            this.fParser = new SFloorParser(null);
+            this.fParser.parseData(res);
+            this.fParser.spaceList.forEach(t => {
+              t.selectable = true;
+              this.scene.addItem(t);
+            });
+            this.fParser.wallList.forEach(t => this.scene.addItem(t));
+            this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
+            this.fParser.doorList.forEach(t => this.scene.addItem(t));
+            this.fParser.columnList.forEach(t => this.scene.addItem(t));
+            this.fParser.casementList.forEach(t => this.scene.addItem(t));
+            this.view.scene = this.scene;
+            this.view.fitSceneToView();
+            this.loading = false;
+            this.isQuerying = false;
+            console.log("success");
+          });
+        } else {
+          console.log("楼层不正确");
+        }
       }
       }
     },
     },
     // 监听变化
     // 监听变化
@@ -310,7 +328,7 @@ export default {
     params = decodeURIComponent(params);
     params = decodeURIComponent(params);
     // params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
     // params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
     const paramsArr = params.split("&");
     const paramsArr = params.split("&");
-    console.log('paramsArr',paramsArr)
+    console.log('paramsArr', paramsArr)
     const obj = {};
     const obj = {};
     paramsArr.map(item => {
     paramsArr.map(item => {
       const arr = item.split("=");
       const arr = item.split("=");

+ 1 - 1
vue.config.js

@@ -10,7 +10,7 @@ module.exports = {
                 target: 'http://map.wanda.cn',
                 target: 'http://map.wanda.cn',
                 changeOrigin: true,
                 changeOrigin: true,
                 pathRewrite: {
                 pathRewrite: {
-                    '^/wdfn': '/editor/fmap',
+                    '^/wdfn': '/editor',
                 },
                 },
             },
             },
             "/serve": {
             "/serve": {