|
@@ -146,11 +146,6 @@
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-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>
|
|
@@ -159,8 +154,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";
|
|
|
|
|
|
const initModalForm = {
|
|
const initModalForm = {
|
|
@@ -172,7 +165,7 @@ const initModalForm = {
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "modify-plan-paper",
|
|
name: "modify-plan-paper",
|
|
- components: { PreviewAttachment, PreviewFile },
|
|
|
|
|
|
+ components: { PreviewFile },
|
|
props: {
|
|
props: {
|
|
instance: {
|
|
instance: {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -217,11 +210,10 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
- // attachmentId preview
|
|
|
|
- attachmentIds: [],
|
|
|
|
|
|
+ curAttachment: {},
|
|
// preview file
|
|
// preview file
|
|
curFile: {
|
|
curFile: {
|
|
- url: "",
|
|
|
|
|
|
+ id: "",
|
|
type: "",
|
|
type: "",
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -284,27 +276,16 @@ export default {
|
|
if (paper) this.paperTypes = paper.paperTypes;
|
|
if (paper) this.paperTypes = paper.paperTypes;
|
|
},
|
|
},
|
|
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) {
|
|
window.open(
|
|
window.open(
|