|
|
|
|
|
|
|
|
import askLeft from './ask/askLeft' |
|
|
import askLeft from './ask/askLeft' |
|
|
import {mapGetters} from "vuex"; |
|
|
import {mapGetters} from "vuex"; |
|
|
import api from '@/api/main/index' |
|
|
import api from '@/api/main/index' |
|
|
import driver from 'static/driver.json' |
|
|
|
|
|
import problemDetailWin from './problem/problemDetailWin' |
|
|
import problemDetailWin from './problem/problemDetailWin' |
|
|
import hpDetailWin from './ask/hpDetailWin' |
|
|
import hpDetailWin from './ask/hpDetailWin' |
|
|
import qualityLeft from './quality/qualityLeft' |
|
|
import qualityLeft from './quality/qualityLeft' |
|
|
|
|
|
|
|
|
map: {}, |
|
|
map: {}, |
|
|
center: {}, |
|
|
center: {}, |
|
|
barHeight: document.body.clientHeight > 1050 ? 2.42 : 2.06, |
|
|
barHeight: document.body.clientHeight > 1050 ? 2.42 : 2.06, |
|
|
|
|
|
driverDataList:[], |
|
|
nameMarkList: [], |
|
|
nameMarkList: [], |
|
|
routersMarker:[], |
|
|
routersMarker:[], |
|
|
polygonList: [], |
|
|
polygonList: [], |
|
|
|
|
|
|
|
|
routesClick(driverId) { |
|
|
routesClick(driverId) { |
|
|
this.clearRoutersMarker() |
|
|
this.clearRoutersMarker() |
|
|
this.checkDriver(driverId) |
|
|
this.checkDriver(driverId) |
|
|
const {data} = driver |
|
|
|
|
|
let child = data.find(item => item.id == driverId) |
|
|
|
|
|
|
|
|
let child = this.driverDataList.find(item => item.id == driverId) |
|
|
if (child&&child.mapInfo&&child.mapInfo.length>0) { |
|
|
if (child&&child.mapInfo&&child.mapInfo.length>0) { |
|
|
this.initRouters(child) |
|
|
this.initRouters(child) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
this.checkDriver(marker.childData.dirverId) |
|
|
this.checkDriver(marker.childData.dirverId) |
|
|
}, |
|
|
}, |
|
|
getDriver() { |
|
|
getDriver() { |
|
|
const {data} = driver |
|
|
|
|
|
data.map(item => { |
|
|
|
|
|
let polygons = this.returnDriver(item) |
|
|
|
|
|
if (polygons) { |
|
|
|
|
|
this.driverList.push(polygons) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
api.getWaterDriver({}).then(res => { |
|
|
|
|
|
this.driverDataList=res.data?res.data:[] |
|
|
|
|
|
res.data.map(item => { |
|
|
|
|
|
let polygons = this.returnDriver(item) |
|
|
|
|
|
if (polygons) { |
|
|
|
|
|
this.driverList.push(polygons) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
returnDriver(item) { |
|
|
returnDriver(item) { |
|
|
let me = this |
|
|
let me = this |
|
|
let polygons = null; |
|
|
let polygons = null; |
|
|
var bounds = item.mapInfo; |
|
|
|
|
|
|
|
|
var bounds = item.pointList; |
|
|
if (bounds && bounds.length > 0) { |
|
|
if (bounds && bounds.length > 0) { |
|
|
let path = [] |
|
|
let path = [] |
|
|
for (let i = 0, l = bounds.length; i < l; i++) { |
|
|
for (let i = 0, l = bounds.length; i < l; i++) { |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
polygons.name = item.name |
|
|
polygons.name = item.name |
|
|
polygons.id = item.id |
|
|
polygons.id = item.id |
|
|
|
|
|
polygons.driverArea=item.driverArea |
|
|
polygons.on('click', function () { |
|
|
polygons.on('click', function () { |
|
|
me.driverId = this.id |
|
|
me.driverId = this.id |
|
|
me.checkDriver(this.id) |
|
|
me.checkDriver(this.id) |