0ac9f2de by 杨威

楼盘表层户高度计算

1 parent b54d20d2
......@@ -9,7 +9,7 @@
<div class="ljz-zdy" :style="{'min-height':ljzzdyHeight+40+'px'}" ref="ljzzdy" v-show="ljzs.zdys.length>0" v-for="(zdys,zdyIndex) in ljzs.zdys" :key="zdyIndex" >
<!-- 循环幢单元下的层户 -->
<!-- <div class="chTable-wrap"> -->
<table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0">
<table class="chTable" :style="{'top':(ljzzdyHeight-1-zdys.cs.length*65)+'px'}" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0">
<tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex">
<!-- 显示层数 -->
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}</td>
......@@ -25,7 +25,7 @@
</div>
<!-- 循环逻辑幢下的层户 -->
<div class="ljz-ch" :style="{'min-height':ljzzdyHeight+40+'px'}" v-if="ljzs.cs.length>0">
<table class="chTable" border="1" cellspacing="0" cellpadding="0">
<table class="chTable" :style="{'top':(ljzzdyHeight+40-1-ljzs.cs.length*65)<0? 0:(ljzzdyHeight+40-1-ljzs.cs.length*65) +'px'}" border="1" cellspacing="0" cellpadding="0">
<tr v-for="(cs) in ljzs.cs" :key="cs.bsm">
<!-- 显示层数 -->
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}</td>
......@@ -199,9 +199,11 @@ export default {
//计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度
higher = highest > this.$refs.ch.offsetHeight ? true : false;
this.zdyHeight = higher ? highest : this.$refs.ch.offsetHeight;
highest = 0;
this.zdyWidth += this.$refs.ch.offsetWidth;
} else {
this.zdyHeight = highest;
highest = 0;
}
} else {
// this.zdyWidth = 124;
......@@ -224,13 +226,21 @@ export default {
if (this.$refs.ljzch != undefined) {
//计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度
higher = highest > this.$refs.ljzch.offsetHeight ? true : false;
this.ljzzdyHeight = higher ? highest : this.$refs.ljzch.offsetHeight;
this.$nextTick(()=>{
this.ljzzdyHeight = higher ? highest : this.$refs.ljzch.offsetHeight;
highest = 0;
})
} else {
this.ljzzdyHeight = highest;
this.$nextTick(()=>{
this.ljzzdyHeight = highest;
highest = 0;
})
}
} else {
// this.zdyWidth = 124;
}
},
//户单击事件
handleTdClick(e, bsm) {
......@@ -497,7 +507,7 @@ export default {
background-color: blanchedalmond;
}
td {
width: 124px;
min-width: 124px;
height: 64px;
line-height: 64px;
text-align: center;
......