Kaynağa Gözat

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

shaun-sheep 5 yıl önce
ebeveyn
işleme
e456e8f8b0

+ 114 - 46
src/components/business_space/newGraphy/graphy.vue

@@ -541,33 +541,61 @@ export default {
     },
     // 根据图从未关联平面图的业务空间中选择--按钮返回关联信号
     createFromUnrelated(zoneObj) {
+      // zoneObj.Outline = [];
+      // zoneObj.Height = 0;
+      // let spaces = {}, IspaceIdList = [];
+      // if (this.scene.cutItem || this.scene.sceneMark) {
+      //   // 如果有划分,求交集
+      //   // 格式为Poly(先与业务空间求差集)
+      //   const obj = this.scene.getZoneDifference(true);
+      //   // 差集与楼层平面图或用户划分区域求交集
+      //   spaces = this.scene.getPloyIntersect(obj)
+      // } else {
+      //   // 格式为SPoint[]
+      //   spaces = this.scene.getZoneDifference();
+      // }
+      // for (let key in spaces) {
+      //   spaces[key].map(t => {
+      //     let temp = t.map(item => {
+      //       return {
+      //         X: 1 * item.x.toFixed(2),
+      //         Y: -item.y.toFixed(2),
+      //         Z: 0
+      //       }
+      //     })
+      //     zoneObj.Outline.push([temp]);
+      //   })
+      //   let curISP = this.sourceIdToISP[key];
+      //   curISP && IspaceIdList.push(curISP.RoomID);
+      //   zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+      // }
+
+      // 改回之前逻辑
       zoneObj.Outline = [];
       zoneObj.Height = 0;
       let spaces = {}, IspaceIdList = [];
+      let selectSpaces = this.scene.getSelectedSpaces();
+      selectSpaces.map(t => {
+        zoneObj.Outline.push(t.data.OutLine);
+        let key = t.data.SourceId;
+        let curISP = this.sourceIdToISP[key];
+        curISP && IspaceIdList.push(curISP.RoomID);
+        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+      })
+      // 如果有划分,求交集
       if (this.scene.cutItem || this.scene.sceneMark) {
-        // 如果有划分,求交集
-        // 格式为Poly(先与业务空间求差集)
-        const obj = this.scene.getZoneDifference(true);
-        // 差集与楼层平面图或用户划分区域求交集
-        spaces = this.scene.getPloyIntersect(obj)
-      } else {
-        // 格式为SPoint[]
-        spaces = this.scene.getZoneDifference();
-      }
-      for (let key in spaces) {
-        spaces[key].map(t => {
+        zoneObj.Outline = [];
+        let arr = this.scene.getIntersect();
+        arr.map(t => {
           let temp = t.map(item => {
             return {
-              X: 1 * item.x.toFixed(2),
-              Y: -item.y.toFixed(2),
+              X: 1 * item.x,
+              Y: -item.y,
               Z: 0
             }
           })
           zoneObj.Outline.push([temp]);
         })
-        let curISP = this.sourceIdToISP[key];
-        curISP && IspaceIdList.push(curISP.RoomID);
-        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
       }
       if (!zoneObj.Outline.length) {
         zoneObj.Outline = null;
@@ -656,40 +684,80 @@ export default {
     },
     // 根据图批量创建所选业务空间
     groupCreateZone() {
+      // let arr = this.scene.getSelectedSpaces();
+      // let createSpaces = [], spaces = {};
+      // if (this.scene.cutItem || this.scene.sceneMark) {
+      //   // 如果有划分,求交集
+      //   // 格式为Poly(先与业务空间求差集)
+      //   const obj = this.scene.getZoneDifference(true);
+      //   // 差集与楼层平面图或用户划分区域求交集
+      //   spaces = this.scene.getPloyIntersect(obj)
+      // } else {
+      //   // 格式为SPoint[]
+      //   spaces = this.scene.getZoneDifference();
+      // }
+      // for (let key in spaces) {
+      //   let zoneObj = { Outline: [], Height: 0 }
+      //   spaces[key].map(t => {
+      //     let temp = t.map(item => {
+      //       return {
+      //         X: 1 * item.x.toFixed(2),
+      //         Y: -item.y.toFixed(2),
+      //         Z: 0
+      //       }
+      //     })
+      //     zoneObj.Outline.push([temp]);
+      //   })
+      //   if (!zoneObj.Outline.length) {
+      //     continue
+      //   }
+      //   let curISP = this.sourceIdToISP[key];
+      //   zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+      //   zoneObj.IspaceId = curISP.RoomID;
+      //   zoneObj.RoomLocalName = curISP.RoomLocalName;
+      //   zoneObj.BuildingId = this.buildFloor[0];
+      //   zoneObj.FloorId = this.buildFloor[1];
+      //   createSpaces.push(zoneObj);
+      // }
+      
+      // 改回之前逻辑
       let arr = this.scene.getSelectedSpaces();
-      let createSpaces = [], spaces = {};
+      let createSpaces = [];
+      // 如果有划分,求交集
       if (this.scene.cutItem || this.scene.sceneMark) {
-        // 如果有划分,求交集
-        // 格式为Poly(先与业务空间求差集)
-        const obj = this.scene.getZoneDifference(true);
-        // 差集与楼层平面图或用户划分区域求交集
-        spaces = this.scene.getPloyIntersect(obj)
-      } else {
-        // 格式为SPoint[]
-        spaces = this.scene.getZoneDifference();
-      }
-      for (let key in spaces) {
-        let zoneObj = { Outline: [], Height: 0 }
-        spaces[key].map(t => {
-          let temp = t.map(item => {
-            return {
-              X: 1 * item.x.toFixed(2),
-              Y: -item.y.toFixed(2),
-              Z: 0
-            }
+        let outlines = this.scene.getIntersectInSpace();
+        for (let k in outlines) {
+          outlines[k] = outlines[k].map(t => {
+            t = t.map(item => {
+              item = item.map(j => {
+                return { X: j.x, Y: -j.y, Z: 0 }
+              })
+              return item
+            })
+            return t;
           })
-          zoneObj.Outline.push([temp]);
-        })
-        if (!zoneObj.Outline.length) {
-          continue
         }
-        let curISP = this.sourceIdToISP[key];
-        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
-        zoneObj.IspaceId = curISP.RoomID;
-        zoneObj.RoomLocalName = curISP.RoomLocalName;
-        zoneObj.BuildingId = this.buildFloor[0];
-        zoneObj.FloorId = this.buildFloor[1];
-        createSpaces.push(zoneObj);
+        createSpaces = arr.map(t => {
+          return {
+            IspaceId: this.BIMIDToSID[t.data.SourceId],
+            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
+            Outline: outlines[t.data.SourceId],
+            BuildingId: this.buildFloor[0],
+            FloorId: this.buildFloor[1],
+            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
+          }
+        }).filter(item => item.Outline && item.Outline.length)
+      } else {
+        createSpaces = arr.map(t => {
+          return {
+            IspaceId: this.BIMIDToSID[t.data.SourceId],
+            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
+            Outline: [t.data.OutLine],
+            BuildingId: this.buildFloor[0],
+            FloorId: this.buildFloor[1],
+            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
+          }
+        })
       }
       if (createSpaces.length) {
         this.canvasLoading = true;

+ 21 - 13
src/components/ledger/handsontables/device.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="height: calc(100% - 44.5px);padding: 0px 10px 10px;box-sizing: border-box;">
+  <div style="height: calc(100% - 44.5px);padding: 0px 10px 10px;box-sizing: border-box;" v-loading="loading">
     <div class="hanson-bar">
       <div style="float:right;overflow:hidden;">
         <!-- <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
@@ -86,10 +86,9 @@
       </p>
     </div>
 
-    <div v-show="mess.deviceId && tableData && tableData.length" v-loading="loading" id="handsontable"
-         ref="handsontable"></div>
+    <div v-show="mess.deviceId && tableData && tableData.length" id="handsontable" ref="handsontable"></div>
     <div v-show="mess.deviceId && tableData && tableData.length" class="right">
-      <my-pagination @change="getTableData" :page="page"></my-pagination>
+      <my-pagination @change="getTableData" :page="page" :key="pageKey"></my-pagination>
     </div>
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
     <!-- 关联的系统 -->
@@ -241,6 +240,7 @@
           total: 0,
           currentPage: 1
         },
+        pageKey: new Date().getTime(),
         batchPage: {
           size: 50,
           sizes: [10, 30, 50, 100, 150, 200],
@@ -350,7 +350,16 @@
     methods: {
       //获取表头
       getHeaderData(code) {
-        this.page.currentPage = 1
+        let tempParams = this.$route.params;
+        if (!tempParams.used && tempParams.pageSize) {
+            this.page.currentPage = tempParams.pageNo;
+            this.page.size = tempParams.pageSize;
+            this.onlyRead = tempParams.readOnly;
+            tempParams.used = true;
+        } else {
+            this.page.currentPage = 1
+        }
+        this.pageKey = new Date().getTime();
         this.mess = code
         this.changeCader()
         if (this.mess.deviceId) {
@@ -1044,14 +1053,13 @@
                     return false
                 //包含的部件字段
                 case 'Count':
-                    if (this.onlyRead) {
-                        this.$router.push({path: '/ledger/parts', query: {deviceId: infos.EquipID}});
-                    } else {
-                        this.$router.push({
-                            path: '/ledger/partsmanage',
-                            query: {deviceId: infos.EquipID, typeId: this.mess.deviceId}
-                        });
-                    }
+                    let countUrl = this.onlyRead ? '/ledger/parts' : '/ledger/partsmanage';
+                    this.$router.push({path: countUrl, query: {
+                        deviceId: infos.EquipID,
+                        typeId: this.mess.deviceId,
+                        pageNo: this.page.currentPage,
+                        pageSize: this.page.size
+                    }});
                     return false
                 default:
                     break;

+ 18 - 3
src/views/ledger/facility/parts/index.vue

@@ -10,6 +10,7 @@
         <span>只看要采集的信息</span>
         <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
       </div> -->
+      <el-button size="small" type="default" icon="el-icon-back" @click="goback" style="margin-right:10px;"></el-button>
       <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
@@ -128,13 +129,15 @@ export default {
       mess: {},
       id: 0,
       EquipmentList: [],
-      firmId: "" //品牌型号所需字段
+      firmId: "", //品牌型号所需字段
+      queryParam: {}, //返回到指定位置
     };
   },
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
   created() {
+    this.queryParam = this.$route.query;
     this.deviceId = this.$route.query.deviceId;
     this.getTypes();
   },
@@ -229,7 +232,7 @@ export default {
         columns: this.formatHeaderType(this.tableHeader),
         rowHeights: 30,
         maxRows: this.tableData.length,
-        contextMenu: this.onlyRead ? false :{
+        contextMenu: this.onlyRead ? false : {
           items: {
             remove_row: {
               name: "删除部件"
@@ -486,7 +489,7 @@ export default {
                         item,
                         head.Path,
                         // child.error ? "表号功能号格式错误" : "表号功能号不存在"
-                        child.error ? child.value? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+                        child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
                       );
                     }
                   });
@@ -498,6 +501,18 @@ export default {
           this.tableExample.loadData(this.tableData);
         });
       }
+    },
+    // 返回
+    goback() {
+      this.$router.push({
+        name: 'facilityLedger',
+        params: {
+          deviceId: this.queryParam.typeId,
+          pageNo: this.queryParam.pageNo,
+          pageSize: this.queryParam.pageSize,
+          readOnly: true
+        }
+      })
     }
   }
 };

+ 4 - 2
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -137,7 +137,7 @@ export default {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
   created() {
-    this.category = this.$route.params;
+    this.category = this.$route.query;
     this.category.ParentId = this.category.Code.substr(0, 4);
     this.getBelongs();
     this.getTableHeader();
@@ -224,7 +224,9 @@ export default {
               path: "/ledger/partsmanage",
               query: {
                 deviceId: this.category.deviceId,
-                typeId: this.category.ParentId
+                typeId: this.category.ParentId,
+                pageNo: this.category.pageNo,
+                pageSize: this.category.pageSize
               }
             });
           }

+ 22 - 3
src/views/ledger/facility/partsmanage/index.vue

@@ -10,6 +10,7 @@
         <span>隐藏自动填充的信息</span>
         <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
       </div> -->
+      <el-button size="small" type="default" icon="el-icon-back" @click="goback" style="margin-right:10px;"></el-button>
       <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
@@ -153,13 +154,15 @@ export default {
       id: 0,
       EquipmentList: [],
       firmId: "", //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
-      deviceType: {}
+      deviceType: {},
+      queryParam: {}, //返回到指定位置
     };
   },
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
   created() {
+    this.queryParam = this.$route.query;
     this.deviceId = this.$route.query.deviceId; //设备id
     this.typeId = this.$route.query.typeId; //设备类id
     this.mess.deviceId = this.typeId;
@@ -300,7 +303,11 @@ export default {
       this.activeTab.deviceId = this.deviceId;
       this.$router.push({
         name: "partsadd",
-        params: this.activeTab
+        query: {
+          ...this.activeTab,
+          pageNo: this.queryParam.pageNo,
+          pageSize: this.queryParam.pageSize
+        }
       });
     },
     // 删除表格行
@@ -406,7 +413,7 @@ export default {
         columns: this.formatHeaderType(this.tableHeader),
         rowHeights: 30,
         maxRows: this.tableData.length,
-        contextMenu: this.onlyRead ? false :{
+        contextMenu: this.onlyRead ? false : {
           items: {
             remove_row: {
               name: "删除部件"
@@ -732,6 +739,18 @@ export default {
         })
       }
     },
+    // 返回
+    goback() {
+      this.$router.push({
+        name: 'facilityLedger',
+        params: {
+          deviceId: this.queryParam.typeId,
+          pageNo: this.queryParam.pageNo,
+          pageSize: this.queryParam.pageSize,
+          readOnly: false
+        }
+      })
+    }
   }
 };
 </script>