Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
| | |
| | | * @param {*} positions 坐标 |
| | | * @param {*} name 名称 |
| | | */ |
| | | export const insertRegionSaveList = (type, positions, name, patrol, extent) => { |
| | | export const insertRegionSaveList = (params) => { |
| | | return request({ |
| | | url: '/api/range/range/insertes', |
| | | method: 'post', |
| | | params: { |
| | | type, |
| | | positions, |
| | | name, |
| | | patrol, |
| | | extent |
| | | } |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | |
| | | </div> |
| | | <div class="no-video" v-show="!isHaveMonitor.video8">设备离线</div> |
| | | </div> |
| | | <div class="deleteVideo" v-show="videoShow" @click="videoShow = false">关闭</div> |
| | | <div class="deleteVideo" v-show="videoShow" @click="closeVideo">关闭</div> |
| | | |
| | | <el-dialog :title="policeChooseCarTitle" :modal="false" :visible.sync="policeChooseCarVisible" |
| | | :before-close="policeChooseCarBeforeClose" :close-on-click-modal="true" class="choose-policeCar-box"> |
| | |
| | | layerName: 'polygonLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if (item.activityArea && item.activityArea.length > 0) { |
| | | let polyGonData = item.activityArea.slice(11, item.activityArea.length - 1) |
| | | polyGonData = polyGonData.replace(/,/g, ";") |
| | |
| | | } else { |
| | | this.lineEditVisible = false |
| | | } |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | }, |
| | | |
| | | // 保存活动标绘箭头 |
| | |
| | | getRegionList (positionNewStr) { |
| | | getRegionList({ page: 1, count: 15, range: positionNewStr }).then(res => { |
| | | let monitorData = res.data.data.list |
| | | this.initMonitoringIcon (monitorData) |
| | | this.monitorOption = [] |
| | | monitorData.forEach((item, index) => { |
| | | let flvAddress = '' |
| | |
| | | }) |
| | | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 关闭视频展示 |
| | | closeVideo(){ |
| | | this.videoShow = false |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | }, |
| | | |
| | |
| | | saveLineInfo () { |
| | | this.updateActivityCar(this.policeIconId, '', this.chooseColor, this.lineWidth) |
| | | this.lineEditVisible = false |
| | | }, |
| | | |
| | | // 遍历监控图标 |
| | | initMonitoringIcon (monitoringList) { |
| | | monitoringList.forEach(item => { |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'monitoringLayers', |
| | | type: "billboard", |
| | | params: { |
| | | name: item.name, |
| | | lng: item.longitude, |
| | | lat: item.latitude, |
| | | alt: 1, |
| | | url: '/img/icon/video.png', |
| | | }, |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 修改巡逻路线位置信息 |
| | |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'activeHeatLayer', |
| | | type: 'HeatLayer' |
| | | }) |
| | |
| | | <el-button type="primary" size="mini" @click="draw('polygon')">绘制面</el-button> |
| | | <el-button type="primary" size="mini" @click="draw('polyline')">巡查路线</el-button> |
| | | <el-button type="primary" size="mini" @click="removeDrawLayer">清除</el-button> |
| | | <!-- <el-button type="primary" size="mini" @click="saveDraw">保存</el-button> --> |
| | | <el-button type="primary" size="mini" @click="draww('polyline')">绘制测试</el-button> |
| | | </div> |
| | | <!-- <div class="range-input" v-show="inputpopup"> |
| | | <div class="close" @click="closeRangeInput"></div> |
| | | <h3>请输入距离</h3> |
| | | <input type="text" v-model="range" /> |
| | | <button @click="changeRange" class="btn">确定</button> |
| | | </div>--> |
| | | |
| | | <div class="down-tree"> |
| | | <el-scrollbar> |
| | | <el-tree v-show="searchLazyFlag" :props="props" :load="loadNode" lazy node-key="id" |
| | |
| | | <div v-show="inputpopup"> |
| | | <div>距离:</div> |
| | | <input type="text" v-model="range" placeholder="请输入绘制线的范围" /> |
| | | <!-- <button @click="changeRange" class="btn">确定</button> --> |
| | | </div> |
| | | <div> |
| | | <button @click="saveDrawInfo">保存</button> |
| | |
| | | inputpopup: false, |
| | | changeBtn: false, |
| | | drawName: '', |
| | | drawInfo: [], |
| | | drawType: 1, |
| | | // saveFlag: true, |
| | | searchExtensivelyValue: '', |
| | | searchExtensivelyValBoxShow: false, |
| | | searchExtensivelyArray: [], |
| | |
| | | defaultExpandedKeys: [], |
| | | searchLazyFlag: true, |
| | | searchTreeData: [], |
| | | drawPlotData:{}, |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | drawDialogBeforeClose () { |
| | | this.drawName = '' |
| | | this.removeDrawLayer() |
| | | if(drawPlotLayers!=null){ |
| | | drawPlotLayers.clear() |
| | | } |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.drawDialogVisible = false |
| | | }, |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | // 封装方法绘制线面 type:polygon/polyline |
| | | // draww (type) { |
| | | // if (graphicLayer == null) graphicLayer = new EntityDraw() |
| | | // graphicLayer.activate(type, (lastEventData) => { |
| | | // }) |
| | | // }, |
| | | |
| | | draw (type) { |
| | | let flag = false |
| | | if (graphicLayer == null) graphicLayer = new EntityDraw() |
| | | |
| | | // this.saveFlag = true |
| | | if (type == 'polyline') { |
| | | this.inputpopup = true |
| | | this.drawType = 1 |
| | | } else { |
| | | this.inputpopup = false |
| | | this.drawType = 2 |
| | | } |
| | | const that = this |
| | | |
| | | |
| | | graphicLayer.activate(type, (lastEventData) => { |
| | | flag = true |
| | | this.drawInfo = lastEventData |
| | | console.log(1111, JSON.stringify(lastEventData)) |
| | | this.getRegionList(type, JSON.stringify(lastEventData)) |
| | | this.drawDialogVisible = true |
| | | |
| | | document.oncontextmenu = function () { |
| | | if (flag) { |
| | | this.drawDialogVisible = true |
| | | flag = false |
| | | } |
| | | return false |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | |
| | | draww (type) { |
| | | if (type == 'polyline') { |
| | | this.inputpopup = true |
| | | this.drawType = 1 |
| | |
| | | if (overlay) { |
| | | drawPlotLayers.addOverlay(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | console.log('overlay', overlay) |
| | | this.drawDialogVisible = true |
| | | this.range = 100 |
| | | this.drawPlotData = overlay |
| | | document.oncontextmenu = function () { |
| | | return false |
| | | } |
| | | this.getRegionList(type, overlay) |
| | | }) |
| | | } |
| | | } |
| | |
| | | removeDrawLayer () { |
| | | this.inputpopup = false |
| | | this.monitoringList = this.monitoringSaveList |
| | | graphicLayer.clearLayer() |
| | | // this.saveFlag = true |
| | | this.drawInfo = [] |
| | | if(drawPlotLayers!=null){ |
| | | drawPlotLayers.clear() |
| | | } |
| | | this.drawPlotData = [] |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | |
| | | // 修改范围 |
| | | setRegion (range) { |
| | | graphicLayer.addPolyLineGon(range, (lastEventData) => { |
| | | this.drawInfo = lastEventData |
| | | this.getRegionList('polyline', JSON.stringify(lastEventData)) |
| | | // this.getRegionList('polyline', JSON.stringify(lastEventData)) |
| | | }) |
| | | }, |
| | | |
| | |
| | | |
| | | getRegionList (type, data) { |
| | | let positionStr = '' |
| | | if (type == 'polyline') { |
| | | JSON.parse(data).data.forEach(item => { |
| | | positionStr = positionStr + item[0] + ',' + item[1] + ';' |
| | | }) |
| | | } else { |
| | | JSON.parse(data).data.forEach(item => { |
| | | positionStr = positionStr + item.lng + ',' + item.lat + ';' |
| | | }) |
| | | positionStr = positionStr + JSON.parse(data).data[0].lng + ',' + JSON.parse(data).data[0].lat + ';' |
| | | if(type == 'polyline'){ |
| | | data._positions.forEach(item=>{ |
| | | positionStr = positionStr + item._lng + ',' + item._lat + ';' |
| | | }) |
| | | console.log('positionStr',positionStr); |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionStr, 100) |
| | | let polygon = new global.DC.Polygon(coords) |
| | | let position = '' |
| | | polygon._positions.forEach(item => { |
| | | position += item._lng + ',' + item._lat + ';' |
| | | }) |
| | | position += polygon._positions[0]._lng +',' + polygon._positions[0]._lat+ ';' |
| | | positionStr = position |
| | | }else{ |
| | | data._positions.forEach(item=>{ |
| | | positionStr = positionStr + item._lng + ',' + item._lat + ';' |
| | | }) |
| | | positionStr = positionStr + data._positions[0]._lng + ',' + data._positions[0]._lat + ';' |
| | | } |
| | | |
| | | getRegionList({ |
| | | page: 1, |
| | | count: 20, |
| | |
| | | * @return {*} |
| | | */ |
| | | initMonitoringIcon () { |
| | | this.monitoringList.forEach((item, index) => { |
| | | this.monitoringList.forEach(item => { |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'monitoringLayers', |
| | | type: "billboard", |
| | |
| | | }) |
| | | }, |
| | | |
| | | // saveDraw () { |
| | | // if (this.drawInfo.length != 0) { |
| | | // this.drawDialogVisible = true |
| | | // this.saveFlag = false |
| | | // } else { |
| | | // this.$message({ |
| | | // message: '请先绘制线或者面', |
| | | // type: 'warning' |
| | | // }) |
| | | // } |
| | | // }, |
| | | |
| | | // 保存绘制的线面 |
| | | saveDrawInfo () { |
| | | if (this.drawName == '') { |
| | |
| | | }) |
| | | } else { |
| | | let drawPositionStr = '' |
| | | let drawPositionLineStr = '' |
| | | let extent = 0 |
| | | let width = 0 |
| | | |
| | | if (this.drawType == 1) { |
| | | // 获取线坐标 |
| | | this.drawPlotData._positions.forEach(item => { |
| | | drawPositionStr += item._lng + ' ' + item._lat+ ',' |
| | | }) |
| | | drawPositionStr = drawPositionStr.slice(0, drawPositionStr.length - 1) |
| | | // 求线长度 |
| | | let linePosition = [] |
| | | this.drawInfo.lineData.forEach(item => { |
| | | linePosition.push([item.lng, item.lat]) |
| | | this.drawPlotData._positions.forEach(item => { |
| | | linePosition.push([item._lng, item._lat]) |
| | | }) |
| | | let line = this.$turf.lineString(linePosition) |
| | | let length = this.$turf.length(line, { units: 'kilometers' }) |
| | | extent = length.toFixed(3) |
| | | this.drawInfo.data.forEach(item => { |
| | | drawPositionStr += item[0] + ' ' + item[1] + ',' |
| | | }) |
| | | this.drawInfo.lineData.forEach(item => { |
| | | drawPositionLineStr += item.lng + ' ' + item.lat + ',' |
| | | }) |
| | | drawPositionStr = drawPositionStr.slice(0, drawPositionStr.length - 1) |
| | | drawPositionLineStr = drawPositionLineStr.slice(0, drawPositionLineStr.length - 1) |
| | | } else { |
| | | this.drawInfo.data.forEach(item => { |
| | | // 获取面坐标 |
| | | this.drawPlotData._positions.forEach(item => { |
| | | drawPositionStr += item.lng + ' ' + item.lat + ',' |
| | | }) |
| | | drawPositionStr += this.drawInfo.data[0].lng + ' ' + this.drawInfo.data[0].lat |
| | | drawPositionStr += this.drawPlotData._positions[0]._lng + ' ' + this.drawPlotData._positions[0]._lat |
| | | // 求面面积 |
| | | let polygonPosition = [] |
| | | this.drawPlotData._positions.forEach(item => { |
| | | polygonPosition.push([item._lng, item._lat]) |
| | | }) |
| | | polygonPosition.push([this.drawPlotData._positions[0]._lng,this.drawPlotData._positions[0]._lat]) |
| | | let polygon = this.$turf.polygon([polygonPosition]); |
| | | let area = this.$turf.area(polygon); |
| | | extent = area.toFixed(3) |
| | | } |
| | | |
| | | this.insertRegionSaveList(this.drawType, drawPositionStr, this.drawName, drawPositionLineStr, extent) |
| | | console.log({type:this.drawType, position:drawPositionStr, name:this.drawName, extent: extent,width:this.range},5555,this.drawPlotData._positions); |
| | | this.insertRegionSaveList({type:this.drawType, positions:drawPositionStr, name:this.drawName, extent: extent,width:this.range}) |
| | | this.drawDialogVisible = false |
| | | this.drawName = '' |
| | | this.removeDrawLayer() |
| | | if(drawPlotLayers!=null) { |
| | | drawPlotLayers.clear() |
| | | } |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 取消绘制线面 |
| | | cancelSaveDrawInfo () { |
| | | this.removeDrawLayer() |
| | | this.drawDialogVisible = false |
| | | this.drawDialogBeforeClose () |
| | | }, |
| | | |
| | | insertRegionSaveList (type, positions, name, patrol, extent) { |
| | | insertRegionSaveList(type, positions, name, patrol, extent).then(res => { |
| | | // type线面类型, positions坐标, name名称, width线宽度, extent线长度或面面积 |
| | | insertRegionSaveList (parmas) { |
| | | insertRegionSaveList(parmas).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | |
| | | :header-cell-style="{ 'text-align': 'center', 'background-color': 'rgba(9, 40, 199, 0.5)', 'borderColor': '#324e75' }" |
| | | :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }" @cell-click="rowClick"> |
| | | <el-table-column prop="name" label="范围名称" min-width="50%"></el-table-column> |
| | | <el-table-column prop="extent" label="长度/km" min-width="50%"> |
| | | <el-table-column prop="extent" label="长度km/面积" min-width="50%"> |
| | | <!-- <template slot-scope="scope"> |
| | | <span>{{ scope.row.extent }}</span> |
| | | <span>千米</span> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="操作" min-width="50%"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="flytoRange(scope.row)" type="text" size="small" title="定位"> |
| | | <el-button @click.stop="flytoRange(scope.row)" type="text" size="small" title="定位"> |
| | | <i class="el-icon-location"></i> |
| | | </el-button> |
| | | <el-button @click="deleteRegionSaveList(scope.row.id)" type="text" size="small" |
| | | <el-button @click.stop="deleteRegionSaveList(scope.row.id)" type="text" size="small" |
| | | title="删除"> |
| | | <i class="el-icon-delete"></i> |
| | | </el-button> |
| | |
| | | }) |
| | | |
| | | this.saveRangeList.forEach(item => { |
| | | let positionStr = this.convertPositionDate(item.positions, 'polygon') |
| | | let polygonName = 'polygon' + item.id |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | let positionStr = '' |
| | | if(item.type == 1){ |
| | | let linePositionStr = '' |
| | | linePositionStr = item.positions.replace(/,/g,';') |
| | | linePositionStr = linePositionStr.replace(/ /g, ',') |
| | | linePositionStr +=';' |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'rangeLayer', |
| | | positions: positionStr, |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes( |
| | | 255, 0, 0, 100 |
| | | ), |
| | | polygonName: polygonName |
| | | }) |
| | | |
| | | let polygonLine = this.convertPositionDate(item.patrol, 'line') |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'rangeLayer', |
| | | positions: polygonLine, |
| | | positions: linePositionStr, |
| | | material: global.DC.Color.YELLOW.withAlpha(0.8), |
| | | width: 1, |
| | | }) |
| | | let coords = global.DC.GeoTools.polylineBuffer(linePositionStr, 100) |
| | | let polygon = new global.DC.Polygon(coords) |
| | | let position = '' |
| | | polygon._positions.forEach(item => { |
| | | position += item._lng + ',' + item._lat + ';' |
| | | }) |
| | | positionStr = position |
| | | }else{ |
| | | positionStr = this.convertPositionDate(item.positions, 'polygon') |
| | | } |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'rangeLayer', |
| | | positions: positionStr, |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes( |
| | | 255, 0, 0, 100 |
| | | ), |
| | | polygonName: 'polygon' + item.id |
| | | }) |
| | | |
| | | }) |
| | | |
| | | }, |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | } else { |
| | | this.isShowVideo = { |
| | | video1: false, |
| | |
| | | type7: '', |
| | | type8: '' |
| | | } |
| | | |
| | | getRegionList({ |
| | | if(row.type == 2){ |
| | | getRegionList({ |
| | | page: 1, |
| | | count: 20, |
| | | id: row.id |
| | |
| | | } |
| | | }) |
| | | }) |
| | | }else{ |
| | | let positionStr = row.positions.replace(/,/g,';') |
| | | positionStr = positionStr.replace(/ /g,',') |
| | | positionStr += ';' |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionStr, row.width) |
| | | let polygon = new global.DC.Polygon(coords) |
| | | let position = '' |
| | | polygon._positions.forEach(item => { |
| | | position += item._lng + ',' + item._lat + ';' |
| | | }) |
| | | getRegionList({ |
| | | page: 1, |
| | | count: 20, |
| | | range: position |
| | | }).then(res => { |
| | | let monitorData = res.data.data.list |
| | | |
| | | this.monitoringList = res.data.data.list |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.initMonitoringIcon() |
| | | |
| | | this.monitorOption = [] |
| | | |
| | | monitorData.forEach((item, index) => { |
| | | this.monitorOption.push({ value: index, label: item.name, item }) |
| | | |
| | | if (index < 8) { |
| | | const ind = index + 1 |
| | | this.isShowVideo[`video${ind}`] = true |
| | | this.monitor[`type${ind}`] = item.name |
| | | if (item.status == 0) { |
| | | this.isShowOutline[`video${ind}`] = true |
| | | } |
| | | |
| | | this.getDevices(item.channelId).then(res => { |
| | | this.playVideoList(`flvPlayer${ind}`, `${res}`, `videoElement${ind}`) |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | this.saveRangeID = row.id |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | //#region |
| | | // enterVideoBox (num) { |
| | | // for (let key in this.isShowSelect) { |
| | | // this.isShowSelect[key] = false |
| | |
| | | // enterSelectBox (num) { |
| | | // this.isShowSelect[`video${num}`] = true |
| | | // }, |
| | | // #endregion |
| | | |
| | | }, |
| | | |