From 2d398b4fa805ba43a89311d955fbb6e47c540e6c Mon Sep 17 00:00:00 2001 From: YANGDL <114714267@qq.com> Date: 星期五, 12 三月 2021 20:57:16 +0800 Subject: [PATCH] 修改了界面自适应 --- src/components/panel/LegendPanel.vue | 451 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 248 insertions(+), 203 deletions(-) diff --git a/src/components/panel/LegendPanel.vue b/src/components/panel/LegendPanel.vue index caa82aa..ed870b4 100644 --- a/src/components/panel/LegendPanel.vue +++ b/src/components/panel/LegendPanel.vue @@ -1,159 +1,27 @@ <template> <div class="legend-panel"> + + <transition name="fade"> + <div class="legend-content" v-show="legendControl"> + <div class="legend-content-box" v-for="(item,index) in legendContents" :key="index"> + <p><span>{{ item.title }}</span></p> + <div :class="index === 5 ? '':'under-line'"></div> + <ul > + <!-- <div >--> + <li v-for="(ite,inde) in item.items" :key="inde"> + <img :src='ite.legendImage' alt=''> + <span>{{ ite.legendContent }}</span> + </li> + + <!-- </div>--> + </ul> + + </div> + </div> + </transition> <div class="legend-icon unactive" @click="legendChange()"> <i class="el-icon-more-outline"></i> <span>鍥句緥</span> - </div> - <div class="legendContent" v-show="legendCont"> - <div class="legendContent_Centent"> - <p>棰勮</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - <hr class="underLine"/> - <p>浼佷笟</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - <hr class="underLine"/> - <p>姘存儏</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - <hr class="underLine"/> - <p>绠$嚎</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - <hr class="underLine"/> - <p>鍙伴</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - <hr class="underLine"/> - <p>闄嶆按绛夌骇</p> - <ul> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - <li> - <img src="../.././assets/images/map-pages/setting.png" alt=""> - <span>鏆撮洦绾㈣壊棰勮</span> - </li> - </ul> - </div> </div> </div> </template> @@ -164,23 +32,124 @@ data () { return { // 鎺у埗鍥句緥 鍐呭鐨� 鏄剧ず/闅愯棌 - legendCont: false + legendControl: false, + // 鍥鹃噷瀛樺偍鏁版嵁 + legendContents: [ + { + title: '浼佷笟', + items: [ + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '涓浗鐭冲寲' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '娌圭敯浼佷笟 ' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鐐煎寲浼佷笟' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '閿�鍞紒涓�' + } + ] + }, + { + title: '姘存儏', + items: [ + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '姘存枃绔�' + } + ] + }, + { + title: '绠$嚎', + items: [ + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '澶╃劧姘旂绾�' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '澶╃劧姘斿満绔�' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鎴愬搧娌圭绾�' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鎴愬搧娌瑰満绔�' + } + ] + }, + { + title: '鍙伴', + items: [ + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鍙伴瀹炴祴涓績' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鍙伴瀹炴祴璺緞' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鍙伴棰勬祴涓績' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鍙伴棰勬祴璺緞' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鍙伴褰撳墠涓績' + } + ] + }, + { + title: '闄嶆按绛夌骇(鍗曚綅锛歮m)', + items: [ + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '灏忛洦0-5' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '涓洦5-10' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '澶ч洦10-20' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '鏆撮洦20-50' + }, + { + legendImage: '../.././assets/images/map-pages/setting.png', + legendContent: '澶ф毚闆�50-100' + } + ] + } + ] } }, methods: { // 鍥炬爣 鎺у埗鍐呭鐨勫睍绀轰笌闅愯棌 legendChange () { - if (this.legendCont === false) { - this.legendCont = true - } else { - this.legendCont = false - } + this.legendControl = !this.legendControl } } } </script> <style lang="less" scoped> +@import '@assets/css/map/_map-variable'; .legend-panel { position: absolute; z-index: 502; @@ -191,62 +160,138 @@ flex-direction: column; -webkit-box-align: end; -ms-flex-align: end; - align-items: flex-end; - + //align-items: flex-end; + transition: all .5s; .legend-icon { - width: 3.4rem; - height: 1.6rem; - border-radius: .3rem; - background: white; + width: .29167rem; + height: .31771rem; + //font-size: .08333rem; + border: .00521rem solid rgba(0,255,246,.15); + border-radius: .03125rem; text-align: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + background: @background-color; + margin-top: .04167rem; + cursor: pointer; + color: @color; + margin-left: auto; + font-size: 0.08333rem; } - .legendContent { - position: absolute; - right: 8rem; - bottom: 3rem; - width: 30rem; - height: 41rem; - border-radius: 1rem; - background: #3c7699; - .legendContent_Centent { - width: 100%; - height: 100%; + @keyframes bounce-in { + 0% { + transform: scale(0); + opacity: 0.3; + } + 100% { + transform: scale(1); + opacity: 1; + } + } + + .fade-enter-active { + transform-origin: right bottom; + animation: bounce-in .2s; + } + + .fade-leave-active { + transform-origin: right bottom; + animation: bounce-in .2s reverse; + } + + .legend-content { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + background: rgba(0,16,30,.9); + border-radius: .05208rem; + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + border: .00521rem solid @color; + box-shadow: 0 0 .03rem @color; + overflow: hidden; + min-height: 1.28646rem; + + .legend-content-box { + font-size: 0.07292rem; + padding: .10417rem; + border-left: .00521rem solid @background-color-split; p { text-align: center; - color: #ffffff; - font-size: 14px; - display: block; - margin-block-start: 1rem; - margin-block-end: 0; - } - ul { - padding: 0; - list-style: none; - display: flex; - flex-wrap: wrap; - width: 100%; - li { - width: 25%; - text-align: center; - line-height: 1.5rem; - img { - vertical-align: middle !important; - } - span { - font-size: 12px; - color: white; - } + margin: 0 !important; + //padding: 0; + //color: @color-title; + -webkit-margin-before: 0.3rem; + margin-block-start: 0.3rem; + -webkit-margin-after: 0.2rem; + margin-block-end: 0.2rem; + margin-bottom: 0.05208rem !important; + span { + color: @color-title; + font-size: .08333rem; + font-weight: 600; } + } + + ul { + list-style: none; + //display: flex; + flex-wrap: wrap; + margin: 0 !important; + padding: 0 !important;; + padding-inline: 0; + //color: #00fff6; + //font-size: .07292rem; + font-size: .08333rem; + + li { + //width: 100%; + //display: flex; + //justify-content: space-around; + //margin-left: 15px; + //margin-right: 15px; + list-style: none; + display: flex; + -webkit-box-align: center; + align-items: center; + margin: 0.05208rem 0; + img { + width: .08333rem; + height: .08333rem; + margin-right: .01042rem; + } + + span { + //width: 80px; + //font-size: 12px; + color: @color; + } + } } } - .underLine { - border: none; - background: none; - width: 100%; - height: 2px; - background: #7bc5ef; + .under-line { + height: 1px; + background: @background-color-split; + margin-block-start: 0; + margin-block-end: 0; } } } -- Gitblit v1.8.0