Quellcode durchsuchen

Merge branch 'develop' of git.sagacloud.cn:web/wanda-bm-guide into develop

guoxiaohuan vor 4 Jahren
Ursprung
Commit
2c1ffe1114
2 geänderte Dateien mit 16 neuen und 7 gelöschten Zeilen
  1. 11 4
      src/components/floorList.vue
  2. 5 3
      src/views/equipment/index.vue

+ 11 - 4
src/components/floorList.vue

@@ -11,7 +11,7 @@
                 <img v-show='parseInt(marginTop) !== 0' v-repeat-click='increase' src='@/assets/imgs/iconBlackTop.png' alt />
                 <img class='disabled' v-show='parseInt(marginTop) === 0' src='@/assets/imgs/iconLightTop.png' alt />
             </div>
-            <div class='floor-out'>
+            <div class='floor-out' :style='{ maxHeight:conHeight + "px",height:conHeight + "px" }'>
                 <!--  放开marginTop样式  -->
                 <div class='floor-center' :style='{ marginTop : marginTop }'>
                     <div
@@ -59,9 +59,10 @@ export default {
             marginTopMax: 0,
             startTime: '',
             endTime: '',
-            showNumber: 8, //需要暂时的楼层数   //TODO:
+            showNumber: 8, //需要展示的楼层数   //TODO:
             height: 39, //一个楼层的高度
-            currIndex: 0 //当前楼层在 楼层数组中的下标,上下箭头使用
+            currIndex: 0, //当前楼层在 楼层数组中的下标,上下箭头使用
+            conHeight: 0 // floor-out 的高度
         }
     },
     props: {
@@ -113,6 +114,11 @@ export default {
             if (index === -1) {
                 this.currentFloorId = this.floorIdArr[0]
             }
+            // 修复在设备设施页面中,楼层组件不够 8个楼层时,出现的样式问题,
+            this.conHeight = this.floorsArr.length * 37.5
+            this.conHeight = this.conHeight >= 300 ? 300 : this.conHeight
+            this.showNumber = this.floorsArr.length > 8 ? 8 : this.floorsArr.length
+
             this.marginTopMax = -(this.floorIdArr.length - this.showNumber) * this.height
             this.changeFloor(0, index)
         },
@@ -231,7 +237,8 @@ export default {
         padding: 6px 4px;
         text-align: center;
         .floor-out {
-            max-height: 300px; //TODO:
+            // max-height: 300px; //TODO:
+            min-height: 38px;
             overflow: hidden;
             position: relative;
             overflow-y: auto;

+ 5 - 3
src/views/equipment/index.vue

@@ -93,13 +93,14 @@ export default {
     components: { floorList, eqDialog, floorMap, editList },
     watch: {
         // 监听currentFloor变化,重新渲染楼层组件,解决 数据与视图不照应的问题
-        '$store.state.currentFloor': {
+        /* '$store.state.currentFloor': {
             handler(newV, oldV) {
                 if (newV.seq !== oldV.seq) {
+                    // TODO: keyFL更新
                     this.keyFL = 'keyFL' + new Date().getTime()
                 }
             }
-        }
+        } */
     },
     methods: {
         // 查询tab页
@@ -142,12 +143,13 @@ export default {
             }
         },
         /**
-         * 关闭弹窗,子组件传回父组件,
+         * 关闭弹窗后,重新渲染 楼层组件
          * 在父组件(本组件)内将 ShowDialog 置为false
          * @param {Boolean} flag 弹窗组件传回的标志: 一直传回 true
          */
         closeModal(flag) {
             this.ShowDialog = false
+            this.keyFL = 'keyFL' + new Date().getTime()
         },
         //附加数据图片查看 showView为3展示状态
         additionalColl() {