yangjunjing 5 år sedan
förälder
incheckning
935e86c12c

+ 8 - 4
src/components/business_space/newGraphy/graphy.vue

@@ -9,7 +9,7 @@
     <div class="canvas-box" v-show="FloorMap" v-loading="canvasLoading">
       <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
       <!-- 初始两个按钮 -->
-      <el-row class="buttons-box">
+      <el-row class="buttons-box" v-if="hidden">
         <div>
           <el-autocomplete popper-class="my-autocomplete" v-model="search" :fetch-suggestions="querySearch" placeholder="输入平面图中已有的业务空间名称进行查找"
             width="180px" @select="handleSelect">
@@ -22,7 +22,7 @@
             </template>
           </el-autocomplete>
         </div>
-        <div class="button-group">
+        <div class="button-group" v-if="hidden">
           <!-- 默认操作模式 -->
           <div v-show="type==1">
             <el-dropdown split-button type="primary" @click="editGraphy" @command="handleCommand">
@@ -55,12 +55,12 @@
             <el-button plain @click="cancelGraphy">取 消</el-button>
           </div>
         </div>
-        <div style="position: absolute;right: 0;">
+        <div style="position: absolute;right: 0;" v-if="hidden">
           <el-button type="text" @click="lookUnrelatBSpace(false)">未关联平面图的业务空间 {{num}} 条</el-button>
         </div>
       </el-row>
       <!-- 底部操作按钮 -->
-      <el-row class="canvas-actions-box">
+      <el-row class="canvas-actions-box" v-if="hidden">
         <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo"
           @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
       </el-row>
@@ -156,12 +156,16 @@ export default {
       zoneList: [], // 业务空间-canvas图中
       groupCreateDialogVis: false, //批量创建业务空间弹窗
       groupCreateType: 1, //批量创建方式
+      hidden: true
     }
   },
   computed: {
     ...mapGetters('layout', ['projectId'])
   },
   created() {
+    if(this.$route.name == "spaceLedger"){
+      this.hidden = false;
+    }
   },
   mounted() {
     this.canvasWidth = this.$refs.graphy.offsetWidth;

+ 1 - 1
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -158,7 +158,7 @@ export default {
     },
     changeContentStyle(){
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.query.isMyTab?this.hidden = true:this.hidden = false;
+      this.$route.name == "spaceLedger"?this.hidden = true:this.hidden = false;
       this.heightData = "height:750px";
     }
   },

+ 1 - 1
src/components/business_space/newTables/syInSpaceTable.vue

@@ -121,7 +121,7 @@ export default {
     },
     changeContentStyle(){
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.query.isMyTab?this.hidden = true:this.hidden = false;
+      this.$route.name == "spaceLedger"?this.hidden = true:this.hidden = false;
       this.heightData = "height:750px";
     }
   },

+ 30 - 24
src/views/screen/splitscreen/spaceledger/index.vue

@@ -27,6 +27,10 @@
             <p><b>位置图片:</b></p>
             <graphy ref="graphy"></graphy>
           </div>
+          <div class="space-img">
+            <!-- 业务空间图片,后台未提供 -->
+            <img src="" alt="">
+          </div>
         </el-aside>
         <el-main>
           <el-tabs v-model="activeTab" type='card'>
@@ -37,7 +41,7 @@
                 </div>
                 <!-- 动态数据 -->
                 <div v-if="activeTab === 'dynamicData'" style="width:100%;textAlign:left;">
-                  <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="spaceDetails.ObjectType" :id="`handsontable${spaceDetails.ObjectType}`">
+                  <handsontable-main ref="handsontable" :zoneCode="spaceDetails.ObjectType" :id="`handsontable${spaceDetails.ObjectType}`">
                   </handsontable-main>
                 </div>
                 <div v-if="activeTab === 'objectRelationship'" class="objectRelationship">
@@ -65,7 +69,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { queryZone, getAllbusiness, getDataDictionary } from '@/api/scan/request'
+import { queryZone, getAllbusiness, getDataDictionary, floorQuery, buildingQuery } from '@/api/scan/request'
 import graphy from "@/components/business_space/newGraphy/graphy";
 import eqToSpaceTable from '@/components/business_space/newTables/eqToSpaceTable'
 import syInSpaceTable from '@/components/business_space/newTables/syInSpaceTable'
@@ -84,7 +88,7 @@ export default {
       spaceDetails: {},
       iframeSrc: '',
       projectId: '',
-      params: {},
+      params: {}
     }
   },
   components: {
@@ -99,16 +103,13 @@ export default {
       this.setFrame();
       this.params = this.$route.query;
     }
-    this.$nextTick(() => {
-      this.getSpaceImg();
-    })
   },
   updated() {
-    if (this.activeTab === "dynamicData") {
-      this.$nextTick(() => {
-        this.initMessage();
-      })
-    }
+    // if (this.activeTab === "dynamicData") {
+    //   this.$nextTick(() => {
+    //     this.initMessage();
+    //   })
+    // }
   },
   computed: {
     ...mapGetters('layout', ['userInfo', 'projects', 'userId', 'secret'])
@@ -124,6 +125,10 @@ export default {
       }
       queryZone(params, res => {
         this.spaceDetails = res.Content[0];
+        this.buildFloorSelectd = [this.FloorMap.BuildID,this.FloorMap.FloorID];
+        if(this.spaceDetails.Outline && this.spaceDetails.Outline.length){
+          this.getSpaceFloor();
+        }
       })
       this.setFrame();
     },
@@ -132,11 +137,19 @@ export default {
       this.projectId = localStorage.getItem('projectId');
       this.iframeSrc = `${process.env.BASE_URL}:8889/#/details?perjectId=${this.projectId}&secret=${this.secret}&FmId=${this.$route.query.RoomID}&type=0&code=${this.$route.query.zone}`
     },
+    getSpaceFloor() {
+      // 获取业务空间楼层
+      let params = {
+        Filters: `FloorID='${this.spaceDetails.FloorId}'`
+      }
+      floorQuery(params, res => {
+        this.FloorMap = res.Content[0];
+        this.getSpaceImg();
+      })
+    },
     getSpaceImg() {
-      // 获取业务空间位置图片
-      // console.log(this.spaceDetails, 8888)
-      this.buildFloorSelectd = [this.spaceDetails.BuildingId,this.spaceDetails.FloorId];
-      this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, this.activeTabType);
+      // 获取业务空间楼层图片
+      this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, {code: this.spaceDetails.ObjectType});
     },
     initMessage() {
       let params = {
@@ -148,9 +161,7 @@ export default {
         type: this.spaceDetails.ObjectType
       }
       getDataDictionary(params, res => {
-        console.log(res, 99999)
-        console.log(this.$refs.handsontable,12345678)
-        this.buildFloorSelectd = [this.spaceDetails.BuildingId,this.spaceDetails.FloorId];
+        this.buildFloorSelectd = [this.spaceDetails.BuildingId, this.spaceDetails.FloorId];
         this.$refs.handsontable[0].getHeader(res.Content, this.buildFloorSelectd);
       })
     },
@@ -164,18 +175,13 @@ export default {
         this.initHot();
       });
     },
-    lookEqu(infos) {
-      infos.id = infos.RoomID
-      infos.name = infos.RoomLocalName
-      this.floor.facility = true
-      this.$refs.facility.getData(infos, this.buildMess)
-    },
   },
   watch: {
     // 监听路由地址,并判断有RoomID和zone,重新请求空间数据
     "$route"() {
       if (this.$route.query.RoomID && this.$route.query.zone) {
         this.getData();
+        // window.location.reload();
       }
     }
   }