shuishen
2023-03-29 5ab15852cea6332f55f7a0f0366b66e24119d30d
src/views/home/components/leftContainer.vue
@@ -43,10 +43,10 @@
                <defs>
                    <path id="border-box-8-path-974b4d7cfafa444396861ca1d1173c8c"
                        d="M0.27,0.03c52.66,0,105.34,0,158,0c1.67,2,3.33,4,5,6c1,0.33,2,0.67,3,1c1.33,1.67,2.67,3.33,4,5
                                                                                                    c16,0,32,0,48,0c53.66,0,107.34,0,161,0c1.13,1.72,0.63,1.36,3,2c0,0.67,0,1.33,0,2c0.67,0,1.33,0,2,0
                                                                                                    c0.01,104.58,0.01,206.44,0,309c-1.43,0.78-4.01,2.77-5,4c-12,0-24,0-36,0c-2.67-3.33-5.33-6.67-8-10c-21,0-42,0-63,0
                                                                                                    c-1.08,2.32-2.35,4.25-4,6c-0.67,0.33-1.33,0.67-2,1c-0.33,1-0.67,2-1,3c-20,0-40,0-60,0c-66.66,0-133.34,0-200,0
                                                                                                    c-1.28-1.57-2.76-2.25-4-4c-0.33,0-0.67,0-1,0c0-8.67,0-17.33,0-26c0-19.66,0-39.34,0-59C0.27,160.04,0.27,80.02,0.27,0.03z"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            c16,0,32,0,48,0c53.66,0,107.34,0,161,0c1.13,1.72,0.63,1.36,3,2c0,0.67,0,1.33,0,2c0.67,0,1.33,0,2,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            c0.01,104.58,0.01,206.44,0,309c-1.43,0.78-4.01,2.77-5,4c-12,0-24,0-36,0c-2.67-3.33-5.33-6.67-8-10c-21,0-42,0-63,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            c-1.08,2.32-2.35,4.25-4,6c-0.67,0.33-1.33,0.67-2,1c-0.33,1-0.67,2-1,3c-20,0-40,0-60,0c-66.66,0-133.34,0-200,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            c-1.28-1.57-2.76-2.25-4-4c-0.33,0-0.67,0-1,0c0-8.67,0-17.33,0-26c0-19.66,0-39.34,0-59C0.27,160.04,0.27,80.02,0.27,0.03z"
                        fill="transparent" />
                    <radialGradient id="border-box-8-gradient-974b4d7cfafa444396861ca1d1173c8c" cx="50%" cy="50%" r="50%">
                        <stop offset="0%" stop-color="#fff" stop-opacity="1" />
@@ -56,10 +56,10 @@
                        <circle cx="0" cy="0" r="150" fill="url(#border-box-8-gradient-974b4d7cfafa444396861ca1d1173c8c)">
                            <animateMotion dur="8s"
                                path="M0.27,0.03c52.66,0,105.34,0,158,0c1.67,2,3.33,4,5,6c1,0.33,2,0.67,3,1c1.33,1.67,2.67,3.33,4,5
                                                                                                        c16,0,32,0,48,0c53.66,0,107.34,0,161,0c1.13,1.72,0.63,1.36,3,2c0,0.67,0,1.33,0,2c0.67,0,1.33,0,2,0
                                                                                                        c0.01,104.58,0.01,206.44,0,309c-1.43,0.78-4.01,2.77-5,4c-12,0-24,0-36,0c-2.67-3.33-5.33-6.67-8-10c-21,0-42,0-63,0
                                                                                                        c-1.08,2.32-2.35,4.25-4,6c-0.67,0.33-1.33,0.67-2,1c-0.33,1-0.67,2-1,3c-20,0-40,0-60,0c-66.66,0-133.34,0-200,0
                                                                                                        c-1.28-1.57-2.76-2.25-4-4c-0.33,0-0.67,0-1,0c0-8.67,0-17.33,0-26c0-19.66,0-39.34,0-59C0.27,160.04,0.27,80.02,0.27,0.03z"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                c16,0,32,0,48,0c53.66,0,107.34,0,161,0c1.13,1.72,0.63,1.36,3,2c0,0.67,0,1.33,0,2c0.67,0,1.33,0,2,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                c0.01,104.58,0.01,206.44,0,309c-1.43,0.78-4.01,2.77-5,4c-12,0-24,0-36,0c-2.67-3.33-5.33-6.67-8-10c-21,0-42,0-63,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                c-1.08,2.32-2.35,4.25-4,6c-0.67,0.33-1.33,0.67-2,1c-0.33,1-0.67,2-1,3c-20,0-40,0-60,0c-66.66,0-133.34,0-200,0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                c-1.28-1.57-2.76-2.25-4-4c-0.33,0-0.67,0-1,0c0-8.67,0-17.33,0-26c0-19.66,0-39.34,0-59C0.27,160.04,0.27,80.02,0.27,0.03z"
                                rotate="auto" repeatCount="indefinite" />
                        </circle>
                    </mask>
