|
@@ -98,7 +98,7 @@
|
|
<image-action-list
|
|
<image-action-list
|
|
:data="curStudent.scores"
|
|
:data="curStudent.scores"
|
|
:column-number="curStudent.scores.length"
|
|
:column-number="curStudent.scores.length"
|
|
- loop
|
|
|
|
|
|
+ @on-review="toReview"
|
|
ref="ImageActionList"
|
|
ref="ImageActionList"
|
|
></image-action-list>
|
|
></image-action-list>
|
|
|
|
|
|
@@ -135,6 +135,14 @@
|
|
@on-change="toPage"
|
|
@on-change="toPage"
|
|
></Page>
|
|
></Page>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- image-preview -->
|
|
|
|
+ <simple-image-preview
|
|
|
|
+ :cur-image="curPaper"
|
|
|
|
+ @on-prev="toPrevPaper"
|
|
|
|
+ @on-next="toNextPaper"
|
|
|
|
+ ref="SimpleImagePreview"
|
|
|
|
+ ></simple-image-preview>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -142,10 +150,11 @@
|
|
import { studentScoreList, workList, subjectList, areaList } from "@/api";
|
|
import { studentScoreList, workList, subjectList, areaList } from "@/api";
|
|
import { CODE_TYPE } from "@/constants/enumerate";
|
|
import { CODE_TYPE } from "@/constants/enumerate";
|
|
import ImageActionList from "./components/ImageActionList";
|
|
import ImageActionList from "./components/ImageActionList";
|
|
|
|
+import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "student-score",
|
|
name: "student-score",
|
|
- components: { ImageActionList },
|
|
|
|
|
|
+ components: { ImageActionList, SimpleImagePreview },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter: {
|
|
filter: {
|
|
@@ -165,7 +174,11 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
size: 1,
|
|
size: 1,
|
|
curStudent: { name: "" },
|
|
curStudent: { name: "" },
|
|
- students: []
|
|
|
|
|
|
+ students: [],
|
|
|
|
+ // image preview
|
|
|
|
+ papers: [],
|
|
|
|
+ curPaper: {},
|
|
|
|
+ curPaperIndex: 0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -217,6 +230,8 @@ export default {
|
|
}
|
|
}
|
|
data.map(student => {
|
|
data.map(student => {
|
|
student.scores.map(score => {
|
|
student.scores.map(score => {
|
|
|
|
+ // score.imgSrc = score.sheetSrc;
|
|
|
|
+ // score.thumbSrc = score.sheetSrc;
|
|
score.title = score.subjectName;
|
|
score.title = score.subjectName;
|
|
score.key = this.$randomCode();
|
|
score.key = this.$randomCode();
|
|
});
|
|
});
|
|
@@ -226,8 +241,10 @@ export default {
|
|
this.toPage(1);
|
|
this.toPage(1);
|
|
},
|
|
},
|
|
toPage(page) {
|
|
toPage(page) {
|
|
|
|
+ if (!this.students[page - 1]) return;
|
|
this.current = page;
|
|
this.current = page;
|
|
- this.curStudent = this.students[page - 1] || {};
|
|
|
|
|
|
+ this.curStudent = this.students[page - 1];
|
|
|
|
+ this.papers = this.curStudent.scores;
|
|
},
|
|
},
|
|
workChange() {
|
|
workChange() {
|
|
this.filter.subject = null;
|
|
this.filter.subject = null;
|
|
@@ -241,6 +258,43 @@ export default {
|
|
this.filter.questionId = null;
|
|
this.filter.questionId = null;
|
|
this.getAreaList();
|
|
this.getAreaList();
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ // paper view
|
|
|
|
+ toReview(index) {
|
|
|
|
+ this.selectPaper(index);
|
|
|
|
+ this.$refs.SimpleImagePreview.open();
|
|
|
|
+ },
|
|
|
|
+ selectPaper(index) {
|
|
|
|
+ let nindex = index;
|
|
|
|
+ if (!this.papers.length) {
|
|
|
|
+ nindex = 0;
|
|
|
|
+ } else if (index > this.papers.length - 1) {
|
|
|
|
+ nindex = this.papers.length - 1;
|
|
|
|
+ } else if (index < 0) {
|
|
|
|
+ nindex = 0;
|
|
|
|
+ }
|
|
|
|
+ this.curPaperIndex = nindex;
|
|
|
|
+ this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
|
|
|
|
+ },
|
|
|
|
+ async toPrevPaper() {
|
|
|
|
+ if (this.curPaperIndex === 0) {
|
|
|
|
+ this.$Message.warning("当前已经是第一条数据了");
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ this.curPaperIndex--;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ async toNextPaper() {
|
|
|
|
+ if (this.curPaperIndex === this.papers.length - 1) {
|
|
|
|
+ this.$Message.warning("当前已经是最后一条数据了");
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ this.curPaperIndex++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|