| | |
| | | lazyTrees, |
| | | getSecurityUnitInfoPage |
| | | } from "../../api/index/index"; |
| | | import { getPosition, getNewPeople } from "@/api/map/people"; |
| | | import { getNewPosition } from "@/api/map/car"; |
| | | |
| | | import car from "@/assets/img/car.png"; |
| | | import peo from "@/assets/img/people.png"; |
| | |
| | | // }, |
| | | node1: {}, //选中的记录 |
| | | node2: {}, |
| | | params: null |
| | | params: null, |
| | | peopleGps: {}, |
| | | carGps: {} |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getPeoplePosition() { |
| | | getPosition({ type: 1, workerId: "1432897970143014913" }).then(result => { |
| | | getNewPeople().then(res => { |
| | | if (JSON.stringify(res.data) != "{}") { |
| | | var arr = res.data.sort(function(a, b) { |
| | | return a["date"] < b["date"] ? 1 : -1; |
| | | }); |
| | | this.peopleGps = { |
| | | LGTD: arr[0].gis_jd, |
| | | LTTD: arr[0].gis_wd |
| | | }; |
| | | } |
| | | this.getTableData(0); |
| | | }); |
| | | }); |
| | | }, |
| | | getCarPosition() { |
| | | getNewPosition({ imei: "861636056082414" }).then(result => { |
| | | var res = result.data.data; |
| | | if (JSON.stringify(res) != "{}") { |
| | | this.carGps = { |
| | | LGTD: res.x, |
| | | LTTD: res.y |
| | | }; |
| | | } |
| | | this.getTableData(0); |
| | | }); |
| | | }, |
| | | //点击节点 |
| | | handleNodeClick1(data) { |
| | | this.value1 = data; |
| | |
| | | // name: type, |
| | | // value: [Number(m.longitude), Number(m.latitude)], |
| | | // }; |
| | | middleData[m.type]["geoData"].push([ |
| | | Number(m.longitude), |
| | | Number(m.latitude) |
| | | ]); |
| | | middleData[m.type]["table"].push(obj); |
| | | if (m.type === 1) { |
| | | middleData[m.type]["geoData"].push([ |
| | | Number(this.peopleGps.LGTD), |
| | | Number(this.peopleGps.LTTD) |
| | | ]); |
| | | middleData[m.type]["table"].push(obj); |
| | | } else if (m.type === 2) { |
| | | middleData[m.type]["geoData"].push([ |
| | | Number(this.carGps.LGTD), |
| | | Number(this.carGps.LTTD) |
| | | ]); |
| | | middleData[m.type]["table"].push(obj); |
| | | } else { |
| | | middleData[m.type]["geoData"].push([ |
| | | Number(m.longitude), |
| | | Number(m.latitude) |
| | | ]); |
| | | middleData[m.type]["table"].push(obj); |
| | | } |
| | | // middleData[m.type]["geoData"].push([ |
| | | // Number(m.longitude), |
| | | // Number(m.latitude) |
| | | // ]); |
| | | // middleData[m.type]["table"].push(obj); |
| | | }); |
| | | this.carNum = middleData[2]["table"].length; |
| | | this.peoNum = middleData[1]["table"].length; |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getPeoplePosition(); |
| | | this.getCarPosition(); |
| | | this.initEchart(); |
| | | this.getHolderNum(0); |
| | | // this.getPoorPerformance(3); |
| | | // this.getTableData("car"); |
| | | // this.initMap(); |
| | | this.getTableData(0); |
| | | // this.getTableData(0); |
| | | // this.initMapEchart(); |
| | | this.getOfficeData(); |
| | | } |