shuishen
2023-01-11 dee394d6425c2fe0e9631f3586dcae13db1df79e
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/srs-police-affairs
4 files modified
270 ■■■■ changed files
src/components/map/index.vue 1 ●●●● patch | view | raw | blame | history
src/components/select/index.vue 28 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 239 ●●●● patch | view | raw | blame | history
src/views/police/index.vue 2 ●●● patch | view | raw | blame | history
src/components/map/index.vue
@@ -593,6 +593,7 @@
            // let polygon = new global.DC.Polygon(positions)
            // let polygonObj = {}//要在全局定义
            polygonObj[polygonName] = new global.DC.Polygon(positions)
            console.log(layerName, 1212)
            // polygon.setStyle({
            polygonObj[polygonName].setStyle({
                material: material,
src/components/select/index.vue
@@ -1,17 +1,26 @@
<template>
    <div class="selects-container">
        <!-- 选择框 -->
        <div :class="{ 'selects-box-show': !optionsShow, 'selects-box-hide': optionsShow }" class="selects-box"
            @click="optionsShow = !optionsShow">
        <div
            :class="{ 'selects-box-show': !optionsShow, 'selects-box-hide': optionsShow }"
            class="selects-box"
            @click="optionsShow = !optionsShow"
        >
            <div class="text" v-text="checkValue"></div>
            <i class="el-icon-arrow-down"></i>
        </div>
        <!-- 下拉框大盒子 -->
        <div :class="{ 'options-box-show': !optionsShow, 'options-box-hide': optionsShow, issel: options.length >= 4 }"
            class="select-options" :style="{ height: 35 * options.length + 'px' }">
        <div
            :class="{ 'options-box-show': !optionsShow, 'options-box-hide': optionsShow, issel: options.length >= 4 }"
            class="select-options"
            :style="{ height: 35 * options.length + 'px' }"
        >
            <!-- 下拉框 -->
            <div @click="cutValue(item, index)" v-for="(item, index) in options" :key="index">{{ item[optionsName] }}
            </div>
            <div
                @click="cutValue(item, index)"
                v-for="(item, index) in options"
                :key="index"
            >{{ item[optionsName] }}</div>
        </div>
    </div>
</template>
@@ -46,7 +55,6 @@
        //点击换文字的方法
        cutValue (item, index) {
            this.optionsShow = true
            this.$emit("selectCheck", item, index)
        }
    }
@@ -66,8 +74,8 @@
//点击时改变选择框的边框颜色
.selects-box-show {
    border: 1px solid rgba(0, 246, 255, .5);
    box-shadow: inset 0 0 6px rgba(0, 246, 255, .5);
    border: 1px solid rgba(0, 246, 255, 0.5);
    box-shadow: inset 0 0 6px rgba(0, 246, 255, 0.5);
}
//恢复边框颜色
@@ -124,7 +132,7 @@
        //鼠标移到下拉框时的背景
        div:hover {
            background: rgba(45,92,200, 0.8);
            background: rgba(45, 92, 200, 0.8);
            color: white;
        }
src/views/home/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-01-11 15:59:14
 * @LastEditTime: 2023-01-11 17:21:27
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
@@ -46,13 +46,13 @@
        <div ref="RegionSelect" style="left: 0;" class="region-select">
            <map-select class="map-select" @selectCheck="policeStationSelect" :checkValue="policeStationCheckValue"
                :options="policeStationOptions" :optionsName="'policeStationName'"></map-select>
                :options="policeStationOptions" :optionsName="'name'"></map-select>
            <map-select class="map-select" @selectCheck="areaSelect" :checkValue="areaCheckValue" :options="areaOptions"
                :optionsName="'areaCheckName'"></map-select>
                :optionsName="'name'"></map-select>
            <map-select class="map-select" @selectCheck="housingSelect" :checkValue="housingCheckValue"
                :options="housingOptions" :optionsName="'housingsName'"></map-select>
                :options="housingOptions" :optionsName="'name'"></map-select>
        </div>
        <el-dialog :title="panoramaTitle" :modal="true" :visible.sync="panoramaVisible"
@@ -289,8 +289,7 @@
                </div>
            </div>
            <div v-show="policeInformationType == '出警信息' && JSON.stringify(CJdata) == '{}'" class="box no-data">
                暂无数据
            <div v-show="policeInformationType == '出警信息' && JSON.stringify(CJdata) == '{}'" class="box no-data">暂无数据
            </div>
        </el-dialog>
@@ -303,10 +302,6 @@
</template>
<script>
import { getPanoramaList } from "@/api/panorama"
import { getResidentialQuartersList } from '@/api/dept/index.js'
let cylinderLayer = null
let circleLayer = null
let treeData = [
@@ -371,59 +366,44 @@
            }]
    }
]
let positionColor = [
    global.DC.Namespace.Cesium.Color.fromBytes(
        3,
        255,
        13,
        100
    ),
    global.DC.Namespace.Cesium.Color.fromBytes(
        102, 176, 255,
        100
    ),
    global.DC.Namespace.Cesium.Color.fromBytes(
        230, 162, 60,
        100
    ),
    global.DC.Namespace.Cesium.Color.fromBytes(
        245, 108, 108,
        100
    ),
    global.DC.Namespace.Cesium.Color.fromBytes(
        139, 195, 74,
        100
    ),
    global.DC.Namespace.Cesium.Color.fromBytes(
        244, 67, 54,
        100
    )
    global.DC.Namespace.Cesium.Color.fromBytes(3, 255, 13, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(102, 176, 255, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(230, 162, 60, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(168, 45, 177, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(245, 108, 108, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(139, 195, 74, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(244, 67, 54, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 127, 80, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(100, 149, 237, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(220, 20, 60, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(0, 0, 139, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(189, 183, 107, 800),
    global.DC.Namespace.Cesium.Color.fromBytes(148, 0, 211, 800),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 20, 147, 800),
    global.DC.Namespace.Cesium.Color.fromBytes(124, 252, 0, 800),
]
let timer = []
import flvjs from 'flv.js'
import axios from "axios"
import { getPanoramaList } from "@/api/panorama"
import { getResidentialQuartersList } from '@/api/dept/index.js'
import carList from '@/assets/data/car.js'
import phoneList from '@/assets/data/phone.js'
import monitoringList from '@/assets/data/monitoring.js'
// import houseList from '@/assets/data/house.js'
import areaOptionData from '@/assets/data/JurisdictionData/areaOptionData.js'
import policeStationOptions from '@/assets/data/JurisdictionData/policeStationOptions.js'
import housingDate from '@/assets/data/JurisdictionData/housingDate.js'
import leftContainer from './components/leftContainer'
import rightContainer from './components/rightContainer'
import bottomContainer from './components/bottomContainer'
import historyArr from '@/assets/data/activitysData/history.js'
import underwayArr from '@/assets/data/activitysData/underway.js'
import { getPoliceStationList } from "@/api/dept"
import { convertStringToList } from "@/utils/geometryStringTool"
import { getActAsPoliceList, getEquipmentPaging } from "@/api/home/index.js"
import { getDevices } from '@/api/video/index.js'
import { getActAsPoliceList, getEquipmentPaging, getPoliceStationTree } from "@/api/home/index.js"
export default {
    data () {
@@ -510,22 +490,19 @@
        this.carList = carList
        this.phoneList = phoneList
        this.monitoringList = monitoringList
        // this.houseList = houseList
        // this.areaOptionData = areaOptionData
        // this.policeStationOptions = policeStationOptions
        // this.housingDate = housingDate
        //获取派出所责任区小区数据
        this.getPoliceStationList()
        this.historyArr = historyArr
        this.underwayArr = underwayArr
        this.getPanoramaList()
        this.getResidentialQuartersList('361102')
        // this.getResidentialQuartersList('361102')
        this.$EventBus.$on('policeSituationSiteClick', (params) => {
            that.policeSituationSiteClick(params)
        })
        getPoliceStationTree(1).then(res => {
            console.log(111, res.data.data)
            this.policeStationOptions = res.data.data
        })
    },
    mounted () {
@@ -561,9 +538,6 @@
                    document.querySelector('.image-switch-icon-btn').classList.add('iconbottom')
                    this.setDomStyle()
                })
                // axios.get('/user/getUserList').then((res) => {
                //     console.log(res, 999)
                // }}
                window.addEventListener('resize', this.setDomStyle)
            }
@@ -622,20 +596,20 @@
        },
        policeStationSelect (item) {
            this.policeStationCheckValue = item.policeStationName
            this.policeStationCheckValue = item.name
            if (item.policeStationName == "全部") {
                this.clearPolygonLayer()
                cylinderLayer.clear()
                cylinderLayer.remove()
                cylinderLayer = null
                this.initPoliceStationLayer()
                this.$EventBus.$emit('toPosition', {
                    siteJd: 116.112550,
                    siteWd: 28.196631,
                    siteGd: 50000,
                    siteHeading: 0,
                    sitePitch: -45
                })
                // this.initPoliceStationLayer()
                // this.$EventBus.$emit('toPosition', {
                //     siteJd: 116.112550,
                //     siteWd: 28.196631,
                //     siteGd: 50000,
                //     siteHeading: 0,
                //     sitePitch: -45
                // })
                this.areaOptions = []
                this.housingOptions = []
                this.areaCheckValue = '请选择责任区'
@@ -643,6 +617,10 @@
            } else {
                this.initAreaOptionLayer(item)
                cylinderLayer.clear()
                this.areaCheckValue = '请选择责任区'
                getPoliceStationTree(2, item.id).then(res => {
                    this.areaOptions = res.data.data
                })
            }
            this.policeStaionChecked = item
            this.$refs.leftContainer.selectPoliceChangeData(item.policeStationName)
@@ -654,12 +632,16 @@
        },
        areaSelect (item) {
            this.areaCheckValue = item.areaCheckName
            this.areaCheckValue = item.name
            if (item.areaCheckName == "全部") {
                this.initAreaOptionLayer(this.policeStaionChecked)
                this.housingOptions = []
                this.housingCheckValue = '请选择小区'
            } else {
                this.housingCheckValue = '请选择小区'
                getPoliceStationTree(3, item.id).then(res => {
                    this.housingOptions = res.data.data
                })
                this.areaChecked = item
                this.initHousingLayer(item)
            }
@@ -667,7 +649,7 @@
        },
        housingSelect (item) {
            this.housingCheckValue = item.housingsName
            this.housingCheckValue = item.name
            if (item.housingsName == "全部") {
                this.initHousingLayer(this.areaChecked)
            } else {
@@ -944,69 +926,77 @@
            cylinderLayer = new global.DC.PrimitiveLayer('cylinderLayer')
            global.viewer.addLayer(cylinderLayer)
            this.policeStationOptions.forEach((item, index) => {
                console.log(item, 89)
                if (item.position && item.position.length > 0) {
                    let str = ''
                    item.position.forEach(it => {
                        str = str + `${it[0]},${it[1]},${it[2]};`
                    })
                    this.$EventBus.$emit('layerPolygonAdd', {
                        layerName: 'polygonLayer',
                        positions: str,
                        material: positionColor[index],
                    })
                    const center = this.getCenter(item.position)
                        let itPositionStr = it.replace(/MULTIPOLYGON\(\(\(/g, '')
                        itPositionStr = itPositionStr.replace(/\)\)\)/g, '')
                        itPositionStr = itPositionStr.replace(/,/g, ";")
                        itPositionStr = itPositionStr.replace(/ /g, ",")
                        this.$EventBus.$emit('layerPolygonAdd', {
                            layerName: 'polygonLayer',
                            positions: itPositionStr,
                            material: positionColor[index],
                        })
                    this.$EventBus.$emit('layerPointAdd', {
                        layerName: 'polygonLayer',
                        type: 'label',
                        params: {
                            lng: center[0],
                            lat: center[1] - 0.03,
                            alt: 1200,
                            text: '5656'
                        },
                        distanceDisplayCondition: { "near": 0, "far": 200000 }
                    })
                    this.$EventBus.$emit('layerPointAdd', {
                        layerName: 'polygonLayer',
                        type: 'label',
                        params: {
                            lng: center[0],
                            lat: center[1],
                            alt: 0,
                            text: item.policeStationName,
                        },
                        distanceDisplayCondition: { "near": 0, "far": 200000 }
                    })
                    let cylinder = new global.DC.LightCylinderPrimitive(new global.DC.Position(center[0] + 0.02, center[1] - 0.01), 1200, 1, 600)
                    cylinder.setStyle({
                        color: global.DC.Namespace.Cesium.Color.fromBytes(
                            102, 176, 255,
                            255
                        )
                    })
                    cylinderLayer.addOverlay(cylinder)
                    // item.position.forEach(it => {
                    //     str = str + `${it[0]},${it[1]},${it[2]};`
                    // })
                    // const center = this.getCenter(item.position)
                    // this.$EventBus.$emit('layerPointAdd', {
                    //     layerName: 'polygonLayer',
                    //     type: 'label',
                    //     params: {
                    //         lng: center[0],
                    //         lat: center[1] - 0.03,
                    //         alt: 1200,
                    //         text: '5656'
                    //     },
                    //     distanceDisplayCondition: { "near": 0, "far": 200000 }
                    // })
                    // this.$EventBus.$emit('layerPointAdd', {
                    //     layerName: 'polygonLayer',
                    //     type: 'label',
                    //     params: {
                    //         lng: center[0],
                    //         lat: center[1],
                    //         alt: 0,
                    //         text: item.policeStationName,
                    //     },
                    //     distanceDisplayCondition: { "near": 0, "far": 200000 }
                    // })
                    // let cylinder = new global.DC.LightCylinderPrimitive(new global.DC.Position(center[0] + 0.02, center[1] - 0.01), 1200, 1, 600)
                    // cylinder.setStyle({
                    //     color: global.DC.Namespace.Cesium.Color.fromBytes(
                    //         102, 176, 255,
                    //         255
                    //     )
                    // })
                    // cylinderLayer.addOverlay(cylinder)
                }
            })
            // this.houseChange(true)
        },
        initAreaOptionLayer (item) {
            let center = this.getPoliceStationCenter(item.policeStationName)
            // let center = this.getPoliceStationCenter(item.policeStationName)
            this.clearPolygonLayer()
            this.$EventBus.$emit('toPosition', {
                siteJd: center[0],
                siteWd: center[1],
                siteGd: 60000,
                siteHeading: -3,
                sitePitch: -90
            })
            this.areaOptionData.some((option) => {
                if (item.policeStationName == option.policeStationName) {
                    this.initAreaCheckoptions(option.areaCheckOptions)
                    this.areaOptions = option.areaCheckOptions
                }
            })
            // this.$EventBus.$emit('toPosition', {
            //     siteJd: center[0],
            //     siteWd: center[1],
            //     siteGd: 60000,
            //     siteHeading: -3,
            //     sitePitch: -90
            // })
            // this.areaOptionData.some((option) => {
            //     if (item.policeStationName == option.policeStationName) {
            //         this.initAreaCheckoptions(option.areaCheckOptions)
            //         this.areaOptions = option.areaCheckOptions
            //     }
            // })
        },
        initHousingLayer (item) {
@@ -1326,10 +1316,11 @@
            layerName: 'activityLayers',
            type: 'ClusterLayer'
        })
        cylinderLayer.clear()
        cylinderLayer.remove()
        cylinderLayer = null
        if (cylinderLayer != null) {
            cylinderLayer.clear()
            cylinderLayer.remove()
            cylinderLayer = null
        }
        circleLayer.clear()
        circleLayer.remove()
        circleLayer = null
src/views/police/index.vue
@@ -356,7 +356,7 @@
            searchExtensivelyValue: '',
            searchExtensivelyValBoxShow: false,
            searchExtensivelyArray: [],
            flvPlayer: null,
        }
    },
    created () {