楼盘表层户高度计算
Showing
1 changed file
with
13 additions
and
3 deletions
... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
9 | <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" > | 9 | <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" > |
10 | <!-- 循环幢单元下的层户 --> | 10 | <!-- 循环幢单元下的层户 --> |
11 | <!-- <div class="chTable-wrap"> --> | 11 | <!-- <div class="chTable-wrap"> --> |
12 | <table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0"> | 12 | <table class="chTable" :style="{'top':(ljzzdyHeight-1-zdys.cs.length*65)+'px'}" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0"> |
13 | <tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex"> | 13 | <tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex"> |
14 | <!-- 显示层数 --> | 14 | <!-- 显示层数 --> |
15 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> | 15 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
25 | </div> | 25 | </div> |
26 | <!-- 循环逻辑幢下的层户 --> | 26 | <!-- 循环逻辑幢下的层户 --> |
27 | <div class="ljz-ch" :style="{'min-height':ljzzdyHeight+40+'px'}" v-if="ljzs.cs.length>0"> | 27 | <div class="ljz-ch" :style="{'min-height':ljzzdyHeight+40+'px'}" v-if="ljzs.cs.length>0"> |
28 | <table class="chTable" border="1" cellspacing="0" cellpadding="0"> | 28 | <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"> |
29 | <tr v-for="(cs) in ljzs.cs" :key="cs.bsm"> | 29 | <tr v-for="(cs) in ljzs.cs" :key="cs.bsm"> |
30 | <!-- 显示层数 --> | 30 | <!-- 显示层数 --> |
31 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> | 31 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
... | @@ -199,9 +199,11 @@ export default { | ... | @@ -199,9 +199,11 @@ export default { |
199 | //计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度 | 199 | //计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度 |
200 | higher = highest > this.$refs.ch.offsetHeight ? true : false; | 200 | higher = highest > this.$refs.ch.offsetHeight ? true : false; |
201 | this.zdyHeight = higher ? highest : this.$refs.ch.offsetHeight; | 201 | this.zdyHeight = higher ? highest : this.$refs.ch.offsetHeight; |
202 | highest = 0; | ||
202 | this.zdyWidth += this.$refs.ch.offsetWidth; | 203 | this.zdyWidth += this.$refs.ch.offsetWidth; |
203 | } else { | 204 | } else { |
204 | this.zdyHeight = highest; | 205 | this.zdyHeight = highest; |
206 | highest = 0; | ||
205 | } | 207 | } |
206 | } else { | 208 | } else { |
207 | // this.zdyWidth = 124; | 209 | // this.zdyWidth = 124; |
... | @@ -224,13 +226,21 @@ export default { | ... | @@ -224,13 +226,21 @@ export default { |
224 | if (this.$refs.ljzch != undefined) { | 226 | if (this.$refs.ljzch != undefined) { |
225 | //计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度 | 227 | //计算自然幢下的幢单元高度,如果有比层户高的幢单元,则幢单元高度设为最高的幢单元高度,如果没有,则设为层户高度 |
226 | higher = highest > this.$refs.ljzch.offsetHeight ? true : false; | 228 | higher = highest > this.$refs.ljzch.offsetHeight ? true : false; |
229 | this.$nextTick(()=>{ | ||
227 | this.ljzzdyHeight = higher ? highest : this.$refs.ljzch.offsetHeight; | 230 | this.ljzzdyHeight = higher ? highest : this.$refs.ljzch.offsetHeight; |
231 | highest = 0; | ||
232 | }) | ||
228 | } else { | 233 | } else { |
234 | this.$nextTick(()=>{ | ||
229 | this.ljzzdyHeight = highest; | 235 | this.ljzzdyHeight = highest; |
236 | highest = 0; | ||
237 | }) | ||
230 | } | 238 | } |
231 | } else { | 239 | } else { |
232 | // this.zdyWidth = 124; | 240 | // this.zdyWidth = 124; |
233 | } | 241 | } |
242 | |||
243 | |||
234 | }, | 244 | }, |
235 | //户单击事件 | 245 | //户单击事件 |
236 | handleTdClick(e, bsm) { | 246 | handleTdClick(e, bsm) { |
... | @@ -497,7 +507,7 @@ export default { | ... | @@ -497,7 +507,7 @@ export default { |
497 | background-color: blanchedalmond; | 507 | background-color: blanchedalmond; |
498 | } | 508 | } |
499 | td { | 509 | td { |
500 | width: 124px; | 510 | min-width: 124px; |
501 | height: 64px; | 511 | height: 64px; |
502 | line-height: 64px; | 512 | line-height: 64px; |
503 | text-align: center; | 513 | text-align: center; | ... | ... |
-
Please register or sign in to post a comment