From 3af11a0e3115789c61512c6f636666a7414e7142 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Wed, 02 Apr 2025 19:55:28 +0800
Subject: [PATCH] feat: 事件聚合95%
---
src/views/Home/useMapAggregation/useMapAggregation.js | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/views/Home/useUavHome/useUavHome.js b/src/views/Home/useMapAggregation/useMapAggregation.js
similarity index 96%
rename from src/views/Home/useUavHome/useUavHome.js
rename to src/views/Home/useMapAggregation/useMapAggregation.js
index 3c8b93c..a51e143 100644
--- a/src/views/Home/useUavHome/useUavHome.js
+++ b/src/views/Home/useMapAggregation/useMapAggregation.js
@@ -4,8 +4,8 @@
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';
@@ -16,7 +16,7 @@
/**
* 机巢聚合功能
*/
-export const useUavHome = type => {
+export const useMapAggregation = type => {
const { flyTo } = cesiumOperation();
const singleImg = type === 'device' ? uavImg : eventImg;
@@ -117,12 +117,12 @@
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);
});
}
@@ -150,6 +150,7 @@
};
const initMapData = async areaCode => {
+ eventList = []
if (!areaCode) return;
const list = type === 'device' ? await getDeviceCount(areaCode) : await getMapEventCount(areaCode);
const splashedList = type === 'device'
@@ -164,8 +165,9 @@
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`);
@@ -200,9 +202,7 @@
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(
--
Gitblit v1.9.3