北京一号线折返策略

This commit is contained in:
fan 2023-01-16 10:08:07 +08:00
parent 00866bde38
commit 910e0c5712
2 changed files with 13 additions and 10 deletions

View File

@ -43,7 +43,6 @@ class Options {
}
update(payload) {
console.log(payload, '*****---------');
if (Number.isFinite(payload.dx)) {
this.offsetX -= payload.dx;
}

View File

@ -118,12 +118,12 @@ export default {
loadInitData(selected, opts) {
this.tempData = [];
const station = this.stationList.find(n => n.code == selected.stationCode);
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
this.tempData.push({ name: station.name, station: selected.name, strategy: opts ? opts.reentryStrategy : '' });
this.$nextTick(() => {
this.$refs.table.setCurrentRow(null);
});
},
doShow(operate, selected, opts) {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.stationName = '';
@ -132,14 +132,18 @@ export default {
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
this.strategyList.forEach(item => {
if (item.value == opts.reentryStrategy) {
this.stationStrategy = item.label;
}
});
if (selected.typeStrategy === 'DEFAULT') {
this.stationStrategy = '关闭';
} else if (selected.typeStrategy === 'NONE') {
this.stationStrategy = '无折返';
} else if (selected.typeStrategy === 'UNMANNED') {
this.stationStrategy = '无人折返';
} else if (selected.typeStrategy === 'AUTO') {
this.stationStrategy = '自动换端';
}
}
this.loadInitData(selected, opts);
}
this.loadInitData(selected);
}
this.dialogShow = true;