shuishen
2022-11-30 21c57339c152c85cf7f2b924ec5f491a2d4b9d66
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
1 files modified
3 files added
159 ■■■■■ changed files
src/api/dept/index.js 13 ●●●●● patch | view | raw | blame | history
src/api/panorama/index.js 13 ●●●●● patch | view | raw | blame | history
src/utils/geometryStringTool.js 23 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 110 ●●●●● patch | view | raw | blame | history
src/api/dept/index.js
New file
@@ -0,0 +1,13 @@
import request from "@/router/axios.js"
/**
 * 获取派出所和责任区数据
 * @param {*} params
 * @returns
 */
export const getPoliceStationList = () => {
    return request({
        url: '/blade-system/dept/getAllPoliceStation',
        method: 'get',
    })
}
src/api/panorama/index.js
New file
@@ -0,0 +1,13 @@
import request from "@/router/axios.js"
/**
 * 获取全景列表
 * @param {*} params
 * @returns
 */
export const getPanoramaList = () => {
    return request({
        url: '/panorama/panorama/all',
        method: 'get',
    })
}
src/utils/geometryStringTool.js
New file
@@ -0,0 +1,23 @@
/**
 * 字符串坐标转数组坐标
 * @param geometryString
 */
export function convertStringToList(geometryString){
    if (geometryString){
        let finalString = geometryString.replaceAll(",",";").replaceAll(" ",",")
        let list = finalString.split(";")
        let finalList = []
        list.forEach(e=>{
            let tempList = e.split(",")
            let tempList1 = []
            tempList.forEach(k=>{
                tempList1.push(k-0)
            })
            tempList1.push(0)
            finalList.push(tempList1)
        })
        return finalList
    }else {
        return []
    }
}
src/views/home/index.vue
@@ -5,8 +5,8 @@
 * @LastEditTime: 2022-11-29 10:16:01
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
-->
<template>
@@ -67,7 +67,8 @@
        <el-dialog :title="panoramaTitle" :modal="true" :visible.sync="panoramaVisible"
            :before-close="panoramaBeforeClose" :close-on-click-modal="true" class="panorama-details-box">
            <iframe src="http://vr.jxpskj.com/JXSFKZQJ/QJ/" style="width: 100%; height: 100%;" frameborder="0"></iframe>
<!--            <iframe src="http://vr.jxpskj.com/JXSFKZQJ/QJ/" style="width: 100%; height: 100%;" frameborder="0"></iframe>-->
          <iframe :src="panoramaVrUrl" style="width: 100%; height: 100%;" frameborder="0"/>
        </el-dialog>
        <el-dialog :title="activityTitle" :modal="true" :visible.sync="activityVisible"
