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) }) },