function dataTransFun() {
return new Promise((resolve, reject) => {
let promises = state.listedInfo.map((info: any) => {
return getApplyForCodePara({ productId: info.productId }).then((res: any) => {
if (res.data && res.status == '1000') {
console.log('代码....')
}
});
});
Promise.all(promises)
.then(() => {
resolve(true);
})
.catch(error => {
reject(error);
});
});
}
async function saveData() {
await dataTransFun();
console.log('其他执行代码')
}