guanqb
2023-01-14 87e2bd6d754d33dc2153ea9a382f691af91f64ba
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
2 files modified
100 ■■■■ changed files
src/api/home/index.js 14 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 86 ●●●●● patch | view | raw | blame | history
src/api/home/index.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-12-27 14:19:19
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-01-11 11:41:50
 * @LastEditTime: 2023-01-13 17:42:10
 * @FilePath: \srs-police-affairs\src\api\home\index.js
 * @Description: 
 * 
@@ -126,4 +126,16 @@
            ...params
        }
    })
}
// 获取设备数据
export const getEquipmentAll = (params) => {
    return request({
        url: `/api/alarm/alarm/channelsCarAll`,
        method: 'get',
        params: {
            ...params,
            deviceId: '36110000002009999000'
        }
    })
}
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-13 11:30:32
 * @LastEditTime: 2023-01-14 11:32:08
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
@@ -43,7 +43,7 @@
                <el-checkbox v-model="carLayerShow" @change="carChange">警车</el-checkbox>
            </div>
            <div class="layers-control-btn phone">
                <el-checkbox v-model="phoneLayerShow" @change="phoneChange">摄像头</el-checkbox>
                <el-checkbox v-model="cameraLayerShow" @change="cameraChange">摄像头</el-checkbox>
            </div>
            <!-- <div class="layers-control-btn moitor">
                <el-checkbox v-model="monitoringLayerShow" @change="monitoringChange">监控</el-checkbox>
@@ -507,8 +507,6 @@
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 leftContainer from './components/leftContainer'
import rightContainer from './components/rightContainer'
@@ -519,14 +517,14 @@
import { convertStringToList } from "@/utils/geometryStringTool"
import { getDevices } from '@/api/video/index.js'
import { getActAsPoliceList, getEquipmentPaging, getPoliceStationTree } from "@/api/home/index.js"
import { getActAsPoliceList, getEquipmentPaging, getPoliceStationTree, getEquipmentAll } from "@/api/home/index.js"
export default {
    data () {
        return {
            houseLayerShow: true,
            carLayerShow: false,
            phoneLayerShow: false,
            cameraLayerShow: false,
            monitoringLayerShow: false,
            panoramaLayerShow: false,
            policeSituationLayerShow: false,
@@ -548,7 +546,8 @@
            peopleVisible: false,
            houseList: [],
            carList: [],
            phoneList: [],
            cameraList: [],
            monitoringList: [],
            panoramaList: [{
                name: '1号全景',
@@ -603,8 +602,7 @@
    created () {
        const that = this
        this.carList = carList
        this.phoneList = phoneList
        this.monitoringList = monitoringList
        this.historyArr = historyArr
        this.underwayArr = underwayArr
@@ -618,6 +616,8 @@
            this.policeStationOptions = res.data.data
        })
        this.getEquipmentAll({ type: 0 })
        this.getEquipmentAll({ type: 1 })
    },
    mounted () {
@@ -639,9 +639,6 @@
                sitePitch: -90
            })
        })
        // axios.get('/user/getUserList').then((res) => {
        //     console.log(res, 999)
        // }}
        window.addEventListener('resize', this.setDomStyle)
    },
@@ -667,6 +664,15 @@
    },
    methods: {
        getEquipmentAll (params) {
            getEquipmentAll(params).then(res => {
                if (params.type == 0) {
                    this.carList = res.data.data
                } else {
                    this.cameraList = res.data.data
                }
            })
        },
        // 接出警切换
        alarmOrActAsPolice (type) {
            this.policeInformationType = type
@@ -842,14 +848,24 @@
        carChange (e) {
            if (e == true) {
                this.carList.forEach(item => {
                    this.$EventBus.$emit('layerPointAdd', {
                        layerName: 'carLayers',
                        type: "billboard",
                        params: item,
                        incident: this.siteClick
                if (this.carList.length > 0) {
                    this.carList.forEach(item => {
                        if (item.longitude && item.latitude) {
                            this.$EventBus.$emit('layerPointAdd', {
                                layerName: 'carLayers',
                                type: "billboard",
                                params: {
                                    ...item,
                                    lng: item.longitude,
                                    lat: item.latitude,
                                    alt: 100,
                                    url: '/img/icon/car.png'
                                },
                                incident: this.phoneSiteClick
                            })
                        }
                    })
                })
                }
            } else {
                this.$EventBus.$emit('mapClearLayer', {
                    layerName: 'carLayers',
@@ -858,19 +874,31 @@
            }
        },
        phoneChange (e) {
        cameraChange (e) {
            if (e == true) {
                this.phoneList.forEach(item => {
                    this.$EventBus.$emit('layerPointAdd', {
                        layerName: 'phoneLayers',
                        type: "billboard",
                        params: item,
                        incident: this.phoneSiteClick
                if (this.cameraList.length > 0) {
                    this.cameraList.forEach(item => {
                        if (item.longitude && item.latitude) {
                            this.$EventBus.$emit('layerPointAdd', {
                                layerName: 'cameraLayers',
                                type: "billboard",
                                params: {
                                    ...item,
                                    lng: item.longitude,
                                    lat: item.latitude,
                                    alt: 100,
                                    url: '/img/icon/camera.png'
                                },
                                incident: this.phoneSiteClick
                            })
                        }
                    })
                })
                }
            } else {
                this.$EventBus.$emit('mapClearLayer', {
                    layerName: 'phoneLayers',
                    layerName: 'cameraLayers',
                    type: 'VectorLayer'
                })
            }
@@ -1437,7 +1465,7 @@
        })
        this.$EventBus.$emit('mapRemoveLayer', {
            layerName: 'phoneLayers',
            layerName: 'cameraLayers',
            type: 'VectorLayer'
        })