|
|
@ -1,5 +1,5 @@ |
|
|
|
// package/pointsStatus/pointsStatus.js
|
|
|
|
import { getProjectGraph, getDeployPoints } from "../../utils/getApiUrl"; |
|
|
|
import { getProjectGraph, getDeployPoints, getProjectPoints } from "../../utils/getApiUrl"; |
|
|
|
import { Request } from "../../common"; |
|
|
|
|
|
|
|
Page({ |
|
|
@ -19,21 +19,24 @@ Page({ |
|
|
|
wx.showLoading({ title: '加载中...' }); |
|
|
|
Request.get(getProjectGraph(projectId)).then(res => { |
|
|
|
if (res) { |
|
|
|
Request.get(getDeployPoints(res.id)).then(pointsRes => { |
|
|
|
Request.get(getDeployPoints(res.id)).then(deployPointsRes => { |
|
|
|
Request.get(getProjectPoints(projectId)).then(allPointRes => { |
|
|
|
wx.hideLoading(); |
|
|
|
that.setData({ |
|
|
|
image: res.graph, |
|
|
|
allPoints: pointsRes.allPoints, |
|
|
|
setedPoints: pointsRes.setedPoints.map(p => ({ |
|
|
|
allPoints: allPointRes, |
|
|
|
setedPoints: deployPointsRes.map(p => ({ |
|
|
|
...p, |
|
|
|
position: JSON.parse(p.position), |
|
|
|
pointInfo: pointsRes.allPoints.find(a => a.id === p.pointId), |
|
|
|
pointInfo: allPointRes.find(a => a.id === p.pointId), |
|
|
|
})), |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.hideLoading(); |
|
|
|
// 未布设
|
|
|
|
} |
|
|
|
wx.hideLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|