@@ -127,6 +127,26 @@
                </use>
            </svg>
        </div>
        <el-dialog title="学校" :modal="false" :visible.sync="xxPopupShow" :before-close="landBeforeClose"
            :close-on-click-modal="true" class="land-details-box">
            <el-table :data="xxArr" style="width: 100%"
                :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
                :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75', 'cursor': 'pointer' }">
                <el-table-column :show-overflow-tooltip="true" prop="XSQ" label="县(市、区)"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="name" label="学校名称"></el-table-column>
                <el-table-column :show-overflow-tooltip="true" prop="DZ" label="地址"></el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="scope">
                        <el-button @click="rowClick(scope.row)" type="text" size="small" title="定位">
                            <i class="el-icon-location"></i>
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
    </div>
</template>
@@ -134,6 +154,7 @@
import { fontSize } from '@/utils/fontSize.js'
import { getAreaStatisticInfo } from "@/api/home/index.js"
import { getVillagePersonStatisticInfo, getVillagePersonStatisticInfoByPoliceStationId, getPersonInfo, getPersonInfoPage, getHouseStatisticInfo } from "@/api/dept"
import { schoolJSON } from '../homeleft/school.js'
let homePersonmyChart = null
let keyPersonmyChart = null
@@ -171,11 +192,15 @@
            keyPlaceNum: '',
            personAll: '',
            // 记录当前选中派出所的ID
            policeStaionID: ''
            policeStaionID: '',
            xxPopupShow: false,
            xxArr: [],
            peopleLoading: false,
        }
    },
    created () {
        console.log(schoolJSON, 1111)
    },
    mounted () {
@@ -190,9 +215,42 @@
        this.$nextTick(() => {
            window.addEventListener("resize", this.echartsResize)
            if (this.userInfo.dept_id == '1596020515064381442') {
                schoolJSON.forEach(item => {
                    if (item.x && item.x != '' && item.y && item.y != '') {
                        this.$EventBus.$emit('layerPointAdd', {
                            layerName: 'schoolJSONlayer',
                            type: "billboard",
                            params: {
                                lng: Number(item.x),
                                lat: Number(item.y),
                                url: '/img/icon/school.png'
                            }
                        })
                    }
                })
            }
        })
    },
    methods: {
        rowClick (row) {
            if (row.x == '' || row.y == '') {
                this.$message({
                    message: '暂无位置信息',
                    type: 'warning'
                })
                return
            }
            this.$EventBus.$emit('toPosition', {
                layerName: 'carLayers',
                siteJd: row.x,
                siteWd: row.y
            })
            this.xxPopupShow = false
        },
        /**
         * @description: 获取首页的所有数据
         * @return {*}
@@ -243,10 +301,15 @@
            if (type == 0) {
                if (this.userInfo.dept_id == '1123598813738675201' && this.policeStaionID == '') {
                    this.getPoliceStationInfo()
                } else {
                    this.getVillagePersonStatisticInfoByPoliceStationId(this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id)
                }
            } else if (type == 1) {
@@ -267,6 +330,11 @@
                    this.disposeEchart()
                    this.personAll = res.data.data
                    if (this.userInfo.dept_id == '1596020515064381442') {
                        this.personAll.emphasisNum = 17
                    }
                    this.policeStationPersonInfo = res.data.data
                    //异步,因此放进接口方法内部
                    this.initPersonEcharts()
@@ -274,7 +342,6 @@
                }
            })
        },
        /**
         * @description: 获取派出所户籍人口数据
@@ -286,11 +353,9 @@
            getVillagePersonStatisticInfoByPoliceStationId(policeStationId, name).then(res => {
                if (res.data.code == 200) {
                    this.disposeEchart()
                    var chartDom = document.getElementById('PersonEcharts')
                    homePersonmyChart = this.$echarts.init(chartDom)
                    this.personAll = res.data.data
                    this.villagePersonStatisticInfoList = res.data.data
                    var xDate = [], yDate = [], colors = ['#ccf9d0', '#f9d888', '#f7857e']
@@ -307,6 +372,9 @@
                    homePersonmyChart.setOption(this.initPersonOptions(xDate, yDate, colors), true)
                    this.clickPeopleChart()
                    setTimeout(() => { this.dataDeep = 2 }, 1000)
                }
            })
        },
@@ -480,7 +548,22 @@
                    xDate.push(item.name)
                    yDate.push(item.num)
                })
                this.inithouseEcharts(xDate, yDate)
                if (this.userInfo.dept_id == '1596020515064381442') {
                    this.keyPlaceNum = 28
                    this.realHouseNum = 205
                    if (isFollow == 2) {
                        xDate = ['学校', '医院', '党政机关', '宾馆酒店', '零售业', '数字经济', '批发业', '装修及建筑业', '租赁业', '房地产业', '商务服务业', '餐饮业']
                        yDate = [36, 1, 3, 34, 16, 25, 30, 33, 2, 7, 6, 2]
                        this.inithouseEcharts(xDate, yDate)
                    } else {
                        xDate = ['反恐重点目标', '危爆品单位']
                        yDate = [14, 14]
                        this.inithouseEcharts(xDate, yDate)
                    }
                } else {
                    this.inithouseEcharts(xDate, yDate)
                }
                this.clickHouseChart()
            })
        },
@@ -686,11 +769,20 @@
        clickPeopleChart () {
            homePersonmyChart.on('click', params => {
                this.dataDeep = 2
                if (params.data.type == 'policeStation') {
                    this.getVillagePersonStatisticInfoByPoliceStationId(params.data.id)
                } else {
                    this.$emit('showpeopledetail', params.data.id, params.data.name)
                }
            })
        },
        clickHouseChart () {
            houseMyChart.on('click', params => {
                console.log('clickHouseChart', params)
                if (params.name == '学校') {
                    this.xxPopupShow = true
                    this.xxArr = schoolJSON
                }
            })
        },
@@ -707,7 +799,15 @@
            let personInfo = await this.getPersonInfo()
            if (this.userInfo.dept_id == '1596020515064381442') {
                personInfo = [{ count: 8, name: '征地拆迁群体', value: 8 }, { count: 4, name: '非涉法涉诉重点个访人员', value: 4 }, { count: 4, name: '涉法涉诉重点个访人员', value: 4 }, { count: 1, name: '楼盘业主维权群体', value: 1 }]
            }
            keyPersonmyChart.setOption(this.initkeyPersonOption(personInfo))
            this.clickkeyPersonChart()
        },
        /**
@@ -909,6 +1009,7 @@
         */
        clickLandChart () {
            landMyChart.on('click', params => {
                console.log('clickLandChart')
                if (this.tabTypeThree == 0) {
                    this.$emit('showlanddetail', params.name, 2, params.data.id)
                } else {