Browse Source

受影响的业务空间

haojianlong 5 năm trước cách đây
mục cha
commit
bf23939149

+ 9 - 3
src/api/scan/request.js

@@ -1474,11 +1474,17 @@ export function buildingQueryAndCount(param, success) {
   http.postJson(url, param, success)
 }
 
+// 查询分区统计信息
+export function countObjZone(param, success) {
+  let url = `${baseUrl}/datacenter/object/zone/count`;
+  http.postJson(url, param, success)
+}
+
 // 创建分区信息
 export function createZone(param, success) {
-    let data = param.data
-    let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
-    http.postJson(url, data, success)
+  let data = param.data
+  let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
+  http.postJson(url, data, success)
 }
 
 //删除分区信息

+ 20 - 1
src/components/business_space/newGraphy/graphy.vue

@@ -35,6 +35,8 @@
             <!-- 点击已经关联的业务空间 -->
             <el-button type="primary" plain @click="refactorBSP" :disabled="zoneDisable" style="margin-left:10px;">重新划分业务空间</el-button>
             <el-button type="primary" @click="editeSpaceDetail" :disabled="zoneDisable">编辑空间详情</el-button>
+            <el-button type="primary" plain @click="confirmZoneSpace" :disabled="false||zoneDisable&&curZoneItem.data&&curZoneItem.data.State">确认业务空间
+            </el-button>
             <el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
           </div>
           <!-- 点击已经关联的业务空间 -->
@@ -50,6 +52,7 @@
           <div v-show="type==4">
             <el-button plain @click="cancelGraphy">取 消</el-button>
             <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
+            <el-button type="primary" @click="confirmAndSave">保存并确认业务空间</el-button>
           </div>
           <!-- 批量创建所选业务空间 -->
           <div v-show="type==5">
@@ -331,6 +334,7 @@ export default {
               OutLine: t.Outline,
               RoomID: t.RoomID,
               Color: colorArr[i % colorArr.length],
+              Infected: t.State
             }
           } else {
             console.log('internet slow')
@@ -639,6 +643,21 @@ export default {
       // 将当前业务空间的每个元素添加到场景中并选中
       this.scene.addAllLikeSpace(this.curZoneItem.data.OutLine);
     },
+    // 确认业务空间
+    confirmZoneSpace() {
+      this.curZoneItem.data.State = 0;
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: [this.curZoneItem.data],
+          Projection: ['Outline', 'State']
+        },
+      }
+      updateZone(pa, res => {
+        this.$emit('updataState', '');
+        this.$message.success('更新成功');
+      })
+    },
     // 重新划分--保存
     saveRefactorBSP() {
       let selectSpace = this.scene.getSelectedSpaces();
@@ -1037,7 +1056,7 @@ export default {
   }
   .canvas-actions-box {
     position: absolute;
-    bottom: 20px;
+    bottom: 60px;
     left: 50%;
     transform: translateX(-50%);
     z-index: 999;

+ 37 - 2
src/views/ledger/spacelist/index.vue

@@ -35,6 +35,9 @@
       <div v-show="isMyTab == 2">
         <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
       </div>
+      <div class="infectedTips" v-show="isMyTab==1&&infectedTotal>0">
+        <p>因底图变化而受影响的业务空间{{infectedTotal.toString()}}个,本层受影响的业务空间{{infectedCurfloor.toString()}}个</p>
+      </div>
     </div>
     <div v-show="needCalculate" style="display:flex;align-items:center;justify-content:center;height:100%;background-color:#fff;">
       <div class="center" style="flex:1">
@@ -63,6 +66,7 @@ import {
   queryDictionaryHead, //数据中心-字典头部信息查询接口
   getrelationTypeProject, //数据中心-当该项目中的"建筑体下的业务空间"“楼层下的业务空间”关系的状态为需更新时,业务空间台账功能不可用
   getSpaceBdFlCount, // 属于多建筑楼层的空间数据统计
+  countObjZone, //受影响统计
 } from "@/api/scan/request";
 import tools from '@/utils/scan/tools'
 import floorCascader from "@/components/ledger/lib/floorCascader";
@@ -119,7 +123,9 @@ export default {
       buildFloorSelectd: [''], //当前所选的建筑楼层
       childBackParam: {},
       needCalculate: false, // 关系是否需要计算
-      mutiCount: 0
+      mutiCount: 0,
+      infectedTotal: 1,
+      infectedCurfloor: '-'
     };
   },
   created() {
@@ -134,6 +140,7 @@ export default {
       this.getTypes()
       this.getBuilding()
       this.getMutiCount()
+      this.getInfected();
     },
     // 获取项目下建筑
     getBuilding() {
@@ -163,6 +170,22 @@ export default {
         }
       })
     },
+    // 获取受影响统计
+    getInfected(floor) {
+      let pa = {
+        Filters: `State=1`
+      }
+      if (floor) {
+        pa.Filters += `;FloorId="${floor}"`
+      }
+      countObjZone(pa, res => {
+        if (floor) {
+          this.infectedCurfloor = res.Count
+        } else {
+          this.infectedTotal = res.Count
+        }
+      })
+    },
     // 切换平面图和列表
     changeRadio(val) {
       this.changeGraphyOrTable(val)
@@ -260,6 +283,7 @@ export default {
       if (num == 2) {
         this.initMessage();
       } else {
+        this.getInfected(this.buildFloorSelectd[1]);
         this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, this.activeTabType);
       }
     },
@@ -309,7 +333,7 @@ export default {
       this.floor.facility = true
       this.$refs.facility.getData(infos, this.buildMess)
     },
-    copyID(val){
+    copyID(val) {
       this.$refs.handsontable.zoneItemID = val;
     },
     // 空间属于多个建筑楼层
@@ -432,6 +456,17 @@ export default {
         border-top: 2px solid #409eff;
       }
     }
+    .infectedTips {
+      position: absolute;
+      bottom: 0px;
+      box-sizing: border-box;
+      width: 100%;
+      margin-left: -10px;
+      padding: 0 20px;
+      line-height: 40px;
+      background: #ec808d;
+      color: #fff;
+    }
   }
   .spaceTypes {
     .types {