|
@@ -2,8 +2,8 @@
|
|
|
<div id="globalMap">
|
|
|
<div
|
|
|
:class="isComponent ? 'global-map' : 'global-map bg'"
|
|
|
- :style="{ width: width ? width : '100%', height: height ? height : '100%' }"
|
|
|
>
|
|
|
+<!-- :style="{ width: width ? width : '100%', height: height ? height : '100%' }"-->
|
|
|
<!-- :style="{ width: width ? width : '8960px', height: height ? height : '2560px'}"-->
|
|
|
<!-- -->
|
|
|
<MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
|
|
@@ -36,8 +36,8 @@
|
|
|
:draw-type="mouseToolState.drawType"
|
|
|
:graphics-type="mouseToolState.graphicsType"
|
|
|
:active-map="activeMap"
|
|
|
- :container-width="isComponent ? 3483 : 8960"
|
|
|
- :container-height="isComponent ? 2140 : 2520"
|
|
|
+ :container-width="width"
|
|
|
+ :container-height="height"
|
|
|
@selectGraphics="analysisSpatial"
|
|
|
@unSelectGraphics="unSelectGraphics"
|
|
|
/>
|
|
@@ -52,7 +52,7 @@
|
|
|
<!--更换地图类型-->
|
|
|
<SwitchMapTool
|
|
|
:active-map="activeMap"
|
|
|
- :class="isComponent || activeMap === 'logical' || activeMap === 'satellite2' ? 'tool-box' : 'tool-box fixed'"
|
|
|
+ class="tool-box"
|
|
|
@switchMap="switchMap"
|
|
|
/>
|
|
|
<!--时间轴-->
|
|
@@ -63,7 +63,7 @@
|
|
|
v-model:color="mouseToolState.color"
|
|
|
v-model:drawType="mouseToolState.drawType"
|
|
|
v-model:graphicsType="mouseToolState.graphicsType"
|
|
|
- :class="isComponent || activeMap === 'logical' || activeMap === 'satellite2' ? 'absoluteTool' : 'absoluteTool fixed'"
|
|
|
+ class="absoluteTool"
|
|
|
@undo="undo"
|
|
|
/>
|
|
|
<!-- <AnalyzeDataDialog v-if="analysisSpatialDataShow" :selectedScope="selectedScope" />-->
|
|
@@ -87,9 +87,13 @@ import TimeAxis from '@/components/TimeAxis/index.vue';
|
|
|
import DrawTools from '@/views/globalMap/DrawTools.vue';
|
|
|
import { countCircleArea, countRectangleArea } from '@/utils/geometryUtil';
|
|
|
import { deepClone } from '@/utils';
|
|
|
-import { getEmergencyExpertNum, getEmergencyExpertNumRound, getRescueMateria } from '@/api/globalMap';
|
|
|
+import {
|
|
|
+ getEmergencyExpertNum,
|
|
|
+ getEmergencyExpertNumRound,
|
|
|
+ getRescueMateria,
|
|
|
+ getSpatialAnalysis
|
|
|
+} from '@/api/globalMap';
|
|
|
import { listMenu } from '@/api/system/menu';
|
|
|
-import autofit from 'autofit.js';
|
|
|
import RightMenu from './RightMenu/index.vue';
|
|
|
import { getWaterList } from '@/api/globalMap/reservoir';
|
|
|
|
|
@@ -108,7 +112,7 @@ const mapData = reactive(logicalData);
|
|
|
let mapRef = ref(null);
|
|
|
let map2Ref = ref(null);
|
|
|
// logical vectorgraph satellite satellite2
|
|
|
-let activeMap = ref('logical');
|
|
|
+let activeMap = ref('vectorgraph');
|
|
|
|
|
|
const switchMap = (key) => {
|
|
|
activeMap.value = key;
|
|
@@ -238,34 +242,22 @@ const analysisSpatial = (data, len?: string) => {
|
|
|
analysisSpatialDataShow.value = true;
|
|
|
});
|
|
|
} else {
|
|
|
- let location = '';
|
|
|
- let pathArr = [];
|
|
|
- if (data.type === 'rectangle') {
|
|
|
- pathArr = [
|
|
|
- [
|
|
|
- [data.southWest[0], data.northEast[1]],
|
|
|
- data.northEast,
|
|
|
- [data.northEast[0], data.southWest[1]],
|
|
|
- data.southWest,
|
|
|
- [data.southWest[0], data.northEast[1]]
|
|
|
- ]
|
|
|
- ];
|
|
|
- } else if (data.type === 'polygon') {
|
|
|
- pathArr = deepClone(data.path);
|
|
|
- pathArr.push(deepClone(pathArr[0]));
|
|
|
- pathArr = [pathArr];
|
|
|
+ let location = [];
|
|
|
+ if (data.path && data.path.length > 1) {
|
|
|
+ data.path.forEach((item) => {
|
|
|
+ location.push({
|
|
|
+ x: item[0],
|
|
|
+ y: item[1]
|
|
|
+ });
|
|
|
+ });
|
|
|
+ location.push({
|
|
|
+ x: data.path[0][0],
|
|
|
+ y: data.path[1][1]
|
|
|
+ });
|
|
|
}
|
|
|
- let pathStr = '';
|
|
|
- pathArr[0].forEach((innerArr, index) => {
|
|
|
- if (index > 0) {
|
|
|
- pathStr += ',';
|
|
|
- }
|
|
|
- pathStr += innerArr.reverse().join(' ');
|
|
|
- });
|
|
|
- location = `POLYGON((${pathStr}))`;
|
|
|
- getEmergencyExpertNum({ location }).then((res) => {
|
|
|
+ getSpatialAnalysis({ location }).then((res) => {
|
|
|
selectedScope[data.id] = deepClone(analysisSpatialData);
|
|
|
- selectedScope[data.id].area = countRectangleArea(pathArr);
|
|
|
+ // selectedScope[data.id].area = countRectangleArea(pathArr);
|
|
|
selectedScope[data.id].expert = res.data.list[0].expertNum?.toString();
|
|
|
analysisSpatialDataShow.value = true;
|
|
|
});
|
|
@@ -276,25 +268,6 @@ const unSelectGraphics = (data) => {
|
|
|
delete selectedScope[data.id];
|
|
|
analysisSpatialDataShow.value = false;
|
|
|
};
|
|
|
-onMounted(() => {
|
|
|
- if (!props.isComponent) {
|
|
|
- autofit.init(
|
|
|
- {
|
|
|
- dw: 8960,
|
|
|
- dh: 2520,
|
|
|
- el: '#globalMap',
|
|
|
- resize: false,
|
|
|
- ignore: ['#aMap', '#YztMap']
|
|
|
- },
|
|
|
- false
|
|
|
- );
|
|
|
- }
|
|
|
-});
|
|
|
-onUnmounted(() => {
|
|
|
- if (autofit) {
|
|
|
- autofit.off();
|
|
|
- }
|
|
|
-});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -307,6 +280,8 @@ onUnmounted(() => {
|
|
|
background-size: cover;
|
|
|
}
|
|
|
.global-map {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
position: relative;
|
|
|
//overflow: hidden;
|
|
|
.tool-box {
|