| | |
| | | </div> |
| | | <div> |
| | | <el-button @click="watchVideo">查看视频</el-button> |
| | | <el-button @click="editLineInfo">编辑</el-button> |
| | | <el-button @click="saveLineInfo">保存</el-button> |
| | | <el-button @click="deleteLine">删除</el-button> |
| | | <el-button @click="lineEditVisible = false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | |
| | | let arrowsListLayer = null |
| | | let plot = undefined |
| | | let arrowPlot = undefined |
| | | let lineLayer = undefined |
| | | let tc = undefined |
| | | let track = undefined |
| | | let loading = null |
| | |
| | | searchPoliceTreeId: '', |
| | | searchTreeShowFlag: false, |
| | | plotOverlayData: null, |
| | | lineObjdata: null, |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | if (arrowsListLayer == null) { |
| | | arrowsListLayer = new global.DC.VectorLayer('arrowsListLayer') |
| | | global.viewer.addLayer(arrowsListLayer) |
| | | } |
| | | |
| | | if (lineLayer == null) { |
| | | lineLayer = new global.DC.VectorLayer('lineLayer') |
| | | global.viewer.addLayer(lineLayer) |
| | | } |
| | | |
| | | if (polylineAreaLayer == null) { |
| | |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | polylineAreaLayer.clear() |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if (polylineAreaLayer != null) { |
| | | polylineAreaLayer.clear() |
| | | } |
| | | if (lineLayer != null) { |
| | | lineLayer.clear() |
| | | } |
| | | |
| | | getSecurityCarList(securityId).then(res => { |
| | | this.isHavePoliceCar = res.data.data.some(item => { |
| | | return item.type == 3 |
| | |
| | | position += item._lng + ',' + item._lat + ';' |
| | | }) |
| | | item.polygonPositionStr = position |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | positions: position, |
| | | material: color, |
| | | params: item, |
| | | incident: this.lineOverlayTypeClick |
| | | }) |
| | | |
| | | // polylineAreaLayer.show = false |
| | | let positionStr = '' |
| | | coords.forEach(item => { |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | }) |
| | | // this.getRegionList(positionStr) |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.RED.withAlpha(0.8), |
| | | width: 3, |
| | | let lineObj = new global.DC.Polyline(positionNewArr) |
| | | lineLayer.addOverlay(lineObj) |
| | | lineObj.setStyle({ |
| | | 'material': global.DC.Color.RED.withAlpha(0.8), |
| | | 'width': 3 |
| | | }) |
| | | item.lineObj = lineObj |
| | | // this.$EventBus.$emit('layerPolylineAdd', { |
| | | // layerName: 'newCarDrawLayers', |
| | | // positions: positionNewArr, |
| | | // material: global.DC.Color.RED.withAlpha(0.8), |
| | | // width: 3, |
| | | // params: item, |
| | | // }) |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: position, |
| | | material: color, |
| | | params: item, |
| | | incident: this.lineOverlayTypeClick |
| | | }) |
| | | } else if (item.type == 2) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | |
| | | }, |
| | | |
| | | // 修改活动警车 |
| | | updateActivityCar (id, carId, color, width) { |
| | | updateActivityCar(id, carId, color, width).then(res => { |
| | | updateActivityCar (id, carId, color, width, type, position) { |
| | | updateActivityCar(id, carId, color, width, type, position).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | |
| | | this.addCarAndRange(this.policeType, position, this.showingSecurityId, type) |
| | | } else if (this.policeChooseVisible == true) { |
| | | this.policeChooseVisible = false |
| | | |
| | | this.addActivityPolice(this.searchPoliceTreeId, position, this.showingSecurityId, type) |
| | | } |
| | | this.policeIconIsCreated = false |
| | |
| | | } |
| | | }, |
| | | |
| | | // 巡逻路线面点击事件 |
| | | lineOverlayTypeClick (e) { |
| | | this.videoShow = false |
| | | this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100 |
| | | this.chooseColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#FF0000' |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.linePosition = e.overlay.attrParams.linePositionStr |
| | | this.lineObjdata = e.overlay.attrParams.lineObj |
| | | this.polygonPosition = e.overlay.attrParams.polygonPositionStr |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) { |
| | | this.lineEditVisible = true |
| | |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | } |
| | | if (item.id == 202) { |
| | | console.log('item', item) |
| | | } |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color } |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | |
| | | |
| | | // 保存巡逻路线信息 |
| | | saveLineInfo () { |
| | | this.updateActivityCar(this.policeIconId, 2, this.chooseColor, this.lineWidth) |
| | | this.updateActivityCar(this.policeIconId, '', this.chooseColor, this.lineWidth) |
| | | this.lineEditVisible = false |
| | | }, |
| | | |
| | | // 修改巡逻路线位置信息 |
| | | editLineInfo () { |
| | | this.lineEditVisible = false |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | let overlayData = this.lineObjdata |
| | | plot.edit(overlayData, (e) => { |
| | | let position = '' |
| | | overlayData._positions.forEach(item => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | lineLayer.addOverlay(overlayData) |
| | | this.updateActivityCar(this.policeIconId, '', this.chooseColor, this.lineWidth, 1, position) |
| | | }) |
| | | }, |
| | | |
| | | // 点击区域 |
| | |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'searchLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | |
| | | |
| | | analyseLayer.clear() |
| | | arrowsListLayer.clear() |
| | | lineLayer.clear() |
| | | |
| | | this.removeAll() |
| | | this.removeAllArrow() |