<el-form-item label="上传:" :prop="'otherAuxiliaryImagingList.' + i + '.imagingDataStorageAddress'"
:rules="otherAuxiliaryImagingCustomRules.imagingDataStorageAddress">
<el-upload class="upload-demo" action="/medical-admin/file/upLoad" :multiple='true'
:on-remove="(file, fileList)=>{return handleRemove(file, fileList, i)}"
:before-upload="beforeAvatarUpload"
:on-success="(response, file, fileList)=>{return onSuccess(response, file, fileList, i)}" multiple
:file-list="ele.imagingDataStorageAddress" :headers="myHeaders">
<el-button size="small" type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
// 上传
onSuccess(response, file, fileList, idx) {
let _this=this;
console.log(response, file)
// 这里是element的上传地址,对应的name,url,自己打印fileList对照
_this.otherAuxiliaryImagingCustom.otherAuxiliaryImagingList[idx].imagingDataStorageAddress.push({
name: file.name,
url: response.msg.split('medical')[1]
});
},
// 移除
handleRemove(file, fileList, idx) {
let Pics = this.otherAuxiliaryImagingCustom.otherAuxiliaryImagingList[idx].imagingDataStorageAddress;
Pics.forEach((item, index) => {
if (file.name == item.name) {
Pics.splice(index, 1);
}
});
}