|
@@ -4,7 +4,7 @@
|
|
|
:visible.sync="modalIsShow"
|
|
|
:title="`上传${curConfig.title}`"
|
|
|
top="10vh"
|
|
|
- width="520px"
|
|
|
+ width="600px"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
append-to-body
|
|
@@ -24,6 +24,7 @@
|
|
|
@upload-success="uploadSuccess"
|
|
|
ref="UploadFileView"
|
|
|
></upload-file-view>
|
|
|
+ <el-button @click="toPreview" style="margin-left: 10px;">预览</el-button>
|
|
|
</div>
|
|
|
<div slot="footer">
|
|
|
<el-button type="primary" @click="confirm" :disabled="loading"
|
|
@@ -36,6 +37,7 @@
|
|
|
|
|
|
<script>
|
|
|
import UploadFileView from "@/components/UploadFileView";
|
|
|
+import { attachmentPreview } from "../../login/api";
|
|
|
|
|
|
export default {
|
|
|
name: "upload-paper-dialog",
|
|
@@ -116,6 +118,14 @@ export default {
|
|
|
confirm() {
|
|
|
this.$emit("confirm", this.attachment, this.uploadType);
|
|
|
this.cancel();
|
|
|
+ },
|
|
|
+ async toPreview() {
|
|
|
+ if (!this.attachment.attachmentId) {
|
|
|
+ this.$message.error(`请先上传${this.curConfig.title}!`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const data = await attachmentPreview(this.attachment.attachmentId);
|
|
|
+ window.open(data.url);
|
|
|
}
|
|
|
}
|
|
|
};
|