guanqb
2023-02-15 d856a70a4e764579e1467a254f28581cdac80427
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
3 files modified
258 ■■■■ changed files
src/components/map/index.vue 4 ●●●● patch | view | raw | blame | history
src/views/home/components/bottomContainer.vue 21 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 233 ●●●● patch | view | raw | blame | history
src/components/map/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 17:00:30
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-02-13 10:51:47
 * @LastEditTime: 2023-02-15 16:02:40
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -215,7 +215,7 @@
            // global.viewer.addTerrain(terrain)
            // 内网
            // that.switchImg()
            that.switchImg()
            // 外网
            // global.viewer.imageryLayers.addImageryProvider(
src/views/home/components/bottomContainer.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-01-13 15:52:59
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-02-13 09:59:47
 * @LastEditTime: 2023-02-15 16:01:18
 * @FilePath: \srs-police-affairs\src\views\home\components\bottomContainer.vue
 * @Description: 
 * 
@@ -395,7 +395,24 @@
        handleCurrentChange: function (currentPage) {
            this.currentPage = currentPage
            this.getAlarmList({ current: this.currentPage })
            if (this.timetype == 0) {
                this.getAlarmList({ type: this.timetype, time: this.dateFormat(this.currentWeekTime), current: this.currentPage })
            } else if (this.timetype == 1) {
                this.getAlarmList({ type: this.timetype, time: this.dateFormat(this.currentMonthTime), current: this.currentPage })
            } else {
                const date = this.currentTime.map(item => {
                    return this.dateFormat(item)
                })
                this.getAlarmList({ start: date[0], end: date[1], current: this.currentPage })
            }
        },
        // 设置默认时间
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-02-14 10:29:23
 * @LastEditTime: 2023-02-15 15:54:57
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
@@ -153,11 +153,15 @@
                :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
            >
                <el-table-column prop="realName" label="姓名"></el-table-column>
                <el-table-column prop="address" label="地址"></el-table-column>
                <el-table-column prop="phone" label="电话"></el-table-column>
                <el-table-column prop="policeStationName" label="所属派出所"></el-table-column>
                <el-table-column prop="areaName" label="所属责任区"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="realName" label="姓名"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="address" label="地址"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="phone" label="电话"></el-table-column>
                <el-table-column
                    :show-overflow-tooltip="true"
                    prop="policeStationName"
                    label="所属派出所"
                ></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="areaName" label="所属责任区"></el-table-column>
            </el-table>
            <div class="pages" ref="tablePagination">
@@ -204,12 +208,16 @@
                :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }"
            >
                <el-table-column prop="zdryxl" label="重点人员类型"></el-table-column>
                <el-table-column prop="realName" label="姓名"></el-table-column>
                <el-table-column prop="address" label="地址"></el-table-column>
                <el-table-column prop="phone" label="电话"></el-table-column>
                <el-table-column prop="policeStationName" label="所属派出所"></el-table-column>
                <el-table-column prop="areaName" label="所属责任区"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="zdryxl" label="重点人员类型"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="realName" label="姓名"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="address" label="地址"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="phone" label="电话"></el-table-column>
                <el-table-column
                    :show-overflow-tooltip="true"
                    prop="policeStationName"
                    label="所属派出所"
                ></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="areaName" label="所属责任区"></el-table-column>
            </el-table>
            <div class="pages" ref="tablePagination">
@@ -249,10 +257,15 @@
                :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }"
                :row-class-name="tableRowClassName"
            >
                <el-table-column type="index" :index="indexMethod" label="序号"></el-table-column>
                <el-table-column prop="channelId" label="通道编号"></el-table-column>
                <el-table-column prop="deviceId" label="设备编号"></el-table-column>
                <el-table-column prop="name" label="设备名称"></el-table-column>
                <el-table-column
                    :show-overflow-tooltip="true"
                    type="index"
                    :index="indexMethod"
                    label="序号"
                ></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="channelId" label="通道编号"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="deviceId" label="设备编号"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="name" label="设备名称"></el-table-column>
                <el-table-column label="设备状态">
                    <template slot-scope="scope">
                        <span>{{ scope.row.status == 0 ? '离线' : '在线' }}</span>
