shuishen
2022-12-08 68bf20bd85117ad1ed20fce5b9d450c2cd5646c9
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
8 files modified
2 files added
370 ■■■■ changed files
public/img/icon/police.png patch | view | raw | blame | history
public/img/policeCar.png patch | view | raw | blame | history
src/api/activity/index.js 47 ●●●●● patch | view | raw | blame | history
src/api/police/index.js 2 ●●● patch | view | raw | blame | history
src/api/video/index.js 3 ●●●● patch | view | raw | blame | history
src/router/axios.js 6 ●●●●● patch | view | raw | blame | history
src/views/activity/index.vue 264 ●●●● patch | view | raw | blame | history
src/views/police/index.vue 16 ●●●●● patch | view | raw | blame | history
src/views/video/list.vue 4 ●●● patch | view | raw | blame | history
src/views/video/region.vue 28 ●●●● patch | view | raw | blame | history
public/img/icon/police.png
public/img/policeCar.png
src/api/activity/index.js
@@ -2,16 +2,37 @@
/**
 * 添加活动
 * 获取活动列表
 * @param {*}   
 * @returns 
 */
export const getSecurityList = (params, requestBaseUrl = 'outside') => {
export const getSecurityList = (type, name, startTime, endTime, requestBaseUrl = 'outside') => {
    return request({
        url: `/security/security/all`,
        url: `/security/security/page`,
        method: 'get',
        requestBaseUrl,
        params
        params: {
            current: 1,
            size: 100,
            type,
            name,
            startTime,
            endTime,
        }
    })
}
/**
 * 获取警车列表
 * @param {*} params
 * @returns
 */
export const getCarList = (params, requestBaseUrl = 'outside') => {
    return request({
        url: `/policecar/policecar/all`,
        method: 'get',
        requestBaseUrl,
        params: params
    })
}
@@ -52,6 +73,24 @@
}
/**
 * 活动修改警车
 * @param {*} carId 警员ID
 * @param {*} id 数据唯一标识
 * @returns
 */
export const updateActivityCar = (id, carId, requestBaseUrl = 'outside') => {
    return request({
        url: `/securityManageCar/securityManageCar/update`,
        method: 'post',
        requestBaseUrl,
        params: {
            id,
            carId,
        }
    })
}
/**
 * 活动添加警员
 * @param {*} policemanId  警员ID
 * @param {*} position  坐标
src/api/police/index.js
@@ -31,7 +31,7 @@
 */
