Compare commits

...

2 Commits

Author SHA1 Message Date
a0049873 65f08c1ba5 Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev 2022-06-15 16:29:14 +08:00
a0049873 011a68190d 新加点击功能 2022-06-15 16:28:55 +08:00
1 changed files with 152 additions and 144 deletions

View File

@ -1,9 +1,8 @@
<template> <template>
<home-header></home-header> <home-header></home-header>
<div class="survey-left"> <div class="survey-left" @click="hidePop()">
<div ref="cityMap" class="city-map-content-echarts"></div> <div ref="cityMap" class="city-map-content-echarts"></div>
<div class="mask"> <div class="box xha" v-show="xhaFlag">
<div class="box xha">
<div class="top"> <div class="top">
<span>西海岸</span> <span>西海岸</span>
<span> <span>
@ -35,7 +34,7 @@
</div> </div>
<div class="zx"></div> <div class="zx"></div>
</div> </div>
<div class="box lsq"> <div class="box lsq" v-show="lsqFlag">
<div class="top"> <div class="top">
<span>崂山区</span> <span>崂山区</span>
<span> <span>
@ -63,7 +62,6 @@
<div class="zx"></div> <div class="zx"></div>
</div> </div>
</div> </div>
</div>
<ability-to-recommend-bottom></ability-to-recommend-bottom> <ability-to-recommend-bottom></ability-to-recommend-bottom>
</template> </template>
<script setup> <script setup>
@ -73,6 +71,8 @@
import geoJson from '/public/static/echartsMapJson/qingdao.json' import geoJson from '/public/static/echartsMapJson/qingdao.json'
// const loadedDataUrl = '/public/static/echartsMapJson/qingdao.json' // const loadedDataUrl = '/public/static/echartsMapJson/qingdao.json'
const echarts = require('echarts') const echarts = require('echarts')
const xhaFlag = ref(false)
const lsqFlag = ref(false)
const areaMenuList = ref([ const areaMenuList = ref([
// //
// { // {
@ -180,14 +180,6 @@
const imgActive = new Image() const imgActive = new Image()
imgActive.src = '/src/assets/home/map-piece-active.png' imgActive.src = '/src/assets/home/map-piece-active.png'
option = { option = {
// visualMap: {
// show: false,
// max: 100,
// seriesIndex: 1,
// inRange: {
// color: ['#000000', 'yellow', 'pink'],
// },
// },
visualMap: { visualMap: {
// //
min: 0, min: 0,
@ -238,6 +230,7 @@
}, },
], ],
z: 2, z: 2,
silent: true,
}, },
], ],
series: [ series: [
@ -598,6 +591,11 @@
console.log('echarts配置==================>', option) console.log('echarts配置==================>', option)
myChart.setOption(option) myChart.setOption(option)
} }
const hidePop = () => {
console.log('取消弹窗')
xhaFlag.value = false
lsqFlag.value = false
}
onMounted(() => { onMounted(() => {
initMap() initMap()
myChart.on('mouseover', function () { myChart.on('mouseover', function () {
@ -605,6 +603,22 @@
type: 'downplay', type: 'downplay',
}) })
}) })
myChart.on('click', function (params) {
console.log(params)
params.event.event.stopPropagation()
switch (params.name) {
case '西海岸':
xhaFlag.value = !xhaFlag.value
lsqFlag.value = false
break
case '崂山区':
lsqFlag.value = !lsqFlag.value
xhaFlag.value = false
break
default:
break
}
})
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -622,12 +636,7 @@
height: 7rem; height: 7rem;
margin: 0rem auto; margin: 0rem auto;
} }
.mask {
position: absolute;
z-index: 1000;
width: 19.2rem;
height: 7rem;
margin: 0rem auto;
.box { .box {
position: absolute; position: absolute;
width: 3.18rem; width: 3.18rem;
@ -712,5 +721,4 @@
left: 11.95rem; left: 11.95rem;
} }
} }
}
</style> </style>