This commit is contained in:
ival 2021-03-01 18:41:04 +08:00
commit 2e2a347f20
4 changed files with 490 additions and 369 deletions

View File

@ -1,8 +1,9 @@
<template>
<li :id="getDomId(item)" :class="item.type === 'separator'?'menu-separator':className?className:'nav-li'" @click.stop="hookClick(item)">
<span v-if="item.type !== 'separator'" :class="className?'label':'nav-li-text'">
<span v-if="item.type !== 'separator'" :class="className?isNextBtn?'triPad label':'label':'nav-li-text'">
{{ item.computedTitle?item.computedTitle(item): item.title }}
</span>
<span v-if="isNextBtn&&item.children" class="triangle" />
<!-- item.title -->
<ul v-if="item.children&&!className" class="nav-ul" :class="{'active' :id==classA}">
<each-child-menu
@ -12,6 +13,7 @@
ref="eachChildMenu"
:item="gridChild"
class-name="menu-li-block"
:is-next-btn="isNextBtn"
/>
</ul>
<div v-if="item.children&&className" class="menu-ul-block-out">
@ -24,6 +26,7 @@
ref="eachChildMenu"
:item="gridChild"
class-name="menu-li-block"
:is-next-btn="isNextBtn"
/>
</ul>
</div>
@ -53,6 +56,12 @@ export default {
default() {
return '';
}
},
isNextBtn:{
type: Boolean,
default() {
return false;
}
}
},
data() {
@ -241,4 +250,18 @@ export default {
position: fixed;
border-left: 1px #CACACA solid;
}
.menu-li-block .triangle{
display: block;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-left: 8px solid #49413e;
border-bottom: 5px solid transparent;
right: 10px;
position: absolute;
top: 10px;
}
.menu-li-block .label.triPad{
padding-right:35px;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div id="menuBar">
<div class="nav">
<each-child-menu v-for="(item,i) in menu" :id="''+i" :key="i" ref="eachChildMenu" :item="item" />
<each-child-menu v-for="(item,i) in menu" :id="''+i" :key="i" ref="eachChildMenu" :item="item" :is-next-btn="isNextBtn" />
</div>
</div>
</template>
@ -23,6 +23,12 @@ export default {
default() {
return null;
}
},
isNextBtn:{
type: Boolean,
default() {
return false;
}
}
},
data() {
@ -32,13 +38,30 @@ export default {
},
watch: {
'$store.state.menuOperation.menuBarIndex': function (newval, oldval) {
if ((oldval !== '' && oldval !== null) && (newval === '' || newval === null)) {
if ((oldval !== '' && oldval !== null)) {
const indexArray = oldval.split(':');
let current = this;
indexArray.forEach(element => {
current = current.$refs.eachChildMenu[element];
current.setClassA(-1);
});
if ((newval === '' || newval === null)) {
indexArray.forEach(element => {
current = current.$refs.eachChildMenu[element];
current.setClassA(-1);
});
} else {
const newArray = newval.split(':');
if (newArray.length === indexArray.length) {
indexArray.forEach(element => {
current = current.$refs.eachChildMenu[element];
});
current.setClassA(-1);
}
if (newArray.length < indexArray.length) {
indexArray.forEach((element, i) => {
current = current.$refs.eachChildMenu[element];
if (element != newArray[i]) { current.setClassA(-1); }
});
}
}
}
},
'$store.state.training.operatemode': function (mode) {

File diff suppressed because it is too large Load Diff

View File

@ -174,11 +174,15 @@ export const OperationEvent = {
operation: '002b',
domId: '_Tips-Mbar-0-reserveMode'
},
/** 批处理*/
batchProcessing: {
/** 批处理*/
batchProcessing: {
operation: '002c',
domId: '_Tips-Mbar-0-batchProcessing'
}
},
limitSpeed:{
operation: '002d',
domId: '_Tips-Mbar-0-limitSpeed'
}
},
// 前端视图指令
view: {
@ -2357,7 +2361,7 @@ export const OperationEvent = {
operation: '6051',
domId: '_Tips-Station-HumanControlALL-Menu{BOTTOM}'
},
confirm: {
confirm: {
operation: '6052',
domId: '_Tips-Station-HumanControlALL-Confirm'
}
@ -2992,14 +2996,14 @@ export const OperationEvent = {
operation: '11003',
domId: '_Tips-Force-Light-Confirm1'
},
confirm2: {
operation: '11004',
domId: '_Tips-Force-Light-Confirm2'
},
choose: {
operation: '11005',
domId: '_Tips-Force-Light-Select'
}
confirm2: {
operation: '11004',
domId: '_Tips-Force-Light-Confirm2'
},
choose: {
operation: '11005',
domId: '_Tips-Force-Light-Select'
}
}
},