浏览代码

替换竖井 业务空间类型接口

haojianlong 5 年之前
父节点
当前提交
839204ad62
共有 1 个文件被更改,包括 21 次插入30 次删除
  1. 21 30
      src/views/ledger/cenotelist/relatedSpace.vue

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

@@ -15,10 +15,8 @@
         </div>
         <el-badge :is-dot="showSpaceDot" style="margin-left:15px;">
           <label style="line-height:32px;">业务空间类型:</label>
-          <el-select v-model="space" placeholder="请选择业务空间" @change="changeSpace" style="margin-left:15px;">
-            <el-option v-for="item in spaceList" :key="item.Code" :label="item.Name" :value="item.Code">
-            </el-option>
-          </el-select>
+          <el-cascader v-model="space" placeholder="请选择业务空间" :props="{value:'Code',label:'Name',children:'ZoneType'}" :options="spaceList"
+            @change="changeSpace" style="margin-left:15px;"></el-cascader>
         </el-badge>
       </div>
       <div class="saga-build-tab">
@@ -31,14 +29,11 @@
         <el-badge :is-dot="showBuildDot">
           <label style="line-height:32px;padding: 0 10px;">所属建筑:</label>
           <el-select v-model="building" placeholder="请选择建筑" @change="changeBuilding" v-loading="buildingLoading">
-            <el-option v-for="item in buildingList" :key="item.value" :label="item.BuildLocalName?item.BuildLocalName:item.BuildName" :value="item.BuildID"></el-option>
+            <el-option v-for="item in buildingList" :key="item.value" :label="item.BuildLocalName?item.BuildLocalName:item.BuildName"
+              :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" 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;">
@@ -58,21 +53,16 @@
             </el-col>
           </el-row>
           <div class="elevation-box">
-            <elevation-map 
-              ref="elevationMap" 
-              :onlyRead="cenoteObj.onlyRead" 
-              :isEdit="isEdit" 
-              :isAI="isAI"
-              @elevationChecked="handleCheckedSpace"
-              @elevationUncheck="handleUncheckSpace"
-              :params="{BuildingId: building, ObjectType: space, ShaftId: $route.query.ShaftId}">
+            <elevation-map ref="elevationMap" :onlyRead="cenoteObj.onlyRead" :isEdit="isEdit" :isAI="isAI" @elevationChecked="handleCheckedSpace"
+              @elevationUncheck="handleUncheckSpace" :params="{BuildingId: building, ObjectType: ObjectType, ShaftId: $route.query.ShaftId}">
             </elevation-map>
           </div>
         </div>
 
       </div>
       <div v-show="isMyTab == 2" class="data-item">
-        <related-spaceList :space="space" :buildingList="buildingList" :spaceType="spaceType" :floorType="floorType" ref="relatedSpacelist"></related-spaceList>
+        <related-spaceList :space="ObjectType" :buildingList="buildingList" :spaceType="spaceType" :floorType="floorType" ref="relatedSpacelist">
+        </related-spaceList>
       </div>
     </div>
   </div>
@@ -83,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 { queryDictionaryHead, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery } from '@/api/scan/request';
+import { queryAllZoneType, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery } from '@/api/scan/request';
 import cenoteGraphy from '@/components/ledger/lib/cenoteGraphy'
 import { mapGetters } from 'vuex'
 export default {
@@ -94,7 +84,8 @@ export default {
       building: '',//当前建筑id
       buildingObj: {},//当前建筑obj
       buildingList: [],
-      space: '',//当前业务空间
+      space: [],//当前业务空间
+      ObjectType: '',//业务空间code
       spaceList: [],//空间list
       floor: '',//当前楼层
       dialogVisible: false,//添加空间弹窗
@@ -111,10 +102,10 @@ export default {
       return this.$route.query;
     },
     showSpaceDot() {
-      return this.spaceList.length > 1 && this.cenoteObj.onlyRead?true:false;
+      return this.spaceList.length > 1 && this.cenoteObj.onlyRead ? true : false;
     },
     showBuildDot() {
-      return this.buildingList.length > 1 && this.cenoteObj.onlyRead?true:false;
+      return this.buildingList.length > 1 && this.cenoteObj.onlyRead ? true : false;
     },
     ...mapGetters("layout", ["projectId"])
   },
@@ -129,7 +120,7 @@ export default {
     elevationMap
   },
   created() {
-    this.isAI = this.$route.query.onlyRead?false:true;
+    this.isAI = this.$route.query.onlyRead ? false : true;
     this.getSpaceData();
   },
   methods: {
@@ -148,9 +139,9 @@ export default {
       }
       else {
         let pa = {
-          Filters: `parentId='Space';Code!='Ispace'`
+          Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]
         }
-        queryDictionaryHead(pa, res => {
+        queryAllZoneType(pa, res => {
           this.spaceList = res.Content.map(t => {
             if (t.Name != "元空间") {
               this.spaceType[t.Code] = t.Name;
@@ -164,7 +155,7 @@ export default {
     //默认显示第一个空间
     showDefaultSpace() {
       if (this.spaceList.length) {
-        this.space = this.spaceList.find((item) => {return item.Code == "GeneralZone"})? "GeneralZone": this.spaceList[0].Code;
+        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;
         // }
@@ -183,7 +174,7 @@ export default {
       if (this.cenoteObj.onlyRead) {
         let param = {
           ShaftId: this.$route.query.ShaftId,
-          ObjectType: this.space
+          ObjectType: this.ObjectType
         };
         this.buildingLoading = true;
         shaftSpaceBuildingQuery(param, res => {
@@ -251,7 +242,7 @@ export default {
     },
     //更改业务空间类型
     changeSpace(val) {
-      this.space = val;
+      this.ObjectType = val[val.length - 1];
       this.floor = '';
       this.buildingList = [];
       this.building = '';
@@ -276,7 +267,7 @@ export default {
     changeFloor(fid) {
       this.floor = fid;
       let buildfloor = [this.building, fid]
-      this.$refs.cenotegraphy.getFloorMap(buildfloor, this.space)
+      this.$refs.cenotegraphy.getFloorMap(buildfloor, this.ObjectType)
     },
     //平面图选中空间,立面图对应选中
     handleCheckedSpace(RoomID) {