a43dbd9f by 杨威

监听有无通过输入框查询选择到的户,如果有,将其bsm放入hbsmList

1 parent 42a381e5
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
19 .db{ 19 .db{
20 display: block; 20 display: block;
21 } 21 }
22 .dn{
23 display: none;
24 }
22 .fl{ 25 .fl{
23 float: left; 26 float: left;
24 } 27 }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 <!-- 显示层数 --> 14 <!-- 显示层数 -->
15 <td class="floor">{{cs.sjc}}</td> 15 <td class="floor">{{cs.sjc}}</td>
16 <!-- 显示户 --> 16 <!-- 显示户 -->
17 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td> 17 <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? hs.bsm : ''" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td>
18 </tr> 18 </tr>
19 </table> 19 </table>
20 <!-- </div> --> 20 <!-- </div> -->
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 <!-- 显示层数 --> 30 <!-- 显示层数 -->
31 <td class="floor">{{cs.sjc}}</td> 31 <td class="floor">{{cs.sjc}}</td>
32 <!-- 显示户 --> 32 <!-- 显示户 -->
33 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td> 33 <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? hs.bsm : ''" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td>
34 </tr> 34 </tr>
35 </table> 35 </table>
36 </div> 36 </div>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
55 <!-- 显示层数 --> 55 <!-- 显示层数 -->
56 <td class="floor">{{cs.sjc}}</td> 56 <td class="floor">{{cs.sjc}}</td>
57 <!-- 显示户 --> 57 <!-- 显示户 -->
58 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td> 58 <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? hs.bsm : ''" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td>
59 </tr> 59 </tr>
60 </table> 60 </table>
61 </div> 61 </div>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
67 <!-- 显示层数 --> 67 <!-- 显示层数 -->
68 <td class="floor">{{cs.sjc}}</td> 68 <td class="floor">{{cs.sjc}}</td>
69 <!-- 显示户 --> 69 <!-- 显示户 -->
70 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td> 70 <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? hs.bsm : ''" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.shbw}}</td>
71 </tr> 71 </tr>
72 </table> 72 </table>
73 </div> 73 </div>
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
143 }, 143 },
144 //按照bdcdyh或shbw筛选户 144 //按照bdcdyh或shbw筛选户
145 lpbDataMap(sh){ 145 lpbDataMap(sh){
146 console.log(sh,'sh'); 146 // console.log('查询'+sh);
147 this.searchNum = sh; 147 this.searchNum = sh;
148 }, 148 },
149 //自然幢下元素高度宽度计算 149 //自然幢下元素高度宽度计算
...@@ -258,6 +258,22 @@ export default { ...@@ -258,6 +258,22 @@ export default {
258 this.lpbContentWidth = this.$refs.lpbContent.offsetWidth -6; 258 this.lpbContentWidth = this.$refs.lpbContent.offsetWidth -6;
259 }, 501); 259 }, 501);
260 }, 260 },
261 //监听有无通过输入框查询选择到的户,如果有,将其bsm放入hbsmList
262 searchNum(n){
263 console.log(this.$refs.hBsm,'this.$refs.hBsm');
264 this.$nextTick(()=>{
265 this.$refs.hBsm.forEach(item=>{
266 console.log(item.dataset,'item');
267 if(item.dataset.bsm != ''){
268 console.log(item.dataset.bsm,'item.dataset.bsm');
269 // 判断hbsmList中是否已经存在
270 if(this.hbsmList.indexOf(item.dataset.bsm) == -1){
271 this.hbsmList.push(item.dataset.bsm) // 将户bsm放进hbsmList
272 }
273 }
274 })
275 })
276 }
261 }, 277 },
262 }; 278 };
263 </script> 279 </script>
......