|
@@ -50,7 +50,6 @@
|
|
|
:before-upload="uploadFile"
|
|
|
:on-success="handleSuccess"
|
|
|
:on-preview="onPreviewFile"
|
|
|
- :limit="1"
|
|
|
style="width: 100%">
|
|
|
<el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
|
|
|
</el-upload>
|
|
@@ -129,16 +128,26 @@ const rules = ref({
|
|
|
const uploadData = ref({});
|
|
|
const fileList = ref([]);
|
|
|
const uploadFile = async (file) => {
|
|
|
+ console.log("111");
|
|
|
const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
uploadData.value = res.uploadBody;
|
|
|
file.id = res.id;
|
|
|
file.fileName = res.fileName;
|
|
|
file.fileUrl = res.fileUrl;
|
|
|
- file.uploadState = true;
|
|
|
return true;
|
|
|
};
|
|
|
const handleSuccess = (any, UploadFile) => {
|
|
|
- UploadFile.raw.uploadState = false;
|
|
|
+ fileList.value = [
|
|
|
+ {
|
|
|
+ raw: {
|
|
|
+ id: UploadFile.raw.id,
|
|
|
+ fileName: UploadFile.raw.fileName,
|
|
|
+ fileUrl: UploadFile.raw.fileUrl,
|
|
|
+ },
|
|
|
+ name: UploadFile.raw.fileName,
|
|
|
+ url: UploadFile.raw.fileUrl,
|
|
|
+ },
|
|
|
+ ];
|
|
|
};
|
|
|
const uploadMainData = ref({});
|
|
|
const uploadMainFile = async (file) => {
|
|
@@ -239,6 +248,9 @@ const clickDelete = (row) => {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|