| | |
| | | <el-option v-for="item in policeOption" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | <div class="line"> |
| | | <div class="value-name-box">选择颜色:</div> |
| | | <div class="pick-color-box"> |
| | | <el-color-picker |
| | | v-model="chooseCarColor" |
| | | :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | </div> |
| | | </div> |
| | | <el-button @click="determine" v-show="!isChoosePoliceElementDisabled">确定</el-button> |
| | | <el-button @click="deletePoliceElement" v-show="!isChoosePoliceElementDisabled">删除</el-button> |
| | | <el-button @click="cancel" v-show="!isChoosePoliceElementDisabled">取消</el-button> |
| | |
| | | <el-tree :data="policeTreeData" :props="policeDefaultProps" @node-click="handlePoliceNodeClick" |
| | | @mousedown.native="preventFocusLost" ref="policeTree" :filter-node-method="filterPoliceNode" |
| | | v-show="searchTreeShowFlag"></el-tree> |
| | | <div class="line"> |
| | | <div class="value-name-box">选择颜色:</div> |
| | | <div class="pick-color-box"> |
| | | <el-color-picker |
| | | v-model="choosePoliceColor" |
| | | :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | </div> |
| | | </div> |
| | | <div class="police-btn-box"> |
| | | <el-button @click="determine" v-show="!isChoosePoliceElementDisabled">确定</el-button> |
| | | <el-button @click="deletePoliceElement" v-show="!isChoosePoliceElementDisabled">删除</el-button> |
| | |
| | | let drawArrowLayers = null |
| | | let polylineAreaLayer = null |
| | | let arrowsListLayer = null |
| | | let pointCircleLayer = null |
| | | let pointCircleManLayer = null |
| | | let pointCircleCarLayer = null |
| | | let plot = undefined |
| | | let arrowPlot = undefined |
| | | let lineLayer = undefined |
| | |
| | | polygonPositionStr: '', |
| | | chooseColor: '#1CA085', |
| | | choosePlotColor: '#1CA085', |
| | | chooseCarColor:'#1CA085', |
| | | choosePoliceColor:'#1CA085', |
| | | chooseLineData: {}, |
| | | lineWidth: 100, |
| | | linePosition: '', |
| | |
| | | isLineEdit: true, |
| | | addLinePosition: '', |
| | | color: 'rgba(255, 69, 0)', |
| | | predefineColors: [ |
| | | '#ff4500', |
| | | '#ff8c00', |
| | | '#ffd700', |
| | | '#90ee90', |
| | | '#00ced1', |
| | | '#1e90ff', |
| | | '#c71585', |
| | | 'rgba(255, 69, 0, )', |
| | | 'rgb(255, 120, 0)', |
| | | 'hsv(51, 100, 98)', |
| | | 'hsva(120, 40, 94)', |
| | | 'hsl(181, 100%, 37%)', |
| | | 'hsla(209, 100%, 56%)', |
| | | '#c7158577' |
| | | ] |
| | | predefineColors: [ |
| | | '#ff4500', |
| | | '#ff8c00', |
| | | '#ffd700', |
| | | '#90ee90', |
| | | '#00ced1', |
| | | '#1e90ff', |
| | | '#c71585', |
| | | 'rgba(255, 69, 0, )', |
| | | 'rgb(255, 120, 0)', |
| | | 'hsv(51, 100, 98)', |
| | | 'hsva(120, 40, 94)', |
| | | 'hsl(181, 100%, 37%)', |
| | | 'hsla(209, 100%, 56%)', |
| | | '#c7158577' |
| | | ], |
| | | } |
| | | }, |
| | | |
| | |
| | | arrowPlot = new global.DC.Plot(global.viewer) |
| | | } |
| | | |
| | | if (pointCircleLayer == null) { |
| | | pointCircleLayer = new global.DC.VectorLayer('pointCircleLayer') |
| | | global.viewer.addLayer(pointCircleLayer) |
| | | if (pointCircleManLayer == null) { |
| | | pointCircleManLayer = new global.DC.VectorLayer('pointCircleManLayer') |
| | | global.viewer.addLayer(pointCircleManLayer) |
| | | } |
| | | |
| | | if (pointCircleCarLayer == null) { |
| | | pointCircleCarLayer = new global.DC.VectorLayer('pointCircleCarLayer') |
| | | global.viewer.addLayer(pointCircleCarLayer) |
| | | } |
| | | |
| | | if (arrowsListLayer == null) { |
| | |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if(pointCircleCarLayer!=null){ |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | getSecurityPoliceList(securityId).then(res => { |
| | | this.isHavePoliceMan = res.data.data.some(item => { |
| | | return item.type == 3 |
| | |
| | | }) |
| | | |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policeman', item.id, item.policemanId, item.deptId) |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policeman', item.id, item.policemanId, item.deptId,item.color) |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | 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) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | } |
| | | pointCircleCarLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'billboard', |
| | |
| | | } |
| | | if (lineLayer != null) { |
| | | lineLayer.clear() |
| | | } |
| | | if(pointCircleManLayer!=null){ |
| | | pointCircleManLayer.clear() |
| | | } |
| | | |
| | | getSecurityCarList(securityId).then(res => { |
| | |
| | | }, |
| | | }) |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policecar', item.id, item.carId, item.deptId) |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policecar', item.id, item.carId, item.deptId,item.color) |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | 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) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | } |
| | | pointCircleManLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'billboard', |
| | |
| | | incident: this.overlayTypeClick, |
| | | mouseOverIcident:this.pointMouseOver |
| | | }) |
| | | // let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | // let circle = new global.DC.Circle(position, 20) |
| | | // circle.size = [32,32] |
| | | // pointCircleLayer.addOverlay(circle) |
| | | // circle.setStyle({ |
| | | // "material": global.DC.Color.YELLOW, |
| | | // }) |
| | | |
| | | } |
| | | }) |
| | | }) |
| | |
| | | }, |
| | | |
| | | // 修改活动警员 |
| | | updateActivityPolice (id, policemanId) { |
| | | updateActivityPolice(id, policemanId).then(res => { |
| | | // id活动id, policemanId警察id ,color颜色 |
| | | updateActivityPolice (params) { |
| | | updateActivityPolice(params).then(res => { |
| | | this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |
| | | // 修改活动警车 |
| | | updateActivityCar (id, carId, color, width, type, position) { |
| | | updateActivityCar(id, carId, color, width, type, position).then(res => { |
| | | // id活动id, carId警车id, color颜色, width巡逻路线范围宽度, type线面类型, position坐标 |
| | | updateActivityCar (params) { |
| | | updateActivityCar(params).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | |
| | | }, |
| | | |
| | | // 活动添加警员 |
| | | addActivityPolice (policemanId, position, securityId, type) { |
| | | addActivityPolice(policemanId, position, securityId, type).then(res => { |
| | | // policemanId警车id, position坐标, securityId活动id, type线面类型 |
| | | addActivityPolice (params) { |
| | | addActivityPolice(params).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '添加成功', |
| | |
| | | message: '添加失败' |
| | | }) |
| | | } |
| | | this.getSecurityPoliceList(securityId, this.policeSwitch) |
| | | this.getSecurityPoliceList(params.securityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |
| | | // 转换 点 坐标数据 |
| | | convertBillboardPositionDate (data, iconName, plotId, policeId, deptId) { |
| | | convertBillboardPositionDate (data, iconName, plotId, policeId, deptId,color) { |
| | | let positionStr = data |
| | | positionStr = data.slice(6, positionStr.length - 1) |
| | | let positionArr = positionStr.split(" ") |
| | |
| | | if (iconName == 'activity') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0, url: '/img/icon/activity.png' } |
| | | } else if (iconName == 'policeman') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0, url: '/img/icon/man3.png', id: plotId, policemanId: policeId, deptId: deptId } |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.01, url: '/img/icon/man3.png', id: plotId, policemanId: policeId, deptId: deptId,color:color } |
| | | } else if (iconName == 'policecar') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0, url: '/img/icon/car3.png', id: plotId, carId: policeId, deptId: deptId } |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.01, url: '/img/icon/car3.png', id: plotId, carId: policeId, deptId: deptId,color:color } |
| | | } |
| | | return positionObj |
| | | }, |
| | |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if(pointCircleManLayer!=null){ |
| | | pointCircleManLayer.clear() |
| | | } |
| | | if(pointCircleCarLayer!=null){ |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | }, |
| | | |
| | | // 地图元素绘制 |
| | |
| | | if (policeType == 'policeman') { |
| | | that.searchPoliceTreeId = '' |
| | | that.searchPoliceTreeName = '' |
| | | that.choosePoliceColor = '#FF0000' |
| | | that.policeChooseVisible = true |
| | | } else if (policeType == 'policecar') { |
| | | that.policeOption = that.policecarOption |
| | | that.chooseCarColor = '#FF0000' |
| | | that.policeChooseCarVisible = true |
| | | } |
| | | flag = false |
| | |
| | | } |
| | | if (this.policeChooseCarVisible == true) { |
| | | this.policeChooseCarVisible = false |
| | | this.addCarAndRange({ carId: this.policeType, position: position, securityId: this.showingSecurityId, type: type }) |
| | | this.addCarAndRange({ carId: this.policeType, position: position, securityId: this.showingSecurityId, type: type ,color:this.chooseCarColor}) |
| | | } else if (this.policeChooseVisible == true) { |
| | | this.policeChooseVisible = false |
| | | |
| | | this.addActivityPolice(this.searchPoliceTreeId, position, this.showingSecurityId, type) |
| | | this.addActivityPolice({policemanId:this.searchPoliceTreeId, position:position, securityId:this.showingSecurityId, type:type,color:this.choosePoliceColor}) |
| | | } |
| | | this.policeIconIsCreated = false |
| | | } else { |
| | | if (this.policeChooseVisible == true) { |
| | | this.updateActivityPolice(this.policeIconId, this.searchPoliceTreeId) |
| | | this.updateActivityPolice({id:this.policeIconId, policemanId:this.searchPoliceTreeId,color:this.choosePoliceColor}) |
| | | this.policeChooseVisible = false |
| | | } else if (this.policeChooseCarVisible == true) { |
| | | this.updateActivityCar(this.policeIconId, this.policeType) |
| | | this.updateActivityCar({id:this.policeIconId, carId:this.policeType,color:this.chooseCarColor}) |
| | | this.policeChooseCarVisible = false |
| | | } |
| | | this.policeIconIsCreated = false |
| | |
| | | if ('policemanId' in e.overlay.attrParams) { |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.policemanId |
| | | this.choosePoliceColor = e.overlay.attrParams.color!=''?e.overlay.attrParams.color:'#FF0000' |
| | | let choosePoliceName = this.platFn(this.policeTreeData).find(item => item.id == e.overlay.attrParams.policemanId).name |
| | | this.searchPoliceTreeName = choosePoliceName |
| | | this.policeIconIsCreated = true |
| | |
| | | this.policeOption = this.policecarOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.carId |
| | | this.chooseCarColor = e.overlay.attrParams.color!=''?e.overlay.attrParams.color:'#FF0000' |
| | | this.policeIconIsCreated = true |
| | | this.policeChooseCarVisible = true |
| | | } |
| | |
| | | |
| | | // 保存巡逻路线信息 |
| | | saveLineInfo () { |
| | | this.updateActivityCar(this.policeIconId, '', this.chooseColor, this.lineWidth) |
| | | this.updateActivityCar({id:this.policeIconId,color: this.chooseColor, width:this.lineWidth}) |
| | | this.lineEditVisible = false |
| | | }, |
| | | |
| | |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | lineLayer.addOverlay(overlayData) |
| | | this.updateActivityCar(this.policeIconId, '', this.chooseColor, this.lineWidth, 1, position) |
| | | this.updateActivityCar({id:this.policeIconId, color:this.chooseColor, width:this.lineWidth, type:1, position:position}) |
| | | }) |
| | | }, |
| | | |
| | |
| | | searchPoliceTreeName (val) { |
| | | this.$refs.policeTree.filter(val) |
| | | }, |
| | | choosePlotColor(val){ |
| | | console.log(val); |
| | | // #1FBC9C |
| | | // #1CA085 |
| | | // #2ECC70 |
| | | // #27AF60 |
| | | // #3398DB |
| | | // #2980B9 |
| | | // #A463BF |
| | | // #8E43AD |
| | | // #3D556E |
| | | // #222F3D |
| | | // #F2C511 |
| | | // #F39C19 |
| | | // #E84B3C |
| | | // #C0382B |
| | | // #DDE6E8 |
| | | // #BDC3C8 |
| | | }, |
| | | }, |
| | | |
| | | destroyed () { |
| | |
| | | analyseLayer.clear() |
| | | arrowsListLayer.clear() |
| | | lineLayer.clear() |
| | | if(pointCircleManLayer!=null){ |
| | | pointCircleManLayer.clear() |
| | | } |
| | | |
| | | if(pointCircleCarLayer!=null){ |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | this.removeAll() |
| | | this.removeAllArrow() |
| | | if (tc) { |