|
|
|
@ -25,22 +25,7 @@ |
|
|
|
@time-range-change="setTrajectoryTimeRangeCustom" |
|
|
|
/> |
|
|
|
|
|
|
|
<div v-if="panelVisible" class="info-panel"> |
|
|
|
<div class="info-panel__header"> |
|
|
|
<span class="info-panel__title">设备详情</span> |
|
|
|
<button class="info-panel__close" @click="panelVisible = false">×</button> |
|
|
|
</div> |
|
|
|
<div class="info-panel__body"> |
|
|
|
<div v-if="selectedMarker"> |
|
|
|
<div class="info-panel__name">{{ selectedMarker.name }}</div> |
|
|
|
<div class="info-panel__coord" |
|
|
|
>坐标:{{ selectedMarker.coordinates[0].toFixed(6) }}, |
|
|
|
{{ selectedMarker.coordinates[1].toFixed(6) }}</div |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div v-else class="info-panel__empty">未选择设备</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script lang="ts" setup> |
|
|
|
@ -79,6 +64,7 @@ const props = withDefaults(defineProps<MapProps>(), { |
|
|
|
}) |
|
|
|
|
|
|
|
const emit = defineEmits<{ |
|
|
|
(e: 'on-click-marker', marker: MarkerData): void |
|
|
|
(e: 'fence-draw-complete', coordinates: [number, number][]): void |
|
|
|
(e: 'refresh-fences'): void |
|
|
|
(e: 'time-range-change', range: { startTime: number; endTime: number }): void |
|
|
|
@ -90,10 +76,6 @@ const showFences = ref(props.showFences) |
|
|
|
const showDrawFences = ref(false) |
|
|
|
const mapContainerRef = ref<HTMLElement | null>(null) |
|
|
|
|
|
|
|
// 左侧信息面板状态 |
|
|
|
|
|
|
|
const panelVisible = ref(false) |
|
|
|
const selectedMarker = ref<MarkerData | null>(null) |
|
|
|
|
|
|
|
/** |
|
|
|
gasStatus 气体报警状态 |
|
|
|
@ -197,8 +179,7 @@ const init = () => { |
|
|
|
onMarkerClick: (marker: MarkerData) => { |
|
|
|
console.log('marker clicked', marker) |
|
|
|
|
|
|
|
selectedMarker.value = marker |
|
|
|
panelVisible.value = true |
|
|
|
emit('on-click-marker', marker) |
|
|
|
}, |
|
|
|
onZoomEnd: (zoom: number) => { |
|
|
|
console.log('onZoomEnd', zoom) |
|
|
|
@ -342,81 +323,5 @@ defineExpose({ refreshFences, fitToMarkers, setCenter, showTrajectory }) |
|
|
|
height: 100% !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.info-panel { |
|
|
|
position: absolute; |
|
|
|
top: 100px; |
|
|
|
right: 20px; |
|
|
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.9); |
|
|
|
border-radius: 8px; |
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
|
|
|
z-index: 1000; |
|
|
|
width: 313px; |
|
|
|
max-height: 80vh; |
|
|
|
overflow-y: auto; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
.info-panel__header { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
padding: 10px 15px; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
background-color: #f5f5f5; |
|
|
|
border-radius: 8px 8px 0 0; |
|
|
|
|
|
|
|
.info-panel__title { |
|
|
|
font-size: 16px; |
|
|
|
font-weight: bold; |
|
|
|
color: #333; |
|
|
|
} |
|
|
|
|
|
|
|
.info-panel__close { |
|
|
|
background-color: #ff4d4f; |
|
|
|
color: white; |
|
|
|
border: none; |
|
|
|
border-radius: 50%; |
|
|
|
width: 24px; |
|
|
|
height: 24px; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
cursor: pointer; |
|
|
|
font-size: 18px; |
|
|
|
font-weight: bold; |
|
|
|
transition: background-color 0.3s ease; |
|
|
|
|
|
|
|
&:hover { |
|
|
|
background-color: #d9363e; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.info-panel__body { |
|
|
|
padding: 15px; |
|
|
|
flex-grow: 1; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
.info-panel__empty { |
|
|
|
text-align: center; |
|
|
|
color: #888; |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.info-panel__name { |
|
|
|
font-size: 18px; |
|
|
|
font-weight: bold; |
|
|
|
margin-bottom: 5px; |
|
|
|
color: #555; |
|
|
|
} |
|
|
|
|
|
|
|
.info-panel__coord { |
|
|
|
font-size: 14px; |
|
|
|
color: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|