Commit 99d1d646 authored by 华国豪's avatar 华国豪 🙄

上传失败1

parent 21bc5ae9
......@@ -311,6 +311,7 @@
<div style="margin-bottom:10px;width: 29%;">
附件上传:
<el-upload
ref="my-upload"
class="upload-demo"
drag
:http-request="uploadFileBtn"
......@@ -399,6 +400,8 @@ export default {
this.attach = "";
},
previewFile(e) {
window.open(this.attach, "_blank");
return
const link = document.createElement("a");
let _loadUrl = this.domainManager().DomainUrl;
let str = window.location.href;
......@@ -407,6 +410,11 @@ export default {
link.click();
},
uploadFileBtn(file) {
if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning('上传文件不能大于100M');
this.$refs['my-upload'].clearFiles();
return;
}
//上传
let newArr = [];
newArr.push(file.file);
......@@ -415,6 +423,8 @@ export default {
this.UploadSelfFileT(path, newArr, x => {
this.attach = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.$message.success(this.$t("tips.scchenggong"));
}, err=>{
});
},
init(id) {
......
......@@ -753,10 +753,15 @@ export default {
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
})
}).catch(function(reason){
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
});
}
}).catch(function (err) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment