async await用法
2022-05-26 本文已影响0人
jesse28
例子:
// 调用查看接口
async getInfo() {
this.ruleForm = await evaluationScoreGetApi(this.id);
// 获取评查类别数组start
const { list: evaluationTypeArray2 } = await caseEvaluationTypeListApi({
limit: 99999,
page: 1,
standardId: this.ruleForm.standardId,
});
this.evaluationTypeArray2 = evaluationTypeArray2;
// 获取评查类别数组end
// 获取评查要点数组start
const { list: mainPointArray2 } = await evaluationMainpointListApi({
limit: 99999,
page: 1,
standardId: this.ruleForm.standardId,
typeId: this.ruleForm.typeId,
});
this.mainPointArray2 = mainPointArray2;
// 获取评查要点数组start
// 获取评查细则数组start
const { list: ruleArray } = await evaluationContentListApi({
limit: 99999,
page: 1,
standardId: this.ruleForm.standardId,
typeId: this.ruleForm.typeId,
mainpointId: this.ruleForm.mainpointId,
});
this.ruleArray = ruleArray;
// 获取评查细则数组end
},
