shuishen
2022-09-19 4b5689711e8a6ca4a6af7b19731e9d57c545ad7a
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
2 files modified
126 ■■■■ changed files
src/components/map/index.vue 8 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 118 ●●●● patch | view | raw | blame | history
src/components/map/index.vue
@@ -292,6 +292,14 @@
        }
        // 注册事件
        // 使用示例
        // this.$EventBus.emit('mapAddLayer', {
        //     layerName: 'housingEstateLayer',
        //     type: 'VectorLayer'
        // })
        this.$EventBus.on('mapAddLayer', (params) => {
            that.mapAddLayer(params.layerName, params.type)
        })
src/views/home/index.vue
@@ -99,14 +99,14 @@
                <div id="peopleList" class="echarts-box">
                    <el-table
                        :data="arr"
                        stripe
                        style="width: 100%"
                        :header-cell-style="{'text-align':'center'}"
                        :cell-style="{'text-align':'center'}"
                        :header-cell-style="{'text-align':'center','background-color':'#00204f','borderColor':'#073365'}"
                        :cell-style="{'text-align':'center','borderColor':'#073365'}"
                        :row-class-name="tableRowClassName"
                    >
                        <el-table-column prop="type" label="人员类型" width="80"></el-table-column>
                        <el-table-column prop="num" label="人数" width="180"></el-table-column>
                        <el-table-column prop="radio" label="占比" width="100"></el-table-column>
                        <el-table-column prop="radio" label="占比" width="120"></el-table-column>
                    </el-table>
                </div>
            </div>
@@ -216,6 +216,7 @@
            var option
            option = {
                color: ['#2967c4', '#112d54'],
                xAxis: {
                    type: 'value',
                    splitLine: {
@@ -248,18 +249,21 @@
                },
                series: [
                    {
                        data: [191, 141, 97, 77, 54],
                        data: [54, 77, 97, 141, 191],
                        type: 'bar',
                        itemStyle: {
                            normal: {
                                label: {
                                    show: true,
                                    position: 'right',
                                    textStyle: {
                                        color: '#1a94a8',
                                        fontSize: 16
                                    }
                                }
                        zlevel: 2,
                    },
                    {
                        data: [{ 'value': 191, 'realValue': 54 }, { 'value': 191, 'realValue': 77 }, { 'value': 191, 'realValue': 97 }, { 'value': 191, 'realValue': 141 }, { 'value': 191, 'realValue': 191 }],
                        type: 'bar',
                        barGap: '-100%',
                        label: {
                            show: true,
                            color: '#fff',
                            position: 'right', // 标签右对齐
                            distance: 5,// 标签距离柱条的距离
                            formatter: params => {
                                return params.data.realValue + '个'
                            }
                        }
                    }
@@ -278,25 +282,68 @@
            var chartDom = document.getElementById('EquipmentEcharts')
            var myChart = this.$echarts.init(chartDom)
            var option
            var regionTotal = 0
            // console.log(regionTotal)
            let dataArr = [
                { value: 21438, name: '未知' },
                { value: 4664, name: '固定枪机' },
                { value: 310, name: '固定球机' },
                { value: 279, name: '可控球机' },
                { value: 241, name: '卡口枪击' },
                { value: 5, name: '云台枪击' }
            ]
            for (let i = 0; i < dataArr.length; i++) {
                regionTotal += dataArr[i].value
                console.log('222', regionTotal)
            }
            option = {
                title: {
                    show: true,
                    text: ['{a|摄像头总数}', '{b|26937个}'].join('                                      '), // 主副标题
                    left: 'left',
                    textStyle: {
                        rich: {
                            a: {
                                fontWeight: 'normal',
                                fontSize: 16,
                                color: '#fff'
                            },
                            b: {
                                fontSize: 22,
                                fontWeight: 'bolder',
                                color: '#fff'
                            }
                        }
                    }
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    left: '50%',
                    y: 'center',
                    itemGap: 25,
                    left: '55%',
                    y: '20%',
                    itemGap: 10,
                    textStyle: {
                        color: '#fff'          // 图例文字颜色
                    }
                        color: '#fff'
                    },
                    formatter: function (name) {
                        let data = option.series[0].data
                        let tarValue
                        for (let i = 0; i < data.length; i++) {
                            if (data[i].name == name) {
                                tarValue = data[i].value
                            }
                        }
                        let v = tarValue
                        return `${name}     ${v} 个    `
                    },
                },
                series: [
                    {
                        name: 'Access From',
                        type: 'pie',
                        radius: ['40%', '70%'],
                        center: ['30%', '60%'],
                        center: ['27%', '57%'],
                        avoidLabelOverlap: false,
                        label: {
                            show: false,
@@ -378,8 +425,8 @@
                    trigger: 'item'
                },
                legend: {
                    left: '50%',
                    y: 'center',
                    left: '75%',
                    y: '10%',
                    itemGap: 25,
                    textStyle: {
                        color: '#fff'          // 图例文字颜色
@@ -390,7 +437,7 @@
                        name: 'Access From',
                        type: 'pie',
                        radius: ['40%', '70%'],
                        center: ['30%', '60%'],
                        center: ['40%', '60%'],
                        avoidLabelOverlap: false,
                        label: {
                            show: false,
@@ -421,7 +468,14 @@
            }
            option && myChart.setOption(option)
        }
        },
        tableRowClassName () {
            // if ((rowIndex + 1) % 2 === 0) {
            return "aa"
            // } else {
            //     return "background:rgba(0,8,1,0.1)"
            // }
        },
    }
}
</script>
@@ -429,7 +483,14 @@
<style scoped lang="scss">
.container {
    color: #fff;
    ::v-deep .el-table tr:nth-child(2n) {
        background: #03254c;
        color: #fff;
    }
    ::v-deep .el-table tr:nth-child(2n-1) {
        background: #26426a;
        color: #fff;
    }
    .left-container {
        position: fixed;
        top: 80px;
@@ -463,6 +524,9 @@
        .alert-box,
        .crowd-box {
            height: 35%;
            .el-table__row.statistics-warning-row {
                background: #ff0000;
            }
        }
    }