代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-15 18:04:30 +08:00
parent b72736813a
commit bf4b376d04
2 changed files with 96 additions and 2 deletions

View File

@ -5,7 +5,8 @@
<map-system-draft ref="mapCanvas" @back="back" /> <map-system-draft ref="mapCanvas" @back="back" />
</transition> </transition>
<simulation-menu ref="simulationMenu" :mode="mode" /> <simulation-menu ref="simulationMenu" :mode="mode" />
<!-- 可切换的终端类型 -->
<terminal-list ref="terminalList"/>
</div> </div>
</template> </template>
<script> <script>
@ -13,6 +14,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import SimulationMenu from './simulationMenu'; import SimulationMenu from './simulationMenu';
import TerminalList from './terminalList';
import { clearSimulation, getSimulationInfoNew} from '@/api/simulation'; import { clearSimulation, getSimulationInfoNew} from '@/api/simulation';
import { loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
@ -22,7 +24,8 @@ export default {
name: 'DisplayDraft', name: 'DisplayDraft',
components: { components: {
MapSystemDraft, MapSystemDraft,
SimulationMenu SimulationMenu,
TerminalList
}, },
data() { data() {
return { return {

View File

@ -0,0 +1,91 @@
<template>
<div v-if="isShow" class="terminalList">
<div v-for="(eachTerminal,index) in terminalList" :key="index" :class="active==index?'eachTerminal active':'eachTerminal'" @click="eachTerminal.click(index)">{{ eachTerminal.name }}</div>
</div>
</template>
<script>
export default {
name:'TerminalList',
data() {
return {
terminalList:[],
active:0,
terminalMap:{
'datie':{
'01':[
{name:'现地工作站', code:'localWork', click:this.noEvent},
{name:'车务终端', code:'trafficTerminal', click:this.noEvent},
{name:'车务管理终端', code:'trafficManageTerminal', click:this.noEvent}
],
'02':[
{name:'行调工作站', code:'dispatchWork', click:this.noEvent},
{name:'调度计划', code:'schedulingPlan', click:this.noEvent},
{name:'调度命令', code:'dispatchingCommand', click:this.noEvent}
]
},
'subway':{
'01':[],
'02':[]
}
}
};
},
computed:{
//
isShow() {
return !this.$route.query.projectDevice;
},
// 线
lineCode() {
return this.$route.query.lineCode;
},
// 线
datie() {
return ['16', '19'].includes(this.$route.query.lineCode);
},
prdType() {
return this.$route.query.prdType;
}
},
mounted() {
let currentType = '';
if (this.datie) {
currentType = 'datie';
} else {
currentType = 'subway';
}
this.terminalList = this.terminalMap[currentType][this.prdType];
},
methods:{
noEvent(index) {
this.active = index;
}
}
};
</script>
<style lang="scss" scoped>
.terminalList{
position: absolute;
right: 0px;
top: 45%;
width: 111px;
padding-left: 1px;
padding-top: 1px;
padding-bottom: 1px;
padding-right: 1px;
background: #fff;
border-radius: 5px 0px 0px 5px;
}
.eachTerminal{
padding: 8px 0px;
text-align: center;
border-bottom: 1px #dedede solid;
font-size: 14px;
cursor: pointer;
background: #f5f7fa;
}
.eachTerminal.active{
color:#409eff;
background: #ffff;
}
</style>