shuishen
2023-02-04 7d4fea7918e2d4c95115990df36bfadb2a7d3bca
现有地图表点击事件调整
1 files modified
57 ■■■■■ changed files
src/views/home/components/leftContainer.vue 57 ●●●●● patch | view | raw | blame | history
src/views/home/components/leftContainer.vue
@@ -271,9 +271,6 @@
        // 获取所有数据并加载
        this.getHomeAllData()
        this.inithouseEcharts()
        this.clickLandChart()
        if (this.userInfo.dept_id != '1123598813738675201') {
            this.showBack = false
            this.isAllPoliceStation = false
@@ -566,6 +563,7 @@
                    xDate.push(item.name)
                    yDate.push(item.num)
                })
                this.inithouseEcharts(xDate, yDate)
            })
        },
@@ -678,13 +676,6 @@
            }
        },
        initLandEcharts (landData) {
            var chartDom = document.getElementById('landEcharts')
            landMyChart = this.$echarts.init(chartDom)
            landMyChart.setOption(this.initLandOptions(landData[0], landData[1]))
        },
        initLandOptions (xDate, yDate) {
            return {
                grid: {
@@ -783,16 +774,6 @@
                    this.getVillagePersonStatisticInfoByPoliceStationId(params.data.id)
                } else {
                    this.$emit('showpeopledetail', params.data.id, params.data.name)
                }
            })
        },
        clickLandChart () {
            landMyChart.on('click', params => {
                if (this.tabTypeThree == 0) {
                    this.$emit('showlanddetail', params.name, 2, params.data.id)
                } else {
                    this.$emit('showlanddetail', params.name, 1, params.data.id)
                }
            })
        },
@@ -937,7 +918,6 @@
         * @return {*}
         */
        landTabClick (type) {
            this.tabTypeThree = type
            if (type == 0) {
@@ -945,7 +925,6 @@
            } else if (type == 1) {
                this.getAreaStatisticInfo(1)
            }
        },
        /**
@@ -984,6 +963,40 @@
        },
        /**
         * @description: 现有地图表渲染
         * @param {*} landData
         * @return {*}
         */
        initLandEcharts (landData) {
            var chartDom = document.getElementById('landEcharts')
            landMyChart = this.$echarts.init(chartDom)
            landMyChart.setOption(this.initLandOptions(landData[0], landData[1]))
            this.clickLandChart()
        },
        /**
         * @description: 现有地图表点击事件
         * @return {*}
         */
        clickLandChart () {
            landMyChart.off('click')
            landMyChart.on('click', params => {
                console.log(params, 95959999)
                if (this.tabTypeThree == 0) {
                    this.$emit('showlanddetail', params.name, 2, params.data.id)
                } else {
                    this.$emit('showlanddetail', params.name, 1, params.data.id)
                }
            })
        },
        /**
         * @description: 视图窗口改变时,echarts图表重置
         * @return {*}
         */