a43dbd9f by 杨威

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

1 parent 42a381e5
......@@ -19,6 +19,9 @@
.db{
display: block;
}
.dn{
display: none;
}
.fl{
float: left;
}
......
......@@ -14,7 +14,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
<!-- </div> -->
......@@ -30,7 +30,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -55,7 +55,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -67,7 +67,7 @@
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -143,7 +143,7 @@ export default {
},
//按照bdcdyh或shbw筛选户
lpbDataMap(sh){
console.log(sh,'sh');
// console.log('查询'+sh);
this.searchNum = sh;
},
//自然幢下元素高度宽度计算
......@@ -258,6 +258,22 @@ export default {
this.lpbContentWidth = this.$refs.lpbContent.offsetWidth -6;
}, 501);
},
//监听有无通过输入框查询选择到的户,如果有,将其bsm放入hbsmList
searchNum(n){
console.log(this.$refs.hBsm,'this.$refs.hBsm');
this.$nextTick(()=>{
this.$refs.hBsm.forEach(item=>{
console.log(item.dataset,'item');
if(item.dataset.bsm != ''){
console.log(item.dataset.bsm,'item.dataset.bsm');
// 判断hbsmList中是否已经存在
if(this.hbsmList.indexOf(item.dataset.bsm) == -1){
this.hbsmList.push(item.dataset.bsm) // 将户bsm放进hbsmList
}
}
})
})
}
},
};
</script>
......