|
@@ -9,6 +9,7 @@
|
|
|
append-to-body
|
|
|
fullscreen
|
|
|
@open="reloadData"
|
|
|
+ @close="closeHandle"
|
|
|
>
|
|
|
<div class="archives-student-body">
|
|
|
<div class="archives-student-content part-box">
|
|
@@ -46,6 +47,9 @@
|
|
|
<p>
|
|
|
<span>教学班:</span><span>{{ student.teachClass }}</span>
|
|
|
</p>
|
|
|
+ <p>
|
|
|
+ <span>扫描批次号:</span><span>{{ curPage.batchNo }}</span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
<el-divider></el-divider>
|
|
|
<el-button v-if="showFix" type="primary" size="small" @click="toFix"
|
|
@@ -55,6 +59,7 @@
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
:disabled="!curImageRotate"
|
|
|
+ :loading="loading"
|
|
|
@click="toSaveRotate"
|
|
|
>保存旋转</el-button
|
|
|
>
|
|
@@ -111,10 +116,12 @@ export default {
|
|
|
imageList: [],
|
|
|
pageList: [],
|
|
|
studentInfo: {},
|
|
|
+ loading: false,
|
|
|
// image preview
|
|
|
curImage: { url: "" },
|
|
|
curImageIndex: 0,
|
|
|
curImageRotate: 0,
|
|
|
+ curPage: {},
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -135,6 +142,9 @@ export default {
|
|
|
open() {
|
|
|
this.modalIsShow = true;
|
|
|
},
|
|
|
+ closeHandle() {
|
|
|
+ this.$emit("close");
|
|
|
+ },
|
|
|
async getImageList() {
|
|
|
const resData = await studentPictureList({
|
|
|
paperScanTaskId: this.student.paperScanTaskId,
|
|
@@ -159,6 +169,7 @@ export default {
|
|
|
this.$refs.LibraryDialog.open();
|
|
|
},
|
|
|
getImageInfo(url) {
|
|
|
+ console.log(url);
|
|
|
const curPage = this.pageList.find((item) => item.fileUrls.includes(url));
|
|
|
const pindex = curPage.fileUrls.indexOf(url);
|
|
|
return { ...curPage, pindex };
|
|
@@ -169,15 +180,18 @@ export default {
|
|
|
async toSaveRotate() {
|
|
|
if (!this.curImageRotate) return;
|
|
|
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
const { paperLibraryId, pindex } = this.getImageInfo(this.curImage.url);
|
|
|
|
|
|
- await updateDocumentImageRotate({
|
|
|
- paperScanTaskId: this.student.paperScanTaskId,
|
|
|
- studentId: this.student.studentId,
|
|
|
+ const res = await updateDocumentImageRotate({
|
|
|
paperLibraryId,
|
|
|
- pindex,
|
|
|
+ isFront: pindex === 0,
|
|
|
rotate: this.curImageRotate,
|
|
|
- });
|
|
|
+ }).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
this.curImageRotate = 0;
|
|
|
this.updateImageSource(this.curImage.url, uncacheUrl(this.curImage.url));
|
|
|
},
|
|
@@ -189,7 +203,7 @@ export default {
|
|
|
curPage.fileUrls[pindex] = newUrl;
|
|
|
|
|
|
const imgIndex = this.imageList.indexOf(oldUrl);
|
|
|
- this.imgIndex[imgIndex] = newUrl;
|
|
|
+ this.imageList[imgIndex] = newUrl;
|
|
|
},
|
|
|
async toDelete() {
|
|
|
const res = await this.$confirm(`确认要删除当前页已扫描数据?`, "提示", {
|
|
@@ -200,7 +214,6 @@ export default {
|
|
|
const { paperLibraryId } = this.getImageInfo(this.curImage.url);
|
|
|
|
|
|
await deleteDocumentImage({
|
|
|
- paperScanTaskId: this.student.paperScanTaskId,
|
|
|
studentId: this.student.studentId,
|
|
|
paperLibraryId,
|
|
|
});
|
|
@@ -210,6 +223,7 @@ export default {
|
|
|
selectImage(index) {
|
|
|
this.curImage = { url: this.imageList[index] };
|
|
|
this.curImageRotate = 0;
|
|
|
+ this.curPage = this.getImageInfo(this.curImage.url);
|
|
|
},
|
|
|
toPrevImage() {
|
|
|
if (this.curImageIndex === 0) {
|