| | |
| | | <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="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>--> |
| | | |
| | | <div class="down-tree"> |
| | | <el-scrollbar> |
| | |
| | | :close-on-click-modal="true" |
| | | class="video-draw-box" |
| | | > |
| | | <input type="text" v-model="drawName" placeholder="请输入绘制线的名称" /> |
| | | <button @click="saveDrawInfo">保存</button> |
| | | <div> |
| | | <div>名称:</div> |
| | | <input type="text" v-model="drawName" placeholder="请输入绘制线的名称" /> |
| | | </div> |
| | | <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> |
| | | <button @click="cancelSaveDrawInfo">取消</button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import flvjs from 'flv.js' |
| | | |
| | | let graphicLayer = null |
| | | let plot = undefined |
| | | let drawPlotLayers = null |
| | | |
| | | |
| | | export default { |
| | | inject: ['userInfo'], |
| | |
| | | drawName: '', |
| | | drawInfo: [], |
| | | drawType: 1, |
| | | saveFlag: true, |
| | | // saveFlag: true, |
| | | searchExtensivelyValue: '', |
| | | searchExtensivelyValBoxShow: false, |
| | | searchExtensivelyArray: [], |
| | |
| | | children: 'zones', |
| | | isLeaf: 'leaf' |
| | | }, |
| | | |
| | | defaultProps: { |
| | | children: "children", //代表children为子级 |
| | | label: "name", //根据name渲染tree列表 |
| | | }, |
| | | |
| | | defaultExpandedKeys: [], |
| | | |
| | | searchLazyFlag: true, |
| | | searchTreeData: [] |
| | | searchTreeData: [], |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | mounted () { |
| | | this.$parent.$parent.$parent.resize('400px', true) |
| | | this.$nextTick(()=>{ |
| | | if (drawPlotLayers == null) { |
| | | drawPlotLayers = new global.DC.VectorLayer('drawPlotLayers') |
| | | global.viewer.addLayer(drawPlotLayers) |
| | | plot = new global.DC.Plot(global.viewer) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | }) |
| | | return flvAddress |
| | | }, |
| | | |
| | | |
| | | |
| | | async siteClick (e) { |
| | | if (this.flvPlayer != null) { |
| | |
| | | }, |
| | | |
| | | drawDialogBeforeClose () { |
| | | this.drawDialogVisible = false |
| | | this.drawName = '' |
| | | this.removeDrawLayer() |
| | | this.drawDialogVisible = false |
| | | }, |
| | | |
| | | searchChange (e) { |
| | |
| | | }, |
| | | |
| | | draw (type) { |
| | | |
| | | let flag = false |
| | | if (graphicLayer == null) graphicLayer = new EntityDraw() |
| | | |
| | | this.saveFlag = true |
| | | // this.saveFlag = true |
| | | if (type == 'polyline') { |
| | | this.inputpopup = true |
| | | this.drawType = 1 |
| | |
| | | |
| | | |
| | | 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 |
| | | } else { |
| | | this.inputpopup = false |
| | | this.drawType = 2 |
| | | } |
| | | plot && plot.draw(type,overlay => { |
| | | if(overlay){ |
| | | drawPlotLayers.addOverlay(overlay) |
| | | plot.edit(overlay) |
| | | if (overlay) { |
| | | drawPlotLayers.addOverlay(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | console.log('overlay',overlay); |
| | | document.oncontextmenu = function () { |
| | | return false |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | removeDrawLayer () { |
| | | this.inputpopup = false |
| | | this.monitoringList = this.monitoringSaveList |
| | | graphicLayer.clearLayer() |
| | | this.saveFlag = true |
| | | // this.saveFlag = true |
| | | this.drawInfo = [] |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | }, |
| | | |
| | | // 修改范围 |
| | |
| | | }) |
| | | }, |
| | | |
| | | saveDraw () { |
| | | if (this.drawInfo.length != 0) { |
| | | this.drawDialogVisible = true |
| | | this.saveFlag = false |
| | | } else { |
| | | this.$message({ |
| | | message: '请先绘制线或者面', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | }, |
| | | // saveDraw () { |
| | | // if (this.drawInfo.length != 0) { |
| | | // this.drawDialogVisible = true |
| | | // this.saveFlag = false |
| | | // } else { |
| | | // this.$message({ |
| | | // message: '请先绘制线或者面', |
| | | // type: 'warning' |
| | | // }) |
| | | // } |
| | | // }, |
| | | |
| | | // 保存绘制的线面 |
| | | saveDrawInfo () { |
| | | if (this.drawName == '') { |
| | | this.$message({ |
| | | message: '请输入名称', |
| | | type: 'warning' |
| | | type: 'error' |
| | | }) |
| | | } else { |
| | | let drawPositionStr = '' |
| | |
| | | this.drawName = '' |
| | | this.removeDrawLayer() |
| | | } |
| | | }, |
| | | |
| | | // 取消绘制线面 |
| | | cancelSaveDrawInfo () { |
| | | this.removeDrawLayer() |
| | | this.drawDialogVisible = false |
| | | }, |
| | | |
| | | insertRegionSaveList (type, positions, name, patrol, extent) { |
| | |
| | | return resolve(data) |
| | | }, |
| | | |
| | | async treeClick (node) { |
| | | treeClick (node) { |
| | | if (node.parent == true) return |
| | | |
| | | const { longitude, latitude } = node |
| | |
| | | :deep(.el-button--primary) { |
| | | background-color: #1d5ce4; |
| | | border-color: #1d5ce4; |
| | | } |
| | | } |
| | | |
| | | .range-input { |
| | | position: absolute; |
| | | right: -190px; |
| | | top: 20px; |
| | | width: 180px; |
| | | height: 100px; |
| | | background-color: $bg-color; |
| | | |
| | | input { |
| | | outline: none; |
| | | border: 1px solid #005ca9; |
| | | background-color: transparent; |
| | | width: 160px; |
| | | height: 30px; |
| | | margin-top: 10px; |
| | | color: #fff; |
| | | padding-left: 6px; |
| | | } |
| | | |
| | | .btn { |
| | | width: 60px; |
| | | height: 30px; |
| | | background-color: #65b1ff; |
| | | color: #fff; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .close { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | width: 20px; |
| | | height: 10px; |
| | | } |
| | | |
| | | .close::before { |
| | | content: '\e6db'; |
| | | font-family: element-icons; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |