|
@@ -2,11 +2,11 @@
|
|
|
<div class="flex">
|
|
|
<div class="plusIcon" @click="addStep"></div>
|
|
|
<div style="margin: 10px 0; position: relative">
|
|
|
- <el-slider class="slider" v-model="step" :min="1" :max="4" vertical :show-tooltip="false" height="183px" @input="changeStep" />
|
|
|
+ <el-slider v-model="step" class="slider" :min="1" :max="4" vertical :show-tooltip="false" height="183px" @input="changeStep" />
|
|
|
<div v-show="step === 1" class="tooltip">市</div>
|
|
|
- <div v-show="step === 2" class="tooltip" style="bottom: 30px">区/县</div>
|
|
|
- <div v-show="step === 3" class="tooltip" style="bottom: 77px">镇/街道</div>
|
|
|
- <div v-show="step === 4" class="tooltip" style="bottom: 123px">村/社区</div>
|
|
|
+ <div v-show="step === 2" class="tooltip" style="bottom: 36px">区/县</div>
|
|
|
+ <div v-show="step === 3" class="tooltip" style="bottom: 93px; left: -162px">镇/街道</div>
|
|
|
+ <div v-show="step === 4" class="tooltip" style="bottom: 160px; left: -162px">村/社区</div>
|
|
|
</div>
|
|
|
<div class="minusIcon" @click="reduceStep"></div>
|
|
|
</div>
|
|
@@ -22,16 +22,14 @@ const step = ref(1);
|
|
|
watch(
|
|
|
() => props.zoom,
|
|
|
(zoom) => {
|
|
|
- if (zoom <= 8) {
|
|
|
+ if (zoom <= 7.9) {
|
|
|
step.value = 1;
|
|
|
- } else if (zoom >= 8 && zoom < 12) {
|
|
|
+ } else if (zoom > 7.9 && zoom <= 9.21) {
|
|
|
step.value = 2;
|
|
|
- } else if (zoom >= 12 && zoom <= 14) {
|
|
|
+ } else if (zoom > 9.21 && zoom <= 11.38) {
|
|
|
step.value = 3;
|
|
|
- } else if (zoom >= 14 && zoom < 16) {
|
|
|
+ } else if (zoom > 11.38) {
|
|
|
step.value = 4;
|
|
|
- } else if (zoom >= 16) {
|
|
|
- step.value = 5;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -41,7 +39,6 @@ watch(
|
|
|
|
|
|
// 发生变化时
|
|
|
const changeStep = (value) => {
|
|
|
- console.log(122, value);
|
|
|
emits('changeStep', value);
|
|
|
};
|
|
|
// 增加
|
|
@@ -79,18 +76,28 @@ const reduceStep = () => {
|
|
|
}
|
|
|
.tooltip {
|
|
|
position: absolute;
|
|
|
- //left: -55px;
|
|
|
- left: -80px;
|
|
|
- bottom: -12px;
|
|
|
+ left: -126px;
|
|
|
+ bottom: -23px;
|
|
|
color: #fff;
|
|
|
padding-left: 14px;
|
|
|
padding-top: 4px;
|
|
|
font-size: 32px;
|
|
|
- width: 63px;
|
|
|
- height: 33px;
|
|
|
- background: url('@/assets/images/map/marker.png') no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- font-family: 'SourceHanSansCN';
|
|
|
+ min-width: 80px;
|
|
|
+ height: 63px;
|
|
|
+ line-height: 63px;
|
|
|
+ background-color: #3b71eb;
|
|
|
+ text-align: center;
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-bottom: 45px solid #3b71eb;
|
|
|
+ border-left: 45px solid transparent;
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ right: -20px;
|
|
|
+ transform: rotate(-45deg);
|
|
|
+ }
|
|
|
}
|
|
|
.slider {
|
|
|
:deep(.el-slider__bar) {
|