antdesign table中使用upload传行信息
作者:互联网
<a-table :columns="columns1" :data-source="data" class="components-table-demo-nested" > <span slot="action" slot-scope="record"> <a-upload :action="url1" :default-file-list="defaultFileList" :show-upload-list="false" :beforeUpload="(info) =>handleChangeWs(info,record)" > <a-button type="primary"><a-icon type="upload"/> 文书上传 </a-button> </a-upload> </span> </a-table>
handleChangeWs(file,record) { // console.log(file,record,'file,record') this.confirmLoading = true let formData = new FormData() formData.append('multipartFiles', file) formData.append('xfjId', record.xfjId) formData.append('xfrId', record.id) httpAction(this.url.uploadZmcl, formData, 'post').then(res => { if (res.success) { this.$message.success('上传成功') } else { this.$message.warning(res.message) } }).finally(()=>{ this.confirmLoading = false }) },
标签:res,formData,upload,传行,record,file,antdesign,message,append 来源: https://www.cnblogs.com/shababy/p/16490146.html