diff --git a/weapp/package/report/report.js b/weapp/package/report/report.js index d806058..702e204 100644 --- a/weapp/package/report/report.js +++ b/weapp/package/report/report.js @@ -256,9 +256,14 @@ Page({ } const { id, name, departmentId, deptName } = wx.getStorageSync('userInfo'); const newData = that.data.data.map((item) => { + let pointDevices=[] + item.devices.map(child=>{ + const {pointDevice,...newItem } = child; + pointDevices.push({device:newItem,deviceId:pointDevice.deviceId}) + }) // 使用对象的解构赋值去掉 project 和 devices 属性 const { project, devices, ...newItem } = item; - return newItem; + return {...newItem,pointDevices} }); const nextItemData=newData.find(item=>item.id===pointList[pointIndex].id) // const curPlan = that.data.planList.find(item=>item.id==patrolTemplate[patrolTemplateIndex].id)