Browse Source

Merge branch 'develop'

YaolongHan 4 năm trước cách đây
mục cha
commit
d4b1fc0dbd

+ 3 - 3
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.25",
-    "@saga-web/big": "1.0.106",
+    "@saga-web/big": "1.0.107",
     "@saga-web/draw": "2.1.106",
-    "@saga-web/feng-map": "1.0.36",
-    "@saga-web/graph": "2.1.122",
+    "@saga-web/feng-map": "1.0.38",
+    "@saga-web/graph": "2.1.123",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 27 - 26
src/components/baseEditer.vue

@@ -172,9 +172,9 @@ export default {
       if (floor == "g80") {
         // 屋顶
         if (window.FENGMAP.frImg) {
-          // const pj = this.urlMsg.fmapID.split('_')[0]
-          // // 单张图片
-          // if (!ProjectRf[pj]) {
+          const pj = this.urlMsg.fmapID.split('_')[0]
+          // 单张图片
+          if (!ProjectRf[pj]) {
             const imgItem = new SImageItem(
               null,
               `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${window.FENGMAP.frImg}`
@@ -185,29 +185,29 @@ export default {
             });
             this.scene.addItem(imgItem);
             this.view.scene = this.scene;
-          // } else {
-          //   // 多张图
-          //   try {
-          //     // 初始化0
-          //     this.count = 0;
-          //     ProjectRf[pj].forEach(t => {
-          //       const item = new SImageItem(
-          //         null,
-          //         `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${t.name}`
-          //       );
-          //       item.width = t.width
-          //       item.height = t.width
-          //       item.moveTo(t.x, t.y)
-          //       item.connect("imgLoadOver", this, () => {
-          //         this.countRf(ProjectRf[pj].length);
-          //       });
-          //       this.scene.addItem(item);
-          //     })
-          //     this.view.scene = this.scene;
-          //   } catch(e) {
-          //     console.log(e);
-          //   }
-          // }
+          } else {
+            // 多张图
+            try {
+              // 初始化0
+              this.count = 0;
+              ProjectRf[pj].forEach(t => {
+                const item = new SImageItem(
+                  null,
+                  `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${t.name}`
+                );
+                item.width = t.width
+                item.height = t.height
+                item.moveTo(t.x, t.y)
+                item.connect("imgLoadOver", this, () => {
+                  this.countRf(ProjectRf[pj].length);
+                });
+                this.scene.addItem(item);
+              })
+              this.view.scene = this.scene;
+            } catch(e) {
+              console.log(e);
+            }
+          }
         } else {
           // 屋顶图不为图片
           this.readBaseMap(floor);
@@ -357,6 +357,7 @@ export default {
     // 顶楼为多张图时计数器
     countRf(len) {
       this.count++
+      console.log(len == this.count);
       if (len == this.count) {
         this.readGraph();
       } else {

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

@@ -349,7 +349,7 @@
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <editDialog ref="dialog" :attrCards="attrCards" :GraphElementId="GraphElementId" :InfoLocal="InfoLocal" :sysNum="imageNum" :key="new Date().getTime()" />
+    <editDialog ref="dialog" :attrCards="attrCards" :GraphElementId="GraphElementId" :InfoLocal="InfoLocal" :sysNum="imageNum" :key="keys" />
 <!--    <editDialog ref="dialog" :attrCards="attrCards" :getmajorId="getmajorId" :InfoLocal="InfoLocal" :sysNum="imageNum" :key="new Date().getTime()" />-->
     <!--    <editDialog ref="dialog" :typeEdit="2" :getmajorId="'1001'" :sysNum="5" />-->
   </div>
@@ -475,6 +475,7 @@ export default {
       GraphElementId:'',//图例Id
       CUSTOMbgColor: 'rgba(0,0,0,0.15)', // 自定义多边形背景色
       CUSTOMbdColor: 'rgba(0,0,0,1)', // 自定义多边形线条色
+      keys:new Date().getTime()
     };
   },
   methods: {
@@ -558,7 +559,10 @@ export default {
       }
     },
     handleEdit() {
-      this.$refs.dialog.showModal();
+      this.keys = new Date().getTime()
+      setTimeout(()=>{
+          this.$refs.dialog.showModal();
+      })
     },
     // 修改设备数量
     changeImageNum() {

+ 3 - 3
src/components/edit/edit-dialog.vue

@@ -281,7 +281,7 @@
                     graphElementId:this.GraphElementId,
                 }).then(res=>{
                     this.spinning = false;
-                    let data = res.Data;
+                    const data = res.Data;
                     (function recursion(newObj) {
                         newObj.map(item => {
                             item.label = item.name;
@@ -293,7 +293,7 @@
                     })(data)
                     this.treeData = data;
                     this.treeData.length && this.treeData.map(item=>{
-                        let index = item.name.indexOf('/');
+                        const index = item.name.indexOf('/');
                         item.name = item.name.slice(index+1);
                     })
                 }).catch(()=>{
@@ -330,7 +330,7 @@
             //获取treeId --classstructureid
             onSearchTree(val){
                 console.log(this.majorId);
-                let arr = [];
+                const arr = [];
                 const reg = new RegExp(val, 'g');
                 let flag= false;
                 if(this.majorId=='#'){

+ 50 - 13
src/views/drafts.vue

@@ -93,7 +93,7 @@
 </template>
 <script>
 import Tree from "./../components/Tree/Tree.vue";
-import { SFengParser } from "@saga-web/feng-map";
+import { SFengParser, ProjectRf } from "@saga-web/feng-map";
 import { SFloorParser } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
 import { EditScence } from "@/components/mapClass/EditScence";
@@ -158,7 +158,8 @@ export default {
       BuildingID: "1", // 建筑id
       categoryId: "", //系统类id
       currentNodekey: "", //默认选中的节点树
-      expandedkeys: [] //默认展开的节点树
+      expandedkeys: [], //默认展开的节点树
+      count: 0, // 顶楼为多张图时计数器
     };
   },
   methods: {
@@ -222,17 +223,42 @@ export default {
       if (floor == "g80") {
         // 屋顶
         if (fengmap.frImg) {
-          const imgItem = new SImageItem(
-            null,
-            `${this.mapServerURL}/webtheme/${this.fmapID}/${fengmap.frImg}`
-          );
-          imgItem.showType = SImageShowType.AutoFit;
-          imgItem.connect("imgLoadOver", this, () => {
-            this.view.fitSceneToView();
-          });
-          this.scene.addItem(imgItem);
-          this.loading = false;
-          this.isQuerying = false;
+          const pj = this.fmapID.split('_')[0]
+          if (!ProjectRf[pj]){
+            const imgItem = new SImageItem(
+              null,
+              `${this.mapServerURL}/webtheme/${this.fmapID}/${fengmap.frImg}`
+            );
+            imgItem.showType = SImageShowType.AutoFit;
+            imgItem.connect("imgLoadOver", this, () => {
+              this.view.fitSceneToView();
+            });
+            this.scene.addItem(imgItem);
+            this.loading = false;
+            this.isQuerying = false;
+          } else {
+            // 多张图
+            try {
+              // 初始化0
+              this.count = 0;
+              ProjectRf[pj].forEach(t => {
+                const item = new SImageItem(
+                  null,
+                  `${this.mapServerURL}/webtheme/${this.fmapID}/${t.name}`
+                );
+                item.width = t.width
+                item.height = t.height
+                item.moveTo(t.x, t.y)
+                item.connect("imgLoadOver", this, () => {
+                  this.countRf(ProjectRf[pj].length);
+                });
+                this.scene.addItem(item);
+              })
+              // this.view.scene = this.scene;
+            } catch(e) {
+              console.log(e);
+            }
+          }
         } else {
           this.readBaseMap(floor)
         }
@@ -244,6 +270,17 @@ export default {
         }
       }
     },
+    // 顶楼为多张图时计数器
+    countRf(len) {
+      this.count++
+      console.log(len == this.count);
+      if (len == this.count) {
+        // this.readGraph();
+        this.view.fitSceneToView();
+      } else {
+        console.log('所有图片未加载完成');
+      }
+    },
     readBaseMap(floor){
       fengmap.parseData(this.floorList[floor], res => {
         if (res.err) {