|
|
|
@ -271,15 +271,21 @@ export default {
|
|
|
|
|
getElectronicFence(electronicFenceId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
let circleAreaList = JSON.parse(response.data.circleAreaListStr)
|
|
|
|
|
let polygonAreaList = JSON.parse(response.data.polygonAreaListStr)
|
|
|
|
|
let polygonAreaListArr = JSON.parse(response.data.polygonAreaListStr)
|
|
|
|
|
|
|
|
|
|
let polygonData1 = {}
|
|
|
|
|
let polygonData = []
|
|
|
|
|
polygonAreaList.forEach(e => {
|
|
|
|
|
if (polygonData1[e.index]) {
|
|
|
|
|
polygonData1[e.index].push([e.longitude, e.latitude])
|
|
|
|
|
} else {
|
|
|
|
|
polygonData1[e.index] = [[e.longitude, e.latitude]]
|
|
|
|
|
}
|
|
|
|
|
polygonAreaListArr.forEach(e1 => {
|
|
|
|
|
let polygonAreaListJson = JSON.parse(e1);
|
|
|
|
|
let polyJsonArr = JSON.parse(polygonAreaListJson["polyJsonArr"]);
|
|
|
|
|
let fenceAreaId = polygonAreaListJson["fenceAreaId"];
|
|
|
|
|
polyJsonArr.forEach(e => {
|
|
|
|
|
if (polygonData1[e.index]) {
|
|
|
|
|
polygonData1[e.index].push([e.longitude, e.latitude])
|
|
|
|
|
} else {
|
|
|
|
|
polygonData1[e.index] = [[e.longitude, e.latitude]]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
Object.keys(polygonData1).forEach(e => {
|
|
|
|
|
polygonData[e] = polygonData1[e]
|
|
|
|
@ -289,8 +295,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
circleAreaList.forEach(e => {
|
|
|
|
|
let center = JSON.parse(e.center)
|
|
|
|
|
let radius = e.radius
|
|
|
|
|
let fenceAreaId = e.fenceAreaId;
|
|
|
|
|
let center = JSON.parse(e.center);
|
|
|
|
|
let radius = e.radius;
|
|
|
|
|
this.setCircle({center, radius})
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|