按计划行车状态判断调整

This commit is contained in:
fan 2020-11-05 17:32:48 +08:00
parent cfc6f9648a
commit f09b1aa17d
4 changed files with 11 additions and 36 deletions

View File

@ -149,7 +149,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -198,6 +197,9 @@ export default {
},
scriptModeList() {
return ScriptMode;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -236,8 +238,6 @@ export default {
const initTime = new Date(this.$store.state.training.initTime || null);
const model = {initTime:this.formatTime(initTime)};
this.start(model);
} else {
this.isDisable = true;
}
}
},
@ -286,9 +286,6 @@ export default {
const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`;
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -334,7 +331,6 @@ export default {
});
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -344,7 +340,6 @@ export default {
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -375,7 +370,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -385,7 +379,6 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},

View File

@ -233,14 +233,9 @@ export default {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
} else if (this.isScript) {
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
}
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!');

View File

@ -98,7 +98,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -140,6 +139,9 @@ export default {
},
projectDevice() {
return this.$route.query.projectDevice;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -210,9 +212,6 @@ export default {
console.log(error);
}
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -239,7 +238,6 @@ export default {
this.$refs.setTime.doShow();
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -249,7 +247,6 @@ export default {
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -280,7 +277,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -290,14 +286,12 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then((res)=>{
this.isDisable = false;
EventBus.$emit('clearRunSeries');
this.quitQuest();
this.initLoadPage();

View File

@ -109,7 +109,6 @@ export default {
},
data() {
return {
isDisable: false,
backLoading: false,
chatShow: true,
jsStart: true,
@ -161,6 +160,9 @@ export default {
isDeviceLogin() {
const typeList = ['LW', 'CW'];
return typeList.includes(this.$route.query.type);
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -172,11 +174,6 @@ export default {
});
}
},
'$store.state.training.started': function (val) {
if (val) {
this.isDisable = true;
}
},
'$store.state.socket.simulationOver':function(val) {
if (val && this.project == 'refereeJsxt') {
this.$router.go(-1);
@ -284,7 +281,6 @@ export default {
},
// 仿
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
@ -294,7 +290,6 @@ export default {
}
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -319,13 +314,11 @@ export default {
});
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/resetActiveTrainList', false);
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList', false);
this.$messageBox(this.$t('error.endSimulationFailed'));
});