北京一号线折返策略

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) { update(payload) {
console.log(payload, '*****---------');
if (Number.isFinite(payload.dx)) { if (Number.isFinite(payload.dx)) {
this.offsetX -= payload.dx; this.offsetX -= payload.dx;
} }

View File

@ -118,12 +118,12 @@ export default {
loadInitData(selected, opts) { loadInitData(selected, opts) {
this.tempData = []; this.tempData = [];
const station = this.stationList.find(n => n.code == selected.stationCode); 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.$nextTick(() => {
this.$refs.table.setCurrentRow(null); this.$refs.table.setCurrentRow(null);
}); });
}, },
doShow(operate, selected, opts) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
if (!this.dialogShow) { if (!this.dialogShow) {
this.stationName = ''; this.stationName = '';
@ -132,14 +132,18 @@ export default {
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) { if (station) {
this.stationName = station.name; this.stationName = station.name;
this.strategyList.forEach(item => { if (selected.typeStrategy === 'DEFAULT') {
if (item.value == opts.reentryStrategy) { this.stationStrategy = '关闭';
this.stationStrategy = item.label; } 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; this.dialogShow = true;
@ -177,7 +181,7 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected); this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },