|
@@ -0,0 +1,402 @@
|
|
|
|
+<script setup>
|
|
|
|
+import { ref,reactive, onMounted } from 'vue';
|
|
|
|
+import { map_data } from '@/request/api';
|
|
|
|
+
|
|
|
|
+const emit = defineEmits(['someEvent'])
|
|
|
|
+const map_click = (title,coal_washery_id) => {
|
|
|
|
+ emit('someEvent', {title,coal_washery_id})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const tooltip = reactive({
|
|
|
|
+ data: {}
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+function get_map_data(){
|
|
|
|
+ map_data({
|
|
|
|
+
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ tooltip.data = res.content.map_data
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ get_map_data()
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const interval = ref(null);
|
|
|
|
+const titleItems_hover = ref(0);
|
|
|
|
+const map = ref(null);
|
|
|
|
+const titleItems = ref(null);
|
|
|
|
+
|
|
|
|
+function init() {
|
|
|
|
+ map.value = document.querySelector(".map");
|
|
|
|
+ titleItems.value = document.querySelectorAll('.title_item');
|
|
|
|
+
|
|
|
|
+ map.value.addEventListener("mouseover", handleMouseOver);
|
|
|
|
+ map.value.addEventListener("mouseout", handleMouseOut);
|
|
|
|
+ map.value.addEventListener("click", handleMapClick);
|
|
|
|
+
|
|
|
|
+ startInterval();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function handleMouseOver(e) {
|
|
|
|
+ clearInterval(interval.value);
|
|
|
|
+ const hoveredItem = e.target.closest('.title_item'); // 确保获取到正确的标题项
|
|
|
|
+ if (hoveredItem) {
|
|
|
|
+ titleItems.value.forEach((item) => {
|
|
|
|
+ item.childNodes[1].style.display = item === hoveredItem ? "block" : "none";
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function handleMouseOut(e) {
|
|
|
|
+ startInterval();
|
|
|
|
+ titleItems.value.forEach((item) => {
|
|
|
|
+ item.childNodes[1].style.display = "none";
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function handleMapClick(e) {
|
|
|
|
+ const clickedItem = e.target.closest('.title_item'); // 确保获取到正确的标题项
|
|
|
|
+ if (clickedItem) {
|
|
|
|
+ titleItems.value.forEach((item) => {
|
|
|
|
+ item.childNodes[1].style.display = "none";
|
|
|
|
+ });
|
|
|
|
+ clickedItem.childNodes[1].style.display = "block";
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function startInterval() {
|
|
|
|
+ interval.value = setInterval(() => {
|
|
|
|
+ titleItems.value.forEach((item, index) => {
|
|
|
|
+ item.childNodes[1].style.display = index === titleItems_hover.value ? "block" : "none";
|
|
|
|
+ });
|
|
|
|
+ titleItems_hover.value = (titleItems_hover.value + 1) % titleItems.value.length;
|
|
|
|
+ }, 3000);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ init()
|
|
|
|
+ },2000)
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<template>
|
|
|
|
+ <div class="map">
|
|
|
|
+ <div class="map_img">
|
|
|
|
+ <img src="@/assets/images/map_ningdong.png" alt="">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_list" v-if="tooltip.data.linxing">
|
|
|
|
+ <div class="left">
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.linxing" @click="map_click(tooltip.data.linxing.title,tooltip.data.linxing.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.linxing.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.linxing.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.hongliu" @click="map_click(tooltip.data.hongliu.title,tooltip.data.hongliu.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.hongliu.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.hongliu.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.zaoquan" @click="map_click(tooltip.data.zaoquan.title,tooltip.data.zaoquan.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.zaoquan.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.zaoquan.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.jinneng" @click="map_click(tooltip.data.jinneng.title,tooltip.data.jinneng.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.jinneng.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.jinneng.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.jianxiuyichejian" @click="map_click(tooltip.data.jianxiuyichejian.title,tooltip.data.jianxiuyichejian.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.jianxiuyichejian.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.jianxiuyichejian.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.jianxiuerchejian" @click="map_click(tooltip.data.jianxiuerchejian.title,tooltip.data.jianxiuerchejian.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.jianxiuerchejian.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.jianxiuerchejian.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 2025-05-21:新增 -->
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.gongchengke" @click="map_click(tooltip.data.gongchengke.title,tooltip.data.gongchengke.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.gongchengke.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.gongchengke.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.jidiandonglike" @click="map_click(tooltip.data.jidiandonglike.title,tooltip.data.jidiandonglike.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.jidiandonglike.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.jidiandonglike.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.shengchanjishuke" @click="map_click(tooltip.data.shengchanjishuke.title,tooltip.data.shengchanjishuke.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.shengchanjishuke.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.shengchanjishuke.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.zongheke" @click="map_click(tooltip.data.zongheke.title,tooltip.data.zongheke.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.zongheke.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.zongheke.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div class="right">
|
|
|
|
+
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.qingshuiying" @click="map_click(tooltip.data.qingshuiying.title,tooltip.data.qingshuiying.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.qingshuiying.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.qingshuiying.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.meihuajing" @click="map_click(tooltip.data.meihuajing.title,tooltip.data.meihuajing.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.meihuajing.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.meihuajing.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.shicaocun" @click="map_click(tooltip.data.shicaocun.title,tooltip.data.shicaocun.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.shicaocun.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.shicaocun.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.shuangma" @click="map_click(tooltip.data.shuangma.title,tooltip.data.shuangma.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.shuangma.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.shuangma.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.jinfeng" @click="map_click(tooltip.data.jinfeng.title,tooltip.data.jinfeng.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.jinfeng.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.jinfeng.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.yangchangwan" @click="map_click(tooltip.data.yangchangwan.title,tooltip.data.yangchangwan.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.yangchangwan.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.yangchangwan.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="title_item" v-if="tooltip.data.yanger" @click="map_click(tooltip.data.yanger.title,tooltip.data.yanger.id)">
|
|
|
|
+ <div class="title">{{ tooltip.data.yanger.title }}</div>
|
|
|
|
+ <div class="data">
|
|
|
|
+ <div class="item" v-for="(item, index) in tooltip.data.yanger.data" :key="index">
|
|
|
|
+ <div class="name">{{ item.name }}</div>
|
|
|
|
+ <div class="value">{{ item.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+.map {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .map_img {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 50%;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+
|
|
|
|
+ img {
|
|
|
|
+ width: 335px;
|
|
|
|
+ height: 550px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .line_img {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 50%;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+
|
|
|
|
+ img {
|
|
|
|
+ width: 398px;
|
|
|
|
+ height: 499px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title_list {
|
|
|
|
+ margin-top: 30px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+
|
|
|
|
+ .title_item {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 4px 8px;
|
|
|
|
+ border: 2px solid #3F6FFF;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .data {
|
|
|
|
+ display: none;
|
|
|
|
+ width: 100px;
|
|
|
|
+ background-color: #3F6FFF;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding: 10px 20px;
|
|
|
|
+
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: -14px;
|
|
|
|
+ left: 124px;
|
|
|
|
+
|
|
|
|
+ .item {
|
|
|
|
+ color: #FFF;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 30px;
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .data::before {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: -4px;
|
|
|
|
+ top: 15px;
|
|
|
|
+ transform: rotate(45deg);
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ background-color: #3F6FFF
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title_item:hover {
|
|
|
|
+ background-color: #3F6FFF;
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ color: #FFF;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .data {
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .left {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: -20px;
|
|
|
|
+ top: 0;
|
|
|
|
+
|
|
|
|
+ .title_item {
|
|
|
|
+ margin-bottom: 34px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 490px;
|
|
|
|
+ top: 0;
|
|
|
|
+
|
|
|
|
+ .title_item {
|
|
|
|
+ margin-bottom: 32px;
|
|
|
|
+
|
|
|
|
+ .data {
|
|
|
|
+ left: -160px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .data::before {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 124px;
|
|
|
|
+ top: 15px;
|
|
|
|
+ transform: rotate(45deg);
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ background-color: #3F6FFF
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title_item:nth-child(1) {
|
|
|
|
+ margin-top: 60px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title_item:nth-child(4) {
|
|
|
|
+ margin-bottom: 104px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|