|
@@ -77,6 +77,7 @@
|
|
|
<script setup>
|
|
|
import AMapLoader from '@amap/amap-jsapi-loader';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
+import { updateEventLocation, addEvent } from '@/api/emergencyCommandMap/JointDuty';
|
|
|
|
|
|
const props = defineProps({
|
|
|
visible: {
|
|
@@ -137,7 +138,6 @@ onUnmounted(() => {
|
|
|
}
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
});
|
|
|
-
|
|
|
function handleInput(flag) {
|
|
|
if (!location.value) return;
|
|
|
|
|
@@ -178,13 +178,11 @@ function handleInput(flag) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
function handleChangePage(newNum) {
|
|
|
if (!searchPop.value) return;
|
|
|
pageNum.value = newNum;
|
|
|
this.handleInput(1);
|
|
|
}
|
|
|
-
|
|
|
function closeSearchList() {
|
|
|
searchPop.value = false;
|
|
|
location.value = '';
|
|
@@ -192,18 +190,17 @@ function closeSearchList() {
|
|
|
total.value = 0;
|
|
|
pageNum.value = 1;
|
|
|
}
|
|
|
-
|
|
|
// 地图中心的平移至指定点位置
|
|
|
function handlePanTo(index) {
|
|
|
let lnglat = searchList.value[index].lnglat;
|
|
|
- form.longitude = searchList.value[index].name + '(' + searchList.value[index] + ')';
|
|
|
- form.latitude = lnglat[0];
|
|
|
+ form.address = searchList.value[index].name + '(' + searchList.value[index].address + ')';
|
|
|
+ form.longitude = lnglat[0];
|
|
|
form.latitude = lnglat[1];
|
|
|
+
|
|
|
map.panTo(lnglat);
|
|
|
setMarks(lnglat);
|
|
|
closeSearchList();
|
|
|
}
|
|
|
-
|
|
|
const initMap = async () => {
|
|
|
let position = [110.93154257997, 21.669064031332];
|
|
|
const AMap = await AMapLoader.load({
|
|
@@ -226,7 +223,6 @@ const initMap = async () => {
|
|
|
map.on('rightclick', handleRightclick);
|
|
|
handleResize();
|
|
|
};
|
|
|
-
|
|
|
function ContextMenu() {
|
|
|
contextMenu = new AMap.ContextMenu();
|
|
|
contextMenu.addItem(
|
|
@@ -246,14 +242,12 @@ function ContextMenu() {
|
|
|
1
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
// 右键事件
|
|
|
function handleRightclick(e) {
|
|
|
let lnglat = [e.lnglat.getLng(), e.lnglat.getLat()];
|
|
|
contextMenu.open(map, e.lnglat);
|
|
|
lnglatPosition.value = lnglat;
|
|
|
}
|
|
|
-
|
|
|
function setMarks(lnglat) {
|
|
|
//添加标记
|
|
|
if (marker) map.remove(marker);
|
|
@@ -269,14 +263,11 @@ function setMarks(lnglat) {
|
|
|
});
|
|
|
marker.setMap(map);
|
|
|
}
|
|
|
-
|
|
|
function handleClose() {
|
|
|
emits('update:visible', false);
|
|
|
}
|
|
|
-
|
|
|
let queryFormRef = ref();
|
|
|
let containerRef = ref();
|
|
|
-
|
|
|
function handleResize() {
|
|
|
const containerWidth = containerRef.value.clientWidth * (document.body.clientWidth / 8960);
|
|
|
const containerHeight = containerRef.value.clientHeight * (document.body.clientHeight / 2520);
|
|
@@ -286,14 +277,17 @@ function handleResize() {
|
|
|
map.resize();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
function submit() {
|
|
|
queryFormRef.value.validate((valid) => {
|
|
|
if (valid) {
|
|
|
console.log('提交数据', form);
|
|
|
router.push({
|
|
|
path: '/emergencyCommandMap',
|
|
|
- query: { id: '11111111' }
|
|
|
+ query: {
|
|
|
+ address: form.address,
|
|
|
+ longitude: form.longitude,
|
|
|
+ latitude: form.latitude
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -306,12 +300,10 @@ function submit() {
|
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-
|
|
|
.map {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
-
|
|
|
.search {
|
|
|
width: 50%;
|
|
|
position: absolute;
|
|
@@ -322,7 +314,6 @@ function submit() {
|
|
|
border-radius: 3px;
|
|
|
display: flex;
|
|
|
}
|
|
|
-
|
|
|
.btn {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
@@ -337,7 +328,6 @@ function submit() {
|
|
|
top: 70px;
|
|
|
padding: 15px;
|
|
|
border-radius: 3px;
|
|
|
-
|
|
|
.close {
|
|
|
position: absolute;
|
|
|
right: 2%;
|
|
@@ -346,7 +336,6 @@ function submit() {
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.scroll {
|
|
|
width: 100%;
|
|
|
max-height: 250px;
|
|
@@ -388,7 +377,6 @@ function submit() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
::v-deep {
|
|
|
.el-scrollbar__wrap {
|
|
|
overflow-x: hidden !important;
|
|
@@ -398,11 +386,9 @@ function submit() {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.empty {
|
|
|
margin: 20px 0;
|
|
|
}
|
|
|
-
|
|
|
.dialog-wrap {
|
|
|
position: fixed;
|
|
|
top: 50%;
|
|
@@ -413,7 +399,6 @@ function submit() {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
font-size: 16px;
|
|
|
-
|
|
|
.dialog {
|
|
|
width: 4000px;
|
|
|
height: 2000px;
|
|
@@ -422,29 +407,23 @@ function submit() {
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.dialog {
|
|
|
padding: 0 20px;
|
|
|
-
|
|
|
.dialog-header {
|
|
|
width: 100%;
|
|
|
height: 70px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
-
|
|
|
.dialog-title {
|
|
|
font-size: 36px;
|
|
|
}
|
|
|
-
|
|
|
.icon-close {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.dialog-content {
|
|
|
padding: 10px 0;
|
|
|
-
|
|
|
.map_box {
|
|
|
width: calc(4000px - 50px) !important;
|
|
|
height: calc(2000px - 200px) !important;
|