经营主体地图弹窗

This commit is contained in:
13713575202 2025-04-30 10:17:34 +08:00
parent 5c701d1306
commit 48bb84fe76
3 changed files with 54 additions and 31 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -8,7 +8,8 @@
<el-dialog <el-dialog
v-model="isShow" v-model="isShow"
:title="currentMap.name + dialogTitle" :title="currentMap.name + dialogTitle"
width="360" :width="dialogWidth"
:style="{ 'background-image': 'url(' + getAssetsFile(bgImageVal) + ')' }"
:show-close="false" :show-close="false"
:before-close="handleClose" :before-close="handleClose"
custom-class="map-info-dialog" custom-class="map-info-dialog"
@ -22,7 +23,7 @@
</template> </template>
<script setup> <script setup>
import { isEmpty, getAssetsFile } from '@/utils'; import { isEmpty, getAssetsFile } from '@/utils';
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import geoJsonData from '../components/530926geo.json'; // import geoJsonData from '../components/530926geo.json'; //
const route = useRoute(); const route = useRoute();
@ -37,9 +38,19 @@ const props = defineProps({
return []; return [];
}, },
}, },
bgImage: {
type: String,
default: 'images/vsualized/mapopup.png',
},
dialogWidth: {
type: Number,
default: 360,
},
}); });
var iconUrl = getAssetsFile('images/vsualized/gmmap2.png').href; var iconUrl = getAssetsFile('images/vsualized/gmmap2.png').href;
let bgImageVal = computed(() => {
return props.bgImage;
});
const isShow = ref(false); const isShow = ref(false);
let geoData = geoJsonData; let geoData = geoJsonData;
let mapName = ref('ZJ' + route.name); let mapName = ref('ZJ' + route.name);
@ -183,16 +194,21 @@ const chartsData = reactive({
let currentMap = reactive({}); let currentMap = reactive({});
const mapClick = (data) => { const mapClick = (data) => {
if (props.markerData.length && props.markerData.length > 0) {
if (data.seriesType == 'effectScatter') {
isShow.value = true; isShow.value = true;
currentMap = data; currentMap = data;
emit('mapclick', currentMap); emit('mapclick', currentMap);
}
} else {
isShow.value = true;
currentMap = data;
emit('mapclick', currentMap);
}
}; };
const handleClose = () => { const handleClose = () => {
isShow.value = false; isShow.value = false;
}; };
onMounted(() => {
console.info('iconUrl', iconUrl);
});
const emit = defineEmits(['mapclick']); const emit = defineEmits(['mapclick']);
</script> </script>
@ -203,7 +219,10 @@ div {
::v-deep() { ::v-deep() {
.el-dialog { .el-dialog {
background: url('@/assets/images/vsualized/mapopup.png') no-repeat left top; background: url(iconUrl) no-repeat left top;
background-repeat: no-repeat;
background-size: cover;
border-radius: 8px !important;
min-height: 200px; min-height: 200px;
max-height: 500px; max-height: 500px;
overflow-y: auto; overflow-y: auto;

View File

@ -1,19 +1,25 @@
<template> <template>
<centerMap :dialog-title="'投入品'" :marker-data="markerData" @mapclick="doMapclick"> <centerMap
:dialog-title="'经营主体'"
:marker-data="markerData"
:bg-image="'images/vsualized/mapopup1.png'"
:dialog-width="240"
@mapclick="doMapclick"
>
<template #header> <template #header>
<div class="land-map-pop-header"> <div class="land-map-pop-header">
<div class="title">{{ currentRegion && currentRegion.name ? currentRegion.name : '投入品' }}</div> <div class="title">{{ currentRegion && currentRegion.name ? currentRegion.name : '经营主体' }}</div>
</div> </div>
</template> </template>
<template #dialogContent> <template #dialogContent>
<!-- <div class="land-map-pop-content"> <div class="land-map-pop-content">
<div v-for="(n, index) in list" :key="index" class="list-item"> <div v-for="(n, index) in list" :key="index" class="list-item">
<div class="title"> <div class="title">
<span class="title-val"> {{ n.title }}</span> <span class="title-val"> {{ n.title }}</span>
</div> </div>
<div class="value">{{ n.value }}{{ n.unit }}</div> <div class="value">{{ n.value }}{{ n.unit }}</div>
</div> </div>
</div> --> </div>
</template> </template>
</centerMap> </centerMap>
</template> </template>
@ -33,7 +39,6 @@ const doMapclick = (data) => {
}; };
let markerData = reactive([ let markerData = reactive([
[
// //
{ {
name: '永星食品加工厂', name: '永星食品加工厂',
@ -44,14 +49,13 @@ let markerData = reactive([
}, },
}, },
{ {
name: '耿马镇', name: '欣欣种源企业',
value: [99.402267, 23.538889, 150], // , , value: [99.402267, 23.538889, 150], // , ,
symbol: 'image://' + getAssetsFile('images/vsualized/marker.png'), symbol: 'image://' + getAssetsFile('images/vsualized/marker.png'),
itemStyle: { itemStyle: {
color: '#4bffb4', // color: '#4bffb4', //
}, },
}, },
],
]); ]);
</script> </script>