|
@@ -1,33 +1,17 @@
|
|
|
<template>
|
|
|
<div id="globalMap">
|
|
|
- <div
|
|
|
- :class="isComponent ? 'global-map' : 'global-map bg'"
|
|
|
- >
|
|
|
-<!-- :style="{ width: width ? width : '100%', height: height ? height : '100%' }"-->
|
|
|
-<!-- :style="{ width: width ? width : '8960px', height: height ? height : '2560px'}"-->
|
|
|
-<!-- -->
|
|
|
+ <div :class="isComponent ? 'global-map' : 'global-map bg'">
|
|
|
<MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
|
|
|
<YztMap
|
|
|
v-else-if="activeMap === 'satellite2'"
|
|
|
ref="map2Ref"
|
|
|
v-model:drawing="mouseToolState.drawing"
|
|
|
- :activeMap="activeMap"
|
|
|
+ :active-map="activeMap"
|
|
|
:color="mouseToolState.color"
|
|
|
:draw-type="mouseToolState.drawType"
|
|
|
:graphics-type="mouseToolState.graphicsType"
|
|
|
- :container-width="isComponent ? 3483 : 8960"
|
|
|
- :container-height="isComponent ? 2140 : 2520"
|
|
|
- @selectGraphics="analysisSpatial"
|
|
|
+ @select-graphics="analysisSpatial"
|
|
|
/>
|
|
|
- <!-- <YMap-->
|
|
|
- <!-- v-else-if="activeMap === 'satellite2'"-->
|
|
|
- <!-- ref="map2Ref"-->
|
|
|
- <!-- v-model:drawing="mouseToolState.drawing"-->
|
|
|
- <!-- :color="mouseToolState.color"-->
|
|
|
- <!-- :draw-type="mouseToolState.drawType"-->
|
|
|
- <!-- :graphics-type="mouseToolState.graphicsType"-->
|
|
|
- <!-- :active-map="activeMap"-->
|
|
|
- <!-- />-->
|
|
|
<Map
|
|
|
v-else
|
|
|
ref="mapRef"
|
|
@@ -36,25 +20,15 @@
|
|
|
:draw-type="mouseToolState.drawType"
|
|
|
:graphics-type="mouseToolState.graphicsType"
|
|
|
:active-map="activeMap"
|
|
|
- :container-width="width"
|
|
|
- :container-height="height"
|
|
|
- @selectGraphics="analysisSpatial"
|
|
|
- @unSelectGraphics="unSelectGraphics"
|
|
|
+ @select-graphics="analysisSpatial"
|
|
|
+ @un-select-graphics="unSelectGraphics"
|
|
|
/>
|
|
|
<!--左侧菜单-->
|
|
|
- <LeftMenu
|
|
|
- style="position: absolute; top: 20px; left: 20px"
|
|
|
- @click-menu="clickMenu"
|
|
|
- @selectSearchMarker="selectSearchMarker"
|
|
|
- />
|
|
|
+ <LeftMenu style="position: absolute; top: 20px; left: 20px" @click-menu="clickMenu" @select-search-marker="selectSearchMarker" />
|
|
|
<!--右侧菜单-->
|
|
|
- <RightMenu ref="rightMenuRef" :analysisData="selectedScope" />
|
|
|
+ <RightMenu ref="rightMenuRef" :analysis-data="selectedScope" />
|
|
|
<!--更换地图类型-->
|
|
|
- <SwitchMapTool
|
|
|
- :active-map="activeMap"
|
|
|
- class="tool-box"
|
|
|
- @switchMap="switchMap"
|
|
|
- />
|
|
|
+ <SwitchMapTool :active-map="activeMap" class="tool-box" @switch-map="switchMap" />
|
|
|
<!--时间轴-->
|
|
|
<TimeAxis />
|
|
|
<DrawTools
|
|
@@ -66,36 +40,23 @@
|
|
|
class="absoluteTool"
|
|
|
@undo="undo"
|
|
|
/>
|
|
|
-<!-- <AnalyzeDataDialog v-if="analysisSpatialDataShow" :selectedScope="selectedScope" />-->
|
|
|
-<!-- <div v-if="showDialog" class="box">-->
|
|
|
-<!-- <div v-for="(item, index) in markerList" :key="index" @click="toAddress(item)">{{item.name}}</div>-->
|
|
|
-<!-- </div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="globalMap">
|
|
|
import Map from '@/components/Map/index.vue';
|
|
|
-// import YztMap from '@/components/Map/YztMap/index.vue';
|
|
|
-import YMap from '@/components/Map/YMap.vue';
|
|
|
-import Dialog from '@/components/Dialog/index2.vue';
|
|
|
+import YztMap from '@/components/Map/YztMap/index.vue';
|
|
|
import MapLogical from '@/components/Map/MapLogical.vue';
|
|
|
import { iconList, logicalData } from './data/mapData';
|
|
|
import SwitchMapTool from '@/views/globalMap/SwitchMapTool.vue';
|
|
|
import LeftMenu from './LeftMenu.vue';
|
|
|
import TimeAxis from '@/components/TimeAxis/index.vue';
|
|
|
import DrawTools from '@/views/globalMap/DrawTools.vue';
|
|
|
-import { countCircleArea, countRectangleArea } from '@/utils/geometryUtil';
|
|
|
+import { countCircleArea } from '@/utils/geometryUtil';
|
|
|
import { deepClone } from '@/utils';
|
|
|
-import {
|
|
|
- getEmergencyExpertNum,
|
|
|
- getEmergencyExpertNumRound,
|
|
|
- getRescueMateria,
|
|
|
- getSpatialAnalysis
|
|
|
-} from '@/api/globalMap';
|
|
|
-import { listMenu } from '@/api/system/menu';
|
|
|
+import { getEmergencyExpertNumRound, getRescueMateria, getSpatialAnalysis } from '@/api/globalMap';
|
|
|
import RightMenu from './RightMenu/index.vue';
|
|
|
-import { getWaterList } from '@/api/globalMap/reservoir';
|
|
|
|
|
|
interface Props {
|
|
|
isComponent?: boolean;
|
|
@@ -164,9 +125,9 @@ const clickMenu = (item) => {
|
|
|
addMarkers(item);
|
|
|
}
|
|
|
if (['空间分析', '江湖河库', '路网视频', '水库监测', '河道监测'].includes(item.name)) {
|
|
|
- if (item.checked) {
|
|
|
- rightMenuRef.value.handleMenu(item.name);
|
|
|
- }
|
|
|
+ // if (item.checked) {
|
|
|
+ // rightMenuRef.value.handleMenu(item.name);
|
|
|
+ // }
|
|
|
if (item.name === '江湖河库') {
|
|
|
// getWaterList().then((res) => {
|
|
|
// debugger;
|
|
@@ -207,7 +168,6 @@ interface AnalysisSpatialData {
|
|
|
medicalInstitutionNum: string;
|
|
|
expert: string;
|
|
|
}
|
|
|
-let analysisSpatialDataShow = ref(false);
|
|
|
let selectedScope = reactive({});
|
|
|
// 空间分析数据
|
|
|
const analysisSpatialData = reactive<AnalysisSpatialData>({
|
|
@@ -226,47 +186,27 @@ const analysisSpatial = (data, len?: string) => {
|
|
|
if (selectedScope[data.id]) {
|
|
|
delete selectedScope[data.id];
|
|
|
if (JSON.stringify(selectedScope) === '{}') {
|
|
|
- analysisSpatialDataShow.value = false;
|
|
|
+ rightMenuRef.value.clickContractMenu();
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- if (data.type === 'circle') {
|
|
|
- const params = {
|
|
|
- location: `POINT(${data.center.join(' ')})`,
|
|
|
- radius: data.radius.toString()
|
|
|
- };
|
|
|
- getEmergencyExpertNumRound(params).then((res) => {
|
|
|
- selectedScope[data.id] = deepClone(analysisSpatialData);
|
|
|
- selectedScope[data.id].area = countCircleArea(data.center, data.radius);
|
|
|
- selectedScope[data.id].expert = res.data.list[0].expertNum?.toString();
|
|
|
- analysisSpatialDataShow.value = true;
|
|
|
- });
|
|
|
- } else {
|
|
|
- let location = [];
|
|
|
- if (data.path && data.path.length > 1) {
|
|
|
- data.path.forEach((item) => {
|
|
|
- location.push({
|
|
|
- x: item[0],
|
|
|
- y: item[1]
|
|
|
- });
|
|
|
- });
|
|
|
+ let location = [];
|
|
|
+ if (data.path && data.path.length > 1) {
|
|
|
+ data.path.forEach((item) => {
|
|
|
location.push({
|
|
|
- x: data.path[0][0],
|
|
|
- y: data.path[1][1]
|
|
|
+ x: item[0],
|
|
|
+ y: item[1]
|
|
|
});
|
|
|
- }
|
|
|
- getSpatialAnalysis({ location }).then((res) => {
|
|
|
- selectedScope[data.id] = deepClone(analysisSpatialData);
|
|
|
- // selectedScope[data.id].area = countRectangleArea(pathArr);
|
|
|
- selectedScope[data.id].expert = res.data.list[0].expertNum?.toString();
|
|
|
- analysisSpatialDataShow.value = true;
|
|
|
});
|
|
|
}
|
|
|
+ getSpatialAnalysis({ location }).then((res) => {
|
|
|
+ rightMenuRef.value.setAnalysisData(res.data);
|
|
|
+ });
|
|
|
};
|
|
|
// 取消显示
|
|
|
const unSelectGraphics = (data) => {
|
|
|
delete selectedScope[data.id];
|
|
|
- analysisSpatialDataShow.value = false;
|
|
|
+ rightMenuRef.value.clickContractMenu();
|
|
|
};
|
|
|
</script>
|
|
|
|