shuishen
2023-06-25 fd1274d07f1e68ed28bdb08bd95e5bb27c4e2da1
src/views/home/components/leftContainer.vue
@@ -77,12 +77,12 @@
                    element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.5)">
                    <div class="sub-tab">
                        <div class="tab" :class="{ 'select-on-tab': tabTypeTwo == 0 }" @click="houseTabClick(0)">
                            <div class="tab-title-small">实有楼栋:</div>
                            <div class="tab-title-small">{{ realHouseNum ? realHouseNum : 0 }}栋</div>
                        </div>
                        <div class="tab" :class="{ 'select-on-tab': tabTypeTwo == 1 }" @click="houseTabClick(1)">
                            <div class="tab-title-small">关注场所:</div>
                            <div class="tab-title-small">{{ keyPlaceNum ? keyPlaceNum : 0 }}栋</div>
                        </div>
                        <div class="tab" :class="{ 'select-on-tab': tabTypeTwo == 1 }" @click="houseTabClick(1)">
                            <div class="tab-title-small">实有楼栋:</div>
                            <div class="tab-title-small">{{ realHouseNum ? realHouseNum : 0 }}栋</div>
                        </div>
                    </div>
                    <div id="houseEcharts" class="echarts-box"></div>
@@ -135,7 +135,7 @@
<script>
import { fontSize } from '@/utils/fontSize.js'
import { getAreaStatisticInfo } from "@/api/home/index.js"
import { getAreaStatisticInfo, getVillageStatisticData, getVillageStatisticDetail, getPlaceOfConcernStatisticData, getPlaceOfConcernStatisticDetail, getVillageDetailAndPlaceStatisticNumber } from "@/api/home/index.js"
import { schoolJSON } from '../homeleft/school'
import { hospitalJSON } from '../homeleft/hospital'
import { hotelJSON } from '../homeleft/hotel'
@@ -146,6 +146,7 @@
import { antiTerroristJSON } from '../homeleft/antiTerrorist'
import { dExplosionJSON } from '../homeleft/dExplosion'
import { serviceObjJSON } from '../homeleft/serviceObj'
import { difficultyJSON } from '../homeleft/difficulty'
import { getVillagePersonStatisticInfo, getVillagePersonStatisticInfoByPoliceStationId, getPersonInfo, getPersonInfoPage, getHouseStatisticInfo } from "@/api/dept"
@@ -196,7 +197,24 @@
            // 记录当前选中派出所的ID
            policeStaionID: '',
            peopleLoading: false,
            personEchartsHeight: '100%'
            personEchartsHeight: '100%',
            syldPage: {
                total: 0,
                pageSize: 15,
                currentPage: 1
            },
            gzcsPage: {
                total: 0,
                pageSize: 15,
                currentPage: 1
            },
            syldBigType: '',
            syldName: '',
            gzcsType: '',
            gzcsUnitName: '',
            gzcsPerson: '',
            gzcsPhone: '',
            isFirstMounted: true,
        }
    },
