guanqb
2022-11-26 4ac1b3856acf40f6f057bd50c0be8461eec04894
活动接口对接
6 files modified
1 files added
171 ■■■■ changed files
src/api/activity/index.js 61 ●●●●● patch | view | raw | blame | history
src/api/police/index.js 15 ●●●●● 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 46 ●●●●● patch | view | raw | blame | history
src/views/police/index.vue 35 ●●●●● patch | view | raw | blame | history
src/views/video/region.vue 5 ●●●●● patch | view | raw | blame | history
src/api/activity/index.js
New file
@@ -0,0 +1,61 @@
import request from "@/router/axios.js"
/**
 * 获取警员列表
 * @param {*} params
 * @returns
 */
export const getPoliceList = (params, requestBaseUrl = '') => {
    return request({
        url: `/policeman/policeman/all`,
        method: 'get',
        requestBaseUrl,
        params: params
    })
}
/**
 * 活动添加警车和范围
 * @param {*} carId  警车ID
 * @param {*} position  坐标
 * @param {*} securityId  活动ID
 * @param {*} type  范围类型
 * @returns
 */
export const addCarAndRange = (carId, position, securityId, type, requestBaseUrl = '') => {
    return request({
        url: `/securityManageCar/securityManageCar/save`,
        method: 'post',
        requestBaseUrl,
        params: {
            carId,
            position,
            securityId,
            type
        }
    })
}
/**
 * 活动添加警员
 * @param {*} policemanId  警车ID
 * @param {*} position  坐标
 * @param {*} securityId  活动ID
 * @param {*} deptId  部分ID
 * @param {*} type  范围类型
 * @returns
 */
export const addActivityPolice = (policemanId, position, securityId, deptId, type, requestBaseUrl = '') => {
    return request({
        url: `/securityManage/securityManage/save`,
        method: 'post',
        requestBaseUrl,
        params: {
            policemanId,
            position,
            securityId,
            deptId,
            type
        }
    })
}
src/api/police/index.js
@@ -23,4 +23,19 @@
    })
}
/**
 * 获取警车信息
 * @param {*} page 页数
 * @param {*} count 每页数量
 * @returns
 */
export const getCarList = (params = {},) => {
    return request({
        url: '/policecar/policecar/all',
        method: 'get',
        params: {
            ...params,
        }
    })
}
src/api/video/index.js
@@ -61,8 +61,7 @@
        params: {
            page,
            count,
            range,
            requestBaseUrl,
            range
        }
    })
}
src/router/axios.js
@@ -23,7 +23,8 @@
const service = axios.create({
    // baseURL: 'http://36.14.255.242:18080/api',
    baseURL: 'http://192.168.0.105:18080/api',
    // baseURL: 'http://192.168.0.102:1888/api',
    baseURL: 'http://192.168.0.105:8081/api',
    timeout: 600000 // request timeout
})
@@ -40,7 +41,8 @@
    (config) => {
        if (config.requestBaseUrl == 'outside') {
            config.baseURL = 'http://192.168.0.102:1888/api'
            // config.baseURL = 'http://192.168.0.102:1888/api'
            config.baseURL = 'http://192.168.0.105:8081/api'
        }
        // const token = auth.getToken()
src/views/activity/index.vue
@@ -260,6 +260,8 @@
</template>
<script>
import { getPoliceList, addCarAndRange, addActivityPolice } from '@/api/activity/index.js'
let analyseLayer = null
let analysePolygon = null
let drawLayers = null
@@ -286,22 +288,7 @@
                value: '选项5',
                label: '北京烤鸭'
            }],
            policeOption: [{
                value: '选项1',
                label: '何晨光'
            }, {
                value: '选项2',
                label: '李二牛'
            }, {
                value: '选项3',
                label: '王艳兵'
            }, {
                value: '选项4',
                label: '宋凯飞'
            }, {
                value: '选项5',
                label: '徐天龙'
            }],
            policeOption: [],
            activityType: '',
            policeType: '',
            searchActivity: '',
