Browse Source

feat: 布局优化

feature-v1.0.0
邱伟洋 1 month ago
parent
commit
768dfd31b0
  1. 28
      src/views/Main/Map/components/LayerSwitch.vue
  2. 6
      src/views/Main/Map/components/Legend.vue
  3. 11
      src/views/Main/index.vue

28
src/views/Main/Map/components/LayerSwitch.vue

@ -2,12 +2,26 @@
<div class="layer-switch-box"> <div class="layer-switch-box">
<div class="layer-switch"> <div class="layer-switch">
<div class="btn"> <div class="btn">
<img class="icon" src="@/assets/map/layer.svg" alt="" @click="layerTreeChange" /> <img
class="icon"
src="@/assets/map/layer.svg"
alt=""
@click="layerTreeChange"
/>
</div> </div>
<div class="slider-line"></div> <div class="slider-line"></div>
<div class="btn"> <div class="btn">
<el-tooltip effect="dark" :content="is3DScene ? '三维模式' : '二维模式'" placement="right"> <el-tooltip
<img class="icon" src="@/assets/map/changeScene.svg" alt="" @click="handleChangeMode" /> effect="dark"
:content="is3DScene ? '三维模式' : '二维模式'"
placement="right"
>
<img
class="icon"
src="@/assets/map/changeScene.svg"
alt=""
@click="handleChangeMode"
/>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
@ -34,7 +48,7 @@ function handleChangeMode() {
() => { () => {
console.log("移动结束 >>>>> "); console.log("移动结束 >>>>> ");
}, },
1, 1
); );
} }
@ -46,9 +60,9 @@ function layerTreeChange() {
<style lang="scss" scoped> <style lang="scss" scoped>
.layer-switch-box { .layer-switch-box {
position: fixed; // position: fixed;
top: 24px; // top: 24px;
right: 510px; // right: 510px;
border-radius: 4px; border-radius: 4px;
background-color: #fff; background-color: #fff;
} }

6
src/views/Main/Map/components/Legend.vue

@ -73,9 +73,9 @@ onMounted(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.legend-box { .legend-box {
position: fixed; // position: fixed;
bottom: 24px; // bottom: 24px;
right: 510px; // right: 510px;
padding: 12px 0 12px 12px; padding: 12px 0 12px 12px;
overflow-y: auto; overflow-y: auto;
border-radius: 4px; border-radius: 4px;

11
src/views/Main/index.vue

@ -8,7 +8,7 @@
<RegionSelect /> <RegionSelect />
</LeftPanel> </LeftPanel>
<RightPanel> <RightPanel>
<div> <div class="right-panel-left">
<div class="top"> <div class="top">
<MapLayerSwitch @showChange="layerTreeChange"></MapLayerSwitch> <MapLayerSwitch @showChange="layerTreeChange"></MapLayerSwitch>
</div> </div>
@ -76,4 +76,11 @@ onBeforeUnmount(() => {
}); });
</script> </script>
<style scoped></style> <style scoped lang="less">
.right-panel-left {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
}
</style>

Loading…
Cancel
Save