Compare commits

..

No commits in common. "5d631ffbdb9a2e2c51f9bee6e15908d8b5eff415" and "301fad495c198563eac4a1ba7c4a3e75fa60f843" have entirely different histories.

3 changed files with 3 additions and 86 deletions

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.changhu.common.annotation.JsonBody; import com.changhu.common.annotation.JsonBody;
import com.changhu.common.exception.MessageException; import com.changhu.common.exception.MessageException;
import com.changhu.common.pojo.vo.SelectNodeVo; import com.changhu.common.pojo.vo.SelectNodeVo;
import com.changhu.module.management.pojo.entity.EnterprisesUnit;
import com.changhu.module.management.pojo.params.EnterprisesUnitSaveOrUpdateParams; import com.changhu.module.management.pojo.params.EnterprisesUnitSaveOrUpdateParams;
import com.changhu.module.management.pojo.queryParams.EnterprisesUnitPagerQueryParams; import com.changhu.module.management.pojo.queryParams.EnterprisesUnitPagerQueryParams;
import com.changhu.module.management.pojo.vo.EnterprisesUnitPagerVo; import com.changhu.module.management.pojo.vo.EnterprisesUnitPagerVo;
@ -59,10 +58,4 @@ public class EnterprisesUnitController {
return enterprisesUnitService.queryListByAdministrativeDivisionCodes(administrativeDivisionCodes); return enterprisesUnitService.queryListByAdministrativeDivisionCodes(administrativeDivisionCodes);
} }
@Operation(summary = "企事业单位地图点位")
@GetMapping("/mapPoint")
public List<EnterprisesUnit> mapPoint() {
return enterprisesUnitService.list();
}
} }

View File

@ -1,89 +1,13 @@
<template> <template>
<div class="container"> <div style="width: 100vw;height: 100vh">
<div class="header"> <map-container/>
<h1>地图页面标题</h1>
</div>
<MapContainer class="map-container" ref="mapRef" :map-options="mapOptions" :init-callback="initMap">
<div class="left-panel panel">
<h2>左侧统计面板</h2>
<!-- 添加你的统计数据 -->
</div>
<div class="right-panel panel">
<h2>右侧统计面板</h2>
<!-- 添加你的统计数据 -->
</div>
</MapContainer>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import MapContainer from "@/components/aMap/MapContainer.vue"; import MapContainer from "@/components/aMap/MapContainer.vue";
import {ref} from "vue";
import {ComponentExposed} from "vue-component-type-helpers";
import api from "@/axios";
const mapRef = ref<ComponentExposed<typeof MapContainer>>(null)
const mapOptions: AMap.MapOptions = {
// 3D
viewMode: "3D",
//
zoom: 16,
mapStyle: 'amap://styles/darkblue'
}
const initMap = async () => {
const {data} = await api.get<any[]>('/enterprisesUnit/mapPoint')
mapRef.value?.mapInstance?.clearMap()
const markers = data.map(item => {
if (!item.point) {
return null;
}
return new AMap.Marker({
position: item.point
})
}).filter(Boolean)
mapRef.value.mapInstance.add(markers)
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container {
position: relative;
height: 100vh;
}
.header {
background-color: rgba(255, 255, 255, 0.7);
color: #333;
text-align: center;
padding: 20px;
position: absolute;
top: 20px;
left: 0;
right: 0;
z-index: 10;
}
.map-container {
height: 100%;
position: relative;
}
.panel {
background-color: rgba(255, 255, 255, 0.7);
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
position: absolute;
top: 100px; /* 调整顶部距离以避免与标题重叠 */
z-index: 10;
}
.left-panel {
left: 10px;
}
.right-panel {
right: 10px;
}
</style> </style>

View File

@ -87,7 +87,7 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
placeholder={'请输入详细地址'} placeholder={'请输入详细地址'}
autocomplete="off" autocomplete="off"
onFocus={() => { onFocus={() => {
if (!_mapRef.value?.mapInstance) { if (!_mapRef.value.mapInstance) {
message.error('地图组件尚未初始化成功 请重新打开页面') message.error('地图组件尚未初始化成功 请重新打开页面')
return return
} }