export const getCarList = (params = {}, requestBaseUrl = 'outside') => {
    return request({
        url: '/policecar/policecar/all',
        url: '/policecar/policecar/page',
        method: 'get',
        requestBaseUrl,
        params: {
src/api/video/index.js
@@ -109,7 +109,7 @@
 * @param {*} current 当前页
 * @param {*} size 每页数据数量
 */
export const getRegionSaveList = (current, size, requestBaseUrl = 'outside') => {
export const getRegionSaveList = (current, size, name, requestBaseUrl = 'outside') => {
    return request({
        url: '/range/range/page',
        method: 'get',
@@ -117,6 +117,7 @@
        params: {
            current,
            size,
            name
        }
    })
}
src/router/axios.js
@@ -24,7 +24,8 @@
const service = axios.create({
    // baseURL: 'http://36.14.255.242:18080/api',
    // baseURL: 'http://192.168.0.102:1888/api',
    baseURL: 'http://192.168.0.105:18080/api',
    // baseURL: 'http://192.168.0.105:18080/api',
    baseURL: 'http://192.168.0.115:82',
    // baseURL: 'http://192.168.0.106:1888/api',
    timeout: 600000 // request timeout
})
@@ -43,7 +44,8 @@
        if (config.requestBaseUrl == 'outside') {
            // config.baseURL = 'http://192.168.0.102:1888/api'
            config.baseURL = 'http://192.168.0.105:80/api'
            // config.baseURL = 'http://192.168.0.105:80/api'
            config.baseURL = 'http://192.168.0.115:82'
            // config.baseURL = 'http://192.168.0.106:1888/api'
        }
src/views/activity/index.vue
@@ -17,7 +17,12 @@
                <div>
                    <div class="category">活动类型:</div>
                    <div class="category-value">
                        <el-select size="small" v-model="activityType" placeholder="请选择">
                        <el-select
                            size="small"
                            v-model="activityType"
                            placeholder="请选择"
                            @change="activityTypeChange"
                        >
                            <el-option
                                v-for="item in activityOptions"
                                :key="item.value"
@@ -31,18 +36,32 @@
                    <div class="category">活动名称:</div>
                    <div class="category-value">
                        <input type="text" placeholder="请输入搜索条件" v-model="searchActivity" />
                        <button class="el-icon-search"></button>
                        <button class="el-icon-search" @click="searchClick"></button>
                    </div>
                </div>
                <div>
                    <div class="category">选择时间:</div>
                    <div class="category-value">
                        <el-date-picker
                        <!-- <el-date-picker
                            size="small"
                            v-model="selectTime"
                            type="date"
                            placeholder="选择日期"
                            style="width:268px"
                        ></el-date-picker>-->
                        <el-date-picker
                            v-model="selectTime"
                            type="daterange"
                            align="right"
                            unlink-panels
                            format="yyyy-MM-dd HH:mm:ss"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            :picker-options="pickerOptions"
                            style="width:268px"
                            @change="activityTimeChange"
                        ></el-date-picker>
                    </div>
                </div>
@@ -61,6 +80,10 @@
                            <div>
                                <div class="category">活动名称:</div>
                                <div class="category-value">{{ item.name }}</div>
                            </div>
                            <div>
                                <div class="category">申报人数:</div>
                                <div class="category-value">{{ item.number }}</div>
                            </div>
                            <div>
                                <div class="category">活动时间:</div>
@@ -91,12 +114,6 @@
        <div class="draw-btn-box" v-show="dialogVisible">
            <ul>
                <!-- <li>
                    <button @click="draw('point')">点</button>
                </li>
                <li>
                    <button @click="draw('billboard')">图标点</button>
                </li>-->
                <li>
                    <button @click="draw('billboard','policeman')">警员</button>
                </li>
@@ -115,30 +132,6 @@
                <li>
                    <button @click="draw('polygon','policecar')">警车范围</button>
                </li>
                <!-- <li>
                    <button @click="draw('circle')">圆</button>
                </li>
                <li>
                    <button @click="draw('rectangle')">矩形</button>
                </li>
                <li>
                    <button @click="draw('attack_arrow')">进攻箭头</button>
                </li>
                <li>
                    <button @click="draw('double_arrow')">双箭头</button>
                </li>
                <li>
                    <button @click="draw('fine_arrow')">直箭头</button>
                </li>
                <li>
                    <button @click="draw('tailed_attack_arrow')">燕尾箭头</button>
                </li>
                <li>
                    <button @click="draw('gathering_place')">聚集地</button>
                </li>
                <li>
                    <button @click="removeAll()">清除</button>
                </li>-->
            </ul>
        </div>
@@ -272,7 +265,7 @@
</template>
<script>
import { getSecurityList, getPoliceList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice } from '@/api/activity/index.js'
import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice, updateActivityCar } from '@/api/activity/index.js'
let analyseLayer = null
let analysePolygon = null
@@ -285,22 +278,27 @@
    data () {
        return {
            activityOptions: [{
                value: '选项1',
                label: '黄金糕'
                value: '1',
                label: '教育活动'
            }, {
                value: '选项2',
                label: '双皮奶'
                value: '2',
                label: '科技活动'
            }, {
                value: '选项3',
                label: '蚵仔煎'
                value: '3',
                label: '公益活动'
            }, {
                value: '选项4',
                label: '龙须面'
                value: '4',
                label: '组织活动'
            }, {
                value: '选项5',
                label: '北京烤鸭'
                value: '5',
                label: '文娱活动'
            }, {
                value: '6',
                label: '体育活动'
            }],
            policeOption: [],
            policemanOption: [],
            policecarOption: [],
            activityType: '',
            policeType: '',
            searchActivity: '',
@@ -466,11 +464,8 @@
    },
    created () {
        this.getPoliceList()
        // this.addCarAndRange('1595988751891415042', '1 2,3 4', 1, 1)
        // this.addActivityPolice()
        this.getCarList()
        this.getSecurityList()
        // this.getSecurityPoliceList()
        // this.getSecurityCarList()
    },
    mounted () {
@@ -499,7 +494,8 @@
        })
    },
    updated () { },
    updated () {
    },
    methods: {
        // 生成热力图坐标
@@ -511,6 +507,39 @@
                list.push(new global.DC.Position(lng, lat))
            }
            return list
        },
        // 点击搜索
        searchClick () {
            let startTime = ''
            let endTime = ''
            if (this.selectTime) {
                startTime = this.selectTime[0]
                endTime = this.selectTime[1]
            }
            this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime)
        },
        // 下拉选择值变化
        activityTypeChange () {
            let startTime = ''
            let endTime = ''
            if (this.selectTime) {
                startTime = this.selectTime[0]
                endTime = this.selectTime[1]
            }
            this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime)
        },
        // 时间选中值触发
        activityTimeChange () {
            let startTime = ''
            let endTime = ''
            if (this.selectTime) {
                startTime = this.selectTime[0]
                endTime = this.selectTime[1]
            }
            this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime)
        },
        // 获取活动警员分布信息
