vue代码。
data数据:
list: [
{listName:"待办",listNum:0},
{listName:"退回",listNum:0},
{listName:"已办",listNum:0},
{listName:"全部",listNum:0}
],
methods里面的方法:
async getAllData(){
this.list.map((listItem,index)=>{
let tabId = '';
if(index===0) {
tabId = 'd301b60048e811ec85e763f083b99d99'
}else if(index===2) {
tabId = 'cf80ec80a5d611ec84446f0a1ef0fb8d'
}else if(index===3) {
tabId = 'd0308d70a5d611ec84446f0a1ef0fb8d'
}else if(index===1) {
tabId = '9dcc552037d111ed9487799545a81f0d'
}
let data ={
currpage: 1,
limit: 10,
'pm_project_info#PRO_NAME': "",
'pm_project_info#PRO_ID': null,
menuId_: '244ed54824a46b4da2029bdac66a2573',
tabId: tabId,
templateId: "40f5a4537cc77f0a203a9ea73a54f6f3",
}
this.$api.businessData(data).then(_res=>{ //封装的接口
listItem.listNum = _res.data.result.total;
});
})
},