| | |
| | | |
| | | <script> |
| | | import { |
| | | updateActivityCar, |
| | | updateActivityCar,updateActivityPolice, |
| | | updateSecurityPlot |
| | | } from '@/api/activity/index.js' |
| | | |
| | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 保存新增警力资源 |
| | | addNewPolice(data,type){ |
| | | let positionObj = this.$parent.convertBillboardPositionDate(data, type) |
| | | let positionArr = data.position.slice(7, data.position.length - 2).split(',')[0].split(' ') |
| | |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | if('name' in params){ |
| | |
| | | } |
| | | }, |
| | | |
| | | // 修改警车样式 |
| | | editPoliceStyle(params,overlay) { |
| | | if('color' in params && 'pointOverlayData' in overlay.attrParams){ |
| | | overlay.attrParams.color = params.color |
| | | overlay.attrParams.pointOverlayData.attrParams.color = params.color |
| | | 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 color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | overlay.attrParams.pointOverlayData.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | } |
| | | |
| | | if('carId' in params){ |
| | | overlay.attrParams.data.carId= params.carId |
| | | } |
| | | |
| | | if('policemanId' in params){ |
| | | overlay.attrParams.data.policemanId= params.policemanId |
| | | } |
| | | }, |
| | | |
| | | // 修改活动警车 |
| | | // id活动id, carId警车id, color颜色, width巡逻路线范围宽度, type线面类型, position坐标 |
| | | updateActivityCar (params) { |
| | | updateActivityCar (params,overlay) { |
| | | updateActivityCar(params).then(res => { |
| | | if (res.data.success) { |
| | | this.editPoliceStyle(params,overlay) |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | |
| | | }) |
| | | } |
| | | |
| | | this.$parent.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | // this.$parent.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | }) |
| | | }, |
| | | |
| | | // 修改活动警员 |
| | | // id活动id, policemanId警察id ,color颜色 |
| | | updateActivityPolice (params,overlay) { |
| | | updateActivityPolice(params).then(res => { |
| | | if (res.data.success) { |
| | | this.editPoliceStyle(params,overlay) |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }) |
| | | } else { |
| | | this.$message({ |
| | | message: '保存失败', |
| | | type: 'error' |
| | | }) |
| | | } |
| | | // this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice, getServiceDictionary, getActivityType, addSecurityPlot, getSecurityPlotList, deleteActivityCar, deleteActivityPolice, deleteSecurityPlot, getSearchInfo, getPolicemanTree } from '@/api/activity/index.js' |
| | | import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, getServiceDictionary, getActivityType, addSecurityPlot, getSecurityPlotList, deleteActivityCar, deleteActivityPolice, deleteSecurityPlot, getSearchInfo, getPolicemanTree } from '@/api/activity/index.js' |
| | | import { getEquipmentAll } from '@/api/home/index.js' |
| | | import activityDetail from './components/activityDetail.vue' |
| | | import drawBtnBox from './components/drawBtnBox.vue' |
| | |
| | | this.isHaveLine = res.data.data.some(item => { |
| | | return item.type == 1 |
| | | }) |
| | | |
| | | |
| | | type == 'car' && pointShow && this.addMapCarAndPersonLayers( |
| | | res.data.data.filter(item => item.type == 3), |
| | | 'policecar', |
| | |
| | | * @return {*} |
| | | */ |
| | | addMapLineLayers (data) { |
| | | console.log('data',data); |
| | | data.forEach(item => { |
| | | console.log('item',item); |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | // 线坐标字符串 |
| | | item.linePositionStr = positionNewArr |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 修改活动警员 |
| | | // id活动id, policemanId警察id ,color颜色 |
| | | updateActivityPolice (params) { |
| | | updateActivityPolice(params).then(res => { |
| | | this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |
| | | // 活动添加警车和范围 |
| | | // carId警车id, position坐标, securityId活动id, type线面类型,width缓存范围,color范围颜色 |
| | | addCarAndRange (params) { |
| | |
| | | type: 'error' |
| | | }) |
| | | } |
| | | // this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch, params.type == 1 ? 'line' : 'car') |
| | | }) |
| | | }, |
| | | |
| | |
| | | type: 'error' |
| | | }) |
| | | } |
| | | // this.getSecurityPoliceList(params.securityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |
| | |
| | | } |
| | | } else { |
| | | if (this.policeChooseVisible == true) { |
| | | this.updateActivityPolice({ id: this.policeIconId, policemanId: this.searchPoliceTreeId, color: this.choosePoliceColor }) |
| | | this.$refs.DRAWBTNBOX.updateActivityPolice({ id: this.policeIconId, policemanId: this.searchPoliceTreeId, color: this.choosePoliceColor },policeOverlayData.overlay) |
| | | this.policeChooseVisible = false |
| | | } else if (this.policeChooseCarVisible == true) { |
| | | this.$refs.DRAWBTNBOX.updateActivityCar({ id: this.policeIconId, carId: this.policeType, color: this.chooseCarColor }) |
| | | this.$refs.DRAWBTNBOX.updateActivityCar({ id: this.policeIconId, carId: this.policeType, color: this.chooseCarColor },policeOverlayData.overlay) |
| | | this.policeChooseCarVisible = false |
| | | } |
| | | this.policeIconIsCreated = false |