created() {
this.init()
},
async init(){
await treeselect().then(response => {
let treeData = response.data.filter((res)=>{
return res.id===2||res.parentId === 2
})
this.treeLength = treeData.length-1
this.deptOptions = this.handleTree(treeData, "id");
this.leafTree = treeData.filter((ite)=>{
return ite.parentId === 2
})
console.log('1')
})
/* await this.getTreeselect() */
await getBaseRank().then((res)=>{
console.log('2')
this.ranksOptions = res
})
await this.formdataRouter()
},
页面初始化里的异步处理
最新推荐文章于 2024-08-14 10:51:33 发布