@@ -527,7 +556,7 @@
                        this.$EventBus.$emit('layerPolylineAdd', {
                            layerName: 'newDrawLayers',
                            positions: positionNewArr,
                            material: global.DC.Color.RED,
                            material: global.DC.Color.ORANGE.withAlpha(0.6),
                            width: 4,
                            params: {
                                id: item.id,
@@ -540,7 +569,7 @@
                        this.$EventBus.$emit('layerPolygonAdd', {
                            layerName: 'newDrawLayers',
                            positions: positionNewArr,
                            material: global.DC.Color.RED,
                            material: global.DC.Color.ORANGE.withAlpha(0.6),
                            params: {
                                id: item.id,
                                policemanId: item.policemanId
@@ -549,7 +578,7 @@
                        })
                    } else if (item.type == 3) {
                        let positionObj = this.convertBillboardPositionDate(item.position, 'police', item.id, item.policemanId)
                        let positionObj = this.convertBillboardPositionDate(item.position, 'policeman', item.id, item.policemanId)
                        this.$EventBus.$emit('layerPointAdd', {
                            layerName: 'newDrawLayers',
                            type: 'billboard',
@@ -563,25 +592,74 @@
        // 获取活动警车分布信息
        getSecurityCarList (securityId) {
            this.removeAll()
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'newCarDrawLayers',
                type: 'VectorLayer'
            })
            getSecurityCarList(securityId).then(res => {
                console.log('活动警车列表', res.data.data)
                res.data.data.forEach(item => {
                    if (item.type == 1) {
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
                        this.$EventBus.$emit('layerPolylineAdd', {
                            layerName: 'newCarDrawLayers',
                            positions: positionNewArr,
                            material: global.DC.Color.BLUE.withAlpha(0.4),
                            width: 8,
                            params: {
                                id: item.id,
                                carId: item.carId
                            },
                            incident: this.overlayTypeClick
                        })
                    } else if (item.type == 2) {
                        let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type)
                        this.$EventBus.$emit('layerPolygonAdd', {
                            layerName: 'newCarDrawLayers',
                            positions: positionNewArr,
                            material: global.DC.Color.BLUE.withAlpha(0.4),
                            params: {
                                id: item.id,
                                carId: item.carId
                            },
                            incident: this.overlayTypeClick
                        })
                    } else if (item.type == 3) {
                        let positionObj = this.convertBillboardPositionDate(item.position, 'policecar', item.id, item.carId)
                        this.$EventBus.$emit('layerPointAdd', {
                            layerName: 'newCarDrawLayers',
                            type: 'billboard',
                            params: positionObj,
                            incident: this.overlayTypeClick
                        })
                    }
                })
            })
        },
        // 获取活动列表
        getSecurityList () {
            getSecurityList().then(res => {
                this.activityList = res.data.data
        getSecurityList (type, name, startTime, endTime) {
            getSecurityList(type, name, startTime, endTime).then(res => {
                this.activityList = res.data.data.records
                this.addActivityPoint()
                console.log('活动列表', res.data.data)
            })
        },
        // 获取警员列表,生成下拉数据
        getPoliceList () {
            getPoliceList().then(res => {
                console.log('警员列表', res.data.data)
                res.data.data.forEach(item => {
                    this.policeOption.push({ value: `${item.id}`, label: `${item.name}` })
                    this.policemanOption.push({ value: `${item.id}`, label: `${item.name}` })
                })
            })
        },
        // 获取警车列表,生成下拉数据
        getCarList () {
            getCarList().then(res => {
                res.data.data.forEach(item => {
                    this.policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}` })
                })
            })
        },
@@ -593,10 +671,17 @@
            })
        },
        // 修改活动警车
        updateActivityCar (id, carId) {
            updateActivityCar(id, carId).then(res => {
                this.getSecurityCarList(this.showingSecurityId)
            })
        },
        // 活动添加警车和范围
        addCarAndRange (carId, position, securityId, type) {
            addCarAndRange(carId, position, securityId, type).then(res => {
                console.log(res, 2323)
                this.getSecurityCarList(securityId)
            })
        },
@@ -616,21 +701,22 @@
        // 活动添加警员
        addActivityPolice (policemanId, position, securityId, type) {
            addActivityPolice(policemanId, position, securityId, type).then(res => {
                console.log(res, 3333)
                this.getSecurityPoliceList(securityId)
            })
        },
        // 转换 点 坐标数据
        convertBillboardPositionDate (data, iconName, plotId, policemanId) {
        convertBillboardPositionDate (data, iconName, plotId, policeId) {
            let positionStr = data
            positionStr = data.slice(6, positionStr.length - 1)
            let positionArr = positionStr.split(" ")
            let positionObj = {}
            if (iconName == 'activity') {
                positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/icon/activity.png' }
            } else {
                positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/policeIcon.png', id: plotId, policemanId: policemanId }
            } else if (iconName == 'policeman') {
                positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/icon/police.png', id: plotId, policemanId: policeId }
            } else if (iconName == 'policecar') {
                positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/icon/car.png', id: plotId, carId: policeId }
            }
            return positionObj
        },
@@ -695,6 +781,7 @@
                type: 'VectorLayer'
            })
            this.getSecurityPoliceList(item.id)
            this.getSecurityCarList(item.id)
            if (this.currentClickIndex !== '' && this.currentClickIndex == index) {
                return
            }
@@ -804,7 +891,7 @@
                if (poltType == 'billboard' && policeType == 'policeman') {
                    overlay.icon = '/img/policeIcon.png'
                } else if (poltType == 'billboard' && policeType == 'policecar') {
                    overlay.icon = '/img/policeCar.png'
                    overlay.icon = '/img/policeCar.jfif'
                }
                if (overlay) {
@@ -814,9 +901,17 @@
                        flag = true
                        overlay.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick)
                        overlay.drawType = poltType
                        overlay.policeType = policeType
                        this.overlayObj = overlay
                        document.oncontextmenu = function () {
                            if (flag == true) {
                                if (policeType == 'policeman') {
                                    that.policeChooseTitle = '选择警员'
                                    that.policeOption = that.policemanOption
                                } else if (policeType == 'policecar') {
                                    that.policeChooseTitle = '选择警车'
                                    that.policeOption = that.policecarOption
                                }
                                that.policeChooseVisible = true
                                flag = false
                            }
@@ -900,12 +995,19 @@
                    position += this.overlayObj._positions[0]._lng + ' ' + this.overlayObj._positions[0]._lat + ','
                    position = position.slice(0, position.length - 1)
                }
                this.addActivityPolice(this.policeType, position, this.showingSecurityId, type)
                if (this.overlayObj.policeType == 'policeman') {
                    this.addActivityPolice(this.policeType, position, this.showingSecurityId, type)
                } else if (this.overlayObj.policeType == 'policecar') {
                    this.addCarAndRange(this.policeType, position, this.showingSecurityId, type)
                }
                this.policeChooseVisible = false
                this.policeIconIsCreated = false
            } else {
                this.updateActivityPolice(this.policeIconId, this.policeType)
                if (this.policeChooseTitle == '选择警员') {
                    this.updateActivityPolice(this.policeIconId, this.policeType)
                } else if (this.policeChooseTitle == '选择警车') {
                    this.updateActivityCar(this.policeIconId, this.policeType)
                }
                this.policeChooseVisible = false
                this.policeIconIsCreated = false
            }
@@ -913,10 +1015,18 @@
        // 地图绘制元素点击事件
        overlayTypeClick (e) {
            // console.log('点击了元素', e.overlay.attrParams)
            this.policeIconIsCreated = true
            this.policeIconId = e.overlay.attrParams.id
            this.policeType = e.overlay.attrParams.policemanId
            if ('policemanId' in e.overlay.attrParams) {
                this.policeChooseTitle = '选择警员'
                this.policeOption = this.policemanOption
                this.policeIconId = e.overlay.attrParams.id
                this.policeType = e.overlay.attrParams.policemanId
            } else if ('carId' in e.overlay.attrParams) {
                this.policeChooseTitle = '选择警车'
                this.policeOption = this.policecarOption
                this.policeIconId = e.overlay.attrParams.id
                this.policeType = e.overlay.attrParams.carId
            }
            this.policeChooseVisible = true
        }
    },
@@ -944,6 +1054,10 @@
        this.$EventBus.$emit('mapClearLayer', {
            layerName: 'newDrawLayers',
            type: 'VectorLayer'
        })
        this.$EventBus.$emit('mapClearLayer', {
            layerName: 'newCarDrawLayers',
            type: 'VectorLayer'
        })
@@ -1055,7 +1169,7 @@
                .row-box {
                    margin: 10px;
                    padding: 10px;
                    background: rgba(29, 38, 105, 1);
                    background: rgba(25, 23, 99, 0.7);
                    cursor: pointer;
                    font-size: 14px;
@@ -1079,11 +1193,13 @@
                }
                .row-box:hover {
                    background-color: $table-header-bg-color;
                    // background-color: $table-header-bg-color;
                    background-color: rgba(0, 0, 138, 0.8);
                }
                .row-box.on {
                    background: $table-header-bg-color;
                    // background: $table-header-bg-color;
                    background-color: rgba(0, 0, 138, 0.8);
                }
                :deep(.el-dialog) {
src/views/police/index.vue
@@ -382,7 +382,6 @@
<script>
import { listQuery, accurateSearch } from "@/utils/search.js"
import phoneList from '@/assets/data/phone.js'
import zfList from '@/assets/data/zf.js'
import dtList from '@/assets/data/dt.js'
@@ -458,16 +457,13 @@
            this.currentPage = currentPage
        },
        getCarList () {
            getCarList().then(res => {
                console.log(res, 6666)
                this.carListSaveDate = res.data.data
                this.carList = res.data.data
        getCarList (serialNumber) {
            getCarList({ current: 1, size: 10, serialNumber: serialNumber }).then(res => {
                console.log(res.data.data.records, 6666)
                this.carListSaveDate = res.data.data.records
                this.carList = res.data.data.records
            })
        },
        navClick (type) {
            if (!type) { type = 1 }
@@ -610,7 +606,7 @@
        searchClick () {
            this.searchValBoxShow = false
            if (this.navType == 1) {
                this.carList = accurateSearch(this.carListSaveDate, this.searchValue, 'name')
                this.getCarList(this.searchValue)
            } else if (this.navType == 2) {
                this.phoneList = accurateSearch(phoneList, this.searchValue, 'name')
            } else if (this.navType == 3) {
src/views/video/list.vue
@@ -246,7 +246,6 @@
            if (this.searchValue == '') {
                this.searchValBoxShow = false
                this.searchArray = []
                // this.monitoringList = this.monitoringSaveList
                this.getVideoList(1, 10, this.searchValue)
                this.$message({
                    message: '请输入搜索内容',
@@ -262,7 +261,6 @@
        searchClick () {
            if (this.searchValue != '') {
                this.searchValBoxShow = false
                this.monitoringList = accurateSearch(this.monitoringSaveList, this.searchValue, 'name')
                this.getVideoList(1, 10, this.searchValue)
            } else {
                this.$message({
@@ -270,7 +268,6 @@
                    type: 'warning'
                })
            }
        },
        searchVlaClick (item) {
@@ -278,6 +275,7 @@
            this.searchArray = []
            this.monitoringList = [item]
            this.searchValue = item.name
            this.getVideoList(1, 10, this.searchValue)
        },
        draw (type) {
src/views/video/region.vue
@@ -299,7 +299,6 @@
                flvPlayer5: null,
                flvPlayer6: null,
            },
            saveRangeList: [],
            monitorOption: [],
            monitorType1: '',
@@ -429,8 +428,8 @@
        },
        getRegionSaveList () {
            getRegionSaveList(1, 10).then(res => {
        getRegionSaveList (name) {
            getRegionSaveList(1, 10, name).then(res => {
                this.saveRangeList = res.data.data.records
                this.initRangeListLayer()
            })
@@ -438,7 +437,7 @@
        deleteRegionSaveList (id) {
            deleteRegionSaveList(id).then(res => {
                console.log('删除', res)
                console.log('删除成功', res)
                this.getRegionSaveList()
            })
        },
@@ -565,22 +564,37 @@
            if (this.searchValue == '') {
                this.searchValBoxShow = false
                this.searchArray = []
                this.getRegionSaveList(this.searchValue)
                this.$message({
                    message: '请输入搜索内容',
                    type: 'warning'
                })
                // this.monitoringList = monitoringList
            } else {
                // this.searchArray = listQuery(monitoringList, this.searchValue, 'name')
                this.searchArray = listQuery(this.saveRangeList, this.searchValue, 'name')
                this.searchValBoxShow = true
                this.getRegionSaveList(this.searchValue)
            }
        },
        searchClick () {
            this.searchValBoxShow = false
            // this.monitoringList = accurateSearch(monitoringList, this.searchValue, 'name')
            if (this.searchValue != '') {
                this.searchValBoxShow = false
                this.getRegionSaveList(this.searchValue)
            } else {
                this.$message({
                    message: '请输入搜索内容',
                    type: 'warning'
                })
            }
        },
        searchVlaClick (item) {
            this.searchValBoxShow = false
            this.searchArray = []
            this.monitoringList = [item]
            this.searchValue = item.name
            this.getRegionSaveList(this.searchValue)
        },
        // 大小重置