| | |
| | | |
| | | <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) |
| | | }) |
| | | }, |
| | | |