From 9f55452e21a84c5c46528a0de51ccd7796643470 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 03 Apr 2025 08:23:33 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/drone/command-center-dashboard
---
src/views/Home/useMapAggregation/useMapAggregation.js | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/views/Home/useUavHome/useUavHome.js b/src/views/Home/useMapAggregation/useMapAggregation.js
similarity index 95%
rename from src/views/Home/useUavHome/useUavHome.js
rename to src/views/Home/useMapAggregation/useMapAggregation.js
index 3c8b93c..1617249 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,22 +117,22 @@
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 findFun = (featItem, numItem) => Number(featItem.region_code.slice(0, 6)) === numItem.properties.adcode;
- const { VITE_APP_BASE } = import.meta.env;
- const defaultDir = `${VITE_APP_BASE}public/geoJson/100000/`;
+ const { VITE_APP_BASE,VITE_APP_ENV } = import.meta.env;
+ const defaultDir = `${VITE_APP_BASE}${VITE_APP_ENV === 'development' ? 'public/' : ''}geoJson/100000/`;
const getFiler = async url => {
- const gJson = await import(/* @vite-ignore */ url);
- return JSON.parse(JSON.stringify(gJson));
+ const res = await fetch(url);
+ return await res.json()
};
const getOutLine = async (jsonPathPre, hierarchy) => {
const parentGJson = await getFiler(`${defaultDir}${jsonPathPre}/index.json`);
@@ -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