| | |
| | | </span> |
| | | </div> |
| | | </el-upload> |
| | | <el-image-viewer |
| | | v-if="showViewer" |
| | | <el-image-viewer |
| | | v-if="showViewer" |
| | | :on-close="closeViewer" |
| | | :initialIndex="tempIndex" |
| | | :url-list="srcList" |
| | | :z-index="3000" |
| | | /> |
| | | </div> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/uploadLocal', |
| | | |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadLocal', |
| | | |
| | | realList: [], |
| | | srcList: [], |
| | | tempIndex: 0, |
| | |
| | | this.srcList = [] |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | beforeUpload(file) { |
| | | |
| | | |
| | | this.$emit('beginUpload') |
| | | return true |
| | | }, |
| | | // 上传图片成功 |
| | | uploadSuccess (res, file, fileList) { |
| | | uploadSuccess (res, file, fileList) { |
| | | // console.log('this.fileList', this.fileList); |
| | | // console.log('fileList', fileList); |
| | | this.$emit('endUpload') |
| | | this.$emit('uploadEnd') |
| | | this.realList = fileList |
| | | this.srcList.push(res.data.url) |
| | | // console.log('file', file); |
| | |
| | | } |
| | | }, |
| | | fail (err, file, fileList) { |
| | | this.$emit('endUpload') |
| | | this.$emit('uploadEnd') |
| | | this.$message.error('上传失败') |
| | | }, |
| | | handlePictureCardPreview(file) { |
| | |
| | | this.realList.splice(tempIndex, 1) |
| | | this.fileList.splice(tempIndex, 1) |
| | | this.srcList.splice(tempIndex, 1) |
| | | |
| | | |
| | | }, |
| | | }, |
| | | } |