综合演练 上下行列表显示问题修复

This commit is contained in:
yuan 2021-07-16 10:30:27 +08:00
parent 79f3df8de6
commit 6a674f7db9

View File

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