2026-05-06 17:44:30 +08:00
|
|
|
<!-- 左侧图例组件 -->
|
|
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
class="legend-container"
|
2026-05-06 18:02:56 +08:00
|
|
|
v-show="
|
2026-05-07 12:53:25 +08:00
|
|
|
useStatus.uiComponents.leftLegend.show &&
|
|
|
|
|
Object.keys(useLeftLegend.legendListInfo).length > 0
|
2026-05-06 18:02:56 +08:00
|
|
|
"
|
2026-05-06 17:44:30 +08:00
|
|
|
>
|
|
|
|
|
<div
|
2026-05-06 18:02:56 +08:00
|
|
|
class="legend-box"
|
2026-05-07 12:53:25 +08:00
|
|
|
v-for="key in Object.keys(useLeftLegend.legendListInfo)"
|
2026-05-06 18:02:56 +08:00
|
|
|
:key="key"
|
2026-05-06 17:44:30 +08:00
|
|
|
>
|
2026-05-06 18:02:56 +08:00
|
|
|
<div class="legend-title">
|
2026-05-07 12:53:25 +08:00
|
|
|
{{ useLeftLegend.legendListInfo[key].title }}
|
2026-05-06 18:02:56 +08:00
|
|
|
</div>
|
2026-05-06 17:44:30 +08:00
|
|
|
<div
|
2026-05-06 18:02:56 +08:00
|
|
|
class="legend-item"
|
2026-05-07 12:53:25 +08:00
|
|
|
v-for="(item, index) in useLeftLegend.legendListInfo[key].list"
|
2026-05-06 18:02:56 +08:00
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="legend-color"
|
|
|
|
|
:style="{ 'background-color': `${item.color}` }"
|
|
|
|
|
></div>
|
|
|
|
|
<div class="legend-text">
|
|
|
|
|
<span class="legend-text-title">{{ item.label }}</span>
|
|
|
|
|
</div>
|
2026-05-06 17:44:30 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { useLeftLegendStore } from '@/stores/useLeftLegendStore';
|
|
|
|
|
import { useStatusStore } from '@/stores/useStatusStore';
|
2026-05-07 12:53:25 +08:00
|
|
|
|
|
|
|
|
const useStatus = useStatusStore();
|
|
|
|
|
const useLeftLegend = useLeftLegendStore();
|
2026-05-06 17:44:30 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.legend-container {
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 20px;
|
|
|
|
|
left: 20px;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
padding: 6px;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
display: flex;
|
2026-05-06 18:02:56 +08:00
|
|
|
gap: 30px;
|
|
|
|
|
min-width: 240px;
|
2026-05-06 17:44:30 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
|
|
color: white;
|
|
|
|
|
font-family: Arial, sans-serif;
|
|
|
|
|
background: rgba(14, 52, 98, 0.8);
|
|
|
|
|
border: 1px solid rgb(0, 225, 255);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-06 18:02:56 +08:00
|
|
|
.legend-box:not(:last-child) {
|
|
|
|
|
border-right: 1px solid rgb(0, 225, 255);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-06 17:44:30 +08:00
|
|
|
.legend-title {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.legend-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin: 3px 0;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.legend-color {
|
|
|
|
|
width: 16px;
|
|
|
|
|
height: 16px;
|
|
|
|
|
margin-right: 6px;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|