宁波一号线 菜单样式调整

This commit is contained in:
joylink_cuiweidong 2021-02-18 15:50:14 +08:00
parent 3366718864
commit 5762399c6b
2 changed files with 74 additions and 87 deletions

View File

@ -135,6 +135,7 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.row = null;
this.restoreBeforeDevices(); this.restoreBeforeDevices();
this.$refs.table.setCurrentRow(); this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -220,9 +221,9 @@ export default {
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 1).then(({valid, operate})=>{ commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 1).then(({valid, operate})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose();
const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode); const signal = this.$store.getters['map/getDeviceByCode'](this.row.startSignalCode);
operate.message = `<div>命令:进路设置</div><div>始端信号机:${signal.name}</div><div>进路:${this.row.name} </div>`; operate.message = `<div>命令:进路设置</div><div>始端信号机:${signal.name}</div><div>进路:${this.row.name} </div>`;
this.doClose();
this.$refs.confirmTip.doShow(operate); this.$refs.confirmTip.doShow(operate);
} }
}).catch(() => { }).catch(() => {
@ -236,7 +237,6 @@ export default {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();

View File

@ -19,65 +19,48 @@
<ul class="nav-ul" :class="{'active' :i==classA}"> <ul class="nav-ul" :class="{'active' :i==classA}">
<template v-for="(child,j) in item.children"> <template v-for="(child,j) in item.children">
<template v-if="child.children && child.children.length > 0"> <template v-if="child.children && child.children.length > 0">
<li v-if="child.type === 'separator'" :key="j" class="menu-separator"> <li v-if="child.type === 'separator'" :key="j" class="menu-separator" />
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li <li
v-else v-else
:id="getDomId(child)" :id="getDomId(child)"
:key="j" :key="j"
class="menu-li" class="menu-li-block"
@click.stop="selectedClassB(child, j)" @click.stop="selectedClassB(child, j)"
> >
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span> <span class="status">&ensp;</span>
<span class="label">{{ child.title }}</span> <span class="label">{{ child.title }}</span>
</span> <div class="menu-ul-block-out">
</div> <div class="menu-ul-block">
<ul class="menu-ul" :class="{'active' :j==classB}"> <ul class="menu-ul" :class="{'active' :j==classB}" style="position:fixed">
<template v-for="(grandchild,k) in child.children"> <template v-for="(grandchild,k) in child.children">
<li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator"> <li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator" />
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li <li
v-else-if="grandchild.show" v-else-if="grandchild.show"
:id="getDomId(grandchild)" :id="getDomId(grandchild)"
:key="k" :key="k"
class="menu-li" class="menu-li-block"
@click.stop="hookClick(grandchild)" @click.stop="hookClick(grandchild)"
> >
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span> <span class="status">&ensp;</span>
<span class="label">{{ grandchild.title }}</span> <span class="label">{{ grandchild.title }}</span>
</span>
</div>
</li> </li>
</template> </template>
</ul> </ul>
</div>
</div>
</li> </li>
</template> </template>
<template v-else> <template v-else>
<li v-if="child.type === 'separator'" :key="j" class="menu-separator"> <li v-if="child.type === 'separator'" :key="j" class="menu-separator" />
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li <li
v-else-if="child.show" v-else-if="child.show"
:id="getDomId(child)" :id="getDomId(child)"
:key="j" :key="j"
class="menu-li" class="menu-li-block"
@click.stop="hookClick(child)" @click.stop="hookClick(child)"
> >
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span> <span class="status">&ensp;</span>
<span class="label">{{ child.title }}</span> <span class="label">{{ child.title }}</span>
</span>
</div>
</li> </li>
</template> </template>
</template> </template>
@ -685,7 +668,7 @@ export default {
initMenu(menu) { initMenu(menu) {
const type = State2SimulationMap[this.$store.state.training.prdType]; const type = State2SimulationMap[this.$store.state.training.prdType];
this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[type], this.$store.state.training.operatemode); this.menu = MenuContextHandler.menuBarConvert(this.menuNormal[type], this.$store.state.training.operatemode);
if (this.menu[2]) { if (this.menu[2] && this.$store.state.training.prdType == '02') {
this.menu[2].children = this.initStationList(); this.menu[2].children = this.initStationList();
} }
this.clickEvent(); this.clickEvent();
@ -977,7 +960,6 @@ export default {
$height: 30px; $height: 30px;
$menuPadding: 10px; $menuPadding: 10px;
$menuItemHeight: 30px; $menuItemHeight: 30px;
$menuItemWidth: 180px;
$menuItemPadding: 5px; $menuItemPadding: 5px;
#menuBar { #menuBar {
@ -1026,11 +1008,11 @@ export default {
list-style: none; list-style: none;
border: 1px solid gray !important; border: 1px solid gray !important;
line-height: $menuItemHeight; line-height: $menuItemHeight;
width: $menuItemWidth; background: #F0F0F0;
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
max-height: 550px; max-height: 550px;
overflow-y: scroll; overflow-y: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 4px; width: 4px;
@ -1053,15 +1035,40 @@ export default {
list-style: none; list-style: none;
background: #F0F0F0; background: #F0F0F0;
line-height: $menuItemHeight; line-height: $menuItemHeight;
width: $menuItemWidth;
bottom: $menuItemHeight;
} }
.active { .menu-ul-block-out{
position: absolute; position: absolute;
display: block !important; width: 100%;
height: 100%;
display: inline-block;
overflow: hidden;
} }
.menu-ul-block{
position: relative;
margin-left: 100%;
overflow-x: hidden;
display: inline-block;
overflow-y: auto;
width: 100%;
height: 30px;
}
.nav-ul.active {
position: absolute;
display: flex;
flex-direction: column;
}
.menu-ul.active{
display: flex;
flex-direction: column;
padding:0;
max-height: 200px;
overflow: auto;
position: fixed;
border-left: 1px #CACACA solid;
}
.menu-ul-text { .menu-ul-text {
font-size: 14px; font-size: 14px;
color: #000; color: #000;
@ -1070,56 +1077,36 @@ export default {
line-height: $menuItemHeight; line-height: $menuItemHeight;
} }
.menu-li {
text-align: left;
background: #F0F0F0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-block { .menu-li-block {
display: flex; display: flex;
flex-direction: row;
justify-content: flex-start;
letter-spacing: 0; letter-spacing: 0;
height: $menuItemHeight; height: $menuItemHeight;
line-height: $menuItemHeight; position: relative;
} }
.menu-li-text { .menu-li-block .status {
font-size: 14px;
color: #000;
}
.menu-li-text .status {
display: inline-block;
border-right: 1px inset #CACACA; border-right: 1px inset #CACACA;
width: $width; width: $width;
display: block;
} }
.menu-li-text .label { .menu-li-block .label {
display: inline-block; font-size: 14px;
display: block;
color: #000;
padding:0px 10px 0px 5px;
line-height: $menuItemHeight;
white-space: nowrap;
} }
.menu-separator { .menu-separator {
text-align: left; text-align: left;
background: #F0F0F0; height: 1px;
height: 2px;
line-height: 2px;
}
.menu-separator .status {
display: inline-block;
border-right: 1px inset #CACACA;
width: $width;
height: 100%;
background: #EFECDE;
}
.menu-separator .separator {
display: inline-block;
background: #CACACA; background: #CACACA;
margin-left: 5px; margin-left:30px;
height: 2px; line-height: 2px;
width: $menuItemWidth - $width - 30px;
} }
.menu-li-block:hover { .menu-li-block:hover {