guanqb
2023-04-07 8062c7cd30703803b07806739dfbb26c923a74e9
活动bug修复和数据地图地图范围切换
7 files modified
116 ■■■■ changed files
src/components/map/index.vue 1 ●●●● patch | view | raw | blame | history
src/utils/turfPolygon.js 5 ●●●●● patch | view | raw | blame | history
src/views/activity/components/publicIndex.vue 7 ●●●● patch | view | raw | blame | history
src/views/activity/index.vue 26 ●●●●● patch | view | raw | blame | history
src/views/home/components/bottomContainer.vue 3 ●●●● patch | view | raw | blame | history
src/views/policeInfor/index.vue 70 ●●●● patch | view | raw | blame | history
vue.config.js 4 ●●●● patch | view | raw | blame | history
src/components/map/index.vue
@@ -900,6 +900,7 @@
                labelElement.on(global.DC.MouseEventType.CLICK, incident)
            } else if (type == 'HeatPoint') {
                layersObjcect[layerName].setPositions(params.positions)
                console.log('----------HeatPoint------------', params.positions)
            }
        },
src/utils/turfPolygon.js
@@ -12,6 +12,7 @@
export const computerCapacity = (data, type) => {
    if (type == 'region') {
        console.log('computerCapacity', data)
        const pointArr = data.reduce((pre, cur) => {
            cur.position && JSON.parse(cur.position).coordinates[0][0].forEach(item => {
                console.log(item, 959)
@@ -33,7 +34,7 @@
        console.log(scope, scaledPoly, 5555)
    } else {
        let pointArr = []
        console.log('data', data)
        data.forEach(item => {
            if (item.longitude && item.latitude) {
                pointArr.push(turf.point([item.longitude, item.latitude]))
@@ -52,7 +53,7 @@
        console.log(scope, 5555)
        const poly = turf.polygon([[[0, 29], [3.5, 29], [2.5, 32], [0, 29]]])
        // const poly = turf.polygon([[[0, 29], [3.5, 29], [2.5, 32], [0, 29]]])
        global.viewer.flyToBounds(scope,
            { heading: 0, pitch: -45, roll: 0 },
src/views/activity/components/publicIndex.vue
@@ -8,7 +8,7 @@
        <polyline-plot ref="PolylinePlotPage" :showingSecurityId="showingSecurityId"></polyline-plot>
        <two-draw-btn-box v-if="currentPlotType == 1" ref="DRAWBTNBOX" :="dialogVisible"
        <two-draw-btn-box v-if="currentPlotType == 1" ref="DRAWBTNBOX" :dialogVisible="dialogVisible"
            :isShowActivityEditBox="isShowActivityEditBox" :showingSecurityId="showingSecurityId"
            :policeSwitch="policeSwitch" :polylineBtnSwitch="polylineBtnSwitch" :arrowBtnSwitch="arrowBtnSwitch"
            :policeIconId="policeIconId" :lineWidth="lineWidth" @setPoliceOption="setPoliceOption"></two-draw-btn-box>
@@ -253,10 +253,13 @@
            this.currentPlotType = params.item.plotType
            this.closeActivityDetails()
            // 当前选中的ID
            this.showingSecurityId = params.item.id
            // 当前选中的详情
            this.activityDetails = params.item
            // 测试安保活动报错
            this.dialogVisible = true
            if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == params.item.deptId) {
@@ -271,6 +274,7 @@
            // 加载当前活动区域
            if (params.item.activityArea && params.item.activityArea.length > 0) {
                let polyGonData = params.item.activityArea.slice(11, params.item.activityArea.length - 1)
                polyGonData = polyGonData.replace(/,/g, ";")
                polyGonData = polyGonData.replace(/ /g, ",")
@@ -295,6 +299,7 @@
            this.getSecurityPlotList(params.id)
            this.getSecurityPoliceList(params.id)
            this.getSecurityCarList(params.id)
        },
        // 获取树状警员列表
src/views/activity/index.vue
@@ -176,7 +176,8 @@
        </div>
        <div class="second-container" :class="{ 'spread': boxShow, 'take-back': !boxShow }">
            <el-tree :data="treeData" show-checkbox node-key="id" @check="treeCheckClick"></el-tree>
            <el-tree :data="treeData" show-checkbox node-key="id" @check="treeCheckClick"
                @check-change="treeCheckChange"></el-tree>
        </div>
        <map-search-box></map-search-box>
@@ -191,6 +192,7 @@
import publicIndex from './components/publicIndex.vue'
import { initMapPosition } from '@/utils/mapPositionInit'
import { computerCapacity } from "@/utils/turfPolygon.js"
let loading = null
@@ -409,6 +411,7 @@
        this.getEquipmentAll({ type: "2-2" }, '')
        //执法记录仪
        this.getEquipmentAll({ type: 3 }, '')
    },
    mounted () {
@@ -494,7 +497,6 @@
            this.showingSecurityId = item.id
            this.$refs.PublicIndexPage.reloadAll({ id: item.id, deptId: item.deptId, item })
            this.activityDeptId = item.deptId
@@ -626,7 +628,27 @@
            }
            this.dataTreeCheckedNodes = e2.checkedNodes
            this.eachDataTreeCheckedNodes(this.dataTreeCheckedNodes)
        },
        //树形控件选中状态改变事件
        treeCheckChange (e1, e2) {
            if (e2 && !e1.children) {
                let iconArr = []
                if (e1.label == '视频监控') {
                    iconArr = cameraList
                } else if (e1.label == '警车') {
                    iconArr = carList
                } else if (e1.label == '公网') {
                    iconArr = talkBackEquipmentPublicList
                } else if (e1.label == '专网') {
                    iconArr = talkBackEquipmentList
                } else if (e1.label == '执法记录仪') {
                    iconArr = policeCarmeraList
                }
                // 获取图标中心跳转
                computerCapacity(iconArr, 'icon')
            }
        },
        // 遍历树数据实时图标
src/views/home/components/bottomContainer.vue
@@ -54,7 +54,7 @@
                </ul>
                <!-- <vue-seamless-scroll v-if="policeSituationRealtimeArr.length > 0" :data="policeSituationRealtimeArr"
                                                                                                                                                    class="warp" :class-option="classOption"> -->
                                                                                                                                                                    class="warp" :class-option="classOption"> -->
                <div v-if="policeSituationRealtimeArr.length > 0" :data="policeSituationRealtimeArr" class="warp"
                    :class-option="classOption">
                    <el-carousel indicator-position="none" direction="vertical" @change="changeAlarm">
@@ -331,7 +331,6 @@
        // 获取实时接警记录
        getAnswerPolices () {
            getAnswerPolices({ deptId: this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id }).then(res => {
                this.policeSituationRealtimeArr = []
src/views/policeInfor/index.vue
@@ -274,6 +274,22 @@
            this.navClick(0)
            this.setTableHeight()
            console.log('mounted')
            let list = []
            for (let i = 0; i < 10000; i++) {
                let lng = 121.48339987478337 + Math.random() * 0.05
                let lat = 31.220954026657488 + Math.random() * 0.05
                list.push(new global.DC.Position(lng, lat))
            }
            console.log(list, 2222222222)
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'policeInfoHeatLayer',
                type: "HeatPoint",
                layerType: 'HeatLayer',
                params: {
                    positions: list
                }
            })
        })
        window.addEventListener('resize', this.setTableHeight)
@@ -363,27 +379,24 @@
        getAnswerPolices () {
            this.loading()
            this.realPoliceInforData = []
            this.realEmptyText = ""
            this.realEmptyText = "  "
            getAnswerPolices({ deptId: this.userInfo.dept_id }).then(res => {
                if (res.data && res.data.length) {
                    this.realPoliceInforData = res.data.map((item, index) => {
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE || ''
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0] ? BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE : ''
                        return { ...item, index: index + 1, lng: item.ZDDWXZB, lat: item.ZDDWYZB, BJLX: bjlxText }
                    })
                    this.addPoliceInforSiteLayer(this.realPoliceInforData)
                } else {
                    this.realPoliceInforData = []
                    this.realEmptyText = "暂无实时警情信息"
                }
                this.addPoliceInforSiteLayer(this.realPoliceInforData)
                setTimeout(() => {
                    loading && loading.close()
                }, 500)
            }).catch(res => {
                this.realEmptyText = "实时警情请求失败"
                this.realEmptyText = "暂无实时警情信息"
                setTimeout(() => {
                    loading && loading.close()
                }, 500)
@@ -480,28 +493,30 @@
            // }, 500)
        },
        // 获取历史接警记录
        // 获取历史接警记录(不分页)
        getAlarmList (params) {
            this.loading()
            this.historyPoliceInforData = []
            this.historyEmptyText = ""
            getAlarmList({ ...params, size: this.pages.size, jjdwbh: this.userInfo.dept_id }).then(res => {
                if (res.data.data.records.length > 0) {
                    this.pages.total = res.data.data.pages
                    this.historyPoliceInforData = res.data.data.records.map((item, index) => {
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE || ''
            getAlarmList({ ...params, size: this.pages.size, jjdwbh: this.userInfo.dept_id, type: 3 }).then(res => {
                console.log('------------getAlarmList----------', res.data.data, 1122)
                if (res.data.data.length > 0) {
                    // this.pages.total = res.data.data.pages
                    this.historyPoliceInforData = res.data.data.map((item, index) => {
                        const bjlxText = BjlxData.filter(i => item.BJLX == i.BJLX)[0] ? BjlxData.filter(i => item.BJLX == i.BJLX)[0].VALUE : ''
                        return { ...item, index: index + 1, lng: item.ZDDWXZB, lat: item.ZDDWYZB, BJLX: bjlxText }
                    })
                } else {
                    this.pages.total = 0
                    // this.pages.total = 0
                    this.historyPoliceInforData = []
                    this.realEmptyText = "暂无历史警情信息"
                }
                this.addPoliceInforSiteLayer(this.historyPoliceInforData)
                setTimeout(() => {
                    loading && loading.close()
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    loading && loading.close()
                }, 500)
@@ -596,13 +611,13 @@
        addPoliceInforSiteLayer (data) {
            this.clearLayer()
            let policeInfoPositionList = []
            data.forEach((item, index) => {
                if (item.lng && item.lng != undefined && item.lng != '') {
                    let center = new global.DC.Position(Number(item.lng), Number(item.lat))
                    let point = new global.DC.PointPrimitive(center)
                    policeInfoPositionList.push(center)
                    let num = 0
                    timer[index] = setInterval(() => {
@@ -620,7 +635,22 @@
                    point.attrParams = item
                    point.on(global.DC.MouseEventType.CLICK, this.siteClick)
                    policeInforSiteLayer.addOverlay(point)
                    // policeInforSiteLayer.addOverlay(point)
                }
            })
            let list = []
            for (let i = 0; i < 10000; i++) {
                let lng = 121.48339987478337 + Math.random() * 0.05
                let lat = 31.220954026657488 + Math.random() * 0.05
                list.push(new global.DC.Position(lng, lat))
            }
            console.log('policeInfoPositionList', policeInfoPositionList)
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'policeInfoHeatLayer',
                type: "HeatPoint",
                layerType: 'HeatLayer',
                params: {
                    positions: list
                }
            })
        },
vue.config.js
@@ -161,8 +161,8 @@
        proxy: {
            "/api": {
                // target用于配置你允许访问数据的计算机名称,即是你的api接口的服务器地址
                target: "http://localhost:82",
                // target: "http://192.168.0.100:82",
                // target: "http://localhost:82",
                target: "http://192.168.0.100:82",
                // target: "http://17.20.10.3:82",
                // target: "http://10.141.11.11:8081/api",
                // ws: true, //启用webSocket6566