|
@@ -135,7 +135,8 @@
|
|
|
<!-- image-preview -->
|
|
|
<simple-image-preview
|
|
|
:cur-image="curImage"
|
|
|
- simple
|
|
|
+ @on-prev="toPrevImage"
|
|
|
+ @on-next="toNextImage"
|
|
|
ref="SimpleImagePreview"
|
|
|
></simple-image-preview>
|
|
|
</div>
|
|
@@ -173,7 +174,10 @@ export default {
|
|
|
curRow: {},
|
|
|
curPapers: [],
|
|
|
downloading: false,
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ // img view
|
|
|
+ curImageIndex: 0,
|
|
|
+ imageList: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -219,21 +223,13 @@ export default {
|
|
|
if (!res) return;
|
|
|
this.$message.success("导出任务已经提交");
|
|
|
},
|
|
|
- toViewPaper(row) {
|
|
|
- if (!row.sheetUrls) {
|
|
|
- this.$message.error("原卷缺失!");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curImage = { url: row.sheetUrls };
|
|
|
- this.$refs.SimpleImagePreview.open();
|
|
|
- },
|
|
|
async toDownload(row) {
|
|
|
if (this.downloading) return;
|
|
|
this.downloading = true;
|
|
|
|
|
|
const res = await downloadByApi(() => {
|
|
|
return scoreDownload(row.studentCode);
|
|
|
- }, `${row.name}-原卷.jpg`).catch(e => {
|
|
|
+ }, `${row.name}-原卷.zip`).catch(e => {
|
|
|
console.log(e);
|
|
|
});
|
|
|
this.downloading = false;
|
|
@@ -244,6 +240,40 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$message.success("下载成功!");
|
|
|
+ },
|
|
|
+ // img view
|
|
|
+ toViewPaper(row) {
|
|
|
+ if (!row.sheetUrls) {
|
|
|
+ this.$message.error("原卷缺失!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curImageIndex = 0;
|
|
|
+ this.imageList = row.sheetUrls.map((item, index) => {
|
|
|
+ return { url: item, name: index + 1 };
|
|
|
+ });
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
+ this.$refs.SimpleImagePreview.open();
|
|
|
+ },
|
|
|
+ selectImage(index) {
|
|
|
+ this.curImage = this.imageList[index];
|
|
|
+ },
|
|
|
+ toPrevImage() {
|
|
|
+ if (this.curImageIndex === 0) {
|
|
|
+ this.curImageIndex = this.imageList.length - 1;
|
|
|
+ } else {
|
|
|
+ this.curImageIndex--;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
+ },
|
|
|
+ toNextImage() {
|
|
|
+ if (this.curImageIndex === this.imageList.length - 1) {
|
|
|
+ this.curImageIndex = 0;
|
|
|
+ } else {
|
|
|
+ this.curImageIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectImage(this.curImageIndex);
|
|
|
}
|
|
|
}
|
|
|
};
|