shuishen
2023-01-10 5c4d1db24f9af34a2b801a340a05b862fb3c7e3a
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/srs-police-affairs
5 files modified
142 ■■■■ changed files
src/api/home/index.js 14 ●●●●● patch | view | raw | blame | history
src/router/axios.js 2 ●●● patch | view | raw | blame | history
src/views/activity/index.vue 35 ●●●● patch | view | raw | blame | history
src/views/home/index.vue 2 ●●● patch | view | raw | blame | history
src/views/police/index.vue 89 ●●●●● 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-10 11:50:32
 * @LastEditTime: 2023-01-10 16:34:03
 * @FilePath: \srs-police-affairs\src\api\home\index.js
 * @Description: 
 * 
@@ -92,3 +92,15 @@
        }
    })
}
// 派出所责任区小区-获取三级区域数据
export const getPoliceStationTree = (type, id) => {
    return request({
        url: `/api/policeStationInfo/policeStationInfo/getPoliceStationTree`,
        method: 'get',
        params: {
            type,
            id
        }
    })
}
src/router/axios.js
@@ -29,7 +29,7 @@
if (process.env.NODE_ENV == 'development') {
    // 开发
    defaultApi = prodEnv.VUE_APP_INTRANET
    defaultApi = prodEnv.VUE_APP_OUTER_NET
    searchAllApi = prodEnv.VUE_APP_OUTER_NET_SEARCH
    videoApi = prodEnv.VUE_APP_OUTER_NET_VIDEO
} else {
src/views/activity/index.vue
@@ -275,8 +275,8 @@
            </div>-->
        </div>
        <div class="plan-control" v-show="dialogVisible">
            <div class="row-box">
        <div class="plan-control" v-show="dialogVisible&&(isHavePolice||isHaveArrow||isHaveLine)">
            <div class="row-box" v-show="isHavePolice">
                <div class="category">警力资源:</div>
                <div class="category-value">
                    <el-switch
@@ -288,8 +288,8 @@
                </div>
            </div>
            <div class="row-box">
                <div class="category">作战标绘</div>
            <div class="row-box" v-show="isHaveArrow">
                <div class="category">作战标绘:</div>
                <div class="category-value">
                    <el-switch
                        v-model="arrowBtnSwitch"
@@ -299,7 +299,7 @@
                    ></el-switch>
                </div>
            </div>
            <div class="row-box">
            <div class="row-box" v-show="isHaveLine">
                <div class="category">巡逻路线:</div>
                <div class="category-value">
                    <el-switch
@@ -563,7 +563,7 @@
            currentClickIndex: '',
            policeSwitch: true,
            arrowBtnSwitch: true,
            polylineBtnSwitch: true,
            polylineBtnSwitch: false,
            analyseInput: 100,
            activityList: [],
            activityDetails: {},
@@ -578,6 +578,10 @@
            searchExtensivelyValue: '',
            searchExtensivelyValBoxShow: false,
            searchExtensivelyArray: [],
            isHavePoliceCar: false,
            isHavePoliceMan: false,
            isHaveArrow: false,
            isHaveLine: false,
        }
    },
    created () {
@@ -706,6 +710,9 @@
                type: 'VectorLayer'
            })
            getSecurityPoliceList(securityId).then(res => {
                this.isHavePoliceMan = res.data.data.some(item => {
                    return item.type == 3
                })
                res.data.data.forEach(item => {
                    if (item.type == 1) {
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
@@ -754,6 +761,12 @@
                type: 'VectorLayer'
            })
            getSecurityCarList(securityId).then(res => {
                this.isHavePoliceCar = res.data.data.some(item => {
                    return item.type == 3
                })
                this.isHaveLine = res.data.data.some(item => {
                    return item.type == 1
                })
                res.data.data.forEach(item => {
                    if (item.type == 1 && polylineShow) {
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
@@ -1255,6 +1268,9 @@
            this.removeAllArrow()
            if (!arrowShow) return
            getSecurityPlotList(securityId).then(res => {
                this.isHaveArrow = res.data.data.some(item => {
                    return item
                })
                res.data.data.forEach(item => {
                    let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',')
                    let chooseArrow = null
@@ -1394,6 +1410,13 @@
        },
    },
    computed: {
        isHavePolice () {
            return this.isHavePoliceCar || this.isHavePoliceMan
        }
    },
    destroyed () {
        this.$EventBus.$emit('mapRemoveLayer', {
            layerName: 'activeLayer',
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-10 16:13:51
 * @LastEditTime: 2023-01-10 16:36:57
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
src/views/police/index.vue
@@ -83,6 +83,14 @@
                                >
                                    <i class="el-icon-position"></i>
                                </el-button>
                                <el-button
                                    @click="play(scope.row)"
                                    type="text"
                                    size="small"
                                    title="播放视频"
                                >
                                    <i class="el-icon-video-play"></i>
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
@@ -137,6 +145,14 @@
                                    title="轨迹"
                                >
                                    <i class="el-icon-position"></i>
                                </el-button>
                                <el-button
                                    @click="play(scope.row)"
                                    type="text"
                                    size="small"
                                    title="播放视频"
                                >
                                    <i class="el-icon-video-play"></i>
                                </el-button>
                            </template>
                        </el-table-column>
@@ -194,6 +210,14 @@
                                >
                                    <i class="el-icon-position"></i>
                                </el-button>
                                <el-button
                                    @click="play(scope.row)"
                                    type="text"
                                    size="small"
                                    title="播放视频"
                                >
                                    <i class="el-icon-video-play"></i>
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
@@ -249,6 +273,14 @@
                                    title="轨迹"
                                >
                                    <i class="el-icon-position"></i>
                                </el-button>
                                <el-button
                                    @click="play(scope.row)"
                                    type="text"
                                    size="small"
                                    title="播放视频"
                                >
                                    <i class="el-icon-video-play"></i>
                                </el-button>
                            </template>
                        </el-table-column>
@@ -435,6 +467,8 @@
import { getHistoricalTrack } from '@/api/police/index.js'
import { getCarList } from '@/api/police/index.js'
import { getSearchExtensively } from '@/api/dept/index.js'
import { getDevices } from '@/api/video/index.js'
import flvjs from 'flv.js'
let tc = null
@@ -615,15 +649,56 @@
            })
        },
        siteClick (e) {
            this.dialogTitle = e.overlay.attrParams.name
            this.dialogVisible = true
        async play (row) {
            if (this.flvPlayer != null) {
                this.flvPlayer.pause()
                this.flvPlayer.unload()
                this.flvPlayer.detachMediaElement()
                this.flvPlayer.destroy()
                this.flvPlayer = null
            }
            if (this.$refs.videoElement && this.$refs.videoElement != null) {
                this.$refs.videoElement.currentTime = 0
                this.$refs.videoElement.play()
            this.dialogTitle = row.name
            this.dialogVisible = true
            let flvUrl = ''
            await this.getDevices(row.deviceId, row.channelId).then(res => {
                flvUrl = res
            })
            if (flvjs.isSupported() && flvUrl != 'nodata') {
                var videoElement = document.getElementById('videoElement')
                this.flvPlayer = flvjs.createPlayer({
                    type: 'flv',
                    isLive: true,
                    hasAudio: false,
                    url: flvUrl
                })
                this.flvPlayer.attachMediaElement(videoElement)
                this.flvPlayer.load()
                this.flvPlayer.play()
            }
        },
        async getDevices (id, channelId) {
            let flvAddress = ''
            await getDevices(id, channelId).then(res => {
                if ('data' in res.data) {
                    flvAddress = res.data.data.flv
                } else {
                    flvAddress = 'nodata'
                }
            })
            return flvAddress
        },
        // siteClick (e) {
        //     this.dialogTitle = e.overlay.attrParams.name
        //     this.dialogVisible = true
        //     if (this.$refs.videoElement && this.$refs.videoElement != null) {
        //         this.$refs.videoElement.currentTime = 0
        //         this.$refs.videoElement.play()
        //     }
        // },
        phoneSiteClick (e) {
            this.phoneTitle = e.overlay.attrParams.name
@@ -918,6 +993,8 @@
            this.searchExtensivelyValue = ''
            this.searchExtensivelyChange()
        },
    },
    destroyed () {