@@ -500,7 +487,9 @@
        }
    },
    created () {
        this.getPoliceList()
        // this.addCarAndRange()
        // this.addActivityPolice()
    },
    mounted () {
@@ -552,6 +541,29 @@
            return list
        },
        getPoliceList () {
            getPoliceList().then(res => {
                console.log(res.data.data, 7777)
                res.data.data.forEach((item, index) => {
                    this.policeOption.push({ value: `${index}`, label: `${item.name}` })
                })
            })
        },
        // 活动添加警车和范围
        addCarAndRange () {
            addCarAndRange('1595988751891415042', '1 2,3 4', 1, 1).then(res => {
                console.log(res, 2323)
            })
        },
        // 活动添加警员
        addActivityPolice () {
            addActivityPolice('1596389528611971073', '11 22,33 44', 2, 1, 2).then(res => {
                console.log(res, 3333)
            })
        },
        treeCheckClick (e1, e2) {
            const that = this
            this.$EventBus.$emit('mapRemoveLayer', {
src/views/police/index.vue
@@ -50,14 +50,11 @@
                        :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
                        :height="currentTableHeight"
                    >
                        <el-table-column prop="name" label="名称" min-width="25%"></el-table-column>
                        <el-table-column prop="serialNumber" label="编号" min-width="25%"></el-table-column>
                        <el-table-column prop="carType" label="类型" min-width="25%"></el-table-column>
                        <el-table-column prop="state" label="状态" min-width="25%">
                        <el-table-column prop="status" label="状态" min-width="25%">
                            <template slot-scope="scope">
                                <div
                                    class="state-box"
                                    :class="{ online: scope.row.state == '使用中' }"
                                ></div>
                                <div class="state-box" :class="{ online: scope.row.status == '1' }"></div>
                            </template>
                        </el-table-column>
@@ -386,11 +383,11 @@
<script>
import { listQuery, accurateSearch } from "@/utils/search.js"
import carList from '@/assets/data/car.js'
import phoneList from '@/assets/data/phone.js'
import zfList from '@/assets/data/zf.js'
import dtList from '@/assets/data/dt.js'
import { getHistoricalTrack } from '@/api/police/index.js'
import { getCarList } from '@/api/police/index.js'
let tc = null
let track = null
@@ -431,10 +428,12 @@
            }],
            typeValue: '1',
            boxShow: true,
            carListSaveDate: [],
        }
    },
    created () {
        this.carList = carList
        this.getCarList()
        this.dtList = dtList
        this.phoneList = phoneList
        this.zfList = zfList
@@ -445,6 +444,7 @@
        })
        window.addEventListener('resize', this.setTableHeight)
    },
    mounted () {
        this.$parent.resize('400px', true)
@@ -457,6 +457,17 @@
        handleCurrentChange: function (currentPage) {
            this.currentPage = currentPage
        },
        getCarList () {
            getCarList().then(res => {
                console.log(res, 6666)
                this.carListSaveDate = res.data.data
                this.carList = res.data.data
            })
        },
        navClick (type) {
            if (!type) { type = 1 }
@@ -471,7 +482,7 @@
            this.searchValue = ''
            this.searchValBoxShow = false
            this.searchArray = []
            this.carList = carList
            this.carList = this.carListSaveDate
            this.dtList = dtList
            this.phoneList = phoneList
            this.zfList = zfList
@@ -578,13 +589,13 @@
            if (this.searchValue == '') {
                this.searchValBoxShow = false
                this.searchArray = []
                this.carList = carList
                this.carList = this.carListSaveDate
                this.dtList = dtList
                this.phoneList = phoneList
                this.zfList = zfList
            } else {
                if (this.navType == 1) {
                    this.searchArray = listQuery(carList, this.searchValue, 'name')
                    this.searchArray = listQuery(this.carListSaveDate, this.searchValue, 'name')
                } else if (this.navType == 2) {
                    this.searchArray = listQuery(phoneList, this.searchValue, 'name')
                } else if (this.navType == 3) {
@@ -599,7 +610,7 @@
        searchClick () {
            this.searchValBoxShow = false
            if (this.navType == 1) {
                this.carList = accurateSearch(carList, this.searchValue, 'name')
                this.carList = accurateSearch(this.carListSaveDate, this.searchValue, 'name')
            } else if (this.navType == 2) {
                this.phoneList = accurateSearch(phoneList, this.searchValue, 'name')
            } else if (this.navType == 3) {
src/views/video/region.vue
@@ -403,22 +403,27 @@
            this.playVideoList('flvPlayer1', `${this.monitorOption[value].flvUrl}`, 'videoElement1')
        },
        navClick2 (value) {
            this.playVideoList('flvPlayer2', `${this.monitorOption[value].flvUrl}`, 'videoElement2')
        },
        navClick3 (value) {
            this.playVideoList('flvPlayer3', `${this.monitorOption[value].flvUrl}`, 'videoElement3')
        },
        navClick4 (value) {
            this.playVideoList('flvPlayer4', `${this.monitorOption[value].flvUrl}`, 'videoElement4')
        },
        navClick5 (value) {
            this.playVideoList('flvPlayer5', `${this.monitorOption[value].flvUrl}`, 'videoElement5')
        },
        navClick6 (value) {
            this.playVideoList('flvPlayer6', `${this.monitorOption[value].flvUrl}`, 'videoElement6')