guanqb
2022-10-28 9358124aad77238404e0690a99c143997d2535e8
首页数据联动
2 files modified
48 ■■■■■ changed files
src/views/home/components/leftContainer.vue 2 ●●● patch | view | raw | blame | history
src/views/home/components/rightContainer.vue 46 ●●●●● patch | view | raw | blame | history
src/views/home/components/leftContainer.vue
@@ -287,7 +287,7 @@
        personTabClick (type) {
            this.tabType = type
            this.dataDeep = 1
            let xDate, yDate
            if (type == 0) {
src/views/home/components/rightContainer.vue
@@ -55,6 +55,10 @@
<script>
let equipmentmyChart
import areaOptionData from '@/assets/data/JurisdictionData/areaOptionData.js'
import policeStationOptions from '@/assets/data/JurisdictionData/policeStationOptions.js'
import housingDate from '@/assets/data/JurisdictionData/housingDate.js'
export default {
    data () {
        return {
@@ -139,6 +143,8 @@
        this.initEquipmentEcharts()
        this.initEventChangeEcharts()
        this.clickEquimentChart()
        // 测试
        this.getTreeData()
    },
    methods: {
@@ -277,6 +283,46 @@
                }
            })
        },
        getTreeData () {
            let arr1 = policeStationOptions
            let arr2 = areaOptionData
            let arr3 = housingDate
            let areaArr = []
            let housingArr = []
            let jurisdictionData = [{
                label: '全部',
                children: []
            }]
            arr1.forEach((item1, index1) => {
                console.log(item1.policeStationName)
                if (item1.policeStationName != '全部') {
                    let policeArr = [{
                        label: '全部',
                        children: areaArr
                    }]
                    let item1Obj = { label: item1.policeStationName, id: item1.policeStationId, children: policeArr }
                    arr2.forEach((item2, index2) => {
                        if (item2.policeStationName == item1.policeStationName) {
                            item2.areaCheckOptions.forEach((item3, index3) => {
                                if (item3.areaCheckName != '全部') {
                                    let policeArr = [{
                                        label: '全部',
                                        children: areaArr
                                    }]
                                    let item3Obj = { label: item3.areaCheckName, id: item3.areaCheckId, childern: housingArr }
                                }
                            })
                        }
                    })
                }
            })
        }
    }
}
</script>