层选中事件
Showing
3 changed files
with
27 additions
and
4 deletions
... | @@ -372,6 +372,7 @@ export default { | ... | @@ -372,6 +372,7 @@ export default { |
372 | lpbContentwidth: "", | 372 | lpbContentwidth: "", |
373 | time: "", | 373 | time: "", |
374 | dyztBsmList: {}, //单元状态bsmList | 374 | dyztBsmList: {}, //单元状态bsmList |
375 | cbsmList:[], // 层bsmlist | ||
375 | }; | 376 | }; |
376 | }, | 377 | }, |
377 | created() { | 378 | created() { |
... | @@ -484,6 +485,11 @@ export default { | ... | @@ -484,6 +485,11 @@ export default { |
484 | } | 485 | } |
485 | console.log(this.bsms); | 486 | console.log(this.bsms); |
486 | }, | 487 | }, |
488 | //获取选中层bsmlist | ||
489 | getCbsm(data){ | ||
490 | this.cbsmList = data; | ||
491 | console.log(this.cbsmList); | ||
492 | }, | ||
487 | //不动产单元号输入框事件 | 493 | //不动产单元号输入框事件 |
488 | inputFocus() { | 494 | inputFocus() { |
489 | this.inputWidth = 200; | 495 | this.inputWidth = 200; | ... | ... |
... | @@ -12,7 +12,7 @@ | ... | @@ -12,7 +12,7 @@ |
12 | <table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0"> | 12 | <table class="chTable" 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')">{{cs.sjc}}层</td> | 15 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
16 | <!-- 显示户 --> | 16 | <!-- 显示户 --> |
17 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> | 17 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> |
18 | </tr> | 18 | </tr> |
... | @@ -28,7 +28,7 @@ | ... | @@ -28,7 +28,7 @@ |
28 | <table class="chTable" border="1" cellspacing="0" cellpadding="0"> | 28 | <table class="chTable" 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')">{{cs.sjc}}层</td> | 31 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
32 | <!-- 显示户 --> | 32 | <!-- 显示户 --> |
33 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> | 33 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> |
34 | </tr> | 34 | </tr> |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | <table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0"> | 53 | <table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0"> |
54 | <tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex"> | 54 | <tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex"> |
55 | <!-- 显示层数 --> | 55 | <!-- 显示层数 --> |
56 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}层</td> | 56 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
57 | <!-- 显示户 --> | 57 | <!-- 显示户 --> |
58 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> | 58 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> |
59 | </tr> | 59 | </tr> |
... | @@ -65,7 +65,7 @@ | ... | @@ -65,7 +65,7 @@ |
65 | <table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs != null && lpbData.cs.length>0" > | 65 | <table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs != null && lpbData.cs.length>0" > |
66 | <tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex"> | 66 | <tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex"> |
67 | <!-- 显示层数 --> | 67 | <!-- 显示层数 --> |
68 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}层</td> | 68 | <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')" @click="handleClickC($event,cs)">{{cs.sjc}}层</td> |
69 | <!-- 显示户 --> | 69 | <!-- 显示户 --> |
70 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> | 70 | <td v-for="(hs,hsIndex) in cs.hs" :data-bsm="hs.bsm" ref="hBsm" :key="hsIndex" :class="(searchNum == hs.shbw || searchNum == hs.bdcdyh) ? 'tdSelect':''" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)" @contextmenu.prevent="openMenu($event, hs,'h')">{{hs.shbw}}</td> |
71 | </tr> | 71 | </tr> |
... | @@ -117,6 +117,7 @@ export default { | ... | @@ -117,6 +117,7 @@ export default { |
117 | ljzzdyHeight: 0, //逻辑幢下幢单元的div高度 | 117 | ljzzdyHeight: 0, //逻辑幢下幢单元的div高度 |
118 | loading: true, | 118 | loading: true, |
119 | hbsmList: [], | 119 | hbsmList: [], |
120 | cbsmList:[], | ||
120 | time: null, //区分单双击事件的定时器 | 121 | time: null, //区分单双击事件的定时器 |
121 | searchNum: Math.random(), | 122 | searchNum: Math.random(), |
122 | //接收父组件传入的根据单元状态/房屋性质/房屋用途筛选的户bsmList | 123 | //接收父组件传入的根据单元状态/房屋性质/房屋用途筛选的户bsmList |
... | @@ -278,6 +279,7 @@ export default { | ... | @@ -278,6 +279,7 @@ export default { |
278 | }, | 279 | }, |
279 | //户右键点击事件 | 280 | //户右键点击事件 |
280 | openMenu(e,item,type){ | 281 | openMenu(e,item,type){ |
282 | debugger | ||
281 | console.log(e,'e'); | 283 | console.log(e,'e'); |
282 | this.lpbChLeft = e.pageX; | 284 | this.lpbChLeft = e.pageX; |
283 | this.lpbChTop = e.pageY; | 285 | this.lpbChTop = e.pageY; |
... | @@ -285,6 +287,20 @@ export default { | ... | @@ -285,6 +287,20 @@ export default { |
285 | this.rightClickFlag = type; | 287 | this.rightClickFlag = type; |
286 | this.lpbChVisible = true; | 288 | this.lpbChVisible = true; |
287 | }, | 289 | }, |
290 | // 层选中事件 | ||
291 | handleClickC(e,item){ | ||
292 | //判断点击的层是否选中 | ||
293 | if (e.target.className.indexOf("tdSelect") == -1) { | ||
294 | //未选中→选中 | ||
295 | e.target.className += " tdSelect"; //加边框 | ||
296 | this.cbsmList.push(item.bsm); // 将户bsm放进hbsmList | ||
297 | } else { | ||
298 | //选中→未选中 | ||
299 | e.target.className = "floor"; | ||
300 | this.deleteArrOption(this.cbsmList,item.bsm); | ||
301 | } | ||
302 | this.$parent.getCbsm(this.cbsmList); | ||
303 | }, | ||
288 | //关闭右键菜单 | 304 | //关闭右键菜单 |
289 | closeMenu(){ | 305 | closeMenu(){ |
290 | this.lpbChVisible = false | 306 | this.lpbChVisible = false |
... | @@ -485,6 +501,7 @@ export default { | ... | @@ -485,6 +501,7 @@ export default { |
485 | background-image: url("../../../../../assets/tdSelect.png"); | 501 | background-image: url("../../../../../assets/tdSelect.png"); |
486 | background-repeat: no-repeat; | 502 | background-repeat: no-repeat; |
487 | background-position: right top; | 503 | background-position: right top; |
504 | background-size: 30px; | ||
488 | } | 505 | } |
489 | } | 506 | } |
490 | } | 507 | } | ... | ... |
-
Please register or sign in to post a comment