@@ -316,10 +329,20 @@
                        <span>{{(landPage.currentPage - 1) * landPage.pageSize + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="责任区名称" v-if="this.landType == 1"></el-table-column>
                <el-table-column prop="aoiName" label="小区名称" v-if="this.landType == 2"></el-table-column>
                <el-table-column prop="policeName" label="负责人"></el-table-column>
                <el-table-column prop="phone" label="联系电话"></el-table-column>
                <el-table-column
                    :show-overflow-tooltip="true"
                    prop="name"
                    label="责任区名称"
                    v-if="this.landType == 1"
                ></el-table-column>
                <el-table-column
                    :show-overflow-tooltip="true"
                    prop="aoiName"
                    label="小区名称"
                    v-if="this.landType == 2"
                ></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="policeName" label="负责人"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话"></el-table-column>
            </el-table>
            <div class="pages" ref="tablePagination">
@@ -502,6 +525,8 @@
<script>
let cylinderLayer = null
let circleLayer = null
let DataSourcesArray = []
let treeData = [
    {
        label: '全部',
@@ -565,27 +590,27 @@
    }
]
let positionColor = [
    global.DC.Namespace.Cesium.Color.fromBytes(3, 255, 13, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(102, 176, 255, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(230, 162, 60, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(168, 45, 177, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(245, 108, 108, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(139, 195, 74, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(244, 67, 54, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 127, 80, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(100, 149, 237, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(220, 20, 60, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(0, 0, 139, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(189, 183, 107, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(148, 0, 211, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 20, 147, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(216, 191, 216, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(238, 130, 238, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(245, 222, 179, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(154, 205, 50, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(64, 224, 208, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(70, 130, 180, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 99, 71, 100),
    global.DC.Namespace.Cesium.Color.fromBytes(3, 255, 13, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(102, 176, 255, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(230, 162, 60, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(168, 45, 177, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(245, 108, 108, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(139, 195, 74, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(244, 67, 54, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 127, 80, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(100, 149, 237, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(220, 20, 60, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(0, 0, 139, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(189, 183, 107, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(148, 0, 211, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 20, 147, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(216, 191, 216, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(238, 130, 238, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(245, 222, 179, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(154, 205, 50, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(64, 224, 208, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(70, 130, 180, 150),
    global.DC.Namespace.Cesium.Color.fromBytes(255, 99, 71, 150),
]
let timer = []
@@ -740,7 +765,6 @@
            this.policeStaionID = this.userInfo.dept_id
        }
        this.getPoliceStationTree(1)
        // setTimeout(() => {
@@ -780,7 +804,6 @@
                        name: '全部',
                        id: 1
                    })
                    if (this.userInfo.dept_id != '1123598813738675201') {
@@ -1307,30 +1330,16 @@
        /**
         * @description: 计算多个多边形面中心点
         * @param {Array} data 多个面的数据
         * @param {Array} params 多个面的数据
         * @return {Array} 多边形的中心点坐标
         */
        getRegionCenter (data) {
        getRegionCenter (params) {
            let arr = []
            data.forEach(areaArray => {
                let tempData = areaArray.slice(15, areaArray.length - 3)
                if (tempData.indexOf('),(') != -1) {
                    let tempPloyganList = tempData.split('),(')
                    tempPloyganList.forEach((polygonStr) => {
                        arr.push(this.getCurrentAreaCenter(polygonStr))
                    })
                } else {
                    let polygonStr = tempData
                    arr.push(this.getCurrentAreaCenter(polygonStr))
                }
            params.forEach(areaArray => {
                JSON.parse(areaArray).coordinates.forEach(item => {
                    arr.push(this.$turf.centroid(this.$turf.polygon([item[0]])).geometry.coordinates)
                })
            })
            if (arr.length == 1) {
@@ -1343,26 +1352,6 @@
                return this.$turf.centroid(this.$turf.polygon([arr])).geometry.coordinates
            }
        },
        /**
         * @description: 获取中心点
         * @param {*} polygonStr
         * @return {*}
         */
        getCurrentAreaCenter (polygonStr) {
            polygonStr = polygonStr.split(',')
            // 存储一个多边形的面数组
            let currentArea = polygonStr.reduce((pre, cur, index) => {
                pre.push(cur.split(' ').map(i => Number(i)))
                return pre
            }, [])
            return this.$turf.centroid(this.$turf.polygon([currentArea])).geometry.coordinates
        },
@@ -1385,28 +1374,24 @@
            cylinderLayer = new global.DC.PrimitiveLayer('cylinderLayer')
            global.viewer.addLayer(cylinderLayer)
            DataSourcesArray.forEach(item => {
                global.viewer.dataSources.remove(item, true)
            })
            this.policeStationOptions.forEach((item, index) => {
                if (item.position && item.position.length > 0) {
                    item.position.forEach((sourceItem, sourceIndex) => {
                    item.position.forEach(it => {
                        let polygonData = this.multPolyganToList(it) // 把multipolygon处理成多个polygon
                        if (polygonData.type == 'Array') {
                            polygonData.data.forEach(dataStr => {
                                this.$EventBus.$emit('layerPolygonAdd', {
                                    layerName: 'polygonLayer',
                                    positions: dataStr,
                                    material: positionColor[index],
                                })
                            })
                        } else {
                            this.$EventBus.$emit('layerPolygonAdd', {
                                layerName: 'polygonLayer',
                                positions: polygonData.data,
                                material: positionColor[index],
                            })
                        }
                        const Json = { ...JSON.parse(sourceItem) }
                        global.DC.Namespace.Cesium.GeoJsonDataSource.load(Json, {
                            stroke: positionColor[index],
                            fill: positionColor[index], //注意:颜色必须大写,即不能为blue
                            strokeWidth: 0,
                        }).then(function (dataSource) {
                            DataSourcesArray.push(dataSource)
                            global.viewer.dataSources.add(dataSource)
                        })
                    })
@@ -1444,7 +1429,10 @@
                    // })
                    // cylinderLayer.addOverlay(cylinder)
                }
            })
            const center = this.getAllRegionCenter(this.policeStationOptions)
@@ -1456,31 +1444,23 @@
                sitePitch: -45
            })
            // this.houseChange(true)
            this.houseChange(true)
        },
        initAreaOptionLayer (item) {
            this.clearPolygonLayer()
            item.position.forEach((it, index) => {
            item.position.forEach((sourceItem, index) => {
                let polygonData = this.multPolyganToList(it) // 把multipolygon处理成多个polygon
                if (polygonData.type == 'Array') {
                    polygonData.data.forEach(dataStr => {
                        this.$EventBus.$emit('layerPolygonAdd', {
                            layerName: 'polygonLayer',
                            positions: dataStr,
                            material: positionColor[index],
                        })
                    })
                } else {
                    this.$EventBus.$emit('layerPolygonAdd', {
                        layerName: 'polygonLayer',
                        positions: polygonData.data,
                        material: positionColor[index],
                    })
                }
                const Json = { ...JSON.parse(sourceItem) }
                global.DC.Namespace.Cesium.GeoJsonDataSource.load(Json, {
                    stroke: positionColor[index],
                    fill: positionColor[index], //注意:颜色必须大写,即不能为blue
                    strokeWidth: 0,
                }).then(function (dataSource) {
                    DataSourcesArray.push(dataSource)
                    global.viewer.dataSources.add(dataSource)
                })
            })
            const center = this.getRegionCenter(item.position)
@@ -1547,6 +1527,12 @@
        },
        clearPolygonLayer () {
            DataSourcesArray.forEach(item => {
                global.viewer.dataSources.remove(item, true)
            })
            DataSourcesArray = []
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'polygonLayer',
                type: 'VectorLayer'
@@ -1959,14 +1945,11 @@
    },
    destroyed () {
        this.clearPolygonLayer()
        this.$store.commit('SET_DETAILSPOPUP', {
            showBox: false,
            showBtn: false
        })
        this.$EventBus.$emit('mapRemoveLayer', {
            layerName: 'polygonLayer',
            type: 'VectorLayer'
        })
        this.$EventBus.$emit('mapRemoveLayer', {