Преглед изворни кода

立面图接口调试,和竖井相关bug修改

zhangyu пре 5 година
родитељ
комит
0a78e0b218

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

@@ -1795,8 +1795,13 @@ export function shaftSpaceTypeQuery(param, success) {
   let url = `${baseUrl}/datacenter/sh-contain-sp-base/space-type-query?shaftId=${param.shaftId}`;
   http.postJson(url, param, success)
 }
-//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
+//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
 export function shaftZoneLink(param, success) {
+  let url = `${baseUrl}/datacenter/sh-contain-sp-base/link-shsps`;
+  http.postJson(url, param, success)
+}
+//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
+export function shaftZoneLinkReplace(param, success) {
   let url = `${baseUrl}/datacenter/sh-contain-sp-base/link-shsps-replace?BuildingId=${param.BuildingId}&FloorId=${param.FloorId}&Type=${param.Type}`;
   http.postJson(url, param.data, success)
 }

+ 110 - 105
src/components/ledger/cenote/elevationMap.vue

@@ -32,7 +32,7 @@
 </template>
 
 <script>
-  import { shaftVerticalSpace } from "@/api/scan/request"
+  import { shaftVerticalSpace, shaftZoneLink } from "@/api/scan/request"
 
   import {mapGetters} from 'vuex'
   export default {
@@ -51,105 +51,101 @@
     params: Object,
     onlyRead: Boolean,
     isEdit: Boolean,
-    IsAI: Boolean,
+    isAI: Boolean,
   },
   methods: {
     init () { //获取数据并格式化数据
       //根据isAI判断请求参数是否包含AI推介数据(暂未完成)
-      // if (this.IsAI) {
-
-      // } else {
-
-      // }
+      this.params.AiSwitch = this.isAI
       console.log(this.params)
       this.load = true;
       // 查询竖井关联的空间垂直交通关系
-      // shaftVerticalSpace(this.params, (res) => {
-      // let data = res.Content;
-      let data = [
-        {
-          FloorSequenceID: 5,
-          FloorLocalName: 'F5',
-          ZoneSpaceList: [
-            {
-              RoomID: 'f5-001',
-              IsAI: false,
-              RoomLocalName: '业务空间f5-001',
-              SpaceIdList: ['f4-002']
-            }
-          ]
-        },
-        {
-          FloorSequenceID: 4,
-          FloorLocalName: 'F4',
-          ZoneSpaceList: [{
-            RoomID: 'f4-001',
-            IsAI: true,
-            RoomLocalName: '业务空间f4-001',
-            SpaceIdList: ['f3-002']
-          }, {
-            RoomID: 'f4-002',
-            IsAI: true,
-            RoomLocalName: '业务空间f4-002',
-            SpaceIdList: ['f5-001']
-          }]
-        },
-        {
-          FloorSequenceID: 3,
-          FloorLocalName: 'F3',
-          ZoneSpaceList: [{
-            RoomID: 'f3-001',
-            IsAI: false,
-            RoomLocalName: '业务空间f3-001',
-            SpaceIdList: ['f2-002']
-          }, {
-            RoomID: 'f3-002',
-            IsAI: true,
-            RoomLocalName: '业务空间f3-002',
-            SpaceIdList: ['f2-002','f4-001']
-          }]
-        },
-        {
-          FloorSequenceID: 2,
-          FloorLocalName: 'F2',
-          ZoneSpaceList: [{
-            RoomID: 'f2-001',
-            IsAI: false,
-            RoomLocalName: '业务空间f2-001',
-            SpaceIdList: ['f1-001']
-          }, {
-            RoomID: 'f2-002',
-            IsAI: true,
-            RoomLocalName: '业务空间f2-002',
-            SpaceIdList: ['f3-001','f3-002']
-          }, {
-            RoomID: 'f2-003',
-            IsAI: false,
-            RoomLocalName: '业务空间f2-003',
-            SpaceIdList: []
-          }]
-        },
-        {
-          FloorSequenceID: 1,
-          FloorLocalName: 'F1',
-          ZoneSpaceList: [{
-            RoomID: 'f1-001',
-            IsAI: false,
-            RoomLocalName: '业务空间f1-001',
-            SpaceIdList: ['f2-001']
-          }, {
-            RoomID: 'f1-002',
-            IsAI: false,
-            RoomLocalName: '业务空间f1-002',
-            SpaceIdList: []
-          }, {
-            RoomID: 'f1-003',
-            IsAI: false,
-            RoomLocalName: '业务空间f1-003',
-            SpaceIdList: []
-          }]
-        }
-      ];
+      shaftVerticalSpace(this.params, (res) => {
+        let data = res.Content;
+        // let data = [
+        //   {
+        //     FloorSequenceID: 5,
+        //     FloorLocalName: 'F5',
+        //     ZoneSpaceList: [
+        //       {
+        //         RoomID: 'f5-001',
+        //         IsAI: false,
+        //         RoomLocalName: '业务空间f5-001',
+        //         SpaceIdList: ['f4-002']
+        //       }
+        //     ]
+        //   },
+        //   {
+        //     FloorSequenceID: 4,
+        //     FloorLocalName: 'F4',
+        //     ZoneSpaceList: [{
+        //       RoomID: 'f4-001',
+        //       IsAI: true,
+        //       RoomLocalName: '业务空间f4-001',
+        //       SpaceIdList: ['f3-002']
+        //     }, {
+        //       RoomID: 'f4-002',
+        //       IsAI: true,
+        //       RoomLocalName: '业务空间f4-002',
+        //       SpaceIdList: ['f5-001']
+        //     }]
+        //   },
+        //   {
+        //     FloorSequenceID: 3,
+        //     FloorLocalName: 'F3',
+        //     ZoneSpaceList: [{
+        //       RoomID: 'f3-001',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f3-001',
+        //       SpaceIdList: ['f2-002']
+        //     }, {
+        //       RoomID: 'f3-002',
+        //       IsAI: true,
+        //       RoomLocalName: '业务空间f3-002',
+        //       SpaceIdList: ['f2-002','f4-001']
+        //     }]
+        //   },
+        //   {
+        //     FloorSequenceID: 2,
+        //     FloorLocalName: 'F2',
+        //     ZoneSpaceList: [{
+        //       RoomID: 'f2-001',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f2-001',
+        //       SpaceIdList: ['f1-001']
+        //     }, {
+        //       RoomID: 'f2-002',
+        //       IsAI: true,
+        //       RoomLocalName: '业务空间f2-002',
+        //       SpaceIdList: ['f3-001','f3-002']
+        //     }, {
+        //       RoomID: 'f2-003',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f2-003',
+        //       SpaceIdList: []
+        //     }]
+        //   },
+        //   {
+        //     FloorSequenceID: 1,
+        //     FloorLocalName: 'F1',
+        //     ZoneSpaceList: [{
+        //       RoomID: 'f1-001',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f1-001',
+        //       SpaceIdList: ['f2-001']
+        //     }, {
+        //       RoomID: 'f1-002',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f1-002',
+        //       SpaceIdList: []
+        //     }, {
+        //       RoomID: 'f1-003',
+        //       IsAI: false,
+        //       RoomLocalName: '业务空间f1-003',
+        //       SpaceIdList: []
+        //     }]
+        //   }
+        // ];
         let max = 0, idMap = {}, groupMap = {}, copyData = JSON.parse(JSON.stringify(data));
         this.groupWidth = {};
         copyData.reverse().forEach(floor => {
@@ -201,7 +197,7 @@
         this.elevationData = data
         console.log(this.elevationData)
         this.load = false;
-      // })
+      })
     },
     handleClickCheck (sapceItem) { //点选推介的业务空间
       console.log(this.isEdit)
@@ -218,25 +214,34 @@
       }
     },
     savaEdit () {// 接口保存数据和业务空间的关系
-      console.log(this.checkedList);
-      this.init();
+      let params = {
+        ShaftId: this.params.ShaftId,
+        SpaceIdList: this.checkedList.map(item => {
+          return item.RoomID
+        })
+      }
+      console.log(params);
+      shaftZoneLink(params, res =>{
+        this.$message.success("保存成功");
+        this.init();
+      })
     }
   },
   watch: {
     projectId() {
-      if (this.params.buildingId && this.params.objectType && this.params.shaftId) {
+      if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
         this.init();
       }
       console.log(this.projectId)
     },
-    IsAI() {
-      if (this.params.buildingId && this.params.objectType && this.params.shaftId) {
-        this.init();
-      }
-    },
+    // isAI() {
+    //   if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
+    //     this.init();
+    //   }
+    // },
     params: {
-      handler(val) {
-        if (this.params.buildingId && this.params.objectType && this.params.shaftId) {
+      handler(val,ccc) {
+        if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
           this.init();
         }
       },
@@ -312,7 +317,7 @@
           .saga-spaceItem-checked {
             cursor: pointer;
             box-sizing: border-box;
-            background-color: green;
+            background-color: #1abc9c;
             border: 1px dashed #333333;
           }
         }

+ 2 - 2
src/components/ledger/lib/cenoteGraphy.vue

@@ -22,7 +22,7 @@ import { SColor, SPoint } from "@saga-web/draw/lib";
 import { DivideFloorScene, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
 import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
 import { colorArr } from '@/utils/spaceColor';
-import { getFloorMsgByFloorID, queryZone, shaftSpaceQuery, shaftZoneLink } from '@/api/scan/request';
+import { getFloorMsgByFloorID, queryZone, shaftSpaceQuery, shaftZoneLinkReplace } from '@/api/scan/request';
 import { resolve, reject } from 'q';
 export default {
   data() {
@@ -211,7 +211,7 @@ export default {
       param.data.SpaceIdList = arr.map(t => {
         return t.data.RoomID;
       })
-      shaftZoneLink(param, res => {
+      shaftZoneLinkReplace(param, res => {
         this.config.isEdit = false;
         this.$message.success("保存成功");
         this.getBusinessSpace();

+ 18 - 15
src/views/ledger/cenotelist/relatedSpace.vue

@@ -63,7 +63,7 @@
               :onlyRead="cenoteObj.onlyRead" 
               :isEdit="isEdit" 
               :isAI="isAI"
-              :params="{buildingId: building, objectType: space, shaftId: $route.query.ShaftId}">
+              :params="{BuildingId: building, ObjectType: space, ShaftId: $route.query.ShaftId}">
             </elevation-map>
           </div>
         </div>
@@ -99,8 +99,8 @@ export default {
       spaceType: {},//空间种类
       floorType: {},//子组件楼层信息
       buildingLoading: false,//左侧列表加载
-      showSpaceDot: false,//空间提示红点
-      showBuildDot: false,//楼层提示红点
+      // showSpaceDot: false,//空间提示红点
+      // showBuildDot: false,//楼层提示红点
       isAI: true,//是否打开AI
     }
   },
@@ -108,6 +108,12 @@ export default {
     cenoteObj() {
       return this.$route.query;
     },
+    showSpaceDot() {
+      return this.spaceList.length > 1 && this.cenoteObj.onlyRead?true:false;
+    },
+    showBuildDot() {
+      return this.buildingList.length > 1 && this.cenoteObj.onlyRead?true:false;
+    },
     ...mapGetters("layout", ["projectId"])
   },
   props: {
@@ -121,8 +127,8 @@ export default {
     elevationMap
   },
   created() {
+    this.isAI = this.$route.query.onlyRead?false:true;
     this.getSpaceData();
-    this.isAI = this.cenoteObj.onlyRead?false:true;
   },
   methods: {
     //获取空间信息
@@ -157,9 +163,9 @@ export default {
     showDefaultSpace() {
       if (this.spaceList.length) {
         this.space = this.spaceList.find((item) => {return item.Code == "GeneralZone"})? "GeneralZone": this.spaceList[0].Code;
-        if (this.spaceList.length > 1 && this.cenoteObj.onlyRead) {
-          this.showSpaceDot = true;
-        }
+        // if (this.spaceList.length > 1 && this.cenoteObj.onlyRead) {
+        //   this.showSpaceDot = true;
+        // }
       }
       //处理空间类型
       this.spaceList.map(item => {
@@ -215,16 +221,15 @@ export default {
         this.$refs.relatedSpacelist.setFloorData(this.buildingList);
       }
       if (this.buildingList.length) {
-        if (this.buildingList.length > 1 && this.cenoteObj.onlyRead) {
-          this.showBuildDot = true;
-        }
+        // if (this.buildingList.length > 1 && this.cenoteObj.onlyRead) {
+        //   this.showBuildDot = true;
+        // }
         this.changeBuilding(this.buildingList[0].BuildID);
-      }
-      else {
+      } else {
         this.buildingList = [];
         this.building = '';
         this.floor = '';
-        this.showBuildDot = false;
+        // this.showBuildDot = false;
       }
       this.buildingList.map(item => {
         if (item.BuildID && item.BuildLocalName) {
@@ -241,7 +246,6 @@ export default {
     },
     //更改业务空间类型
     changeSpace(val) {
-      this.showSpaceDot = false;
       this.space = val;
       this.floor = '';
       this.buildingList = [];
@@ -262,7 +266,6 @@ export default {
           }
         }
       })
-      this.showBuildDot = false;
     },
     //更换楼层
     changeFloor(fid) {