| | |
| | | <li> |
| | | <button @click="drawArrow('polygon')" title="多边形">多边形</button> |
| | | </li> |
| | | <li> |
| | | <button @click="drawArrow('billboard','icon1')" title="头像1">头像1</button> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div> |
| | |
| | | <ul> |
| | | <li> |
| | | <!-- <el-button |
| | | title="路线绘制" |
| | | @click="draw('billboard', 'policeman')" |
| | | icon="el-icon-my-route" |
| | | ></el-button>--> |
| | | <button @click="draw('polyline', 'policecar')" title="巡逻路线"> |
| | | <img src="../../../public/img/icon/route1.png" style="height:100%" /> |
| | |
| | | |
| | | <el-dialog :title="polygonAddTitle" :modal="false" :visible.sync="polygonAddVisible" :close-on-click-modal="true" |
| | | class="add-polygon-box" :before-close="cancelSavePolygon"> |
| | | <div class="line" v-show="isNeedName"> |
| | | <!-- <div class="line" v-show="isNeedName"> |
| | | <div class="value-name-box">设置名称:</div> |
| | | <div> |
| | | <input type="text" v-model="polygonName" /> |
| | | </div> |
| | | </div> --> |
| | | <div class="line"> |
| | | <div class="value-name-box">设置透明度:</div> |
| | | <div class="alpha"> |
| | | <el-slider v-model="choosePlotColorAlpha" :format-tooltip="formatTooltip"></el-slider> |
| | | </div> |
| | | </div> |
| | | <div class="line"> |
| | | <div class="value-name-box">选择颜色:</div> |
| | | <div class="pick-color-box"> |
| | | <el-color-picker v-model="choosePlotColor" :predefine="predefineColors" size="small" show-alpha> |
| | | <el-color-picker v-model="choosePlotColor" :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <el-dialog title="修改标绘" :modal="false" :visible.sync="editPlotVisible" :close-on-click-modal="true" |
| | | class="edit-plot-box"> |
| | | <div v-show="polygonName"> |
| | | <!-- <div v-show="polygonName"> |
| | | <div class="value-name-box">设置名称:</div> |
| | | <div> |
| | | <input type="text" v-model="polygonName" /> |
| | | </div> |
| | | </div> --> |
| | | <div> |
| | | <div class="value-name-box">设置透明度:</div> |
| | | <div class="alpha"> |
| | | <el-slider v-model="choosePlotColorAlpha" :format-tooltip="formatTooltip"></el-slider> |
| | | </div> |
| | | </div> |
| | | <div v-show="!polygonName" class="placeholder"></div> |
| | | <div> |
| | | <div class="value-name-box">选择标绘颜色:</div> |
| | | <div class="pick-color-box"> |
| | | <el-color-picker v-model="choosePlotColor" :predefine="predefineColors" size="small" show-alpha> |
| | | <el-color-picker v-model="choosePlotColor" :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | </div> |
| | | </div> |
| | |
| | | polygonName: '', |
| | | polygonPositionStr: '', |
| | | chooseColor: '#1CA085', |
| | | choosePlotColor: 'rgba(255, 69, 0, 0.68)', |
| | | choosePlotColor: '#409EFF', |
| | | choosePlotColorAlpha:48, |
| | | chooseCarColor: '#1CA085', |
| | | choosePoliceColor: '#1CA085', |
| | | chooseLineData: {}, |
| | |
| | | drawLayers.clear() |
| | | }, |
| | | |
| | | drawArrow (type) { |
| | | drawArrow (type,iconType) { |
| | | if (type == 'polygon') { |
| | | const that = this |
| | | let flag = false |
| | |
| | | // overlay.on(global.DC.MouseEventType.CLICK, this.polygonClick) |
| | | document.oncontextmenu = function () { |
| | | if (flag) { |
| | | that.choosePlotColor = 'rgba(255, 69, 0, 0.68)' |
| | | that.choosePlotColor = '#409EFF' |
| | | that.choosePlotColorAlpha = 48 |
| | | that.isNeedName = true |
| | | that.polygonName = '' |
| | | that.polygonAddVisible = true |
| | |
| | | }) |
| | | } |
| | | }, { material: global.DC.Color.RED }) |
| | | } else { |
| | | } else if (type == 'billboard'){ |
| | | console.log(11); |
| | | const that = this |
| | | let flag = false |
| | | |
| | | plot && plot.draw(type, overlay => { |
| | | if (iconType == 'icon1') { |
| | | overlay.icon = '/img/icon/icon1.png' |
| | | } |
| | | if (overlay) { |
| | | drawArrowLayers.addOverlay(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | console.log(overlay,3333); |
| | | }) |
| | | } |
| | | }) |
| | | }else { |
| | | const that = this |
| | | let flag = false |
| | | arrowPlot && arrowPlot.draw(type, overlay => { |
| | |
| | | drawArrowLayers.addOverlay(overlay) |
| | | document.oncontextmenu = function () { |
| | | if (flag) { |
| | | that.choosePlotColor = 'rgba(255, 69, 0, 0.68)' |
| | | that.choosePlotColor = '#409EFF' |
| | | that.isNeedName = false |
| | | that.polygonAddVisible = true |
| | | flag = false |
| | |
| | | this.isHaveArrow = res.data.data.some(item => { |
| | | return item |
| | | }) |
| | | console.log(res.data.data,1111); |
| | | res.data.data.forEach(item => { |
| | | let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let chooseArrow = null |
| | |
| | | chooseArrow = new global.DC.TailedAttackArrow(position) |
| | | } else if (item.type == 5) { |
| | | chooseArrow = new global.DC.Polygon(position) |
| | | let center = this.getCenter(item.position) |
| | | let centerPosition = new global.DC.Position(center[0], center[1]) |
| | | nameLabel = new global.DC.Label(centerPosition, item.name) |
| | | arrowsListLayer.addOverlay(nameLabel) |
| | | // let center = this.getCenter(item.position) |
| | | // let centerPosition = new global.DC.Position(center[0], center[1]) |
| | | // nameLabel = new global.DC.Label(centerPosition, item.name) |
| | | // arrowsListLayer.addOverlay(nameLabel) |
| | | // nameLabel.setStyle({ |
| | | // "font": "30px", |
| | | // }) |
| | |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 69, 0, 173) |
| | | } else { |
| | | // if(item.type == 5){ |
| | | let colorNumber =item.color.slice(5,item.color.length-1) |
| | | let colorArr = colorNumber.split(',') |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(Number(colorArr[0]), Number(colorArr[1]), Number(colorArr[2]),Math.floor(Number(colorArr[3])*255)) |
| | | // }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) |
| | | // } |
| | | console.log('color',item.color,color); |
| | | 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) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | } |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color, 'name': item.name } |
| | | // chooseArrow.attrParams = { 'id': item.id, 'color': item.color, 'name': item.name } |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color } |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | |
| | | // 单击。标绘箭头 |
| | | reeditArrowClick (e) { |
| | | this.plotOverlayData = e |
| | | this.choosePlotColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : 'rgba(255, 69, 0, 0.68)' |
| | | this.polygonName = e.overlay.attrParams.name |
| | | this.choosePlotColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color.slice(0,7) : '#409EFF' |
| | | this.choosePlotColorAlpha = e.overlay.attrParams.color != '' ? Number(e.overlay.attrParams.color.split(',')[1]) : 48 |
| | | console.log(e.overlay.attrParams.color,this.choosePlotColorAlpha,666); |
| | | // this.polygonName = e.overlay.attrParams.name |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) { |
| | | this.plotId = e.overlay.attrParams.id |
| | | this.editPlotVisible = true |
| | |
| | | |
| | | // 保存标绘修改 |
| | | savePlot () { |
| | | if (this.polygonName == '') { |
| | | this.$message({ |
| | | message: '请设置名称', |
| | | type: 'warning' |
| | | }) |
| | | } else { |
| | | this.updateSecurityPlot({ id: this.plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor, name: this.polygonName }) |
| | | this.editPlotVisible = false |
| | | } |
| | | // this.updateSecurityPlot({ id: this.plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha, name: this.polygonName }) |
| | | this.updateSecurityPlot({ id: this.plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.editPlotVisible = false |
| | | }, |
| | | |
| | | updateSecurityPlot (params) { |
| | |
| | | // 保存绘制区域 |
| | | savePolygonInfo () { |
| | | if (this.isNeedName) { |
| | | if (this.polygonName == '') { |
| | | this.$message({ |
| | | message: '请输入名称', |
| | | type: 'warning' |
| | | }) |
| | | } else { |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.polygonPositionStr, type: 5, name: this.polygonName, color: this.choosePlotColor }) |
| | | this.polygonAddVisible = false |
| | | } |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.polygonPositionStr, type: 5, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.polygonAddVisible = false |
| | | } else { |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.arrowPositionStr, type: this.plotSaveType, color: this.choosePlotColor }) |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.arrowPositionStr, type: this.plotSaveType, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.polygonAddVisible = false |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | return arr |
| | | } |
| | | }, |
| | | |
| | | // 计算透明度值 |
| | | formatTooltip(val) { |
| | | return val / 100; |
| | | }, |
| | | |
| | | }, |
| | | |