aa9fddf2 by 杨威

层右键菜单

1 parent 685b613d
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
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"> 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">{{cs.sjc}}</td> 15 <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{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)">{{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>
19 </table> 19 </table>
20 <!-- </div> --> 20 <!-- </div> -->
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
28 <table class="chTable" :style="{'top':(ljzzdyHeight+40-1-ljzs.cs.length*65)+'px'}" border="1" cellspacing="0" cellpadding="0"> 28 <table class="chTable" :style="{'top':(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">{{cs.sjc}}</td> 31 <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{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)">{{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>
35 </table> 35 </table>
36 </div> 36 </div>
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
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">{{cs.sjc}}</td> 56 <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{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)">{{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>
60 </table> 60 </table>
61 </div> 61 </div>
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
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">{{cs.sjc}}</td> 68 <td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{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)">{{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>
72 </table> 72 </table>
73 </div> 73 </div>
...@@ -86,10 +86,12 @@ ...@@ -86,10 +86,12 @@
86 :style="{ left: lpbChLeft + 'px', top: lpbChTop + 'px' }" 86 :style="{ left: lpbChLeft + 'px', top: lpbChTop + 'px' }"
87 class="contextmenu" 87 class="contextmenu"
88 > 88 >
89 <li >添加户</li> 89 <li v-show='rightClickFlag=="h"' @click="handleAddH">添加</li>
90 <li >移动户</li> 90 <li v-show='rightClickFlag=="h"' @click="handleMoveH">移动</li>
91 <li >删除户</li> 91 <li v-show='rightClickFlag=="h"' @click="handleDeleteH">删除</li>
92 <li >实预测转换</li> 92 <li v-show='rightClickFlag=="h"' @click="handleSyczh">实预测转换</li>
93 <li v-show='rightClickFlag=="c"' @click="handleAddC">添加</li>
94 <li v-show='rightClickFlag=="c"' @click="handleDeleteC">删除</li>
93 </ul> 95 </ul>
94 </div> 96 </div>
95 </template> 97 </template>
...@@ -122,6 +124,9 @@ export default { ...@@ -122,6 +124,9 @@ export default {
122 lpbChVisible:false, //层户右键菜单显隐 124 lpbChVisible:false, //层户右键菜单显隐
123 lpbChLeft:100, 125 lpbChLeft:100,
124 lpbChTop:100, 126 lpbChTop:100,
127 //右键层户数据
128 chData:'',
129 rightClickFlag:""
125 }; 130 };
126 }, 131 },
127 created() {}, 132 created() {},
...@@ -272,17 +277,40 @@ export default { ...@@ -272,17 +277,40 @@ export default {
272 // }); 277 // });
273 }, 278 },
274 //户右键点击事件 279 //户右键点击事件
275 openMenu(e,item){ 280 openMenu(e,item,type){
276 console.log(e,'e'); 281 console.log(e,'e');
277 this.lpbChLeft = e.pageX; 282 this.lpbChLeft = e.pageX;
278 this.lpbChTop = e.pageY; 283 this.lpbChTop = e.pageY;
279 this.zdData = item; 284 this.chData = item;
280 this.lpbChVisible = true 285 this.rightClickFlag = type;
286 this.lpbChVisible = true;
281 }, 287 },
282 //关闭右键菜单 288 //关闭右键菜单
283 closeMenu(){ 289 closeMenu(){
284 this.lpbChVisible = false 290 this.lpbChVisible = false
285 }, 291 },
292 //户右键菜单 start
293 handleAddH(){
294
295 },
296 handleMoveH(){
297
298 },
299 handleDeleteH(){
300
301 },
302 handleSyczh(){
303
304 },
305 //end
306 // 层右键菜单 start
307 handleAddC(){
308
309 },
310 handleDeleteC(){
311
312 },
313 //end
286 }, 314 },
287 computed: { 315 computed: {
288 createFlagChange() { 316 createFlagChange() {
......