代码调整

This commit is contained in:
dong 2022-10-28 18:11:34 +08:00
parent 2156ac1880
commit 838b43e54d
2 changed files with 5 additions and 4 deletions

View File

@ -193,9 +193,9 @@ class Handler {
stepOrder = JSON.parse(stepOrder);
let operateOrder = getLocalStorage('operateOrder') || `1`;
operateOrder = JSON.parse(operateOrder);
const step = stepList[stepOrder - 1];
// const index = stepOrder - 1 >= 0 ? stepOrder - 1 : 0;
// const step = stepList[index];
// const step = stepList[stepOrder - 1];
const index = stepOrder - 1 >= 0 ? stepOrder - 1 : 0;
const step = stepList[index];
const stepOperation = step.operations[operateOrder];
return stepOperation;
} catch (e) {

View File

@ -129,7 +129,8 @@ const training = {
},
handleCheckNewTrainingResult:({commit, state}, valid) => {
const stepList = JSON.parse(state.trainingDetail.stepJson);
const step = stepList[state.stepOrder - 1];
const index = state.stepOrder > 0 ? state.stepOrder - 1 : 0;
const step = stepList[index];
if (valid && step.operations.length === (state.operateOrder + 1 )) {
commit('stepOverCountChange');
} else if (valid) {