guanqb
2023-06-27 a313b5e3758eadf4af6f51f9951586d2df788aac
首页现有住宅合并判断茅家岭
2 files modified
451 ■■■■■ changed files
src/views/home/components/leftContainer.vue 450 ●●●●● patch | view | raw | blame | history
vue.config.js 1 ●●●● patch | view | raw | blame | history
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'
@@ -197,7 +197,25 @@
            // 记录当前选中派出所的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,
            clickPoliceStationId: '',
        }
    },
@@ -217,6 +235,8 @@
        this.$nextTick(() => {
            window.addEventListener("resize", this.echartsResize)
        })
        this.getVillageDetailAndPlaceStatisticNumber({ deptId: this.userInfo.dept_id })
    },
    methods: {
@@ -298,7 +318,9 @@
         */
        getHomeAllData (id = '') {
            this.policeStaionID = id
            this.clickPoliceStationId = id
            this.isFirstMounted = true
            if (id != '') {
                this.showBack = false
                this.isAllPoliceStation = false
@@ -308,7 +330,7 @@
                this.showBack = true
                this.isAllPoliceStation = true
            }
            this.tabType = 0//解决下拉选择派出所重点人员显示bug
            this.personTabClick(this.tabType)
            this.houseTabClick(this.tabTypeTwo)
@@ -333,15 +355,18 @@
         * @return {*}
         */
        personTabClick (type) {
            this.tabType = type
            this.dataDeep = 1
            this.personEchartsLoading = true
            this.disposeEchart()
            console.log('type', type, 'this.tabType', this.tabType, 'this.isFirstMounted', this.isFirstMounted)
            if (type == 0) {
                if (this.tabType == 0 && !this.isFirstMounted) {
                    console.log('再次点击人口总数', this.isFirstMounted)
                    this.$emit('showpeopledetail', '', '总人口列表', 'includeKeypeople', this.clickPoliceStationId)
                    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()
@@ -351,8 +376,17 @@
                }
            } else if (type == 1) {
                if (this.tabType == 1 && !this.isFirstMounted) {
                    console.log('再次点击重点人口')
                    this.$emit('showpeopledetail', this.clickPoliceStationId, '重点人员列表', 'onlyKeypeople')
                    return
                }
                this.dataDeep = 1
                this.disposeEchart()
                this.personEchartsLoading = true
                this.initkeyPersonEcharts()
            }
            this.tabType = type
        },
        /**
@@ -395,11 +429,11 @@
                    var chartDom = document.getElementById('PersonEcharts')
                    homePersonmyChart = this.$echarts.init(chartDom)
                    this.personAll = res.data.data
                    console.log('this.personAll', this.personAll)
                    if (this.userInfo.dept_id == '1596020515064381442') {
                        this.personAll.emphasisNum = 23
                    }
                    this.villagePersonStatisticInfoList = res.data.data
                    var xDate = [], yDate1 = [], yDate2 = []
@@ -419,7 +453,6 @@
                            })
                        })
                    }
                    homePersonmyChart.setOption(this.initPersonOptions(xDate, yDate1, yDate2, peopleColor1, peopleColor2), true)
                    this.clickPeopleChart()
@@ -651,6 +684,7 @@
         * @return {*}
         */
        backBegin () {
            this.clickPoliceStationId = this.userInfo.dept_id
            this.personAll = curSubofficeData
            this.dataDeep = 1
            this.initPersonEcharts()
@@ -701,6 +735,110 @@
            }).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
                        }
                    })
                }
                // 茅家岭单独判断
                if (this.userInfo.dept_id == '1596020515064381442') {
                    this.keyPlaceNum = 54
                    this.realHouseNum = 205
                }
            })
        },
        // 实有住宅统计
        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)
                })
                // 茅家岭单独判断
                if (this.userInfo.dept_id == '1596020515064381442') {
                    xDate = ['学校', '医院', '宾馆酒店', '房屋建筑业', '数字经济', '批发业', '零售业']
                    yDate = [34, 2, 33, 11, 22, 30, 14]
                }
                this.inithouseEcharts(xDate, yDate)
                // 点击事件
                this.clickHouseChart('实有住宅')
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 实有住宅详情
        getVillageStatisticDetail () {
            getVillageStatisticDetail({ deptId: 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)
                })
                // 茅家岭单独判断
                if (this.userInfo.dept_id == '1596020515064381442') {
                    xDate = ['反恐重点目标', '危爆品', '重点服务对象', '困难儿童']
                    yDate = [14, 13, 10, 17]
                }
                this.inithouseEcharts(xDate, yDate)
                // 点击事件
                this.clickHouseChart('关注场所')
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            }).catch(res => {
                setTimeout(() => {
                    this.houseEchartsLoading = false
                }, 500)
            })
        },
        // 关注场所详情
        getPlaceOfConcernStatisticDetail () {
            getPlaceOfConcernStatisticDetail({ deptId: 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)
            })
        },
@@ -768,7 +906,7 @@
                    {
                        data: y1Date,
                        type: 'bar',
                        // barWidth: '10%',
                        barWidth: '50%',
                        barCategoryGap: '80%',
                        zlevel: 2,
                        cursor: that.userInfo.dept_id != '1596020515064381442' ? 'default' : 'pointer',
@@ -813,37 +951,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',
                    }
                // ]
                ]
            }
        },
@@ -853,10 +992,12 @@
            this.houseEchartsLoading = true
            this.disposeHouseEchart()
            if (type == 0) {
                this.getHouseStatisticInfo(2)
            if (type == 1) {
                // this.getHouseStatisticInfo(2)
                this.getVillageStatisticData({ deptId: this.userInfo.dept_id })
            } else {
                this.getHouseStatisticInfo(1)
                // this.getHouseStatisticInfo(1)
                this.getPlaceOfConcernStatisticData({ deptId: this.userInfo.dept_id })
            }
        },
@@ -962,102 +1103,135 @@
                    })
                    this.personEchartsLoading = true
                    this.getVillagePersonStatisticInfoByPoliceStationId(params.data.id)
                    this.clickPoliceStationId = params.data.id
                } else {
                    this.$emit('showpeopledetail', params.data.id, params.data.name)
                }
            })
        },
        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)
                } 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)
                    }
                console.log(params, 'clickHouseChart')
                // 茅家岭单独判断
                if (this.userInfo.dept_id == '1596020515064381442') {
                    this.mjlClick(params)
                    return
                }
                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 {
                    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()
                }
            })
        },
        // 茅家岭账号点击现有住宅
        mjlClick (params) {
            console.log('params', 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)
            } 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)
                }
            }
        },
        /**
@@ -1068,7 +1242,7 @@
            this.disposeEchart()
            let personInfo = await this.getPersonInfo()
            console.log('personInfo', personInfo)
            keyPeopleDataLength = personInfo.length
            if (this.userInfo.dept_id == '1596020515064381442') {
                personInfo = [
@@ -1115,6 +1289,8 @@
         */
        getPersonInfo () {
            const data = getPersonInfo({ deptId: this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id }).then(res => {
                console.log('getPersonInfo', { deptId: this.policeStaionID != '' ? this.policeStaionID : this.userInfo.dept_id })
                res.data = res.data.map(item => {
                    item = {
                        ...item,
vue.config.js
@@ -166,6 +166,7 @@
            "/api": {
                // target用于配置你允许访问数据的计算机名称,即是你的api接口的服务器地址
                target: "http://localhost:82",
                // target: "http://192.168.1.176:82",
                // target: "http://106.225.193.35:82",
                // target: "http://192.168.1.170:82",
                // target: "http://192.168.0.100:82",