|
@@ -96,8 +96,18 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div :id="mapId" class="map-container"></div> -->
|
|
|
|
|
- <AMapContainer ref="mapRef" class="map-container"></AMapContainer>
|
|
|
|
|
|
|
+ <AMapContainer
|
|
|
|
|
+ ref="mapRef"
|
|
|
|
|
+ class="map-container"
|
|
|
|
|
+ :medias="medias"
|
|
|
|
|
+ :longitude="
|
|
|
|
|
+ Number(medias[Math.floor(medias.length / 2)]?.longitude || 120.498409)
|
|
|
|
|
+ "
|
|
|
|
|
+ :latitude="
|
|
|
|
|
+ Number(medias[Math.floor(medias.length / 2)]?.latitude || 32.039665)
|
|
|
|
|
+ "
|
|
|
|
|
+ :coordinates="coordinates"
|
|
|
|
|
+ ></AMapContainer>
|
|
|
<div class="line" style="margin-top: 30px">
|
|
<div class="line" style="margin-top: 30px">
|
|
|
<div class="info-line">
|
|
<div class="info-line">
|
|
|
<div class="info-line-title">开始时间</div>
|
|
<div class="info-line-title">开始时间</div>
|
|
@@ -1987,7 +1997,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { onMounted, reactive, ref, toRefs } from "vue";
|
|
|
|
|
|
|
+import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
|
|
import api from "../../apis/fetch";
|
|
import api from "../../apis/fetch";
|
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
|
import _ from "lodash";
|
|
import _ from "lodash";
|
|
@@ -2028,13 +2038,13 @@ async function getVoyageDetail(isInit) {
|
|
|
spinner: "el-icon-loading",
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
});
|
|
});
|
|
|
- // let res = await api.getVoyageDetail({
|
|
|
|
|
- // type: localStorage.userType,
|
|
|
|
|
- // voyageId: route.query.id,
|
|
|
|
|
- // });
|
|
|
|
|
- let res = {
|
|
|
|
|
- data,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ let res = await api.getVoyageDetail({
|
|
|
|
|
+ type: localStorage.userType,
|
|
|
|
|
+ voyageId: route.query.id,
|
|
|
|
|
+ });
|
|
|
|
|
+ // let res = {
|
|
|
|
|
+ // data,
|
|
|
|
|
+ // };
|
|
|
loading.close();
|
|
loading.close();
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
ElNotification({
|
|
ElNotification({
|
|
@@ -2090,10 +2100,10 @@ async function getVoyageDetail(isInit) {
|
|
|
getLabList();
|
|
getLabList();
|
|
|
getPortWeatherList();
|
|
getPortWeatherList();
|
|
|
getAccidentList();
|
|
getAccidentList();
|
|
|
- try {
|
|
|
|
|
- initMap();
|
|
|
|
|
- } catch (error) {}
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ await nextTick();
|
|
|
|
|
+
|
|
|
|
|
+ mapRef.value.drawMarkers();
|
|
|
} else {
|
|
} else {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
ElNotification({
|
|
ElNotification({
|
|
@@ -2230,88 +2240,6 @@ function cancelUpdateDischarge() {
|
|
|
updateForm.value = {};
|
|
updateForm.value = {};
|
|
|
updatePoundBillList.value = [];
|
|
updatePoundBillList.value = [];
|
|
|
}
|
|
}
|
|
|
-let mapId = ref(`map${route.query.id}`);
|
|
|
|
|
-function initMap() {
|
|
|
|
|
- let c;
|
|
|
|
|
- let longitude = 121.524761;
|
|
|
|
|
- let latitude = 31.228721;
|
|
|
|
|
- if (medias.value.length) {
|
|
|
|
|
- c = Math.floor(medias.value.length / 2);
|
|
|
|
|
- longitude = medias.value[c].longitude;
|
|
|
|
|
- latitude = medias.value[c].latitude;
|
|
|
|
|
- }
|
|
|
|
|
- map.value = new AMap.Map(mapId.value, {
|
|
|
|
|
- zoom: 16, //级别
|
|
|
|
|
- center: [longitude, latitude], //中心点坐标
|
|
|
|
|
- mapStyle: "amap://styles/f48d96805f5fa7f5aada657c5ee37017",
|
|
|
|
|
- zoomEnable: true,
|
|
|
|
|
- dragEnable: true,
|
|
|
|
|
- });
|
|
|
|
|
- let toolBar = new AMap.ToolBar({
|
|
|
|
|
- position: {
|
|
|
|
|
- top: "40px",
|
|
|
|
|
- right: "40px",
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- let hawkEye = new AMap.HawkEye({
|
|
|
|
|
- opened: false,
|
|
|
|
|
- });
|
|
|
|
|
- map.value.addControl(toolBar);
|
|
|
|
|
- map.value.addControl(hawkEye);
|
|
|
|
|
- let markers = [];
|
|
|
|
|
- for (let i of medias.value) {
|
|
|
|
|
- let content = `<div style='width:160px'>
|
|
|
|
|
- ${
|
|
|
|
|
- i.audit == 1
|
|
|
|
|
- ? `<img id='img${i.id}' style='width:160px;height:160px;object-fit:contain;' src='${i.viewUrl}'/>`
|
|
|
|
|
- : ``
|
|
|
|
|
- }
|
|
|
|
|
- <img src='https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png' style='display:block;width:20px;height:20px;margin:6px auto'/
|
|
|
|
|
- </div>`;
|
|
|
|
|
-
|
|
|
|
|
- let marker = new AMap.Marker({
|
|
|
|
|
- content,
|
|
|
|
|
- zIndex: 10,
|
|
|
|
|
- position: new AMap.LngLat(i.longitude, i.latitude),
|
|
|
|
|
- offset: new AMap.Pixel(-80, i.audit == 1 ? -185 : -20),
|
|
|
|
|
- });
|
|
|
|
|
- if (i.audit == 1) {
|
|
|
|
|
- marker.on("click", () => {
|
|
|
|
|
- openMediaModal(i.viewUrl, 1, "航次图片", i);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- markers.push(marker);
|
|
|
|
|
- }
|
|
|
|
|
- for (let i of coordinates.value) {
|
|
|
|
|
- let content = `<div style='width:160px'>
|
|
|
|
|
- <img src='https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/green-circle.png' style='display:block;width:20px;height:20px;margin:6px auto'/
|
|
|
|
|
- </div>`;
|
|
|
|
|
-
|
|
|
|
|
- let marker = new AMap.Marker({
|
|
|
|
|
- content,
|
|
|
|
|
- zIndex: 5,
|
|
|
|
|
- position: new AMap.LngLat(i.longitude, i.latitude),
|
|
|
|
|
- offset: new AMap.Pixel(-80, -20),
|
|
|
|
|
- });
|
|
|
|
|
- if (i.audit == 1) {
|
|
|
|
|
- marker.on("click", () => {
|
|
|
|
|
- openMediaModal(i.viewUrl, 1, "航次图片", i);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- markers.push(marker);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let overlayGroups = new AMap.OverlayGroup(markers);
|
|
|
|
|
- map.value.on("complete", function () {
|
|
|
|
|
- let t = setTimeout(() => {
|
|
|
|
|
- map.value.add(overlayGroups);
|
|
|
|
|
- map.value.setFitView(markers, true, [200, 50, 0, 0], 18);
|
|
|
|
|
- clearTimeout(t);
|
|
|
|
|
- }, 2000);
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
let disabledStatus = ref(true);
|
|
let disabledStatus = ref(true);
|
|
|
let updateCache = {};
|
|
let updateCache = {};
|