aa9fddf2 by 杨威

层右键菜单

1 parent 685b613d
......@@ -12,9 +12,9 @@
<table class="chTable" :style="{'top':(ljzzdyHeight-1-zdys.cs.length*65)+'px'}" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0">
<tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
<!-- </div> -->
......@@ -28,9 +28,9 @@
<table class="chTable" :style="{'top':(ljzzdyHeight+40-1-ljzs.cs.length*65)+'px'}" border="1" cellspacing="0" cellpadding="0">
<tr v-for="(cs) in ljzs.cs" :key="cs.bsm">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -53,9 +53,9 @@
<table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="zdys.cs.length>0">
<tr v-for="(cs,csIndex) in zdys.cs" :key="csIndex">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -65,9 +65,9 @@
<table class="chTable" ref="ch" border="1" cellspacing="0" cellpadding="0" v-show="lpbData.cs != null && lpbData.cs.length>0" >
<tr v-for="(cs,csIndex) in lpbData.cs" :key="csIndex">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<td class="floor" @contextmenu.prevent="openMenu($event, cs,'c')">{{cs.sjc}}</td>
<!-- 显示户 -->
<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>
<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>
</tr>
</table>
</div>
......@@ -86,10 +86,12 @@
:style="{ left: lpbChLeft + 'px', top: lpbChTop + 'px' }"
class="contextmenu"
>
<li >添加户</li>
<li >移动户</li>
<li >删除户</li>
<li >实预测转换</li>
<li v-show='rightClickFlag=="h"' @click="handleAddH">添加</li>
<li v-show='rightClickFlag=="h"' @click="handleMoveH">移动</li>
<li v-show='rightClickFlag=="h"' @click="handleDeleteH">删除</li>
<li v-show='rightClickFlag=="h"' @click="handleSyczh">实预测转换</li>
<li v-show='rightClickFlag=="c"' @click="handleAddC">添加</li>
<li v-show='rightClickFlag=="c"' @click="handleDeleteC">删除</li>
</ul>
</div>
</template>
......@@ -122,6 +124,9 @@ export default {
lpbChVisible:false, //层户右键菜单显隐
lpbChLeft:100,
lpbChTop:100,
//右键层户数据
chData:'',
rightClickFlag:""
};
},
created() {},
......@@ -272,17 +277,40 @@ export default {
// });
},
//户右键点击事件
openMenu(e,item){
openMenu(e,item,type){
console.log(e,'e');
this.lpbChLeft = e.pageX;
this.lpbChTop = e.pageY;
this.zdData = item;
this.lpbChVisible = true
this.chData = item;
this.rightClickFlag = type;
this.lpbChVisible = true;
},
//关闭右键菜单
closeMenu(){
this.lpbChVisible = false
},
//户右键菜单 start
handleAddH(){
},
handleMoveH(){
},
handleDeleteH(){
},
handleSyczh(){
},
//end
// 层右键菜单 start
handleAddC(){
},
handleDeleteC(){
},
//end
},
computed: {
createFlagChange() {
......