bug56 设置运行等级后,查询站台状态显示自动 代码调整

This commit is contained in:
joylink_cuiweidong 2021-01-06 11:27:55 +08:00
parent 923e3ba05c
commit 6e3cdc6bd1
3 changed files with 34 additions and 25 deletions

View File

@ -127,7 +127,8 @@ export default {
},
computed: {
...mapGetters('map', [
'stationList'
'stationList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -157,20 +158,22 @@ export default {
methods: {
loadInitData(selected) {
this.tempData = [];
this.stationList.sort((a, b) => {
return parseInt(a.kmRange) - parseInt(b.kmRange);
});
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
let stationStand, station;
if (selected.direction == '01') { //
if (!selected.right) { //
//
if (index != 0) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && !stand.right);
}
} else {
//
if (index != this.stationList.length - 1) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && stand.right);
}
}
@ -186,7 +189,7 @@ export default {
if (!stationStand || !station) {
this.treeData[2].children[0].value = `自动`;
} else {
this.treeData[2].children[0].value = selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动`;
this.treeData[2].children[0].value = selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工(${selected.runLevelTime})` : `${station.name}${stationStand.name}:自动`;
}
},
doShow(operate, selected) {
@ -247,7 +250,7 @@ export default {
<style lang="scss" scoped>
.content-left{
width: 46%;
width: 34%;
float: left;
height: 24px;
line-height: 24px;
@ -255,7 +258,7 @@ export default {
border-right: 1px solid #f0f0f0;
}
.content-right{
width: 54%;
width: 66%;
float: left;
height: 24px;
line-height: 24px;

View File

@ -198,22 +198,25 @@ export default {
},
loadInitData(selected) {
this.tempData = [];
this.stationList.sort((a, b) => {
return parseInt(a.kmRange) - parseInt(b.kmRange);
});
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { //
let stationStand, station;
if (!selected.right) { //
//
if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: selected.runLevelTime ? this.getLevelByTime(selected.runLevelTime) : '0', time: selected.runLevelTime ? selected.runLevelTime : 0, check: selected.runLevelTimeForever });
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && !stand.right);
}
} else {
//
if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: selected.runLevelTime ? this.getLevelByTime(selected.runLevelTime) : '0', time: selected.runLevelTime ? selected.runLevelTime : 0, check: selected.runLevelTimeForever });
if (index != this.stationList.length - 1) {
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && stand.right);
}
}
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: selected.runLevelTime ? this.getLevelByTime(selected.runLevelTime) : '0', time: selected.runLevelTime ? selected.runLevelTime : 0, check: selected.runLevelTimeForever });
},
doShow(operate, selected) {
this.selected = selected;

View File

@ -69,7 +69,8 @@ export default {
},
computed: {
...mapGetters('map', [
'stationList'
'stationList',
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -92,22 +93,24 @@ export default {
methods: {
loadInitData(selected) {
this.tempData = [];
this.stationList.sort((a, b) => {
return parseInt(a.kmRange) - parseInt(b.kmRange);
});
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
let stationStand, station;
if (!selected.right) { //
//
if (index != 0) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && !stand.right);
}
} else {
//
if (index != this.stationList.length - 1) {
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
station = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
stationStand = this.stationStandList.find(stand => stand.stationCode === station.code && stand.right);
}
}
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
this.tempData.push({ item: this.$t('menu.stationDetainTrain'), status: selected.stationHoldTrain ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
this.tempData.push({ item: this.$t('menu.centerDetainTrain'), status: selected.centerHoldTrain ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
@ -115,7 +118,7 @@ export default {
if (!stationStand || !station) {
this.tempData.push({ item: this.$t('menu.runLevel'), status: this.$t('menu.automatic2') });
} else {
this.tempData.push({ item: this.$t('menu.runLevel'), status: selected.runLevelTime > 0 ? this.$t('menu.to') + station.name + stationStand.name + this.$t('global.colon') + this.$t('menu.artificial') : this.$t('menu.to') + station.name + stationStand.name + this.$t('menu.automatic2') });
this.tempData.push({ item: this.$t('menu.runLevel'), status: selected.runLevelTime > 0 ? this.$t('menu.to') + station.name + stationStand.name + this.$t('global.colon') + this.$t('menu.artificial') + '(' + selected.runLevelTime + ')' : this.$t('menu.to') + station.name + stationStand.name + this.$t('menu.automatic2') });
}
this.tempData.push({ item: this.$t('menu.jumpStop'), status: selected.assignSkip || selected.allSkip ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
this.tempData.push({ item: this.$t('menu.downSwitchbackStrategy'), status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : this.$t('menu.default') });