@@ -257,6 +258,8 @@
</template>
<script>
import {getPanoramaList} from "@/api/panorama";
let cylinderLayer = null
let circleLayer = null
let treeData = [
@@ -368,6 +371,8 @@
import underwayArr from '@/assets/data/activitysData/underway.js'
import realtimeArr from '@/assets/data/policeSituationArr/realtimeArr.js'
import policeSituationHistoryArr from '@/assets/data/policeSituationArr/historyArr.js'
import {getPoliceStationList} from "@/api/dept";
import {convertStringToList} from "@/utils/geometryStringTool";
export default {
    data () {
@@ -382,6 +387,7 @@
            dialogTitle: '',
            dialogVisible: false,
            panoramaTitle: '',
            panoramaVrUrl:'',
            activityTitle: '',
            equimentTitle: '',
            keyPersonTitle: '',
@@ -512,17 +518,20 @@
        this.phoneList = phoneList
        this.monitoringList = monitoringList
        this.houseList = houseList
        this.areaOptionData = areaOptionData
        this.policeStationOptions = policeStationOptions
        this.housingDate = housingDate
        // this.areaOptionData = areaOptionData
        // this.policeStationOptions = policeStationOptions
        // this.housingDate = housingDate
        //获取派出所责任区小区数据
        this.getPoliceStationList()
        this.historyArr = historyArr
        this.underwayArr = underwayArr
        this.policeSituationRealtimeArr = realtimeArr
        this.policeSituationHistoryArr = policeSituationHistoryArr
        this.getPanoramaList();
    },
    mounted () {
        this.$nextTick(() => {
      this.$nextTick(() => {
            this.initPoliceStationLayer()
            circleLayer = new global.DC.VectorLayer('circleLayer')
            global.viewer.addLayer(circleLayer)
@@ -539,6 +548,30 @@
        // }}
        window.addEventListener('resize', this.setDomStyle)
    },
    watch:{
      "policeStationOptions":{
        handler(newVal){
          this.$nextTick(() => {
            this.initPoliceStationLayer()
            circleLayer = new global.DC.VectorLayer('circleLayer')
            global.viewer.addLayer(circleLayer)
            document.querySelector('.dc-container .dc-zoom-controller').classList.add('homebottom')
            document.querySelector('.dc-container .dc-location-bar').classList.add('homebottom')
            document.querySelector('.screen-full-btn').classList.add('homebottom')
            document.querySelector('.image-switch-icon-btn').classList.add('iconbottom')
            document.querySelector('.image-switch-img-btn').classList.add('imgbottom')
            this.setDomStyle()
          })
          // axios.get('/user/getUserList').then((res) => {
          //     console.log(res, 999)
          // }}
          window.addEventListener('resize', this.setDomStyle)
        }
      }
    },
    methods: {
@@ -892,6 +925,7 @@
        panoramaSiteClick (e) {
            this.panoramaTitle = e.overlay.attrParams.name
            this.panoramaVrUrl = e.overlay.attrParams.vrUrl
            this.panoramaVisible = true
        },
@@ -1336,6 +1370,68 @@
            this.policeSituationTimeType = type
        },
        /**
         * 获取所有全景数据
         */
        getPanoramaList(){
          getPanoramaList().then(res=>{
            if (res.data.code == 200){
              let data = res.data.data
              data.forEach(e=>{
                e.lng = e.longitude
                e.lat = e.latitude
                e.alt = 100
                e.url = '/img/icon/map-panorama.png'
              })
              this.panoramaList = data
            }
          })
        },
        /**
         * 获取派出所和责任区数据
         */
        getPoliceStationList(){
            getPoliceStationList().then(res=>{
              if (res.data.code == 200){
                let data = res.data.data
                data.forEach(policeStation=>{
                  //派出所数据匹配
                  policeStation.policeStationName= policeStation.deptName
                  policeStation.policeStationId =  policeStation.id
                  policeStation.position = convertStringToList(policeStation.positionString)
                  if (policeStation.children&&policeStation.children.length>0){
                    //责任区数据匹配
                    policeStation.areaCheckOptions = policeStation.children
                    policeStation.areaCheckOptions.forEach(child=>{
                      child.policeStationId = child.parentId
                      child.areaCheckId = child.id
                      child.areaCheckName = child.deptName
                      child.position = convertStringToList(child.positionString)
                      //小区数据匹配
                      if (child.housingArr && child.housingArr.length>0){
                        child.housingArr.forEach(community=>{
                          community.policeStationId =policeStation.id
                          community.areaCheckId = child.id
                          community.housingsId=community.id
                          community.housingsName = community.name
                          community.position = convertStringToList(community.position)
                        })
                        child.housingArr.unshift({housingsName: '全部'})
                      }
                    })
                    policeStation.areaCheckOptions.unshift({areaCheckName: '全部'})
                    policeStation.areaOptionArr = policeStation.areaCheckOptions
                  }
                })
                data.unshift({policeStationName: '全部'})
                this.policeStationOptions = data
                this.areaOptionData = data
                this.housingDate = data
              }
            })
        }
    },
    destroyed () {