|
@@ -9,7 +9,8 @@ import {
|
|
|
closeOutputPoint,
|
|
|
addPoint,
|
|
|
fullExtent,
|
|
|
- change3DTheme
|
|
|
+ change3DTheme,
|
|
|
+ regionZone
|
|
|
} from '@/utils/map/mapOperation.js';
|
|
|
import { getTrajectorPointOnPeople, getTrajectorPointOnCar } from '@/service/api/mapRequest.js';
|
|
|
import { useDrawPointStore } from '@/stores/drawPointManage';
|
|
@@ -17,6 +18,9 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
//当前病例点位列表
|
|
|
const currentToolSelectArray = ref(['newAdress', 'touch']);
|
|
|
|
|
|
+ //区选择
|
|
|
+ const selectPartKey = ref('松江区');
|
|
|
+
|
|
|
//所有病例点位
|
|
|
const currentAllPointList = ref([]);
|
|
|
|
|
@@ -31,6 +35,30 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
flowCarList.value = [];
|
|
|
};
|
|
|
|
|
|
+ //切换主题后加载初始化地图
|
|
|
+ const initChangeMap = (is3D) => {
|
|
|
+ change3DTheme(is3D);
|
|
|
+ if (is3D) {
|
|
|
+ currentToolSelectArray.value.push('3dChange');
|
|
|
+ } else {
|
|
|
+ currentToolSelectArray.value = currentToolSelectArray.value.filter(
|
|
|
+ (item) => item != '3dChange'
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ currentToolSelectArray.value.forEach((item) => {
|
|
|
+ if (item != '3dChange' && item != 'Bidding' && item != 'flowCar') {
|
|
|
+ setCurrentToolSelectArray(item);
|
|
|
+ if (selectPartKey.value?.length > 0) {
|
|
|
+ if (selectPartKey.value == '浦东新区') {
|
|
|
+ regionZone('浦东');
|
|
|
+ } else {
|
|
|
+ regionZone(selectPartKey.value.split('区')[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
//点亮地图工具图标
|
|
|
const setCurrentToolSelectArray = async (value) => {
|
|
|
currentToolSelectArray.value.push(value);
|
|
@@ -117,6 +145,7 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
imageUrl: new URL(`@/assets/image/mapTools/6.png`, import.meta.url).href
|
|
|
});
|
|
|
}
|
|
|
+ initChangeMap(true);
|
|
|
//流调会商车图标
|
|
|
// addTrajectory();
|
|
|
// setTimeout(() => {
|
|
@@ -125,6 +154,7 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
break;
|
|
|
}
|
|
|
case 'Bidding': {
|
|
|
+ initChangeMap(true);
|
|
|
//有轨迹点
|
|
|
const allShowHasPoint = currentAllPointList.value.filter((item) => {
|
|
|
return item?.x && item?.y && item?.ty == '有轨迹';
|
|
@@ -147,7 +177,7 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
break;
|
|
|
}
|
|
|
case '3dChange': {
|
|
|
- change3DTheme(true);
|
|
|
+ initChangeMap(true);
|
|
|
}
|
|
|
}
|
|
|
} catch (error) {
|
|
@@ -169,6 +199,7 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
|
|
|
useDrawPointStore().modifyTrail = false;
|
|
|
closeOutputPoint();
|
|
|
+ initChangeMap(false);
|
|
|
} else if (value == 'flowCar') {
|
|
|
flowCarList.value.forEach((item) => {
|
|
|
stopTrajectory(item);
|
|
@@ -176,8 +207,10 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
});
|
|
|
closePoint(value);
|
|
|
delFlowCarList();
|
|
|
+ initChangeMap(false);
|
|
|
} else if (value == '3dChange') {
|
|
|
change3DTheme(false);
|
|
|
+ initChangeMap();
|
|
|
} else {
|
|
|
closePoint(value);
|
|
|
}
|
|
@@ -187,6 +220,7 @@ export const useMapStore = defineStore('mapStore', () => {
|
|
|
return {
|
|
|
currentToolSelectArray,
|
|
|
flowCarList,
|
|
|
+ selectPartKey,
|
|
|
currentAllPointList,
|
|
|
pushFlowCarList,
|
|
|
delFlowCarList,
|