From 6a0a093dba38d4c9e819a45a70aec8e340da9ca0 Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期三, 31 三月 2021 19:28:30 +0800 Subject: [PATCH] 图表不显示问题 --- src/components/panel/LegendPanel.vue | 200 ++++++++++++++++++++----------------------------- 1 files changed, 81 insertions(+), 119 deletions(-) diff --git a/src/components/panel/LegendPanel.vue b/src/components/panel/LegendPanel.vue index bffdd81..383aea2 100644 --- a/src/components/panel/LegendPanel.vue +++ b/src/components/panel/LegendPanel.vue @@ -1,26 +1,27 @@ <template> <div class="legend-panel"> - <div class="legend-icon unactive" @click="legendChange()"> - <i class="el-icon-more-outline"></i> - <span>鍥句緥</span> - </div> <transition name="fade"> - <div class="legend-content" v-show="legendControl"> + <div :class="'legend-content map-background'" v-show="legendControl"> <div class="legend-content-box" v-for="(item,index) in legendContents" :key="index"> - <p>{{ item.title }}</p> + <p><span>{{ item.title }}</span></p> + <div :class="index === 5 ? '':'map-under-line'"></div> <ul> <li v-for="(ite,inde) in item.items" :key="inde"> <img :src='ite.legendImage' alt=''> <span>{{ ite.legendContent }}</span> </li> </ul> - <div :class="index === 5 ? '':'under-line'"></div> </div> </div> </transition> + <el-tooltip :popper-class="'map-tooltip'" effect="dark" content="鍥句緥" placement="left"> + <div :class="this.legendControl?'legend-btn map-btn-active':'legend-btn map-btn-unactive'" + @click="legendChange()"> + <i class="el-icon-more-outline"></i> + </div> + </el-tooltip> </div> </template> - <script> export default { name: 'LegendPanel', @@ -31,75 +32,6 @@ // 鍥鹃噷瀛樺偍鏁版嵁 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: '鏆撮洦钃濊壊棰勮' - }, - { - 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: '鏆撮绾㈣壊棰勮' - }, - { - 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: '鏆撮绾㈣壊棰勮' - }, - { - legendImage: '../.././assets/images/map-pages/setting.png', - legendContent: '鏆撮绾㈣壊棰勮' - }, - { - legendImage: '../.././assets/images/map-pages/setting.png', - legendContent: '鏆撮绾㈣壊棰勮' - } - ] - }, - { title: '浼佷笟', items: [ { @@ -108,7 +40,7 @@ }, { legendImage: '../.././assets/images/map-pages/setting.png', - legendContent: '娌圭敯浼佷笟' + legendContent: '娌圭敯浼佷笟 ' }, { legendImage: '../.././assets/images/map-pages/setting.png', @@ -206,18 +138,13 @@ methods: { // 鍥炬爣 鎺у埗鍐呭鐨勫睍绀轰笌闅愯棌 legendChange () { - // if (this.legendControl === false) { - // this.legendControl = true - // } else { - // this.legendControl = false - // } this.legendControl = !this.legendControl } } } </script> -<style lang="less" scoped> +<style lang="less"> .legend-panel { position: absolute; z-index: 502; @@ -228,14 +155,35 @@ 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; + .legend-btn { + width: .2rem; + height: .2rem; + //font-size: .08333rem; + border: .00521rem solid @background-color-light; + border-radius: @border-radius; 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; } @keyframes bounce-in { @@ -243,9 +191,6 @@ transform: scale(0); opacity: 0.3; } - //50% { - // transform: scale(1.1); - //} 100% { transform: scale(1); opacity: 1; @@ -254,64 +199,81 @@ .fade-enter-active { transform-origin: right bottom; - animation: bounce-in .5s; + animation: bounce-in .2s; } .fade-leave-active { transform-origin: right bottom; - animation: bounce-in .5s reverse; + animation: bounce-in .2s reverse; } .legend-content { - position: absolute; - right: 1rem; - bottom: 3rem; - width: 30rem; - height: 30rem; - border-radius: 1rem; - background: #3c7699; + 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; + + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + + 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; + 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; - padding-inline: 20px 0; - margin-block: 0; + margin: 0 !important; + padding: 0 !important;; + padding-inline: 0; + font-size: .08333rem; li { - width: 25%; - height: 1.5rem; + list-style: none; display: flex; + -webkit-box-align: center; align-items: center; + margin: 0.05208rem 0; img { - height: 18px; - width: 18px; + width: .08333rem; + height: .08333rem; + margin-right: .01042rem; } span { - font-size: 12px; - color: white; + color: @color; } } } } - .under-line { - height: 2px; - background: #7bc5ef; - margin-block-start: 0.5rem; - margin-block-end: 0; - } } } </style> -- Gitblit v1.8.0