shuishen
2022-10-29 11f926cb6b77883c898b404a86c7d2a098e2e6b5
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
2 files modified
110 ■■■■ changed files
src/views/home/components/rightContainer.vue 44 ●●●● patch | view | raw | blame | history
src/views/home/index.vue 66 ●●●●● patch | view | raw | blame | history
src/views/home/components/rightContainer.vue
@@ -290,37 +290,33 @@
            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 }
            // arr1.forEach((item1, index1) => {
            //     console.log(item1.policeStationName)
            //     if (item1.policeStationName != '全部') {
                                }
                            })
                        }
                    })
                }
            //         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: housingArr
            //                         }]
            //                         let item3Obj = { label: item3.areaCheckName, id: item3.areaCheckId, childern: housingArr }
            //                     }
            //                 })
            //             }
            //         })
            //     }
            })
            // })
        }
    }
src/views/home/index.vue
@@ -342,6 +342,34 @@
import rightContainer from './components/rightContainer'
import bottomContainer from './components/bottomContainer'
let treeData = [
    {
        label: '全部',
        id: '1',
        children: [{
            label: '车站派出所',
            id: '2',
            children: [{
                label: '责任区1',
                id: '4',
            }, {
                label: '责任区2',
                id: '5',
            }]
        }, {
            label: '沙溪派出所',
            id: '3',
            children: [{
                label: '责任区1',
                id: '6',
            }, {
                label: '责任区2',
                id: '7',
            }]
        }]
    }
]
export default {
    data () {
        return {
@@ -487,13 +515,11 @@
            document.querySelector('.dc-container .dc-zoom-controller').classList.add('homebottom')
            document.querySelector('.dc-container .dc-location-bar').classList.add('homebottom')
            document.querySelector('.screen-full-btn').classList.add('homebottom')
            this.setDomStyle()
        })
        // axios.get('/user/getUserList').then((res) => {
        //     console.log(res, 999)
        // })
        // }}
        window.addEventListener('resize', this.setDomStyle)
    },
@@ -502,6 +528,29 @@
    },
    methods: {
        searchName (name, arr) {
            let obj = {}
            let flag = false
            arr.forEach(item => {
                if (item.label == name) {
                    flag = true
                    obj = item
                }
                // console.log(item.label, name, flag)
            })
            if (flag) {
                return obj
            } else {
                arr.forEach(item => {
                    if (item.children) {
                        obj = this.searchName(name, item.children)
                    }
                })
                return obj
            }
        },
        policeStationSelect (item) {
            this.policeStationCheckValue = item.policeStationName
            if (item.policeStationName == "全部") {
@@ -527,6 +576,8 @@
                cylinderLayer.clear()
            }
            this.$refs.leftContainer.selectPoliceChangeData(item.policeStationName)
        },
        areaSelect (item) {
@@ -1017,6 +1068,15 @@
            this.phoneArrShow = booleans[2]
            this.saveArr = arr
            this.showArr = arr
            // 动态改变树形控件数据
            this.jurisdictionData = [this.searchName(this.policeStationCheckValue, treeData)]
            let arr1 = []
            this.saveArr.some((item1) => {
                if (item1.policeStation == this.policeStationCheckValue) {
                    arr1.push(item1)
                }
            })
            this.showArr = arr1
        },
        showkeypersondetail (name, arr) {