| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:17 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-02-24 14:34:25 |
| | | * @LastEditTime: 2023-03-02 16:11:51 |
| | | * @FilePath: \srs-police-affairs\src\views\video\region.vue |
| | | * @Description: 辖区管理 |
| | | * |
| | |
| | | <el-table-column prop="name" label="范围名称" min-width="50%"></el-table-column> |
| | | <el-table-column prop="extent" label="长度km/面积㎡" min-width="50%"> |
| | | <!-- <template slot-scope="scope"> |
| | | <span>{{ scope.row.extent }}</span> |
| | | <span>千米</span> |
| | | </template>--> |
| | | <span>{{ scope.row.extent }}</span> |
| | | <span>千米</span> |
| | | </template>--> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="操作" min-width="50%"> |
| | | <template slot-scope="scope"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video1"> |
| | | <video id="videoElement1" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video1">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video1">设备离线中…</div> |
| | | </div> |
| | | <div class="item video2" v-show="isShowVideo.video2"> |
| | | <div class="select" v-show="isShowSelect.video2"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video2"> |
| | | <video id="videoElement2" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video2">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video2">设备离线中…</div> |
| | | </div> |
| | | <div class="item video3" v-show="isShowVideo.video3"> |
| | | <div class="select" v-show="isShowSelect.video3"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video3"> |
| | | <video id="videoElement3" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video3">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video3">设备离线中…</div> |
| | | </div> |
| | | <div class="item video4" v-show="isShowVideo.video4"> |
| | | <div class="select" v-show="isShowSelect.video4"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video4"> |
| | | <video id="videoElement4" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video4">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video4">设备离线中…</div> |
| | | </div> |
| | | <div class="item video5" v-show="isShowVideo.video5"> |
| | | <div class="select" v-show="isShowSelect.video5"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video5"> |
| | | <video id="videoElement5" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video5">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video5">设备离线中…</div> |
| | | </div> |
| | | <div class="item video6" v-show="isShowVideo.video6"> |
| | | <div class="select" v-show="isShowSelect.video6"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video6"> |
| | | <video id="videoElement6" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video6">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video6">设备离线中…</div> |
| | | </div> |
| | | <div class="item video7" v-show="isShowVideo.video7"> |
| | | <div class="select" v-show="isShowSelect.video7"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video7"> |
| | | <video id="videoElement7" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video7">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video7">设备离线中…</div> |
| | | </div> |
| | | <div class="item video8" v-show="isShowVideo.video8"> |
| | | <div class="select" v-show="isShowSelect.video8"> |
| | |
| | | <div class="video" v-show="!isShowOutline.video8"> |
| | | <video id="videoElement8" autoplay controls width="100%" height="100%" style="object-fit: fill"></video> |
| | | </div> |
| | | <div class="outline" v-show="isShowOutline.video8">设备离线</div> |
| | | <div class="outline" v-show="isShowOutline.video8">设备离线中…</div> |
| | | </div> |
| | | <!-- <div class="deleteVideo" v-show="isShowVideo.video1" @click="deleteVideo">关闭</div> --> |
| | | |
| | |
| | | |
| | | <el-dialog title="修改范围" :modal="false" :visible.sync="editRangeVisible" :close-on-click-modal="true" |
| | | class="edit-range-box"> |
| | | <div class="line"> |
| | | <div class="line"> |
| | | <div class="value-name-box">选择范围颜色:</div> |
| | | <div class="pick-color-box"> |
| | | <el-color-picker |
| | | v-model="chooseRangeColor" |
| | | :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | <el-color-picker v-model="chooseRangeColor" :predefine="predefineColors" size="small"> |
| | | </el-color-picker> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="isLineRange"> |
| | | <div class="value-name-box">设置范围宽度:</div> |
| | | <div class="input-width-box"> |
| | |
| | | <script> |
| | | import EntityDraw from "@/utils/EntityDraw.js" |
| | | import { listQuery, accurateSearch } from "@/utils/search.js" |
| | | import { getVideoList, getDevices, getRegionSaveList, deleteRegionSaveList, getRegionList ,updataRegionSaveList} from '@/api/video/index.js' |
| | | import { getVideoList, getDevices, getRegionSaveList, deleteRegionSaveList, getRegionList, updataRegionSaveList } from '@/api/video/index.js' |
| | | import flvjs from 'flv.js' |
| | | |
| | | // let graphicLayer = null |
| | |
| | | video8: false, |
| | | }, |
| | | chooseRangeColor: '#FF0000', |
| | | editRangeVisible:false, |
| | | lineWidth:'', |
| | | rangeOverlayData:{}, |
| | | isLineRange:false, |
| | | isEndDrawPlot:true, |
| | | editRangeVisible: false, |
| | | lineWidth: '', |
| | | rangeOverlayData: {}, |
| | | isLineRange: false, |
| | | isEndDrawPlot: true, |
| | | 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' |
| | | '#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' |
| | | ], |
| | | } |
| | | }, |
| | |
| | | // graphicLayer = new EntityDraw() |
| | | this.$nextTick(() => { |
| | | if (rangeLayer == null) { |
| | | rangeLayer = new global.DC.VectorLayer('rangeLayer') |
| | | rangeLayer = new global.DC.VectorLayer('rangeLayer') |
| | | global.viewer.addLayer(rangeLayer) |
| | | plot = new global.DC.Plot(global.viewer) |
| | | } |
| | |
| | | global.viewer.addLayer(rangeLineLayer) |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | |
| | | if (rangeLineLayer != null) { |
| | | rangeLineLayer.clear() |
| | | } |
| | | |
| | | this.saveRangeList.forEach(item => { |
| | | console.log(item,656565656); |
| | | console.log(item, 656565656) |
| | | let positionStr = '' |
| | | if(item.type == 1){ |
| | | let linePositionStr = '' |
| | | linePositionStr = item.positions.replace(/,/g,';') |
| | | linePositionStr = linePositionStr.replace(/ /g, ',') |
| | | linePositionStr +=';' |
| | | 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{ |
| | | if (item.type == 1) { |
| | | let linePositionStr = '' |
| | | linePositionStr = item.positions.replace(/,/g, ';') |
| | | linePositionStr = linePositionStr.replace(/ /g, ',') |
| | | linePositionStr += ';' |
| | | 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') |
| | | } |
| | | 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) |
| | | } |
| | | 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) |
| | | } |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'rangeSaveLayer', |
| | | positions: positionStr, |
| | | material: color, |
| | | polygonName: 'polygon' + item.id, |
| | | params:item, |
| | | incident: this.overlayTypeClick |
| | | layerName: 'rangeSaveLayer', |
| | | positions: positionStr, |
| | | material: color, |
| | | polygonName: 'polygon' + item.id, |
| | | params: item, |
| | | incident: this.overlayTypeClick |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | |
| | | // 点击线面 |
| | | overlayTypeClick(e){ |
| | | if(this.isEndDrawPlot == false){ |
| | | overlayTypeClick (e) { |
| | | if (this.isEndDrawPlot == false) { |
| | | this.$message({ |
| | | message: '请先完成编辑', |
| | | type: 'error' |
| | | }) |
| | | }else{ |
| | | this.rangeOverlayData = e.overlay |
| | | this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100 |
| | | this.chooseRangeColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#FF0000' |
| | | if(e.overlay.attrParams.type == 1){ |
| | | this.isLineRange = true |
| | | }else{ |
| | | this.isLineRange = false |
| | | } |
| | | this.editRangeVisible =true |
| | | } else { |
| | | this.rangeOverlayData = e.overlay |
| | | this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100 |
| | | this.chooseRangeColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#FF0000' |
| | | if (e.overlay.attrParams.type == 1) { |
| | | this.isLineRange = true |
| | | } else { |
| | | this.isLineRange = false |
| | | } |
| | | this.editRangeVisible = true |
| | | } |
| | | }, |
| | | |
| | | // 保存范围修改 |
| | | saveRangeInfo() { |
| | | this.updataRegionSaveList({ id: this.rangeOverlayData.attrParams.id, color: this.chooseRangeColor ,width:this.lineWidth}) |
| | | saveRangeInfo () { |
| | | this.updataRegionSaveList({ id: this.rangeOverlayData.attrParams.id, color: this.chooseRangeColor, width: this.lineWidth }) |
| | | this.editRangeVisible = false |
| | | }, |
| | | |
| | | // 更新范围信息 |
| | | updataRegionSaveList(params){ |
| | | this.isEndDrawPlot =true |
| | | updataRegionSaveList(params).then(res=>{ |
| | | updataRegionSaveList (params) { |
| | | this.isEndDrawPlot = true |
| | | updataRegionSaveList(params).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | message: '保存成功', |
| | |
| | | }, |
| | | |
| | | // 删除线面 |
| | | deleteRange(){ |
| | | deleteRange () { |
| | | deleteRegionSaveList(this.rangeOverlayData.attrParams.id).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | |
| | | message: '删除失败' |
| | | }) |
| | | } |
| | | this.editRangeVisible = false |
| | | this.editRangeVisible = false |
| | | }) |
| | | }, |
| | | |
| | | // 编辑线面 |
| | | editRange(){ |
| | | editRange () { |
| | | this.editRangeVisible = false |
| | | this.isEndDrawPlot =false |
| | | this.isEndDrawPlot = false |
| | | let overlayData = this.rangeOverlayData |
| | | if(this.rangeOverlayData.attrParams.type == 1){ |
| | | if (this.rangeOverlayData.attrParams.type == 1) { |
| | | this.$EventBus.$emit('mapRemovePolygonLayer', { |
| | | layerName: 'rangeSaveLayer', |
| | | polygonName: 'polygon' + this.rangeOverlayData.attrParams.id, |
| | | type: 'VectorLayer' |
| | | }) |
| | | overlayData = this.rangeOverlayData.attrParams.lineObj |
| | | }) |
| | | overlayData = this.rangeOverlayData.attrParams.lineObj |
| | | } |
| | | plot.edit(overlayData, (e) => { |
| | | let position = '' |
| | |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | rangeLayer.addOverlay(overlayData) |
| | | this.updataRegionSaveList({ id: this.rangeOverlayData.attrParams.id, color: this.chooseRangeColor ,width:this.lineWidth,positions:position}) |
| | | this.updataRegionSaveList({ id: this.rangeOverlayData.attrParams.id, color: this.chooseRangeColor, width: this.lineWidth, positions: position }) |
| | | }) |
| | | }, |
| | | |
| | |
| | | // graphicLayer.destroy() |
| | | |
| | | if (rangeLineLayer != null) { |
| | | rangeLineLayer.clear() |
| | | } |
| | | |
| | | rangeLineLayer.clear() |
| | | } |
| | | |
| | | this.$parent.$parent.$parent.resize('0px') |
| | | |
| | | if (this.flvPlayer != null) { |