获取到需要上传的文件数组之后
data() {
return {
mapInfo : {
'入职日期': 'timeOfEntry',
'手机号': 'mobile',
'姓名': 'username',
'转正日期': 'correctionTime',
'工号': 'workNumber',
'部门': 'departmentName',
'聘用形式': 'formOfEmployment'
}
};
},
methods: {
async handleSuccess({ results }) {
const newEnList = results.map(item=>{
const enMapInfo ={}
const keyArr = Object.keys(this.mapInfo)
keyArr.forEach(keyItem => {
const enKey = this.mapInfo[keyItem]
enMapInfo[enKey] = item[keyItem]
})
return enMapInfo
})
await importEmployee(newEnList)
}
},