2026-04-03 16:04:16 +08:00
|
|
|
<!-- LegendItem.vue -->
|
|
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
class="legendItem"
|
|
|
|
|
:class="{ gray: item.checked == 0, disabled: item.canBeChecked == 0 }"
|
|
|
|
|
>
|
2026-04-03 17:04:34 +08:00
|
|
|
<div class="legendIcon" :class="{ smallIcon: item.layerCode == 'eng_point' || item.layerCode == 'ef_point' }">
|
|
|
|
|
<img :src="getIconPath(item.icon)" alt="" />
|
2026-04-03 16:04:16 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="legendIconTitle">
|
|
|
|
|
<span v-html="item.name" style="white-space: pre-wrap"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-04-03 17:04:34 +08:00
|
|
|
import { getIconPath } from "@/utils/index";
|
2026-04-03 16:04:16 +08:00
|
|
|
defineProps<{ item: any }>();
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.legendItem {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
padding: 4px 0;
|
|
|
|
|
min-height: 30px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
.legendIcon {
|
|
|
|
|
width: 25px !important;
|
|
|
|
|
height: 25px !important;
|
|
|
|
|
text-align: center;
|
2026-04-03 17:04:34 +08:00
|
|
|
img {
|
|
|
|
|
max-width: 80%;
|
|
|
|
|
max-height: 80%;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
2026-04-03 16:04:16 +08:00
|
|
|
}
|
|
|
|
|
.smallIcon {
|
|
|
|
|
width: 22px !important;
|
|
|
|
|
height: 22px !important;
|
2026-04-03 17:04:34 +08:00
|
|
|
text-align: center;
|
|
|
|
|
|
2026-04-03 16:04:16 +08:00
|
|
|
}
|
|
|
|
|
.legendIconTitle {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
flex: 1 1;
|
|
|
|
|
}
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #2f6b98;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|