Commit 83b0e45f authored by 莫坚培's avatar 莫坚培

fix: 修复请求参数报错

parent cb194574
...@@ -374,12 +374,6 @@ async function initCanvas() { ...@@ -374,12 +374,6 @@ async function initCanvas() {
if (!Controls.ControlList) { if (!Controls.ControlList) {
return return
} }
// 收集组件数据
collectRequestLoopData()
console.log('分组池', requestLoopDataPool)
// 对数据分组
sliceRequestLoopData(requestLoopGroupSliceNum)
console.log('分组结果', requestLoopGroupSliceRes)
let html = '' let html = ''
let dateList = [] let dateList = []
...@@ -856,6 +850,12 @@ async function initCanvas() { ...@@ -856,6 +850,12 @@ async function initCanvas() {
clearInterval(timer1) clearInterval(timer1)
// setTimer() // setTimer()
// 收集组件数据
collectRequestLoopData()
console.log('分组池', requestLoopDataPool)
// 对数据分组
sliceRequestLoopData(requestLoopGroupSliceNum)
console.log('分组结果', requestLoopGroupSliceRes)
clearInterval(requestLoopTimer) clearInterval(requestLoopTimer)
// 初始化完成后开始轮询 // 初始化完成后开始轮询
for (let i = 0, len = requestLoopGroupSliceRes.length; i < len; i++) { for (let i = 0, len = requestLoopGroupSliceRes.length; i < len; i++) {
...@@ -946,6 +946,10 @@ function startRequestLoop() { ...@@ -946,6 +946,10 @@ function startRequestLoop() {
// 发起requestLoopDataPool的合并请求 // 发起requestLoopDataPool的合并请求
function sendLoopDataRequest(list, i, len) { function sendLoopDataRequest(list, i, len) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!(list instanceof Array)) {
reject()
return
}
request.post(`/bi/${appId}/variables/real-time/data/mergeReq`, list) request.post(`/bi/${appId}/variables/real-time/data/mergeReq`, list)
.then(res => { .then(res => {
// requestLoopGroupSliceRes的最后一个完成即表示这一批请求完成,可以进行下一批(既执行下一次定时器) // requestLoopGroupSliceRes的最后一个完成即表示这一批请求完成,可以进行下一批(既执行下一次定时器)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment