| File was renamed from src/views/Home/useUavHome/useUavHome.js |
| | |
| | | |
| | | import eventImg from '@/assets/images/home/useEventOperate/event.png'; |
| | | |
| | | import DevicePopUpBox from '@/views/Home/useUavHome/DevicePopUpBox.vue'; |
| | | import EventPopUpBox from '@/views/Home/useEventOperate/EventPopUpBox.vue'; |
| | | import DevicePopUpBox from '@/views/Home/useMapAggregation/DevicePopUpBox.vue'; |
| | | import EventPopUpBox from '@/views/Home/useMapAggregation/EventPopUpBox.vue'; |
| | | |
| | | import { render } from 'vue'; |
| | | import { useStore } from 'vuex'; |
| | |
| | | /** |
| | | * 机巢聚合功能 |
| | | */ |
| | | export const useUavHome = type => { |
| | | export const useMapAggregation = type => { |
| | | const { flyTo } = cesiumOperation(); |
| | | |
| | | const singleImg = type === 'device' ? uavImg : eventImg; |
| | |
| | | |
| | | function getMapEventCount(areaCode) { |
| | | return getMapEvents({ areaCode }).then(res => { |
| | | return processChildren(res?.data?.data?.childrens || []); |
| | | }); |
| | | } |
| | | function getEventDetailsFun(areaCode){ |
| | | return getEventDetails({areaCode}).then(res => { |
| | | console.log(res.data.data,'getEventDetailsFun'); |
| | | const resData= res?.data?.data |
| | | if (resData?.data){ |
| | | eventList = resData?.data |
| | | return [] |
| | | } |
| | | return processChildren(resData?.childrens); |
| | | }); |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | const initMapData = async areaCode => { |
| | | eventList = [] |
| | | if (!areaCode) return; |
| | | const list = type === 'device' ? await getDeviceCount(areaCode) : await getMapEventCount(areaCode); |
| | | const splashedList = type === 'device' |
| | |
| | | scalingJudgment[0].gJson = null; |
| | | scalingJudgment[0].splashedList = splashedList; |
| | | active = null; |
| | | console.log(hierarchy); |
| | | |
| | | // 轮廓 |
| | | const outlineGJson = await getOutLine(jsonPathPre, hierarchy); |
| | | scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson)); |
| | | // 省 |
| | | if (hierarchy.length === 1) { |
| | | const gJson1 = await getFiler(`${defaultDir}${jsonPath}/indexDistrict.json`); |
| | |
| | | const center = outlineGJson.features[0].properties.center; |
| | | flyTo({ longitude: center[0], latitude: center[1] }, 0, scalingJudgment[0].height); |
| | | } |
| | | // 轮廓 |
| | | const outlineGJson = await getOutLine(jsonPathPre, hierarchy); |
| | | scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson)); |
| | | determineScaling() |
| | | }; |
| | | |
| | | watch( |