guanqb
2023-01-13 9d4e46b6e6e760edfee933a537e9b5a019d84b43
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
1 files modified
130 ■■■■■ changed files
src/views/police/index.vue 130 ●●●●● patch | view | raw | blame | history
src/views/police/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-12 17:14:12
 * @LastEditTime: 2023-01-13 11:23:58
 * @FilePath: \srs-police-affairs\src\views\police\index.vue
 * @Description: 辖区管理
 * 
@@ -20,13 +20,13 @@
                </el-select>
            </div>
            <div class="list-show" ref="tableBox" v-show="!detailFlag">
                <div class="search-box" ref="tableSearchBox">
            <div class="list-show" v-show="!detailFlag">
                <div class="search-box">
                    资源名称:
                    <input v-model="searchValue" @input="searchChange" type="text" placeholder="请输入搜索条件" />
                </div>
                <div class="list">
                <div class="list" ref="tableBox">
                    <el-table :data="equimentTableData"
                        :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                        :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
@@ -46,8 +46,8 @@
                                <el-button @click="rowClick(scope.row)" type="text" size="small" title="定位">
                                    <i class="el-icon-location"></i>
                                </el-button>
                                <el-button v-show="navType == 0" @click="carDetail(scope.row)" type="text" size="small"
                                    title="轨迹">
                                <el-button v-show="navType == 0" @click="equipmentTrack(scope.row)" type="text"
                                    size="small" title="轨迹">
                                    <i class="el-icon-position"></i>
                                </el-button>
                                <el-button @click="play(scope.row)" type="text" size="small" title="播放视频">
@@ -57,7 +57,7 @@
                        </el-table-column>
                    </el-table>
                    <div class="pages">
                    <div class="pages" ref="tablePagination">
                        <el-pagination background layout="prev, pager, next" :page-size="equimentPage.pageSize"
                            :page-count="equimentPage.count" :current-page="equimentPage.currentPage"
                            @current-change="handleCurrentChange"></el-pagination>
@@ -68,66 +68,36 @@
            <div class="track-box" v-show="detailFlag">
                <div class="track-box-info">
                    <div class="back-btn" @click="goBack" title="轨迹">详细资料及轨迹查询</div>
                    <ul v-show="navType == 0">
                    <ul>
                        <li>
                            <div>车辆型号:</div>
                            <div>SC7103</div>
                            <div>通道编号:</div>
                            <div>{{ currentSelectEquipment.channelId ? currentSelectEquipment.channelId : '' }}
                            </div>
                        </li>
                        <li>
                            <div>责任人:</div>
                            <div>高德光</div>
                            <div>设备编号:</div>
                            <div>{{ currentSelectEquipment.deviceId ? currentSelectEquipment.deviceId : '' }}
                            </div>
                        </li>
                        <li>
                            <div>出场日期:</div>
                            <div>2019-12-02 00:00:00</div>
                            <div>通道名称:</div>
                            <div>{{ currentSelectEquipment.name ? currentSelectEquipment.name : '' }}</div>
                        </li>
                        <li>
                            <div>厂商:</div>
                            <div>重庆长安铃木汽车有限公司</div>
                            <div>状态:</div>
                            <div>{{
                                currentSelectEquipment.status ? (currentSelectEquipment.status == 0 ? '离线' :
                                    '在线') : ''
                            }}</div>
                        </li>
                        <li>
                            <div>选择时间:</div>
                            <div class="datetime">
                                <el-date-picker v-model="trackTime" type="daterange" unlink-panels range-separator="至"
                                    start-placeholder="开始日期" size="mini" :editable="false"
                                    end-placeholder="结束日期"></el-date-picker>
                            </div>
                        </li>
                        <li>
                            <el-button type="text" @click="lookTrack">查看轨迹</el-button>
                        </li>
                    </ul>
                    <ul v-show="navType == 1">
                        <li>
                            <div>型号:</div>
                            <div>350m</div>
                        </li>
                        <li>
                            <div>责任人:</div>
                            <div>高德光</div>
                        </li>
                        <li>
                            <div>出场日期:</div>
                            <div>2019-12-02 00:00:00</div>
                        </li>
                        <li>
                            <div>厂商:</div>
                            <div>摩托罗拉</div>
                        </li>
                        <li>
                            <div>选择时间:</div>
                            <div class="datetime">
                                <el-date-picker v-model="trackTime" type="datetimerange" range-separator="至"
                                    start-placeholder="开始日期" size="mini" :editable="false"
                                    end-placeholder="结束日期"></el-date-picker>
                            </div>
