This commit is contained in:
fan 2021-07-16 10:51:15 +08:00
commit 27b5fcb962

View File

@ -43,6 +43,7 @@
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: 'MenuTrainList',
data() {
@ -57,7 +58,8 @@ export default {
computed: {
lineCode() {
return this.$route.query.lineCode;
}
},
...mapGetters('map', ['mapConfig'])
},
watch:{
'$store.state.map.activeTrainListUpdate': function (val) {
@ -69,9 +71,10 @@ export default {
activeTrainList.forEach((trainCode)=>{
// train.serviceNumber != '' && train.serviceNumber != undefined &&
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && !train.right && train.sectionCode) {
const isUpDirection = this.mapConfig.upRight ? train.right : !train.right
if (train && isUpDirection && train.sectionCode) {
this.topTrainList.push(train);
} else if (train && train.right && train.sectionCode) {
} else if (train && !isUpDirection && train.sectionCode) {
this.bottomTrainList.push(train);
}
});