shuishen
2023-02-22 b1310ebbff92661a76a406af13fa2f72115bdb60
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
4 files modified
182 ■■■■■ changed files
src/styles/base/index.scss 8 ●●●●● patch | view | raw | blame | history
src/views/activity/index.vue 2 ●●●●● patch | view | raw | blame | history
src/views/video/list.vue 165 ●●●●● patch | view | raw | blame | history
src/views/video/region.vue 7 ●●●● patch | view | raw | blame | history
src/styles/base/index.scss
@@ -659,6 +659,14 @@
            height: 100%;
            flex-wrap: wrap;
            &>div {
                display: flex;
                &>div {
                    width: 100px;
                }
            }
            input {
                width: 90%;
                height: 30px;
src/views/activity/index.vue
@@ -875,6 +875,7 @@
            lineObjdata: null,
        }
    },
    created () {
        let userInfo = sessionStorage.getItem("userInfo")
        if (userInfo != null) {
@@ -897,6 +898,7 @@
        this.getEquipmentAll({ type: 1 })
    },
    mounted () {
        this.$parent.$parent.resize('400px', true)
        this.$nextTick(() => {
src/views/video/list.vue
@@ -28,13 +28,14 @@
                <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>
@@ -135,8 +136,19 @@
            :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>
@@ -166,6 +178,9 @@
import flvjs from 'flv.js'
let graphicLayer = null
let plot = undefined
let drawPlotLayers = null
export default {
    inject: ['userInfo'],
@@ -187,7 +202,7 @@
            drawName: '',
            drawInfo: [],
            drawType: 1,
            saveFlag: true,
            // saveFlag: true,
            searchExtensivelyValue: '',
            searchExtensivelyValBoxShow: false,
            searchExtensivelyArray: [],
@@ -196,16 +211,13 @@
                children: 'zones',
                isLeaf: 'leaf'
            },
            defaultProps: {
                children: "children", //代表children为子级
                label: "name", //根据name渲染tree列表
            },
            defaultExpandedKeys: [],
            searchLazyFlag: true,
            searchTreeData: []
            searchTreeData: [],
        }
    },
@@ -214,6 +226,13 @@
    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: {
@@ -228,8 +247,6 @@
            })
            return flvAddress
        },
        async siteClick (e) {
            if (this.flvPlayer != null) {
@@ -277,8 +294,9 @@
        },
        drawDialogBeforeClose () {
            this.drawDialogVisible = false
            this.drawName = ''
            this.removeDrawLayer()
            this.drawDialogVisible = false
        },
        searchChange (e) {
@@ -300,10 +318,10 @@
        },
        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
@@ -315,18 +333,58 @@
            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'
            })
        },
        // 修改范围
@@ -402,24 +460,24 @@
            })
        },
        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 = ''
@@ -454,6 +512,12 @@
                this.drawName = ''
                this.removeDrawLayer()
            }
        },
        // 取消绘制线面
        cancelSaveDrawInfo () {
            this.removeDrawLayer()
            this.drawDialogVisible = false
        },
        insertRegionSaveList (type, positions, name, patrol, extent) {
@@ -601,7 +665,7 @@
            return resolve(data)
        },
        async treeClick (node) {
 treeClick (node) {
            if (node.parent == true) return
            const { longitude, latitude } = node
@@ -803,51 +867,6 @@
            :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;
            }
        }
src/views/video/region.vue
@@ -639,6 +639,11 @@
                type: 'VectorLayer'
            })
            this.$EventBus.$emit('mapRemoveLayer', {
                layerName: 'monitoringLayers',
                type: 'VectorLayer'
            })
            this.saveRangeList.forEach(item => {
                let positionStr = this.convertPositionDate(item.positions, 'polygon')
                let polygonName = 'polygon' + item.id
@@ -703,7 +708,7 @@
                        name: item.name,
                        lng: item.longitude,
                        lat: item.latitude,
                        alt: 0,
                        alt: 10,
                        url: '/img/icon/video.png',
                        // deviceId: item.deviceId
                    },