vue系統平臺之間的對接--實踐篇
大專案實際應用可能分幾個子專案進行開發,比如HR平臺,主專案需要呼叫子專案的準員工的身份資訊
create(){
const query=this.$route.query
this.bacthNo=query.bacth;
if(!this.bacthNo){
this.$message.error('無效的報告')
}else{
this.getBasicInfo();
this.getStart()
this.dealApis();
}
this.getBasicInfo();
this.getStart();
this.dealApis();
}
methods:{
getStart(bacthNo='2323'){
const url=URL.start;
this.$axios.post(url,{"batchNo":batchNo}).then((res)=>{const result=res.data.data; this.apisAndNos=result;}).catch((err)=>{})
},
dealApis(){
this.apisAndNos={
EduDegree:{
id:5001
},
Blacklist:{
id:5001
} ,
.............
} ;
for(var key in this.apisAndNos){
if(this.apiAndNos.hasOwnProperty(key)){
const showFlag=`show${key}`;
const api=`get${key}`;
this[showFlag]=true;
const fun =this[api];
fun();//有的話,執行API
}
}
},
getBasicInfo(taskId=10001){
const url=URL.candidateBasicInfo;
this.$axios.post(url,{"taskId":taskId}).then((res)=>{}).catch((error)=>{})
},
getEduDegree(taskId=10001){
const url=URL.eduDegreeinfo;
this.$axios.post(url,{"taskId":taskId}).then((res)=>{}).catch((error)=>{})
},
getBlacklist(taskId=13){
const url=URL.candidateBasicInfo;
this.$axios.post(url,{"taskId":taskId}).then((res)=>{}).catch((error)=>{})
},
}