YaolongHan před 4 roky
rodič
revize
b7bec67477

+ 4 - 4
package-lock.json

@@ -1080,11 +1080,11 @@
       }
     },
     "@saga-web/feng-map": {
-      "version": "1.0.7",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/feng-map/-/feng-map-1.0.7.tgz",
-      "integrity": "sha512-DqMcEuEw8p62toMq/BQK2wavApy1AD20b/e3/dhfyyxPKzR8YotVV7F7E5eCJgWc15CQfzcpozHFQIrYTAxQFQ==",
+      "version": "1.0.8",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/feng-map/-/feng-map-1.0.8.tgz",
+      "integrity": "sha512-t43r0jYpaUu1Pa1g1Vbbzkqhw6kGX++VuDvEjduCjepNHNJXZFSlFjSwsTy5Zun1dtqMvXzKqThpWcIpEgtZjA==",
       "requires": {
-        "@saga-web/big": "^1.0.17"
+        "@saga-web/big": "1.0.35"
       }
     },
     "@saga-web/graph": {

+ 2 - 2
package.json

@@ -11,8 +11,8 @@
     "@saga-web/base": "2.1.16",
     "@saga-web/big": "1.0.35",
     "@saga-web/draw": "2.1.90",
-    "@saga-web/feng-map": "1.0.7",
-    "@saga-web/graph": "2.1.79",
+    "@saga-web/feng-map": "1.0.8",
+    "@saga-web/graph": "2.1.78",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",

+ 48 - 24
src/components/baseEditer.vue

@@ -52,30 +52,30 @@ export default {
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
       this.scene = new EditScence();
-      // this.fmap = new SFengParser(
-      //   "fengMap",
-      //   this.mapServerURL,
-      //   this.key,
-      //   this.appName,
-      //   null
-      // );
-      // this.fmap.parseData("1001724_29", 6, res => {
-      //   this.fParser = new SFloorParser(null);
-      //   this.fParser.parseData(res);
-      //   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.fParser.spaceList.forEach(t => {
-      //     t.selectable = true;
-      //     // t.connect("click", this, this.spaceClick);
-      //     this.scene.addItem(t);
-      //   });
-      this.view.scene = this.scene;
-      this.view.fitSceneToView();
-      // this.$loading.close(loadings)
-      // });
+      this.fmap = new SFengParser(
+        "fengMap",
+        this.mapServerURL,
+        this.key,
+        this.appName,
+        null
+      );
+      this.fmap.parseData("1001724_29", 6, res => {
+        this.fParser = new SFloorParser(null);
+        this.fParser.parseData(res);
+        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.fParser.spaceList.forEach(t => {
+          t.selectable = true;
+          // t.connect("click", this, this.spaceClick);
+          this.scene.addItem(t);
+        });
+        this.view.scene = this.scene;
+        this.view.fitSceneToView();
+        // this.$loading.close(loadings)
+      });
       this.scene.emitChange = this.emitChange;
     },
     // 监听变化
@@ -122,9 +122,33 @@ export default {
       bus.$on("changebackColor", val => {
         this.scene.updatedbackColor(val);
       });
+<<<<<<< HEAD
       bus.$on("deleiteItem", () => {
         this.scene.deleiteItem();
       });
+=======
+      bus.$on("extractItem", () => {
+        const map = {}
+        this.fParser.spaceList.forEach(t => {
+          if (map[t.data.Type]) {
+            map[t.data.Type]++
+          } else {
+            map[t.data.Type] = 1;
+          }
+        })
+        const data = [];
+        for (const key in map) {
+          data.push({
+            key: key,
+            name: key,
+            age: '',
+            number: map[key],
+            address: "提取"
+          })
+        }
+        bus.$emit('exportItem',data)
+      })
+>>>>>>> 21575eaae2b540d7cb1e3e4401e1dbc90a7d279a
     }
   },
   watch: {

+ 9 - 2
src/components/edit/left_toolbar.vue

@@ -114,6 +114,7 @@
 <script>
 import itemTree from "./leftbar_components/itemTree";
 import {queryByGroup} from "@/api/editer.js"
+import bus from "@/bus";
 const columns = [
   {
     title: "名称",
@@ -304,8 +305,12 @@ export default {
     extractItem() {
       this.visible = !this.visible;
       this.activeItem = 3;
-
-      console.log("this.activeItem", this.activeItem);
+      bus.$emit("extractItem")
+    },
+    getBus(){
+      bus.$on("exportItem", data => {
+        this.data = data;
+      })
     }
   },
   watch: {
@@ -321,6 +326,8 @@ export default {
   mounted() {
     const ele = document.getElementById("drawer-model");
     ele.style.width = document.body.offsetWidth - 70 + "px";
+
+    this.getBus();
   }
 };
 </script>

+ 1 - 1
src/components/mapClass/EditScence.ts

@@ -318,7 +318,7 @@ export class EditScence extends SGraphScene {
      * 提取item
      */
     extractItem(): void {
-
+        console.log(this)
     }
 
     /**