调整实训步骤校验

This commit is contained in:
zyy 2020-03-27 14:37:28 +08:00
parent 3a8a3b87d8
commit a95e940255
2 changed files with 13 additions and 8 deletions

View File

@ -52,13 +52,17 @@ class ValidateHandler {
const order = Handler.getOrder(); const order = Handler.getOrder();
let valid = false; let valid = false;
if (order < steps.length) { if (operate.over) { // 最后一步不用校验 只校验之前的步骤信息 最后直接发送就可以
const standard = steps[order]; valid = true;
if (operate && standard && } else {
operate.code == standard.code && if (order < steps.length) {
operate.operation == standard.operation && const standard = steps[order];
operate.val == standard.val) { if (operate && standard &&
valid = true; operate.code == standard.code &&
operate.operation == standard.operation &&
operate.val == standard.val) {
valid = true;
}
} }
} }

View File

@ -194,11 +194,12 @@ export default {
'$store.state.map.mapViewLoadedCount': function (val) { // '$store.state.map.mapViewLoadedCount': function (val) { //
this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBox = document.getElementsByTagName('canvas'); this.mapBox = document.getElementsByTagName('canvas');
if (this.trainingId) { if (this.trainingId) {
getTrainingStepsDetailNew(this.trainingId, { group: this.group }).then(resp => { getTrainingStepsDetailNew(this.trainingId, { group: this.group }).then(resp => {
this.trainingObj = resp.data; this.trainingObj = resp.data;
this.$store.dispatch('training/setTrainingData', this.trainingObj); this.$store.dispatch('training/setTrainingData', this.trainingObj);
}).catch(error => {
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
}); });
} }
this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation);