| | |
| | | :on-error="uploadError" |
| | | :before-upload="beforeFileUpload" |
| | | :file-list="fileList"> |
| | | <el-button size="small" type="primary" >点击上传</el-button> |
| | | <el-button size="small" type="primary" >点击上传</el-button> |
| | | <div style="display: inline-block;position: absolute" slot="tip" class="el-upload__tip" v-if="showTips">{{'(只能上传'+uploadData.fileType +'文件,且不超过5mb)'}}</div> |
| | | </el-upload> |
| | | </div> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | uploaded:false, |
| | | // fileList:[], |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload?folder='+this.uploadData.folder |
| | | } |
| | |
| | | fileList (nv,ov) { |
| | | if(this.fileList ==null){ |
| | | this.fileList = new Array(); |
| | | } |
| | | if(this.fileList.length == 0){ |
| | | this.uploaded = false |
| | | }else{ |
| | | this.uploaded=true |
| | | } |
| | | // alert(this.fileList) |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | removes() { |
| | | this.uploaded=false |
| | | this.$emit('remove') |
| | | }, |
| | | // 上传图片 |
| | |
| | | handleFileSuccess(res, file) { |
| | | if (res.code == 200) { |
| | | let { data } = res |
| | | this.uploaded = true |
| | | // this.fileList = [{name: data.originname, url: data.url }] |
| | | this.$message.success('上传成功') |
| | | this.$emit('uploadSuccess', { fileurl: data.imgaddr, fileurlFull: data.url, name: data.originname ,index:this.fileIndex}) |