YaolongHan 4 years ago
parent
commit
0fe4855a43

+ 5 - 2
docs/.vuepress/components/tDInsert/addEvent.vue

@@ -106,8 +106,11 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
+
     },
 
     // 鼠标点击事件

+ 4 - 2
docs/.vuepress/components/tDInsert/addEvent1.vue

@@ -108,8 +108,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+        if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 鼠标点击事件

+ 5 - 3
docs/.vuepress/components/tDInsert/addEventShow.vue

@@ -95,13 +95,15 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 鼠标点击事件
     onMousedown(item, e) {
-      alert("鼠标按下!")
+      alert("鼠标按下!");
       console.log("鼠标按下!", item, e);
     },
     // 鼠标抬起事件

+ 4 - 2
docs/.vuepress/components/tDInsert/addEventshow2.vue

@@ -96,8 +96,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 鼠标点击事件

+ 4 - 2
docs/.vuepress/components/tDInsert/addPicture.vue

@@ -96,8 +96,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
       // 获取空间
       this.mapSpace(spaceList);
       // 设备

+ 4 - 2
docs/.vuepress/components/tDInsert/addPicture1.vue

@@ -96,8 +96,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+       if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
       // 获取空间
       this.mapSpace(spaceList);
       // 设备

+ 6 - 4
docs/.vuepress/components/tDInsert/getStart.vue

@@ -1,8 +1,8 @@
 <!-- 画板 -->
 <template>
-  <div  ref="baseMap" class="base-map">
+  <div ref="baseMap" class="base-map">
     <canvas
-    v-loading="loading"
+      v-loading="loading"
       id="floorMap"
       :width="canvasWidth"
       :height="canvasHeight"
@@ -72,8 +72,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 清空画布

+ 4 - 3
docs/.vuepress/components/tDInsert/getStart1.vue

@@ -60,7 +60,6 @@ export default {
       let parser = new SFloorParser();
       parser.parseData(data);
       parser.spaceList.forEach((t) => {
-
         /////////////////////////////////////////
         // 样式调整
         // 是否显示实例
@@ -103,8 +102,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 清空画布

+ 4 - 2
docs/.vuepress/components/tDInsert/getStartShow.vue

@@ -61,8 +61,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+       if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 清空画布

+ 5 - 3
docs/.vuepress/components/tDInsert/getStartShow1.vue

@@ -64,7 +64,7 @@ export default {
         this.scene.addItem(t);
       });
       parser.wallList.forEach((t) => {
-       // 是否显示实例
+        // 是否显示实例
         t.visible = this.isShowWall;
         this.scene.addItem(t);
       });
@@ -89,8 +89,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
     },
 
     // 清空画布

+ 6 - 4
docs/.vuepress/components/tDInsert/partChange.vue

@@ -96,8 +96,10 @@ export default {
         this.scene.addItem(t);
       });
       // 画板是否可拖动
-      this.view.DragMove = true;
-      this.view.fitSceneToView();
+      if (this.view) {
+        this.view.DragMove = true;
+        this.view.fitSceneToView();
+      }
       // 获取空间
       this.mapSpace(spaceList);
       // 设备
@@ -142,7 +144,7 @@ export default {
     },
     // 点击设备
     equipDown(item, e) {
-        this.locationGraphy(item);
+      this.locationGraphy(item);
     },
     // 点击空间
     spaceDown(item, e) {
@@ -152,7 +154,7 @@ export default {
     // 画布移动到中部
     locationGraphy(item) {
       let centerX = this.view.width / 2 - item.x * this.view.scale;
-      let centerY = (this.view.height / 2 - item.y * this.view.scale);
+      let centerY = this.view.height / 2 - item.y * this.view.scale;
       this.view.origin = new SPoint(centerX, centerY);
     },
     // 局部放大

+ 2 - 2
docs/guides/index.js

@@ -95,7 +95,7 @@ const content = [
             ["/guides/tDInsert/addTootip.md", "实现tooltip"],
             ["/guides/tuopuInsert/dragScene.md", "画布拖动"],
             ["/guides/tDInsert/partChange.md", "局部放大与移动"],
-            ["/guides/tDInsert/install.md", "平面图示例代码"],
+            ["/guides/tDInsert/install.md", "平面图示例代码"]
         ]
     },
     {
@@ -109,7 +109,7 @@ const content = [
             ["/guides/tuopuInsert/viewColor.md", "画布颜色"],
             ["/guides/tuopuInsert/derive.md", "派生---设备类"],
             ["/guides/tuopuInsert/anther.md", "修改设备类状态"],
-            ["/guides/tDInsert/install.md", "平面图示例代码"],
+            ["/guides/tDInsert/install.md", "平面图示例代码"]
         ]
     },
     {