|
@@ -292,34 +292,48 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
- <h4 class="mb-2">附件<span>(最多4张)</span>:</h4>
|
|
|
|
|
|
+ <h4 class="mb-2">附件<span>(最多4个)</span>:</h4>
|
|
<div class="image-list">
|
|
<div class="image-list">
|
|
<div
|
|
<div
|
|
class="image-item"
|
|
class="image-item"
|
|
- v-for="(img, index) in paperConfirmAttachments"
|
|
|
|
- :key="index"
|
|
|
|
|
|
+ v-for="(item, index) in imageAttachments"
|
|
|
|
+ :key="`image${index}`"
|
|
>
|
|
>
|
|
<img
|
|
<img
|
|
- :src="img.url"
|
|
|
|
- :alt="img.filename"
|
|
|
|
|
|
+ :src="item.url"
|
|
|
|
+ :alt="item.filename"
|
|
title="点击查看大图"
|
|
title="点击查看大图"
|
|
@click="toPreview(index)"
|
|
@click="toPreview(index)"
|
|
/>
|
|
/>
|
|
<div class="image-delete">
|
|
<div class="image-delete">
|
|
<i
|
|
<i
|
|
class="el-icon-delete-solid"
|
|
class="el-icon-delete-solid"
|
|
- @click="deletePaperConfirmAttachment(index)"
|
|
|
|
|
|
+ @click="deletePaperConfirmAttachment(item)"
|
|
></i>
|
|
></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
v-if="paperConfirmAttachments.length < 4"
|
|
v-if="paperConfirmAttachments.length < 4"
|
|
class="image-item image-add"
|
|
class="image-item image-add"
|
|
- title="上传入库审核表"
|
|
|
|
|
|
+ title="上传附件"
|
|
@click="toUploadPaperConfirm"
|
|
@click="toUploadPaperConfirm"
|
|
>
|
|
>
|
|
<i class="el-icon-plus"></i>
|
|
<i class="el-icon-plus"></i>
|
|
</div>
|
|
</div>
|
|
|
|
+ <br />
|
|
|
|
+ <div
|
|
|
|
+ class="audio-item"
|
|
|
|
+ v-for="(item, index) in audioAttachments"
|
|
|
|
+ :key="`audio${index}`"
|
|
|
|
+ >
|
|
|
|
+ <audio :src="item.url" :alt="item.filename" controls></audio>
|
|
|
|
+ <div class="audio-delete">
|
|
|
|
+ <i
|
|
|
|
+ class="el-icon-delete-solid"
|
|
|
|
+ @click="deletePaperConfirmAttachment(item)"
|
|
|
|
+ ></i>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h4 class="mb-2">附件说明:</h4>
|
|
<h4 class="mb-2">附件说明:</h4>
|
|
@@ -461,7 +475,12 @@ export default {
|
|
cardBuildPresetData: {},
|
|
cardBuildPresetData: {},
|
|
// exam-task-detail
|
|
// exam-task-detail
|
|
examTaskDetail: { makeMethod: "" },
|
|
examTaskDetail: { makeMethod: "" },
|
|
- paperConfirmAttachmentId: { attachmentId: "", filename: "", url: "" },
|
|
|
|
|
|
+ paperConfirmAttachmentId: {
|
|
|
|
+ attachmentId: "",
|
|
|
|
+ filename: "",
|
|
|
|
+ url: "",
|
|
|
|
+ fileType: "",
|
|
|
|
+ },
|
|
paperAttachments: [],
|
|
paperAttachments: [],
|
|
paperConfirmAttachments: [],
|
|
paperConfirmAttachments: [],
|
|
curAttachment: {},
|
|
curAttachment: {},
|
|
@@ -494,6 +513,16 @@ export default {
|
|
IS_TIKU_TAB() {
|
|
IS_TIKU_TAB() {
|
|
return this.curTab === "tiku";
|
|
return this.curTab === "tiku";
|
|
},
|
|
},
|
|
|
|
+ imageAttachments() {
|
|
|
|
+ return this.paperConfirmAttachments.filter(
|
|
|
|
+ (item) => item.fileType === "image"
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ audioAttachments() {
|
|
|
|
+ return this.paperConfirmAttachments.filter(
|
|
|
|
+ (item) => item.fileType === "audio"
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
"examTask.examId": function (val, oldval) {
|
|
"examTask.examId": function (val, oldval) {
|
|
@@ -906,7 +935,10 @@ export default {
|
|
this.paperConfirmAttachments.push(attachment);
|
|
this.paperConfirmAttachments.push(attachment);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- deletePaperConfirmAttachment(index) {
|
|
|
|
|
|
+ deletePaperConfirmAttachment(data) {
|
|
|
|
+ const index = this.paperConfirmAttachments.findIndex(
|
|
|
|
+ (item) => item.url === data.url
|
|
|
|
+ );
|
|
this.paperConfirmAttachments.splice(index, 1);
|
|
this.paperConfirmAttachments.splice(index, 1);
|
|
},
|
|
},
|
|
// cardConfirm(data) {
|
|
// cardConfirm(data) {
|
|
@@ -930,11 +962,11 @@ export default {
|
|
this.$refs.SimpleImagePreview.open();
|
|
this.$refs.SimpleImagePreview.open();
|
|
},
|
|
},
|
|
selectImage(index) {
|
|
selectImage(index) {
|
|
- this.curImage = this.paperConfirmAttachments[index];
|
|
|
|
|
|
+ this.curImage = this.imageAttachments[index];
|
|
},
|
|
},
|
|
toPrevImage() {
|
|
toPrevImage() {
|
|
if (this.curImageIndex === 0) {
|
|
if (this.curImageIndex === 0) {
|
|
- this.curImageIndex = this.paperConfirmAttachments.length - 1;
|
|
|
|
|
|
+ this.curImageIndex = this.imageAttachments.length - 1;
|
|
} else {
|
|
} else {
|
|
this.curImageIndex--;
|
|
this.curImageIndex--;
|
|
}
|
|
}
|
|
@@ -942,7 +974,7 @@ export default {
|
|
this.selectImage(this.curImageIndex);
|
|
this.selectImage(this.curImageIndex);
|
|
},
|
|
},
|
|
toNextImage() {
|
|
toNextImage() {
|
|
- if (this.curImageIndex === this.paperConfirmAttachments.length - 1) {
|
|
|
|
|
|
+ if (this.curImageIndex === this.imageAttachments.length - 1) {
|
|
this.curImageIndex = 0;
|
|
this.curImageIndex = 0;
|
|
} else {
|
|
} else {
|
|
this.curImageIndex++;
|
|
this.curImageIndex++;
|