<>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,
Final review of database : Summary of comprehensive application questions use Python Make simple games Laplance operator ( Second derivative ) Convert hard disk to GPT Partition format Python Implementation of Hanoi Tower code about String How to create objects vue3 Learning journey 1—— establish vue3 project java String from back to front _Java String String summary use Python Write a story about plants versus zombies 【 Greedy Algorithm 】 Huffman coding problem