自动计算站间距离
This commit is contained in:
parent
68340271f1
commit
aa8ae83299
@ -275,9 +275,24 @@ export default {
|
||||
this.runLevelId = val.id;
|
||||
}
|
||||
}
|
||||
},
|
||||
'addModel.startStationCode': function(val) {
|
||||
if (this.addModel.endStationCode && val) {
|
||||
this.getStationDistance();
|
||||
}
|
||||
},
|
||||
'addModel.endStationCode': function(val) {
|
||||
if (this.addModel.startStationCode && val) {
|
||||
this.getStationDistance();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStationDistance() {
|
||||
const startStation = this.$store.getters['map/getDeviceByCode'](this.addModel.startStationCode);
|
||||
const endStation = this.$store.getters['map/getDeviceByCode'](this.addModel.endStationCode);
|
||||
this.addModel.distance = Math.abs(startStation.kmRange - endStation.kmRange);
|
||||
},
|
||||
generateLevel() { // 生成运行等级
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
Loading…
Reference in New Issue
Block a user