Prechádzať zdrojové kódy

Merge branch 'develop'

YaolongHan 5 rokov pred
rodič
commit
e13ddfcc50

+ 5 - 5
package.json

@@ -8,11 +8,11 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
-    "@saga-web/base": "2.1.25",
-    "@saga-web/big": "1.0.107",
-    "@saga-web/draw": "2.1.106",
-    "@saga-web/feng-map": "1.0.38",
-    "@saga-web/graph": "2.1.123",
+    "@saga-web/base": "2.1.27",
+    "@saga-web/big": "1.0.111",
+    "@saga-web/draw": "2.1.107",
+    "@saga-web/feng-map": "1.0.44",
+    "@saga-web/graph": "2.1.124",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 38 - 26
src/components/baseEditer.vue

@@ -9,7 +9,7 @@
 </template>
 <script>
 import { SFengParser, ProjectRf } from "@saga-web/feng-map";
-import { SFloorParser } from "@saga-web/big";
+import { SFloorParser, SBoardItem } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
 import { EditScence } from "./mapClass/EditScence";
 import bus from "@/bus";
@@ -220,8 +220,16 @@ export default {
         }
       }
     },
+    // 解析楼地板
+    loadBoard(floor){
+      window.FENGMAP.loadFloor(floor, res => {
+        const zone = new SBoardItem(null, res)
+        this.scene.addItem(zone);
+      })
+    },
     // 解析底图
     readBaseMap(floor){
+      this.loadBoard(this.floorList[floor]);
       window.FENGMAP.parseData(this.floorList[floor], res => {
         if (res.err) {
           console.log(res.err);
@@ -784,6 +792,7 @@ export default {
           .then(res => {
             if (res.Result == "success") {
               this.graphId = res.Data;
+              this.scene.undoStack.isChange = false;
               Message({
                 message: "保存成功!",
                 type: "success"
@@ -808,37 +817,40 @@ export default {
     },
     // 自动保存接口
     saveMsgNoMessage() {
-      const Elements = this.scene.saveMsgItem();
-      const Seq = Number(this.urlMsg.seq);
-      const data = {
-        Elements,
-        Name: this.appName, // 名称
-        CategoryId: this.urlMsg.categoryId,
-        ProjectID: this.urlMsg.projectId, // 项目ID
-        BuildingID: this.urlMsg.BuildingID, // 建筑ID
-        FloorID: this.urlMsg.FloorID, // 楼层id
-        Seq // 楼层id
-      };
-      saveGroup(data)
-        .then(res => {
-          if (res.Result == "success") {
-            this.graphId = res.Data;
-            console.log("自动保存成功");
-          } else {
+      if (this.scene.undoStack.isChange) {
+        const Elements = this.scene.saveMsgItem();
+        const Seq = Number(this.urlMsg.seq);
+        const data = {
+          Elements,
+          Name: this.appName, // 名称
+          CategoryId: this.urlMsg.categoryId,
+          ProjectID: this.urlMsg.projectId, // 项目ID
+          BuildingID: this.urlMsg.BuildingID, // 建筑ID
+          FloorID: this.urlMsg.FloorID, // 楼层id
+          Seq // 楼层id
+        };
+        saveGroup(data)
+          .then(res => {
+            if (res.Result == "success") {
+              this.graphId = res.Data;
+              this.scene.undoStack.isChange = false;
+              console.log("自动保存成功");
+            } else {
+              Message({
+                message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
+                type: "error"
+              });
+              console.log("自动保存失败");
+            }
+          })
+          .catch(err => {
             Message({
               message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
               type: "error"
             });
             console.log("自动保存失败");
-          }
-        })
-        .catch(err => {
-          Message({
-            message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
-            type: "error"
           });
-          console.log("自动保存失败");
-        });
+      }
     }
   },
   watch: {

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

@@ -733,7 +733,11 @@ export default {
           if (res.data.result == "success") {
             console.log(res.data);
             if (res.data.data && res.data.data.length) {
-              this.attrCards = this.attrCards.concat(res.data.data);
+              let ZoneData = res.data.data
+              ZoneData.map(item=>{
+                item.type='Zone'
+              })
+              this.attrCards = this.attrCards.concat(ZoneData);
             }
           } else {
             // this.$message.error("工程信息化中的位置信息获取失败");
@@ -755,7 +759,11 @@ export default {
         if (res.data.result == "success") {
           console.log(res.data);
           if (res.data.data && res.data.data.length) {
-            this.attrCards = this.attrCards.concat(res.data.data);
+            let data =  res.data.data;
+            data.map(item=>{
+              item.type='Image'
+            })
+            this.attrCards = this.attrCards.concat(data);
           }
         } else {
           // this.$message.error("工程信息化中的设备信息获取失败");

+ 27 - 13
src/components/edit/edit-dialog.vue

@@ -164,8 +164,8 @@
                     },
                     {
                         title: '设备内码',
-                        dataIndex: 'sbjbm',
-                        key: 'sbjbm',
+                        dataIndex: 'assetnum',
+                        key: 'assetnum',
                         width: '25%',
                     },
                 ],
@@ -232,14 +232,15 @@
                     const lists = [];
                     let arr = [];
                     arr = JSON.parse(JSON.stringify(this.arrList))
+                    console.log(arr);
                     arr.map(item => {
-                        if (item.wzjc) {
-                            lists.push({id: item.location || item.assetnum, name: item.wzjc || item.sbjc, type: 'Zone'})
+                        if (item.type=='Zone') {
+                            lists.push({id: item.location, name: item.wzjc , type: 'Zone'})
                         }
-                        if (item.sbjc) {
+                        if (item.type=='Image') {
                             lists.push({
-                                id: item.location || item.assetnum,
-                                name: item.wzjc || item.sbjc,
+                                id: item.assetnum,
+                                name: item.sbjc,
                                 type: 'Image'
                             })
                         }
@@ -256,11 +257,11 @@
                 console.log(this.selectList);
                 arr = JSON.parse(JSON.stringify(this.selectList))
                 arr.map(item => {
-                    if (item.wzjc) {
-                        lists.push({id: item.location || item.assetnum, name: item.wzjc || item.sbjc, type: 'Zone'})
+                    if (item.type=='Zone') {
+                        lists.push({id: item.location , name: item.wzjc , type: 'Zone'})
                     }
-                    if (item.sbjc) {
-                        lists.push({id: item.location || item.assetnum, name: item.wzjc || item.sbjc, type: 'Image'})
+                    if (item.type=='Image') {
+                        lists.push({id: item.assetnum, name: item.sbjc, type: 'Image'})
                     }
 
                 })
@@ -412,8 +413,17 @@
                     paramData = {classstructureid: this.classstructureid};
                     paramDataLocal = {locfl: this.locfl};
                 }else {
-                    paramData = {classstructureid: this.classstructureid, gname: this.floorId};
-                    paramDataLocal = {locfl: this.locfl, gname: this.floorId};
+                    let gcname = '';
+                    // 取gcname
+                    this.dataFloor.forEach(item=>{
+                        console.log('xxxxxxxx',item,this.floorId)
+                        if(item.gname == this.floorId){
+                            gcname=item.gcname
+                        }
+                    })
+                    paramData = {classstructureid: this.classstructureid, gname: gcname};
+                    console.log('gcname',gcname)
+                    paramDataLocal = {locfl: this.locfl, gname: gcname};
                 }
 
                 this.loading = true;
@@ -587,6 +597,7 @@
                                         item.children = item.data;
                                         item.open = false;
                                         item.checked = 'unchecked';
+                                        item.type='Image';
                                         if (item.children) {
                                             recursion(item.children);
                                         }
@@ -634,6 +645,7 @@
                                     newObj.map(item => {
                                         item.label = item.name;
                                         item.checked = 'unchecked';
+                                        item.type='Zone';
                                         if (item.children) {
                                             recursion(item.children);
                                         }
@@ -653,6 +665,7 @@
             }
         },
         created() {
+            // 取gcname
             this.floorId = getUrlMsg().FloorID;
             //如果有专业就带过来
             if (this.GraphElementId) {
@@ -663,6 +676,7 @@
                     this.selectedRowKeys.push(item.location || item.assetnum)
                 })
                 this.arrList = JSON.parse(JSON.stringify(this.attrCards));
+                console.log(this.arrList);
                 this.selectList = JSON.parse(JSON.stringify(this.attrCards));
             } else {
                 this.selectedRowKeys = [];

+ 9 - 1
src/views/drafts.vue

@@ -94,7 +94,7 @@
 <script>
 import Tree from "./../components/Tree/Tree.vue";
 import { SFengParser, ProjectRf } from "@saga-web/feng-map";
-import { SFloorParser } from "@saga-web/big";
+import { SFloorParser, SBoardItem } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
 import { EditScence } from "@/components/mapClass/EditScence";
 import bus from "@/bus";
@@ -270,6 +270,13 @@ export default {
         }
       }
     },
+    // 解析楼地板
+    loadBoard(floor){
+      fengmap.loadFloor(floor, res => {
+        const zone = new SBoardItem(null, res)
+        this.scene.addItem(zone);
+      })
+    },
     // 顶楼为多张图时计数器
     countRf(len) {
       this.count++
@@ -282,6 +289,7 @@ export default {
       }
     },
     readBaseMap(floor){
+      this.loadBoard(this.floorList[floor])
       fengmap.parseData(this.floorList[floor], res => {
         if (res.err) {
           console.log(res.err);