<>js in for Loop multiple requests , Processing of returned data out of order
// On demand processing according to usage scenarios // Use all the data returned by the request first new Promise To handle asynchronously , Store the returned data in a atemp Array const
atemp= [] for (let i = 0; i < 7; i++) { atemp.push( // use Promise For asynchronous computing new
Promise((resolve, reject) => { //queryList[i] Is the request parameter pageFindJobOrder(queryList[i]
).then(res => { return resolve(res) }).catch(err => { return reject(err) }) }) )
} // use Promise.all Put all request data atemp After you get the array , Together
// This is how it is used , The idea is like this , Data is processed on demand according to individual return , I have not intercepted all the data here Promise.all(atemp).then(res => { res
.forEach((ele, i) => { let count = 0 ele.data.data.forEach(ele => { if (ele.
status=== 'FINISH') { count++ } }) this.planNum.push(ele.data.total)
lineChartData.order.expectedData = this.planNum this.actualNum.push(count)
lineChartData.order.actualData = this.actualNum }) }).catch(err => { console.log
('error', err) })

Technology
©2019-2020 Toolsou All rights reserved,
In the problem of target detection “ recall Recall”,“ Accuracy Precision”Linux Page replacement algorithm C Language implementation About wechat payment body( Product description ) Problems encountered stay Vue Use in Web Worker Calculate the working days of each month c++ Memory Pointer out of bounds detection mechanism _CrtMemBlockHeadeJavaScript Medium Call and Apply Remember once EventBus Project issues caused by memory leaks Hundreds of millions of locusts rarely collide Locusts want to be self driving Heroes Java Swing JList: List box components