| | |
| | | class="upload-demo" |
| | | drag |
| | | action="#" |
| | | :on-remove="handleRemove" |
| | | :http-request="httpRequest" |
| | | :file-list="form.fileList" |
| | | :on-exceed="handleExceed" |
| | | :limit="1" |
| | | :accept="'.jpg,.jpeg,.png'" |
| | | multiple> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import fileDownload from '../../../../util/file' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | // 覆盖默认的上传行为,可以自定义上传的实现,将上传的文件依次添加到fileList数组中,支持多个文件 |
| | | httpRequest(option) { |
| | | this.form.fileData = [] |
| | | this.form.fileData.push(option) |
| | | }, |
| | | addImport() { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | handleRemove(file) { |
| | | this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + file.name).then(res => { |
| | | if (res.code === 201) return; |
| | | this.$message.success('删除成功!') |
| | | let index = this.form.fileList.indexOf(fileName) |
| | | if (index != -1) { |
| | | this.successFileList.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | download(row) { |
| | | let url = ''; |
| | | |
| | | // fileDownload.downloadIamge(url, row.fileName) |
| | | url = this.javaApi + 'img/' + row.systemFileName |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | url = this.javaApi + '/img/' + row.systemFileName |
| | | fileDownload.downloadIamge(url, row.fileName) |
| | | } |
| | | } |
| | | } |