ES6中的async函数
使用前提返回的是一个promiss对象
async selectTableDatas(data){
this.formItem.partyMeetingSendList='';
this.partyMeetingSendListFullNames='';
let idss=[];
let idBox=[];
let idsss=[];
data.map(item=>{
idss.push({id:item.id});
idBox.push(item.id);
idsss.push({userId:item.id});
});
this.partyMeetingSendListFullNames= await this.selectFullName(idBox);
this.formItem.partyMeetingSendList = idsss;
this.userModal.id=idss;
},
selectFullName(ids){
return this.get('api/user/getAll?ids='+ ids).then(res => {
if (res && res.code == 0) {
return this.formItem.partyMeetingSendListFullNames =(res.data||[]).map(i=>i.fullName).join(',');
}
return new Promise.resolve(null);
})
},