Commit 4c5fabaa authored by 华国豪's avatar 华国豪 🙄

1

parent a371b088
......@@ -872,11 +872,11 @@
<li v-if="uploadImgList.length<10">
<el-upload
class="avatar-uploader"
:action="importFileUrl"
action=""
:http-request="uploadFileBtn"
:show-file-list="false"
multiple
:limit="10"
:on-success="handleAvatarSuccess">
:multiple="true"
:limit="10">
<i class="el-icon-plus avatar-uploader-icon"></i>
<span class="_upload_tips">最多可上传10张图片</span>
</el-upload>
......@@ -1170,12 +1170,12 @@
</li>
<li v-if="uploadImgList.length<10">
<el-upload
action=""
class="avatar-uploader"
:action="importFileUrl"
:http-request="uploadFileBtn"
:show-file-list="false"
multiple
:limit="10"
:on-success="handleAvatarSuccess">
:multiple="true"
:limit="10">
<i class="el-icon-plus avatar-uploader-icon"></i>
<span class="_upload_tips">最多可上传10张图片</span>
</el-upload>
......@@ -2185,6 +2185,39 @@ export default {
deleteImg(i){ // 删除
this.uploadImgList.splice(i,1)
},
uploadFileBtn(file) { //上传
if(file.file.size > 1024 * 1024 * 10) {
this.$message.warning(this.$t('tips.wjdxbncgsz'))
return
}
// 1 文档 2 数据 3 图片
let typeArr=[
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:3},
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',type:1},
]
let ft=file.file.name.substring(file.file.name.lastIndexOf('.')+1,file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x=>{
if(x.stringArr.indexOf(ft)!='-1')
{
fileTypeNumber=x.type;
typeOk = true;
}
})
if (!typeOk) return this.$message.error(this.$t('tips.qscWEfile'));
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let obj = {
src: this.domainManager().ViittoFileUrl + x.data.FilePath
}
this.uploadImgList.push(obj)
this.$message.success(this.$t('tips.scchenggong'))
}, 1);
},
handleAvatarSuccess(res, file) { //上传
if(res.resultCode==1){
var img_path = res.data.FullFilePath
......
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