This commit is contained in:
fan 2020-05-07 09:03:27 +08:00
commit 30e794ddb8
3 changed files with 99 additions and 17 deletions

View File

@ -769,14 +769,7 @@ export default {
}
});
},
selectedClassB(item, index) {
const order = this.order || 0;
if (this.mode !== TrainingMode.TEACH) { //
this.popupMenuB(item, index);
} else if (this.steps[order] && this.steps[order].type == 'bar') { //
this.popupMenuB(item, index);
}
},
popupMenuB(item, index) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
const operate = {

View File

@ -12,8 +12,8 @@
v-if="handleShow(item)"
:id="getDomId(item)"
:key="i"
class="nav-li"
@click.stop="selectedClassA(item, i)"
:class="i==classA?'nav-li nav-active':'nav-li'"
@click.stop="selectedClassA(item,i)"
>
<span class="nav-li-text">{{ item.title }}</span>
<ul class="nav-ul" :class="{'active' :i==classA}">
@ -23,7 +23,8 @@
:id="getDomId(child)"
:key="j"
class="menu-li"
@click.stop="selectedClassB(child, j)"
@mouseenter="selectedClassB(child, j)"
@mouseleave="tempClassB = -1"
>
<div class="menu-li-block">
<span class="menu-li-text">
@ -31,6 +32,23 @@
<span class="label">{{ child.title }}</span>
</span>
</div>
<ul class="menu-ul" :class="{'active' :j==classB}">
<template v-for="(grandchild,k) in child.children">
<li
:id="getDomId(grandchild)"
:key="k"
class="menu-li"
@click.stop="hookClick(grandchild)"
>
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{ grandchild.title }}</span>
</span>
</div>
</li>
</template>
</ul>
</li>
</template>
<template v-else>
@ -57,6 +75,7 @@
</div>
</template>
<script>
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'MenuBar',
data() {
@ -84,8 +103,44 @@ export default {
operate:{
id:'toolBox'
},
children: [
{
title: '终端',
operate:{
id:'history'
},
click: this.undeveloped
},
{
title: '列点查询',
operate:{
id:'history'
},
click: this.undeveloped
},
{
title: '缩放',
operate:{
id:'history'
},
click: this.undeveloped
},
{
title: '修改密码',
operate:{
id:'history'
},
click: this.undeveloped
},
{
title: '事件导出工具',
operate:{
id:'history'
},
click: this.undeveloped
}
]
},
{
title: '历史',
operate:{
@ -264,6 +319,13 @@ export default {
// const order = this.order || 0;
this.popupMenuA(item, index);
},
selectedClassB(item, index) {
// const order = this.order || 0;
this.popupMenuB(item, index);
},
popupMenuB(item, index) {
this.tempClassB = index;
},
//
popupMenuA(item, index) {
// this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
@ -291,6 +353,11 @@ export default {
closeMenu(flag) {
this.classA = this.tempClassA = -1;
this.classB = this.tempClassB = -1;
},
doClose() {
this.$nextTick(() => {
EventBus.$emit('closeMenu');
});
}
}
};
@ -330,6 +397,7 @@ $menuItemPadding: 5px;
height: 30px;
line-height: 26px;
padding-right: 40px;
background-color: #ACACAC;
border-top: 2px solid #d4d4d4;
border-left: 2px solid #d4d4d4;
border-right: 2px solid #5d5d5d !important;
@ -348,7 +416,7 @@ $menuItemPadding: 5px;
top: 13px;
}
.nav-li:active {
.nav-li:active,.nav-active {
background: #ACACAC;
border-left: 2px solid #565557;
border-top: 2px solid #565557;
@ -371,7 +439,7 @@ $menuItemPadding: 5px;
padding: 0px 40px 0px 10px;
margin: 0px;
max-height: 550px;
overflow-y: scroll;
// overflow-y: scroll;
font-size:13px;
left: -2px;
top: 30px;
@ -397,7 +465,7 @@ $menuItemPadding: 5px;
display: block !important;
}
.nav-li:active {
background: #C9D0E1;
background: #ACACAC;
border-radius: 4px;
}
.menu-li {
@ -405,8 +473,29 @@ $menuItemPadding: 5px;
height: 30px;
line-height: 30px;
white-space: nowrap;
position: relative;
}
.menu-li-block:hover{
color:#fff;
}
.menu-li-block {
display: flex;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-ul {
line-height: $menuItemHeight;
display: none;
list-style: none;
background: #ACACAC;
line-height: 30px;
padding: 0px 40px 0px 10px;
border: 2px #f1f1f1 solid;
top: 0;
left: 100px;
box-shadow: 3px 3px 2px #6d6b6b;
}
</style>

View File

@ -596,10 +596,10 @@ export default {
if (list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(section, 'routingSection');
logicSection.instance.drawBatchSelected(section, '');
});
} else {
section.instance.drawBatchSelected(section, 'routingSection');
section.instance.drawBatchSelected(section, '');
}
});
}