rt-sim-training-client/src/views/newMap/displayNew/menuTrainList.vue

114 lines
3.0 KiB
Vue
Raw Normal View History

<template>
2020-05-26 15:59:11 +08:00
<div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11'}">
<div v-if="drawer" class="menuTrainListBtn" @click="clickBtn">
<i class="el-icon-more" style="font-size: 20px;margin-top: 9px;transform-origin: 50% 50%;transform: rotate(90deg);margin-left: -10px;" /></div>
2020-04-01 12:53:58 +08:00
<div v-else class="menuTrainListBtn1" @click="clickBtn">
<div class="menuTrainListBtn1In">
2020-05-26 15:59:11 +08:00
<i class="el-icon-more" style="font-size: 20px;margin-top: 9px;transform-origin: 50% 50%;transform: rotate(90deg);" />
2020-04-01 12:53:58 +08:00
</div>
</div>
<div
2020-04-01 12:53:58 +08:00
v-show="drawer"
:show-close="false"
style="height: 100%;"
>
2020-04-01 12:53:58 +08:00
<div class="menuTrainList">
2020-04-01 14:14:55 +08:00
<el-table :data="trainList" height="100%" :highlight-current-row="true" @row-click="selectTrain">
2020-04-01 12:53:58 +08:00
<el-table-column property="groupNumber" label="车组号" width="130" />
<el-table-column property="serviceNumber" label="表号" width="130" />
<el-table-column property="tripNumber" label="车次号" width="130" />
2020-04-01 14:14:55 +08:00
<!-- <el-table-column property="right" label="是否上行" width="90" /> -->
2020-04-01 12:53:58 +08:00
</el-table>
</div>
</div>
</div>
</template>
<script>
export default {
2020-04-01 12:53:58 +08:00
name: 'MenuTrainList',
data() {
return {
2020-04-01 12:53:58 +08:00
drawer: false,
trainList:[],
2020-04-01 12:53:58 +08:00
oldDevice: null
};
},
2020-05-26 15:59:11 +08:00
computed: {
lineCode() {
return this.$route.query.lineCode;
}
},
watch:{
2020-04-01 12:53:58 +08:00
'$store.state.map.trainListUpdate': function (val) {
this.trainList = this.$store.state.map.map.trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined;
});
},
2020-04-01 12:53:58 +08:00
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
this.trainList = [];
}
}
},
mounted() {
2020-04-01 12:53:58 +08:00
},
methods:{
clickBtn() {
if (this.drawer) {
this.drawer = false;
} else {
this.drawer = true;
}
},
selectTrain(row, column, event) {
this.setCenter(row.code);
},
// 设置显示中心
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>
<style lang="scss" scoped>
2020-04-01 12:53:58 +08:00
.menuTrainListBtn1In{
width: 20px;
height: 40px;
background: #fff;
text-align: center;
border-radius: 6px 0px 0px 6px;
cursor:pointer;
border: 1px #adadad solid;
}
.menuTrainListBtn1{
position: absolute;
top: 46%;
right:2px;
}
.menuTrainListBtn{
width: 30px;
height: 40px;
background: #fff;
text-align: center;
border-radius: 6px 0px 0px 6px;
position: absolute;
top: 45%;
left: -4%;
z-index: 2;
cursor:pointer;
}
.menuTrainListOut{
position: absolute;
right: 0;
top: 15%;
height: 70%;
2020-04-01 12:53:58 +08:00
}
.menuTrainList{
width: 400px;
height:100%;
border-radius: 10px 0px 0px 10px;
padding: 5px;
background: #fff;
}
</style>