Bläddra i källkod

'添加计算竖井有关联的空间的垂直交通关系方法'

zhangyu 4 år sedan
förälder
incheckning
ed676359a0
2 ändrade filer med 27 tillägg och 2 borttagningar
  1. 6 0
      src/api/scan/request.js
  2. 21 2
      src/views/ledger/cenotelist/relatedSpace.vue

+ 6 - 0
src/api/scan/request.js

@@ -869,6 +869,12 @@ export function shaftVerticalSpace(param, success) {
   http.postJson(url, param, success)
 }
 
+//计算和当前竖井有关联的空间的垂直交通关系
+export function verticalSpace(param, success) {
+  let url = `${baseUrl}/equip-component/shaft/vertical-space`
+  http.postJson(url, param, success)
+}
+
 //获取租户表格内容信息
 export function getRentTableData(param, success) {
   let url = `${baseUrl}/datacenter/tenant/query-with-count`

+ 21 - 2
src/views/ledger/cenotelist/relatedSpace.vue

@@ -33,7 +33,7 @@
               :value="item.BuildID"></el-option>
           </el-select>
         </el-badge>
-        <el-switch v-if="!cenoteObj.onlyRead" style="margin-left:15px;" v-model="isAI" active-text="打开AI">
+        <el-switch v-if="!cenoteObj.onlyRead" style="margin-left:15px;" v-model="isAI" @change="handleChangeAI" active-text="打开AI">
         </el-switch>
         <div style="height:calc(100% - 42px);margin:10px 0 0 0;width:100%;">
           <el-row style="height:100%;margin:0;width:55%;position:relative;display:inline-block;border:1px solid #e4e4e4;">
@@ -73,7 +73,7 @@ import spaceSelect from "@/components/ledger/lib/spaceSelect";
 import relatedSpaceList from "@/components/ledger/cenote/relatedSpaceList";
 import elevationMap from "@/components/ledger/cenote/elevationMap";
 import addSpaceDialog from '@/components/ledger/cenote/dialog/addSpaceDialog';
-import { queryAllZoneType, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery } from '@/api/scan/request';
+import { queryAllZoneType, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery, verticalSpace } from '@/api/scan/request';
 import cenoteGraphy from '@/components/ledger/lib/cenoteGraphy'
 import { mapGetters } from 'vuex'
 export default {
@@ -251,6 +251,23 @@ export default {
         }
       });
     },
+    //计算 和当前竖井有关联的空间的垂直交通关系
+    calculateRelation() {
+      if (this.isAI &&this.building && this.ObjectType && this.ShaftId) {
+        let params = {
+          BuildingId: this.building,
+          ObjectType: this.ObjectType,
+          ShaftId: this.ShaftId,
+        }
+        verticalSpace(params, res => {
+          console.log(res)
+        })
+      }
+    },
+    //改变AI开关
+    handleChangeAI(val) {
+      this.calculateRelation();
+    },
     //更改业务空间类型
     changeSpace(val) {
       this.ObjectType = val[0];
@@ -259,6 +276,7 @@ export default {
       this.building = '';
       this.changeFloor({FloorID: ''});
       this.loadBuildingData();
+      this.calculateRelation();
     },
     //更换建筑
     changeBuilding(bid) {
@@ -273,6 +291,7 @@ export default {
           }
         }
       })
+      this.calculateRelation();
     },
     //更换楼层
     changeFloor(floorObj) {