|
@@ -118,6 +118,7 @@ export default {
|
|
// step
|
|
// step
|
|
steps,
|
|
steps,
|
|
curStepIndex: 0,
|
|
curStepIndex: 0,
|
|
|
|
+ finishedSteps: [],
|
|
questionSubmit: false,
|
|
questionSubmit: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -151,27 +152,14 @@ export default {
|
|
]),
|
|
]),
|
|
async initData() {
|
|
async initData() {
|
|
this.setBasicInfo({ ...this.instance });
|
|
this.setBasicInfo({ ...this.instance });
|
|
|
|
+
|
|
|
|
+ // check step status
|
|
|
|
+ await this.initSteps();
|
|
|
|
+
|
|
const params = {
|
|
const params = {
|
|
examId: this.instance.examId,
|
|
examId: this.instance.examId,
|
|
paperNumber: this.instance.paperNumber,
|
|
paperNumber: this.instance.paperNumber,
|
|
};
|
|
};
|
|
- // check step status
|
|
|
|
- const stepRes = await markParamStepStatus(params);
|
|
|
|
- const stepMap = {
|
|
|
|
- subjectiveStruct: 0,
|
|
|
|
- subjectiveMarker: 1,
|
|
|
|
- subjectiveMarkerClass: 2,
|
|
|
|
- objectiveAnswer: 3,
|
|
|
|
- };
|
|
|
|
- const finishedSteps = Object.keys(stepMap)
|
|
|
|
- .filter((key) => stepRes[key])
|
|
|
|
- .map((key) => stepMap[key]);
|
|
|
|
- this.curStepIndex = Math.max(...finishedSteps);
|
|
|
|
- if (this.curStepIndex !== this.lastStep) {
|
|
|
|
- this.curStepIndex++;
|
|
|
|
- }
|
|
|
|
- this.initSteps();
|
|
|
|
-
|
|
|
|
// structure
|
|
// structure
|
|
const structRes = await markStructureList(params);
|
|
const structRes = await markStructureList(params);
|
|
let curMainNumber = null;
|
|
let curMainNumber = null;
|
|
@@ -199,9 +187,36 @@ export default {
|
|
|
|
|
|
this.dataReady = true;
|
|
this.dataReady = true;
|
|
},
|
|
},
|
|
- initSteps() {
|
|
|
|
|
|
+ async initSteps() {
|
|
|
|
+ const stepRes = await markParamStepStatus({
|
|
|
|
+ examId: this.instance.examId,
|
|
|
|
+ paperNumber: this.instance.paperNumber,
|
|
|
|
+ });
|
|
|
|
+ const stepMap = {
|
|
|
|
+ subjectiveStruct: 0,
|
|
|
|
+ subjectiveMarker: 1,
|
|
|
|
+ subjectiveMarkerClass: 2,
|
|
|
|
+ objectiveAnswer: 3,
|
|
|
|
+ };
|
|
|
|
+ this.finishedSteps = Object.keys(stepMap)
|
|
|
|
+ .filter((key) => stepRes[key])
|
|
|
|
+ .map((key) => stepMap[key]);
|
|
|
|
+ if (this.finishedSteps.length > 0) {
|
|
|
|
+ this.curStepIndex = Math.max(...this.finishedSteps);
|
|
|
|
+ if (this.curStepIndex !== this.lastStep) {
|
|
|
|
+ this.curStepIndex++;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.curStepIndex = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.steps = steps.map((step, index) => {
|
|
this.steps = steps.map((step, index) => {
|
|
- step.status = index <= this.curStepIndex ? "success" : "wait";
|
|
|
|
|
|
+ step.status =
|
|
|
|
+ index < this.curStepIndex
|
|
|
|
+ ? "success"
|
|
|
|
+ : index === this.curStepIndex
|
|
|
|
+ ? "process"
|
|
|
|
+ : "wait";
|
|
step.disabled = step.status === "wait";
|
|
step.disabled = step.status === "wait";
|
|
return step;
|
|
return step;
|
|
});
|
|
});
|
|
@@ -228,7 +243,11 @@ export default {
|
|
const nextStepIndex = this.curStepIndex + step;
|
|
const nextStepIndex = this.curStepIndex + step;
|
|
if (nextStepIndex > this.lastStep) return;
|
|
if (nextStepIndex > this.lastStep) return;
|
|
this.steps[this.curStepIndex].status = "success";
|
|
this.steps[this.curStepIndex].status = "success";
|
|
- this.steps[nextStepIndex].status = "success";
|
|
|
|
|
|
+ if (!this.finishedSteps.includes(this.curStepIndex)) {
|
|
|
|
+ this.finishedSteps.push(this.curStepIndex);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.steps[nextStepIndex].status = "process";
|
|
this.curStepIndex = nextStepIndex;
|
|
this.curStepIndex = nextStepIndex;
|
|
this.steps.forEach((item) => {
|
|
this.steps.forEach((item) => {
|
|
item.disabled = item.status === "wait";
|
|
item.disabled = item.status === "wait";
|
|
@@ -239,7 +258,18 @@ export default {
|
|
const prevStepIndex = this.curStepIndex - step;
|
|
const prevStepIndex = this.curStepIndex - step;
|
|
if (prevStepIndex < 0) return;
|
|
if (prevStepIndex < 0) return;
|
|
|
|
|
|
|
|
+ this.steps[this.curStepIndex].status = this.finishedSteps.includes(
|
|
|
|
+ this.curStepIndex
|
|
|
|
+ )
|
|
|
|
+ ? "success"
|
|
|
|
+ : "wait";
|
|
|
|
+
|
|
this.curStepIndex = prevStepIndex;
|
|
this.curStepIndex = prevStepIndex;
|
|
|
|
+ this.steps[prevStepIndex].status = "process";
|
|
|
|
+
|
|
|
|
+ this.steps.forEach((item) => {
|
|
|
|
+ item.disabled = item.status === "wait";
|
|
|
|
+ });
|
|
},
|
|
},
|
|
async cancel() {
|
|
async cancel() {
|
|
const res = await this.$confirm("确定要退出阅卷参数编辑吗?", "提示", {
|
|
const res = await this.$confirm("确定要退出阅卷参数编辑吗?", "提示", {
|