@@ -214,18 +184,13 @@
                pageSize: 15,
                count: 0,
                currentPage: 1
            }
            },
            currentSelectEquipment: {}
        }
    },
    created () {
        const that = this
        this.$nextTick(() => {
            this.setTableHeight()
        })
        window.addEventListener('resize', this.setTableHeight)
    },
    mounted () {
        this.$parent.$parent.resize('400px', true)
@@ -233,6 +198,10 @@
        this.navClick()
        tc = new global.DC.TrackController(global.viewer)
        this.$nextTick(() => {
            this.setTableHeight()
        })
    },
    methods: {
        // 搜索框改变事件
@@ -252,7 +221,7 @@
            })
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'phoneLayers',
                layerName: 'policeMonitoringLayers',
                type: 'VectorLayer'
            })
@@ -289,7 +258,7 @@
                            })
                        } else if (this.navType == 1) {
                            this.$EventBus.$emit('layerPointAdd', {
                                layerName: 'phoneLayers',
                                layerName: 'policeMonitoringLayers',
                                type: "billboard",
                                params: {
                                    ...item,
@@ -334,7 +303,7 @@
            })
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'phoneLayers',
                layerName: 'policeMonitoringLayers',
                type: 'VectorLayer'
            })
@@ -356,8 +325,10 @@
        },
        // 表格行点击查看轨迹
        carDetail (row) {
        equipmentTrack (row) {
            this.detailFlag = true
            this.currentSelectEquipment = row
        },
        async play (row) {
@@ -444,6 +415,8 @@
        // 查看轨迹
        async lookTrack () {
            global.viewer.scene.globe.depthTestAgainstTerrain = false
            if (this.trackTime.length == 0) {
                this.$message({ message: "请选择开始时间", duration: 2000 })
                return
@@ -485,19 +458,31 @@
            })
            let positionsArr = []
            await this.getHistoricalTrack().then(res => {
            await this.getHistoricalTrack({ start: start, end: end, channelId: this.currentSelectEquipment.channelId }).then(res => {
                positionsArr = res
            })
            if (positionsArr.length == 0) {
                this.$message({
                    message: '该设备暂无轨迹数据',
                    type: 'warning'
                })
                return
            }
            let positionStr = ''
            positionsArr.forEach(item => {
                positionStr = positionStr + item.longitude + ',' + item.latitude + ';'
            })
            this.$EventBus.$emit('layerPolylineAdd', {
                layerName: 'polylineLayer',
                positions: positionStr,
                material: global.DC.Color.RED,
                width: 6
            })
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'polylineLayer',
                type: "billboard",
@@ -508,6 +493,7 @@
                    url: '/img/icon/orgin.png',
                }
            })
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'polylineLayer',
                type: "billboard",
@@ -527,7 +513,6 @@
            tc.addTrack(track)
            this.$EventBus.$emit('toPosition', {
                siteJd: 114.928669,
                siteWd: 25.850383,
@@ -545,7 +530,7 @@
        },
        setTableHeight () {
            this.currentTableHeight = this.$refs.tableBox.offsetHeight - this.$refs.tableSearchBox.offsetHeight
            this.currentTableHeight = this.$refs.tableBox.offsetHeight - this.$refs.tablePagination.offsetHeight
        },
        // 大小重置
@@ -553,11 +538,13 @@
            this.boxShow = val
        },
        async getHistoricalTrack (id) {
        async getHistoricalTrack (params) {
            let positionArr = []
            await getHistoricalTrack({ channelId: id }).then(res => {
            await getHistoricalTrack(params).then(res => {
                positionArr = res.data.data
            })
            return positionArr
        },
@@ -664,7 +651,7 @@
        })
        this.$EventBus.$emit('mapRemoveLayer', {
            layerName: 'phoneLayers',
            layerName: 'policeMonitoringLayers',
            type: 'VectorLayer'
        })
@@ -783,11 +770,6 @@
        .track-box {
            height: calc(100% - 50px);
            // background: rgba(20, 50, 123, 1);
            .track-box-info {
                background: rgba(8, 56, 185, 0.5);
            }
            .back-btn {
                position: relative;