From 62477cd47b8da224d8c376d5ab3c408b89c068e2 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Fri, 15 Jul 2022 11:39:22 +0800 Subject: [PATCH] wyl --- components/indexCom/dataChild/index.js | 34 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/components/indexCom/dataChild/index.js b/components/indexCom/dataChild/index.js index f61b4a1..a94f27b 100644 --- a/components/indexCom/dataChild/index.js +++ b/components/indexCom/dataChild/index.js @@ -64,17 +64,31 @@ Component({ sEndTime:sEndTime } app.globalData.request(obj).then(res=>{ - const data=res + const dt=[] const time=[] - const list=[] - // Object.keys(data).forEach(e=>{ - // time.push(e) - // // e.data.forEach(item=>{ - // // list.push(item) - // // }) - // }) - console.log("这是数据"+data) - // console.log("这是数据"+time) + const lValue=[] + const lName=[] + + res.forEach(e=>{ + // dt.push(e) + time.push(e.Time) + e.Data.forEach(ee=>{ + let l={ + ts:e.Time, + value:ee.value, + key:ee.key + } + lValue.push(l) + time.push( + lName.push(ee.value,ee.key) + ) + + }) + }) + console.log("这是数据"+time[0]) + // console.log("这是数据"+lValue) + // console.log("这是数据"+lName) + // console.log("这是数据"+dt) // console.log("这是数据"+list) }) },