| | |
| | | <div> |
| | | <div class="value-name-box">字体大小:</div> |
| | | <div class="input-fontsize-box"> |
| | | <el-input-number v-model="labelInputFontSize" :step="2" :min="12" max="72" step-strictly></el-input-number> |
| | | <el-input-number v-model="labelInputFontSize" :step="2" :min="12" max="72" |
| | | step-strictly></el-input-number> |
| | | </div> |
| | | </div> |
| | | <div> |
| | |
| | | |
| | | <script> |
| | | import { |
| | | updateActivityCar,updateActivityPolice, |
| | | updateActivityCar, updateActivityPolice, |
| | | updateSecurityPlot |
| | | } from '@/api/activity/index.js' |
| | | |
| | |
| | | let eventLast = 0 |
| | | let addPlotOverlayData = null |
| | | let addPoliceIconOverlayData = null |
| | | let lableOverlayData = null |
| | | let lableOverlayData = null |
| | | |
| | | export default { |
| | | props: [ |
| | |
| | | addLabelPosition: null, |
| | | labelPopupTitle: '添加文字标注', |
| | | labelId: '', |
| | | labelInputFontSize:'40', |
| | | labelInputFontColor:'#FFFFFF', |
| | | labelInputFontSize: '40', |
| | | labelInputFontColor: '#FFFFFF', |
| | | predefineColors: [ |
| | | '#ff4500', |
| | | '#ff8c00', |
| | |
| | | global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, this.viewerLableMove) |
| | | global.viewer.on(global.DC.MouseEventType.LEFT_UP, this.labelUp) |
| | | }) |
| | | |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | |
| | | // 删除所有地图绘制元素 |
| | | removeDraw () { |
| | | addPoliceIconOverlayData!= null && !addPoliceIconOverlayData.attrParams && addPoliceIconOverlayData.remove() |
| | | addPoliceIconOverlayData != null && !addPoliceIconOverlayData.attrParams && addPoliceIconOverlayData.remove() |
| | | }, |
| | | |
| | | clearDraw(){ |
| | | clearDraw () { |
| | | drawLayers != null && drawLayers.clear() |
| | | }, |
| | | |
| | |
| | | labelOverLayerID = [] |
| | | }, |
| | | |
| | | clearDrawArrow() { |
| | | clearDrawArrow () { |
| | | drawArrowLayers != null && drawArrowLayers.clear() |
| | | }, |
| | | |
| | | // 编辑标绘位置 |
| | | plotEdit (overlayData, type) { |
| | | if (type == "arrow") { |
| | | if('pointOverlayData' in overlayData.attrParams){ |
| | | if ('pointOverlayData' in overlayData.attrParams) { |
| | | overlayData.attrParams.pointOverlayData.remove() |
| | | } |
| | | plot.edit(overlayData, (e) => { |
| | | let position = '' |
| | | if('_positions' in overlayData){ |
| | | overlayData._positions.forEach((item,index) => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | if ('_positions' in overlayData) { |
| | | overlayData._positions.forEach((item, index) => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | }else{ |
| | | } else { |
| | | overlayData.position = { |
| | | lng: Number(overlayData._position._lng), |
| | | lat: Number(overlayData._position._lat), |
| | | alt: 0.5, |
| | | } |
| | | position = overlayData._position._lng + ' ' + overlayData._position._lat + ',' + overlayData._position._lng + ' ' + overlayData._position._lat |
| | | let pointPosition = new global.DC.Position(Number(overlayData._position._lng), Number(overlayData._position._lat),0) |
| | | let pointPosition = new global.DC.Position(Number(overlayData._position._lng), Number(overlayData._position._lat), 0) |
| | | let point = new global.DC.Point(pointPosition) |
| | | drawArrowLayers.addOverlay(point) |
| | | point.attrParams = { 'id': overlayData.attrParams.id, 'color': overlayData.attrParams.color, 'item':overlayData.attrParams } |
| | | point.attrParams = { 'id': overlayData.attrParams.id, 'color': overlayData.attrParams.color, 'item': overlayData.attrParams } |
| | | let r = parseInt(overlayData.attrParams.color.slice(1, 3), 16) |
| | | let g = parseInt(overlayData.attrParams.color.slice(3, 5), 16) |
| | | let b = parseInt(overlayData.attrParams.color.slice(5, 7), 16) |
| | |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | this.updateActivityCar({ id: this.policeIconId, color: this.$parent.chooseColor, width: this.lineWidth, type: 1, position: position },overlayData) |
| | | this.updateActivityCar({ id: this.policeIconId, color: this.$parent.chooseColor, width: this.lineWidth, type: 1, position: position }, overlayData) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 保存新增标绘样式修改 |
| | | addNewPlot(item){ |
| | | addNewPlot (item) { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | let a = Math.floor(Number(item.color.split(',')[1]) * 2.55)?Math.floor(Number(item.color.split(',')[1]) * 2.55):255 |
| | | let a = Math.floor(Number(item.color.split(',')[1]) * 2.55) ? Math.floor(Number(item.color.split(',')[1]) * 2.55) : 255 |
| | | let color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | if(item.type == 9) { |
| | | if (item.type == 9) { |
| | | let position = item.position.slice(12, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | position = position.split(';')[0].split(',') |
| | | position = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | let label = new global.DC.Label(position, item.name) |
| | | label.attrParams = { 'id': item.id, item } |
| | | console.log(item,`${item.width}px`,123); |
| | | console.log(item, `${item.width}px`, 123) |
| | | label.setStyle({ |
| | | 'fillColor':color, |
| | | 'fillColor': color, |
| | | "font": `${item.width}px sans-serif`, |
| | | }) |
| | | this.lableAllEvent(label) |
| | | drawArrowLayers.addOverlay(label) |
| | | return |
| | | } |
| | | |
| | | |
| | | addPlotOverlayData.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | addPlotOverlayData.setStyle({ |
| | | "material": color |
| | | }) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | if(item.type == 6 || item.type == 7 || item.type == 8 ) { |
| | | let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ') |
| | | let pointPosition = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | addPlotOverlayData.position = { |
| | | lng: Number(position[0]), |
| | | lat: Number(position[1]), |
| | | alt: 0.5, |
| | | } |
| | | let point = new global.DC.Point(pointPosition) |
| | | drawArrowLayers.addOverlay(point) |
| | | point.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | // point.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | addPlotOverlayData.attrParams.pointOverlayData = point |
| | | if (item.type == 6 || item.type == 7 || item.type == 8) { |
| | | let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ') |
| | | let pointPosition = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | addPlotOverlayData.position = { |
| | | lng: Number(position[0]), |
| | | lat: Number(position[1]), |
| | | alt: 0.5, |
| | | } |
| | | let point = new global.DC.Point(pointPosition) |
| | | drawArrowLayers.addOverlay(point) |
| | | point.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | // point.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | addPlotOverlayData.attrParams.pointOverlayData = point |
| | | } |
| | | if(item.type == 5 && item.areaType == 2){ |
| | | let addPlotPositionArr = [] |
| | | addPlotOverlayData._positions.forEach(inItem=>{ |
| | | addPlotPositionArr.push([Number(inItem._lng),Number(inItem._lat)]) |
| | | }) |
| | | addPlotPositionArr.push([Number(addPlotOverlayData._positions[0]._lng),Number(addPlotOverlayData._positions[0]._lat)]) |
| | | let cachePolygon = this.$turf.polygon([addPlotPositionArr]) |
| | | let arrowsListLayerOverlayList = this.$parent.getArrowsListLayerOverlayList() |
| | | arrowsListLayerOverlayList.push(...drawArrowLayers.getOverlays()) |
| | | arrowsListLayerOverlayList.forEach(inItem=>{ |
| | | if(inItem.attrParams.item.type == 5 && inItem.attrParams.item.areaType == 1){ |
| | | let savePlotPositionArr = [] |
| | | let savePlotPositionStr = [] |
| | | inItem._positions.forEach(ininItem=>{ |
| | | savePlotPositionArr.push([Number(ininItem._lng),Number(ininItem._lat)]) |
| | | savePlotPositionStr += ininItem._lng + ',' + ininItem._lat + ';' |
| | | }) |
| | | savePlotPositionArr.push([Number(inItem._positions[0]._lng),Number(inItem._positions[0]._lat)]) |
| | | let carePolygon = this.$turf.polygon([savePlotPositionArr]) |
| | | let isContains = this.$turf.booleanContains(cachePolygon, carePolygon) |
| | | // 如果完全包含就作为洞面扣去 |
| | | if (isContains) { |
| | | addPlotOverlayData.holes = [savePlotPositionStr] |
| | | } |
| | | if (item.type == 5 && item.areaType == 2) { |
| | | let addPlotPositionArr = [] |
| | | addPlotOverlayData._positions.forEach(inItem => { |
| | | addPlotPositionArr.push([Number(inItem._lng), Number(inItem._lat)]) |
| | | }) |
| | | addPlotPositionArr.push([Number(addPlotOverlayData._positions[0]._lng), Number(addPlotOverlayData._positions[0]._lat)]) |
| | | let cachePolygon = this.$turf.polygon([addPlotPositionArr]) |
| | | let arrowsListLayerOverlayList = this.$parent.getArrowsListLayerOverlayList() |
| | | arrowsListLayerOverlayList.push(...drawArrowLayers.getOverlays()) |
| | | arrowsListLayerOverlayList.forEach(inItem => { |
| | | if (inItem.attrParams.item.type == 5 && inItem.attrParams.item.areaType == 1) { |
| | | let savePlotPositionArr = [] |
| | | let savePlotPositionStr = [] |
| | | inItem._positions.forEach(ininItem => { |
| | | savePlotPositionArr.push([Number(ininItem._lng), Number(ininItem._lat)]) |
| | | savePlotPositionStr += ininItem._lng + ',' + ininItem._lat + ';' |
| | | }) |
| | | savePlotPositionArr.push([Number(inItem._positions[0]._lng), Number(inItem._positions[0]._lat)]) |
| | | let carePolygon = this.$turf.polygon([savePlotPositionArr]) |
| | | let isContains = this.$turf.booleanContains(cachePolygon, carePolygon) |
| | | // 如果完全包含就作为洞面扣去 |
| | | if (isContains) { |
| | | addPlotOverlayData.holes = [savePlotPositionStr] |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 保存新增警力资源 |
| | | addNewPolice(data,type,carType){ |
| | | // 巡逻路线添加 |
| | | if(type == 'policecar' && carType == 1) { |
| | | addNewPolice (data, type, carType) { |
| | | // 巡逻路线添加 |
| | | if (type == 'policecar' && carType == 1) { |
| | | // 线坐标字符串 |
| | | let positionNewArr = this.$parent.convertPolylineOrPolygonPositionDate(data.position, data.type) |
| | | positionNewArr = positionNewArr.slice(1,positionNewArr.length - 2) |
| | | // 范围面坐标串 |
| | | positionNewArr = positionNewArr.slice(1, positionNewArr.length - 2) |
| | | // 范围面坐标串 |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionNewArr, data.width != -1 ? data.width : 100) |
| | | let positionStr = '' |
| | | coords.forEach((item,index) => { |
| | | if(!(index == coords.length - 1)){ |
| | | coords.forEach((item, index) => { |
| | | if (!(index == coords.length - 1)) { |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | } |
| | | }) |
| | | positionStr = positionStr.slice(0,positionStr.length - 1) |
| | | let polygonSavePositionStr = positionStr + coords[0][0] + ',' + coords[0][1] + ';' |
| | | positionStr = positionStr.slice(0, positionStr.length - 1) |
| | | // 面颜色 |
| | | let color = '' |
| | | // 线颜色 |
| | |
| | | "material": lineColor, |
| | | 'width': 3 |
| | | }) |
| | | |
| | | |
| | | data.linePositionStr = positionNewArr |
| | | data.polygonPositionStr = positionStr |
| | | data.polygonPositionStr = polygonSavePositionStr |
| | | data.lineObj = addPoliceIconOverlayData |
| | | |
| | | |
| | | let areaPolygon = new global.DC.Polygon(positionStr) |
| | | drawLayers.addOverlay(areaPolygon) |
| | | areaPolygon.setStyle({ |
| | |
| | | addPoliceIconOverlayData.attrParams = data |
| | | areaPolygon.attrParams = data |
| | | areaPolygon.on(global.DC.MouseEventType.CLICK, this.$parent.lineOverlayTypeClick) |
| | | } else { |
| | | let positionObj = this.$parent.convertBillboardPositionDate(data, type) |
| | | positionObj.lng = positionObj.lng.slice(1,positionObj.lng.length-1) |
| | | positionObj.lat = positionObj.lat.slice(0,positionObj.lat.length-2) |
| | | let positionArr = data.position.slice(7, data.position.length - 2).split(',')[0].split(' ') |
| | | let position = new global.DC.Position(Number(positionArr[0]), Number(positionArr[1])) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (data.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(data.color.slice(1, 3), 16) |
| | | let g = parseInt(data.color.slice(3, 5), 16) |
| | | let b = parseInt(data.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | point.attrParams = positionObj |
| | | drawLayers.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | // point.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | addPoliceIconOverlayData.attrParams = positionObj |
| | | addPoliceIconOverlayData.attrParams.pointOverlayData = point |
| | | addPoliceIconOverlayData.position = { |
| | | lng: Number(positionArr[0]), |
| | | lat: Number(positionArr[1]), |
| | | alt: 0.5, |
| | | } |
| | | addPoliceIconOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | // addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | // addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | } |
| | | } else { |
| | | let positionObj = this.$parent.convertBillboardPositionDate(data, type) |
| | | positionObj.lng = positionObj.lng.slice(1, positionObj.lng.length - 1) |
| | | positionObj.lat = positionObj.lat.slice(0, positionObj.lat.length - 2) |
| | | let positionArr = data.position.slice(7, data.position.length - 2).split(',')[0].split(' ') |
| | | let position = new global.DC.Position(Number(positionArr[0]), Number(positionArr[1])) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (data.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(data.color.slice(1, 3), 16) |
| | | let g = parseInt(data.color.slice(3, 5), 16) |
| | | let b = parseInt(data.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | point.attrParams = positionObj |
| | | drawLayers.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | // point.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | addPoliceIconOverlayData.attrParams = positionObj |
| | | addPoliceIconOverlayData.attrParams.pointOverlayData = point |
| | | addPoliceIconOverlayData.position = { |
| | | lng: Number(positionArr[0]), |
| | | lat: Number(positionArr[1]), |
| | | alt: 0.5, |
| | | } |
| | | addPoliceIconOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | // addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | // addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | } |
| | | }, |
| | | |
| | | // 修改标绘样式 |
| | | editPlotStyle(params,overlay) { |
| | | if('color' in params){ |
| | | editPlotStyle (params, overlay) { |
| | | if ('color' in params) { |
| | | let r = parseInt(params.color.slice(1, 3), 16) |
| | | let g = parseInt(params.color.slice(3, 5), 16) |
| | | let b = parseInt(params.color.slice(5, 7), 16) |
| | | let a = Math.floor(Number(params.color.split(',')[1]) * 2.55) ? Math.floor(Number(params.color.split(',')[1]) * 2.55) : 255 |
| | | let color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | overlay.attrParams.color = params.color |
| | | if(overlay.attrParams.item.type == 9) { |
| | | overlay.setStyle({ |
| | | "fillColor": color |
| | | }) |
| | | }else{ |
| | | if (overlay.attrParams.item.type == 9) { |
| | | overlay.setStyle({ |
| | | "fillColor": color |
| | | }) |
| | | } else { |
| | | overlay.setStyle({ |
| | | "material": color |
| | | }) |
| | | } |
| | | if('pointOverlayData' in overlay.attrParams){ |
| | | if ('pointOverlayData' in overlay.attrParams) { |
| | | let r = parseInt(params.color.slice(1, 3), 16) |
| | | let g = parseInt(params.color.slice(3, 5), 16) |
| | | let b = parseInt(params.color.slice(5, 7), 16) |
| | | let a = Math.floor(Number(params.color.split(',')[1]) * 2.55) |
| | | let color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | overlay.attrParams.pointOverlayData.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | } |
| | | } |
| | | if('name' in params){ |
| | | if ('name' in params) { |
| | | addPlotOverlayData.text = params.name |
| | | } |
| | | |
| | | if('width' in params){ |
| | | if ('width' in params) { |
| | | overlay.setStyle({ |
| | | "font": `${params.width}px sans-serif` |
| | | }) |
| | |
| | | }, |
| | | |
| | | // 修改警车样式 |
| | | editPoliceStyle(params,overlay) { |
| | | if('color' in params && 'pointOverlayData' in overlay.attrParams){ |
| | | editPoliceStyle (params, overlay) { |
| | | if ('color' in params && 'pointOverlayData' in overlay.attrParams) { |
| | | overlay.attrParams.data.color = params.color |
| | | overlay.attrParams.pointOverlayData.attrParams.color = params.color |
| | | let r = parseInt(params.color.slice(1, 3), 16) |
| | |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if('carId' in params){ |
| | | overlay.attrParams.data.carId= params.carId |
| | | if ('carId' in params) { |
| | | overlay.attrParams.data.carId = params.carId |
| | | } |
| | | |
| | | if('policemanId' in params){ |
| | | overlay.attrParams.data.policemanId= params.policemanId |
| | | if ('policemanId' in params) { |
| | | overlay.attrParams.data.policemanId = params.policemanId |
| | | } |
| | | |
| | | if('width' in params){ |
| | | if(overlay.attrParams&&overlay.attrParams.data&&overlay.attrParams.data.type&&overlay.attrParams.data.type == 3) return |
| | | if ('width' in params) { |
| | | if (overlay.attrParams && overlay.attrParams.data && overlay.attrParams.data.type && overlay.attrParams.data.type == 3) return |
| | | let linePosition = '' |
| | | if('position' in params){ |
| | | if ('position' in params) { |
| | | linePosition = params.position.replace(/,/g, ";").replace(/ /g, ",") |
| | | } else { |
| | | linePosition = overlay.attrParams.linePositionStr |
| | | } |
| | | let coords = global.DC.GeoTools.polylineBuffer(linePosition, params.width) |
| | | let positionStr = '' |
| | | coords.forEach((item,index) => { |
| | | if(!(index == coords.length - 1)){ |
| | | coords.forEach((item, index) => { |
| | | if (!(index == coords.length - 1)) { |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | } |
| | | }) |
| | | positionStr = positionStr.slice(0,positionStr.length - 1) |
| | | positionStr = positionStr.slice(0, positionStr.length - 1) |
| | | // 面颜色 |
| | | let color = '' |
| | | // 线颜色 |
| | |
| | | overlay.attrParams.linePositionStr = linePosition |
| | | overlay.attrParams.polygonPositionStr = positionStr |
| | | overlay.attrParams.color = params.color |
| | | |
| | | |
| | | let areaPolygon = new global.DC.Polygon(positionStr) |
| | | drawLayers.addOverlay(areaPolygon) |
| | | areaPolygon.setStyle({ |
| | |
| | | |
| | | // 修改活动警车 |
| | | // id活动id, carId警车id, color颜色, width巡逻路线范围宽度, type线面类型, position坐标 |
| | | updateActivityCar (params,overlay) { |
| | | updateActivityCar (params, overlay) { |
| | | updateActivityCar(params).then(res => { |
| | | if (res.data.success) { |
| | | this.editPoliceStyle(params,overlay) |
| | | this.editPoliceStyle(params, overlay) |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | |
| | | |
| | | // 修改活动警员 |
| | | // id活动id, policemanId警察id ,color颜色 |
| | | updateActivityPolice (params,overlay) { |
| | | updateActivityPolice (params, overlay) { |
| | | updateActivityPolice(params).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }) |
| | | this.editPoliceStyle(params,overlay) |
| | | this.editPoliceStyle(params, overlay) |
| | | } else { |
| | | this.$message({ |
| | | message: '保存失败', |
| | |
| | | }) |
| | | }, |
| | | |
| | | updateSecurityPlot (params,overlay) { |
| | | updateSecurityPlot (params, overlay) { |
| | | updateSecurityPlot(params).then(res => { |
| | | if (res.data.success) { |
| | | this.editPlotStyle(params,overlay) |
| | | this.editPlotStyle(params, overlay) |
| | | this.$message({ |
| | | message: '修改成功', |
| | | type: 'success' |
| | |
| | | // 文字编辑弹窗 |
| | | labelShowPopup (e) { |
| | | this.labelPopupTitle = '添加文字标注' |
| | | this.labelInputFontSize = 40 |
| | | this.labelInputFontColor = '#FFFFFF' |
| | | this.labelInputFontSize = 40 |
| | | this.labelInputFontColor = '#FFFFFF' |
| | | this.addLabelVisible = true |
| | | this.addLabelPosition = e.wgs84SurfacePosition.lng + ' ' + e.wgs84SurfacePosition.lat + ',' + e.wgs84SurfacePosition.lng + ' ' + e.wgs84SurfacePosition.lat |
| | | this.labelInput = '' |
| | |
| | | }) |
| | | } else { |
| | | if (this.labelPopupTitle == "添加文字标注") { |
| | | this.$parent.addSecurityPlot({ securityId: this.showingSecurityId, position: this.addLabelPosition, type: 9, name: this.labelInput ,color:this.labelInputFontColor,width:this.labelInputFontSize}) |
| | | this.$parent.addSecurityPlot({ securityId: this.showingSecurityId, position: this.addLabelPosition, type: 9, name: this.labelInput, color: this.labelInputFontColor, width: this.labelInputFontSize }) |
| | | } else { |
| | | this.updateSecurityPlot({ id: this.labelId, name: this.labelInput,color:this.labelInputFontColor,width:this.labelInputFontSize },addPlotOverlayData) |
| | | this.updateSecurityPlot({ id: this.labelId, name: this.labelInput, color: this.labelInputFontColor, width: this.labelInputFontSize }, addPlotOverlayData) |
| | | } |
| | | this.cancelSaveLabel() |
| | | } |
| | | }, |
| | | |
| | | // 文字标注窗口的删除按钮 |
| | | lableBoxDelete(){ |
| | | this.$parent.deleteSecurityPlot (this.labelId) |
| | | addPlotOverlayData&&addPlotOverlayData.remove() |
| | | lableBoxDelete () { |
| | | this.$parent.deleteSecurityPlot(this.labelId) |
| | | addPlotOverlayData && addPlotOverlayData.remove() |
| | | this.cancelSaveLabel() |
| | | }, |
| | | |
| | |
| | | this.$EventBus.$emit('closeTooltip') |
| | | this.labelId = addPlotOverlayData.attrParams.id |
| | | this.labelPopupTitle = "修改文字标注" |
| | | this.labelInput = addPlotOverlayData.text |
| | | this.labelInputFontSize = Number(addPlotOverlayData.attrParams.item.width) |
| | | this.labelInputFontColor = addPlotOverlayData.attrParams.item.color |
| | | this.labelInput = addPlotOverlayData.text |
| | | this.labelInputFontSize = Number(addPlotOverlayData.attrParams.item.width) |
| | | this.labelInputFontColor = addPlotOverlayData.attrParams.item.color |
| | | this.addLabelVisible = true |
| | | }, |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | destroyed () { |