| | |
| | | <template> |
| | | <div class="legend-panel"> |
| | | <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> |
| | | </ul> |
| | | <hr class="underLine"/> |
| | | <p>降水等级</p> |
| | | <ul> |
| | | <li> |
| | | <img src="../.././assets/images/map-pages/setting.png" alt=""> |
| | | <span>暴雨红色预警</span> |
| | | </li> |
| | | </ul> |
| | | <transition name="fade"> |
| | | <div :class="'legend-content map-background'" v-show="legendControl"> |
| | | <div class="legend-content-box" v-for="(item,index) in serviceLayers" :key="index"> |
| | | <p><span>{{ item.name }}</span></p> |
| | | <div class="map-under-line"></div> |
| | | <ul> |
| | | <li v-for="(ite,inde) in item.layers" :key="inde"> |
| | | <img :src='ite.legendImage' alt=''> |
| | | <span>{{ ite.name }}</span> |
| | | </li> |
| | | </ul> |
| | | </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', |
| | | data () { |
| | | return { |
| | | // 控制图例 内容的 显示/隐藏 |
| | | legendCont: false |
| | | legendControl: false |
| | | } |
| | | }, |
| | | computed: { |
| | | serviceLayers () { |
| | | return this.$store.state.map.serviceLayers.LayerSewersLine |
| | | } |
| | | }, |
| | | methods: { |
| | | // 图标 控制内容的展示与隐藏 |
| | | legendChange () { |
| | | if (this.legendCont === false) { |
| | | this.legendCont = true |
| | | } else { |
| | | this.legendCont = false |
| | | } |
| | | this.legendControl = !this.legendControl |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | <style lang="less"> |
| | | .legend-panel { |
| | | position: absolute; |
| | | z-index: 502; |
| | |
| | | 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; |
| | | } |
| | | |
| | | .legendContent { |
| | | position: absolute; |
| | | right: 8rem; |
| | | bottom: 3rem; |
| | | width: 30rem; |
| | | height: 38rem; |
| | | border-radius: 1rem; |
| | | background: #3c7699; |
| | | @keyframes bounce-in { |
| | | 0% { |
| | | transform: scale(0); |
| | | opacity: 0.3; |
| | | } |
| | | 100% { |
| | | transform: scale(1); |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | .legendContent_Centent { |
| | | width: 100%; |
| | | height: 100%; |
| | | .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; |
| | | |
| | | 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; |
| | | display: block; |
| | | margin-block-start: 1rem; |
| | | margin-block-end: 0; |
| | | 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 { |
| | | padding: 0; |
| | | list-style: none; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | width: 100%; |
| | | margin: 0 !important; |
| | | padding: 0 !important;; |
| | | padding-inline: 0; |
| | | font-size: .08333rem; |
| | | |
| | | li { |
| | | width: 25%; |
| | | text-align: center; |
| | | line-height: 1.5rem; |
| | | list-style: none; |
| | | display: flex; |
| | | -webkit-box-align: center; |
| | | align-items: center; |
| | | margin: 0.05208rem 0; |
| | | |
| | | img { |
| | | vertical-align: middle !important; |
| | | width: .08333rem; |
| | | height: .08333rem; |
| | | margin-right: .01042rem; |
| | | } |
| | | |
| | | span { |
| | | font-size: 12px; |
| | | color: white; |
| | | color: @color; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .underLine { |
| | | border: none; |
| | | background: none; |
| | | width: 100%; |
| | | height: 2px; |
| | | background: #7bc5ef; |
| | | } |
| | | } |
| | | } |
| | | </style> |