@@ -216,6 +234,8 @@
        this.$nextTick(() => {
            window.addEventListener("resize", this.echartsResize)
        })
        this.getVillageDetailAndPlaceStatisticNumber({ deptld: this.userInfo.dept_id })
    },
    methods: {
@@ -332,15 +352,17 @@
         * @return {*}
         */
        personTabClick (type) {
            this.tabType = type
            this.dataDeep = 1
            this.personEchartsLoading = true
            this.disposeEchart()
            if (type == 0) {
                if (this.tabType == 0 && !this.isFirstMounted) {
                    console.log('再次点击人口总数')
                    this.$emit('showpeopledetail', '', '总人口列表', 'includeKeypeople')
                    return
                }
                this.isFirstMounted = false
                this.dataDeep = 1
                this.disposeEchart()
                this.personEchartsLoading = true
                this.personEchartsHeight = '100%'
                if (this.userInfo.dept_id == '1123598813738675201' && this.policeStaionID == '') {
                    this.getPoliceStationInfo()
@@ -350,8 +372,17 @@
                }
            } else if (type == 1) {
                if (this.tabType == 1) {
                    console.log('再次点击重点人口')
                    this.$emit('showpeopledetail', '', '重点人员列表', 'onlyKeypeople')
                    return
                }
                this.dataDeep = 1
                this.disposeEchart()
                this.personEchartsLoading = true
                this.initkeyPersonEcharts()
            }
            this.tabType = type
        },
        /**
@@ -685,8 +716,8 @@
                        yDate = [34, 2, 33, 11, 22, 30, 14]
                        this.inithouseEcharts(xDate, yDate)
                    } else {
                        xDate = ['反恐重点目标', '危爆品', '重点服务对象']
                        yDate = [14, 13, 10]
                        xDate = ['反恐重点目标', '危爆品', '重点服务对象', '困难儿童']
                        yDate = [14, 13, 10, 17]
                        this.inithouseEcharts(xDate, yDate)
                    }
@@ -700,6 +731,92 @@
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 现有住宅和关注场所统计总数
        getVillageDetailAndPlaceStatisticNumber (params) {
            getVillageDetailAndPlaceStatisticNumber(params).then(res => {
                if (res.data.data.length > 0) {
                    res.data.data.forEach(item => {
                        if (item.typeName == 'gzcs') {
                            this.keyPlaceNum = item.number
                        } else if (item.typeName == 'syld') {
                            this.realHouseNum = item.number
                        }
                    })
                }
            })
        },
        // 实有住宅统计
        getVillageStatisticData (params) {
            getVillageStatisticData(params).then(res => {
                console.log('getVillageStatisticData', params)
                this.disposeHouseEchart()
                let xDate = []
                let yDate = []
                res.data.data.forEach(item => {
                    xDate.push(item.typeName)
                    yDate.push(item.number)
                })
                this.inithouseEcharts(xDate, yDate)
                // 点击事件
                this.clickHouseChart('实有住宅')
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 实有住宅详情
        getVillageStatisticDetail () {
            getVillageStatisticDetail({ deptld: this.userInfo.dept_id, bigType: this.syldBigType, name: this.syldName, current: this.syldPage.currentPage, size: this.syldPage.pageSize }).then(res => {
                console.log('getVillageStatisticDetail', res, res.data.data.records)
                this.$parent.syldPage.total = res.data.data.total
                this.$parent.syldArr = res.data.data.records
                setTimeout(() => {
                    this.$parent.syldLoading = false
                }, 500)
            })
        },
        // 关注场所统计
        getPlaceOfConcernStatisticData (params) {
            getPlaceOfConcernStatisticData(params).then(res => {
                this.disposeHouseEchart()
                let xDate = []
                let yDate = []
                res.data.data.forEach(item => {
                    xDate.push(item.typeName)
                    yDate.push(item.number)
                })
                this.inithouseEcharts(xDate, yDate)
                // 点击事件
                this.clickHouseChart('关注场所')
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 关注场所详情
        getPlaceOfConcernStatisticDetail () {
            getPlaceOfConcernStatisticDetail({ deptld: this.userInfo.dept_id, type: this.gzcsType, unitName: this.gzcsUnitName, person: this.gzcsPerson, phone: this.gzcsPhone, current: this.gzcsPage.currentPage, size: this.gzcsPage.pageSize }).then(res => {
                console.log('getPlaceOfConcernStatisticDetail', res, res.data.data.records)
                this.$parent.gzcsPage.total = res.data.data.total
                this.$parent.gzcsArr = res.data.data.records
                setTimeout(() => {
                    this.$parent.gzcsLoading = false
                }, 500)
            })
        },
@@ -767,7 +884,7 @@
                    {
                        data: y1Date,
                        type: 'bar',
                        // barWidth: '10%',
                        barWidth: '50%',
                        barCategoryGap: '80%',
                        zlevel: 2,
                        cursor: that.userInfo.dept_id != '1596020515064381442' ? 'default' : 'pointer',
@@ -812,37 +929,38 @@
                    bottom: '2%',
                    containLabel: true
                },
                // dataZoom: [
                //     {
                //         type: "inside",
                //         startValue: 0,
                //         endValue: 8,
                //         minValueSpan: 2,
                //         maxValueSpan: 2,
                //         yAxisIndex: [0],
                //         zoomOnMouseWheel: false,  // 关闭滚轮缩放
                //         moveOnMouseWheel: true, // 开启滚轮平移
                //         moveOnMouseMove: true  // 鼠标移动能触发数据窗口平移
                //     },
                //     {
                //         type: 'slider',
                //         realtime: true,
                //         startValue: 0,
                //         endValue: 8,
                //         width: '3.5',
                //         height: '80%',
                //         yAxisIndex: [0], // 控制y轴滚动
                //         fillerColor: "rgba(154, 181, 215, 1)", // 滚动条颜色
                //         borderColor: "rgba(17, 100, 210, 0.12)",
                //         backgroundColor: '#cfcfcf',//两边未选中的滑动条区域的颜色
                //         handleSize: 0, // 两边手柄尺寸
                //         showDataShadow: false,//是否显示数据阴影 默认auto
                //         showDetail: false, // 拖拽时是否展示滚动条两侧的文字
                //         top: '1%',
                //         right: '5',
                //     }
                dataZoom: [
                    {
                        type: "inside",
                        startValue: 0,
                        endValue: 4,
                        minValueSpan: 8,
                        maxValueSpan: 8,
                        yAxisIndex: [0],
                        zoomOnMouseWheel: false,  // 关闭滚轮缩放
                        moveOnMouseWheel: true, // 开启滚轮平移
                        moveOnMouseMove: true  // 鼠标移动能触发数据窗口平移
                    },
                    {
                        type: 'slider',
                        realtime: true,
                        startValue: 0,
                        endValue: 4,
                        width: '3.5',
                        height: '90%',
                        yAxisIndex: [0], // 控制y轴滚动
                        // fillerColor: "rgba(154, 181, 215, 1)", // 滚动条颜色
                        fillerColor: "rgba(11, 19, 145, 0.5)", // 滚动条颜色
                        borderColor: "rgba(17, 100, 210, 0.12)",
                        backgroundColor: 'transparent',//两边未选中的滑动条区域的颜色
                        handleSize: 0, // 两边手柄尺寸
                        showDataShadow: false,//是否显示数据阴影 默认auto
                        showDetail: false, // 拖拽时是否展示滚动条两侧的文字
                        top: '1%',
                        right: '5',
                    }
                // ]
                ]
            }
        },
@@ -852,10 +970,12 @@
            this.houseEchartsLoading = true
            this.disposeHouseEchart()
            if (type == 0) {
                this.getHouseStatisticInfo(2)
            if (type == 1) {
                // this.getHouseStatisticInfo(2)
                this.getVillageStatisticData({ deptld: this.userInfo.dept_id })
            } else {
                this.getHouseStatisticInfo(1)
                // this.getHouseStatisticInfo(1)
                this.getPlaceOfConcernStatisticData({ deptld: this.userInfo.dept_id })
            }
        },
@@ -967,89 +1087,117 @@
            })
        },
        clickHouseChart () {
        clickHouseChart (type) {
            houseMyChart.on('click', params => {
                this.$parent.architectureTitle = params.name
                if (params.name == '学校') {
                    this.$parent.xxPopupShow = true
                    this.$parent.houseArr = []
                    this.$parent.houseLoading = true
                    setTimeout(() => {
                        this.$parent.houseLoading = false
                        this.$parent.houseArr = schoolJSON
                    }, 1000)
                console.log(params, 'clickHouseChart')
                if (type == '实有住宅') {
                    this.syldPage.currentPage = 1
                    this.$parent.syldPage.currentPage = 1
                    this.$parent.syldPopupTitle = params.name
                    this.syldBigType = params.name
                    this.syldName = ''
                    this.$parent.syldArr = []
                    this.$parent.syldPopupShow = true
                    this.$parent.syldLoading = true
                    this.getVillageStatisticDetail()
                } else {
                    this.$parent.architectureShow = true
                    this.$parent.architectureTable = []
                    this.$parent.architectureLoad = true
                    if (params.name == '医院') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = hospitalJSON
                        }, 1000)
                    }
                    if (params.name == '宾馆酒店') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = hotelJSON
                        }, 1000)
                    }
                    if (params.name == '数字经济') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = digitalJSON
                        }, 1000)
                    }
                    if (params.name == '房屋建筑业') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = housingJSON
                        }, 1000)
                    }
                    if (params.name == '批发业') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = wholesaleJSON
                        }, 1000)
                    }
                    if (params.name == '零售业') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = retailJSON
                        }, 1000)
                    }
                    if (params.name == '反恐重点目标') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = antiTerroristJSON
                        }, 1000)
                    }
                    if (params.name == '危爆品') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = dExplosionJSON
                        }, 1000)
                    }
                    if (params.name == '重点服务对象') {
                        setTimeout(() => {
                            this.$parent.architectureLoad = false
                            this.$parent.architectureTable = serviceObjJSON
                        }, 1000)
                    }
                    console.log('关注场所')
                    this.gzcsPage.currentPage = 1
                    this.$parent.gzcsPage.currentPage = 1
                    this.gzcsType = params.name
                    this.gzcsUnitName = ''
                    this.gzcsPerson = ''
                    this.gzcsPhone = ''
                    this.$parent.gzcsArr = []
                    this.$parent.gzcsPopupShow = true
                    this.$parent.gzcsLoading = true
                    this.getPlaceOfConcernStatisticDetail()
                }
                // this.$parent.architectureTitle = params.name
                // if (params.name == '学校') {
                //     this.$parent.xxPopupShow = true
                //     this.$parent.houseArr = []
                //     this.$parent.houseLoading = true
                //     setTimeout(() => {
                //         this.$parent.houseLoading = false
                //         this.$parent.houseArr = schoolJSON
                //     }, 1000)
                // } else {
                //     this.$parent.architectureShow = true
                //     this.$parent.architectureTable = []
                //     this.$parent.architectureLoad = true
                //     if (params.name == '医院') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = hospitalJSON
                //         }, 1000)
                //     }
                //     if (params.name == '宾馆酒店') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = hotelJSON
                //         }, 1000)
                //     }
                //     if (params.name == '数字经济') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = digitalJSON
                //         }, 1000)
                //     }
                //     if (params.name == '房屋建筑业') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = housingJSON
                //         }, 1000)
                //     }
                //     if (params.name == '批发业') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = wholesaleJSON
                //         }, 1000)
                //     }
                //     if (params.name == '零售业') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = retailJSON
                //         }, 1000)
                //     }
                //     if (params.name == '反恐重点目标') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = antiTerroristJSON
                //         }, 1000)
                //     }
                //     if (params.name == '危爆品') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = dExplosionJSON
                //         }, 1000)
                //     }
                //     if (params.name == '重点服务对象') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = serviceObjJSON
                //         }, 1000)
                //     }
                //     if (params.name == '困难儿童') {
                //         setTimeout(() => {
                //             this.$parent.architectureLoad = false
                //             this.$parent.architectureTable = difficultyJSON
                //         }, 1000)
                //     }
                // }
            })
        },