| | |
| | | // setTimeout(() => { |
| | | // this.initGeoJson() |
| | | // }, 3000) |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | mounted () { |
| | |
| | | if (type == 1) { |
| | | |
| | | this.policeStationOptions = res.data.data |
| | | console.log('policeStationOptions',this.policeStationOptions ); |
| | | |
| | | this.policeStationOptions.unshift({ |
| | | name: '全部', |
| | |
| | | |
| | | } else if (type == 2) { |
| | | this.areaOptions = res.data.data |
| | | |
| | | console.log(type,2222); |
| | | this.initAreaOptionLayer() |
| | | |
| | | this.areaOptions.unshift({ |
| | |
| | | } else { |
| | | this.housingOptions = res.data.data |
| | | |
| | | this.housingOptions.forEach(item => { |
| | | this.housingOptions.lnegth > 0 && this.housingOptions.forEach(item => { |
| | | const positions = JSON.parse(item.position[0]).coordinates |
| | | |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | |
| | | initAreaOptionLayer () { |
| | | const that = this |
| | | this.clearPolygonLayer() |
| | | console.log(this.areaOptions,11122) |
| | | this.areaOptions.forEach((item, index) => { |
| | | |
| | | item.position.forEach(sourceItem => { |
| | | item.position && item.position.forEach(sourceItem => { |
| | | const Json = { ...JSON.parse(sourceItem) } |
| | | global.DC.Namespace.Cesium.GeoJsonDataSource.load(Json, { |
| | | stroke: positionColor[index], |
| | |
| | | /** |
| | | * 获取派出所和责任区数据 |
| | | */ |
| | | getPoliceStationList () { |
| | | getPoliceStationList().then(res => { |
| | | if (res.data.code == 200) { |
| | | let data = res.data.data |
| | | data.forEach(policeStation => { |
| | | //派出所数据匹配 |
| | | policeStation.policeStationName = policeStation.deptName |
| | | policeStation.policeStationId = policeStation.id |
| | | policeStation.position = convertStringToList(policeStation.positionString) |
| | | if (policeStation.children && policeStation.children.length > 0) { |
| | | //责任区数据匹配 |
| | | policeStation.areaCheckOptions = policeStation.children |
| | | policeStation.areaCheckOptions.forEach(child => { |
| | | child.policeStationId = child.parentId |
| | | child.areaCheckId = child.id |
| | | child.areaCheckName = child.deptName |
| | | child.position = convertStringToList(child.positionString) |
| | | //小区数据匹配 |
| | | if (child.housingArr && child.housingArr.length > 0) { |
| | | child.housingArr.forEach(community => { |
| | | community.policeStationId = policeStation.id |
| | | community.areaCheckId = child.id |
| | | community.housingsId = community.id |
| | | community.housingsName = community.name |
| | | community.position = convertStringToList(community.position) |
| | | }) |
| | | child.housingArr.unshift({ housingsName: '全部' }) |
| | | } |
| | | }) |
| | | policeStation.areaCheckOptions.unshift({ areaCheckName: '全部' }) |
| | | policeStation.areaOptionArr = policeStation.areaCheckOptions |
| | | } |
| | | }) |
| | | // getPoliceStationList () { |
| | | // getPoliceStationList().then(res => { |
| | | // if (res.data.code == 200) { |
| | | // let data = res.data.data |
| | | // console.log(data,111) |
| | | // data.forEach(policeStation => { |
| | | // //派出所数据匹配 |
| | | // policeStation.policeStationName = policeStation.deptName |
| | | // policeStation.policeStationId = policeStation.id |
| | | // policeStation.position = convertStringToList(policeStation.positionString) |
| | | // if (policeStation.children && policeStation.children.length > 0) { |
| | | // //责任区数据匹配 |
| | | // policeStation.areaCheckOptions = policeStation.children |
| | | // policeStation.areaCheckOptions.forEach(child => { |
| | | // child.policeStationId = child.parentId |
| | | // child.areaCheckId = child.id |
| | | // child.areaCheckName = child.deptName |
| | | // child.position = convertStringToList(child.positionString) |
| | | // //小区数据匹配 |
| | | // if (child.housingArr && child.housingArr.length > 0) { |
| | | // child.housingArr.forEach(community => { |
| | | // community.policeStationId = policeStation.id |
| | | // community.areaCheckId = child.id |
| | | // community.housingsId = community.id |
| | | // community.housingsName = community.name |
| | | // community.position = convertStringToList(community.position) |
| | | // }) |
| | | // child.housingArr.unshift({ housingsName: '全部' }) |
| | | // } |
| | | // }) |
| | | // policeStation.areaCheckOptions.unshift({ areaCheckName: '全部' }) |
| | | // policeStation.areaOptionArr = policeStation.areaCheckOptions |
| | | // } |
| | | // }) |
| | | |
| | | data.unshift({ policeStationName: '全部' }) |
| | | this.policeStationOptions = data |
| | | this.areaOptionData = data |
| | | this.housingDate = data |
| | | } |
| | | }) |
| | | }, |
| | | // data.unshift({ policeStationName: '全部' }) |
| | | // this.policeStationOptions = data |
| | | // this.areaOptionData = data |
| | | // this.housingDate = data |
| | | // } |
| | | // }) |
| | | // }, |
| | | |
| | | indexMethod (index) { |
| | | return index + 1 |