|
@@ -176,11 +176,6 @@
|
|
show-watermark
|
|
show-watermark
|
|
></card-preview-dialog>
|
|
></card-preview-dialog>
|
|
|
|
|
|
- <!-- PreviewAttachment -->
|
|
|
|
- <preview-attachment
|
|
|
|
- ref="PreviewAttachment"
|
|
|
|
- :attachment-ids="attachmentIds"
|
|
|
|
- ></preview-attachment>
|
|
|
|
<!-- PreviewFile -->
|
|
<!-- PreviewFile -->
|
|
<preview-file ref="PreviewFile" :data="curFile"></preview-file>
|
|
<preview-file ref="PreviewFile" :data="curFile"></preview-file>
|
|
</div>
|
|
</div>
|
|
@@ -189,8 +184,6 @@
|
|
<script>
|
|
<script>
|
|
import { updatePlanLinkPaper, linkPaperNumberList } from "../api";
|
|
import { updatePlanLinkPaper, linkPaperNumberList } from "../api";
|
|
import { taskApplyDetail } from "../../exam/api";
|
|
import { taskApplyDetail } from "../../exam/api";
|
|
-import { attachmentPreview } from "../../login/api";
|
|
|
|
-import PreviewAttachment from "@/components/PreviewAttachment.vue";
|
|
|
|
import PreviewFile from "@/components/PreviewFile.vue";
|
|
import PreviewFile from "@/components/PreviewFile.vue";
|
|
import CardPreviewDialog from "../../card/components/CardPreviewDialog.vue";
|
|
import CardPreviewDialog from "../../card/components/CardPreviewDialog.vue";
|
|
|
|
|
|
@@ -203,7 +196,7 @@ const initModalForm = {
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "modify-plan-paper",
|
|
name: "modify-plan-paper",
|
|
- components: { PreviewAttachment, PreviewFile, CardPreviewDialog },
|
|
|
|
|
|
+ components: { PreviewFile, CardPreviewDialog },
|
|
props: {
|
|
props: {
|
|
instance: {
|
|
instance: {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -238,11 +231,9 @@ export default {
|
|
],
|
|
],
|
|
},
|
|
},
|
|
curAttachment: {},
|
|
curAttachment: {},
|
|
- // attachmentId preview
|
|
|
|
- attachmentIds: [],
|
|
|
|
// preview file
|
|
// preview file
|
|
curFile: {
|
|
curFile: {
|
|
- url: "",
|
|
|
|
|
|
+ id: "",
|
|
type: "",
|
|
type: "",
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -310,27 +301,16 @@ export default {
|
|
if (paper) this.paperTypes = paper.paperTypes.map((item) => `${item}`);
|
|
if (paper) this.paperTypes = paper.paperTypes.map((item) => `${item}`);
|
|
},
|
|
},
|
|
async toViewAttachment(attachment) {
|
|
async toViewAttachment(attachment) {
|
|
- if (!attachment.jpgAttachmentId) {
|
|
|
|
- if (!attachment.attachmentId) {
|
|
|
|
- this.$message.error("附件丢失!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- const data = await attachmentPreview(attachment.attachmentId);
|
|
|
|
- if (!data[0].url) {
|
|
|
|
- this.$message.error("附件丢失!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this.curFile = {
|
|
|
|
- url: data[0].url,
|
|
|
|
- type: "application/pdf",
|
|
|
|
- };
|
|
|
|
- this.$refs.PreviewFile.open();
|
|
|
|
|
|
+ if (!attachment.attachmentId) {
|
|
|
|
+ this.$message.error("附件丢失!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- const datas = JSON.parse(attachment.jpgAttachmentId);
|
|
|
|
- this.attachmentIds = datas.map((item) => item.attachmentId);
|
|
|
|
- this.$refs.PreviewAttachment.open();
|
|
|
|
|
|
+ this.curFile = {
|
|
|
|
+ id: attachment.attachmentId,
|
|
|
|
+ type: "application/pdf",
|
|
|
|
+ };
|
|
|
|
+ this.$refs.PreviewFile.open();
|
|
},
|
|
},
|
|
toViewCard(attachment) {
|
|
toViewCard(attachment) {
|
|
this.curAttachment = { ...attachment };
|
|
this.curAttachment = { ...attachment };
|