| | |
| | | :title="lineEditTitle" |
| | | :modal="false" |
| | | :visible.sync="lineEditVisible" |
| | | :before-close="lineEditBeforeClose" |
| | | :close-on-click-modal="true" |
| | | class="edit-line-box" |
| | | > |
| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-button>查看视频</el-button> |
| | | <el-button>保存</el-button> |
| | | <el-button @click="watchVideo">查看视频</el-button> |
| | | <el-button @click="saveLineInfo">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | :title="polygonAddTitle" |
| | | :modal="false" |
| | | :visible.sync="polygonAddVisible" |
| | | :close-on-click-modal="true" |
| | | class="add-polygon-box" |
| | | > |
| | | <div> |
| | | <div>设置名称:</div> |
| | | <div> |
| | | <input type="text" placeholder="请输入区域名称" v-model="polygonName" /> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-button @click="savePolygonInfo">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | videoShow: false, |
| | | lineEditVisible: false, |
| | | lineEditTitle: '弹窗', |
| | | polygonAddTitle: '新增活动区域', |
| | | polygonAddVisible: false, |
| | | polygonName: '', |
| | | polygonPositionStr: '', |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | this.getCarList() |
| | | |
| | | this.getSecurityList(this.currentPage, this.pagesize) |
| | | |
| | | |
| | | |
| | | }, |
| | | mounted () { |
| | |
| | | id: item.id, |
| | | policemanId: item.policemanId |
| | | }, |
| | | incident: this.overlayTypeClick |
| | | // incident: this.overlayTypeClick |
| | | }) |
| | | |
| | | } else if (item.type == 3 && pointShow) { |
| | |
| | | |
| | | drawArrow (type) { |
| | | if (type == 'polygon') { |
| | | const that = this |
| | | let flag = false |
| | | plot && plot.draw(type, overlay => { |
| | | if (overlay) { |
| | | drawArrowLayers.addOverlay(overlay) |
| | | plot.edit(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | flag = true |
| | | let positionStr = '' |
| | | overlay._positions.forEach(item => { |
| | | positionStr += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | positionStr = positionStr.slice(0, positionStr.length - 1) |
| | | this.polygonPositionStr = positionStr |
| | | // overlay.on(global.DC.MouseEventType.CLICK, this.polygonClick) |
| | | document.oncontextmenu = function () { |
| | | if (flag) { |
| | | that.polygonAddVisible = true |
| | | flag = false |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | |
| | | // 地图绘制元素点击事件 |
| | | overlayTypeClick (e) { |
| | | console.log(e) |
| | | this.policeIconIsCreated = true |
| | | if ('policemanId' in e.overlay.attrParams) { |
| | | this.policeChooseTitle = '选择警员' |
| | |
| | | this.policeType = e.overlay.attrParams.policemanId |
| | | this.policeChooseVisible = true |
| | | } else if ('carId' in e.overlay.attrParams) { |
| | | if (e.overlay.attrParams.carId) { |
| | | this.policeChooseTitle = '选择警车' |
| | | this.policeOption = this.policecarOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.carId |
| | | this.policeChooseVisible = true |
| | | } else { |
| | | console.log(111) |
| | | this.lineEditVisible = true |
| | | } |
| | | |
| | | this.policeChooseTitle = '选择警车' |
| | | this.policeOption = this.policecarOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.carId |
| | | this.policeChooseVisible = true |
| | | } |
| | | }, |
| | | |
| | | // 保存活动标绘箭头 |
| | | addSecurityPlot (securityId, position, type) { |
| | | addSecurityPlot(securityId, position, type).then(res => { |
| | | addSecurityPlot (securityId, position, type, name) { |
| | | addSecurityPlot(securityId, position, type, name).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'warning' |
| | | }) |
| | | } else { |
| | | this.$message({ |
| | | message: '保存失败' |
| | | }) |
| | | } |
| | | this.getSecurityPlotList(securityId, this.arrowBtnSwitch) |
| | | }) |
| | | }, |
| | |
| | | res.data.data.forEach(item => { |
| | | let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let chooseArrow = null |
| | | let nameLabel = null |
| | | if (item.type == 1) { |
| | | chooseArrow = new global.DC.AttackArrow(position) |
| | | } else if (item.type == 2) { |
| | |
| | | chooseArrow = new global.DC.FineArrow(position) |
| | | } else if (item.type == 4) { |
| | | 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) |
| | | // nameLabel.setStyle({ |
| | | // "font": "30px", |
| | | // }) |
| | | } |
| | | chooseArrow.attrParams = { 'id': item.id } |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | |
| | | }) |
| | | }, |
| | | |
| | | updateSecurityPlot (id, position) { |
| | | updateSecurityPlot(id, position).then(res => { |
| | | updateSecurityPlot (id, position, name) { |
| | | updateSecurityPlot(id, position, name).then(res => { |
| | | this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch) |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | // 观看视频 |
| | | watchVideo () { |
| | | this.videoShow = true |
| | | }, |
| | | |
| | | // 保存巡逻路线信息 |
| | | saveLineInfo () { |
| | | console.log('保存') |
| | | }, |
| | | |
| | | // 点击区域 |
| | | // polygonClick () { |
| | | // console.log('polygonClick') |
| | | // }, |
| | | |
| | | // 保存绘制区域 |
| | | savePolygonInfo () { |
| | | this.addSecurityPlot(this.showingSecurityId, this.polygonPositionStr, 5, this.polygonName) |
| | | this.polygonAddVisible = false |
| | | }, |
| | | |
| | | // 获取面的中心点 |
| | | getCenter (str) { |
| | | let itPositionStr = str.slice(11, str.length - 1) |
| | | let positionArr = itPositionStr.split(',') |
| | | let positionNewArr = [] |
| | | positionArr.forEach(item => { |
| | | positionNewArr.push([Number(item.split(' ')[0]), Number(item.split(' ')[1])]) |
| | | }) |
| | | positionNewArr.push([Number(positionArr[0].split(' ')[0]), Number(positionArr[0].split(' ')[1])]) |
| | | let polygon = this.$turf.polygon([positionNewArr]) |
| | | let center = this.$turf.centroid(polygon) |
| | | return [center.geometry.coordinates[0], center.geometry.coordinates[1]] |
| | | }, |
| | | |
| | | }, |
| | | |
| | | computed: { |