| | |
| | | <img src="@assets/images/map-pages/icon/toolbox/tool.png" alt=""> |
| | | <span>工具</span> |
| | | </el-button> |
| | | <transition name="isD"> |
| | | <el-row v-show="selectGroup" class="specific-tools-group"> |
| | | <el-popover |
| | | placement="bottom" |
| | | width="" |
| | | trigger="click" |
| | | :popper-class="'tools-panel-content'" |
| | | v-for="(item,index) in menuList" :key="index" |
| | | > |
| | | <el-button slot="reference" class="el-button" :class="active === index ? 'tools-panel-choose':''" |
| | | @click="changeChoose(index)"> |
| | | <img :src="item.icon" alt=""/> |
| | | <span>{{ item.label }}</span> |
| | | </el-button> |
| | | <el-button v-for="(itemT,indexT) in item.items" :key="indexT" @click="choiceItem(itemT)"> |
| | | <img :src="itemT.icon" :title="itemT.title"/> |
| | | </el-button> |
| | | </el-popover> |
| | | <el-button @click="changeSelect" class="special-button"> |
| | | <i :class="selectGroup === false ? 'el-icon-d-arrow-right':'el-icon-d-arrow-left'"></i> |
| | | <el-row v-show="selectGroup" class="specific-tools-group"> |
| | | <el-popover |
| | | placement="bottom" |
| | | width="100%" |
| | | trigger="click" |
| | | :popper-class="'tools-panel-content'" |
| | | v-for="(item,index) in menuList" :key="index" |
| | | > |
| | | <el-button slot="reference" class="el-button" :class="active === index ? 'tools-panel-choose':''" |
| | | @click="changeChoose(index)"> |
| | | <img :src="item.icon" alt=""/> |
| | | <span>{{ item.label }}</span> |
| | | </el-button> |
| | | </el-row> |
| | | </transition> |
| | | <el-button v-for="(itemT,indexT) in item.items" :key="indexT" @click="choiceItem(itemT)" v-show="item.index!=='2'"> |
| | | <img :src="itemT.icon" :title="itemT.title" v-show="item.index!=='2'"/> |
| | | </el-button> |
| | | <div class="base-map-inner-panel" v-show="isShow&&item.index==='2'"> |
| | | <div v-for="item in basemapList" :key="item.code" class="basemap-layer-item"> |
| | | <img class="base-map-img" width="50" height="50" :src="item.conf.icon_actived" :title="item.name" |
| | | @click="changeBasemap(item)"/> |
| | | <el-checkbox class="base-map-anno" name="basemap" v-model="item.conf.annotationCheck" |
| | | label="标注" @change="changeBasemap(item)"> |
| | | </el-checkbox> |
| | | </div> |
| | | </div> |
| | | </el-popover> |
| | | <el-button @click="changeSelect" class="special-button"> |
| | | <i :class="selectGroup === false ? 'el-icon-d-arrow-right':'el-icon-d-arrow-left'"></i> |
| | | </el-button> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | // components: { BaseNavMenuItem }, |
| | | data () { |
| | | return { |
| | | isShow: true, |
| | | currentBaseMapCode: 'tianditu_img', |
| | | basemapList: [], |
| | | menuList: [ |
| | | { |
| | | icon: plot, |
| | |
| | | drawLayer: null, |
| | | map: null, |
| | | L: window.L, |
| | | active: 0, |
| | | isShow: true |
| | | active: 0 |
| | | } |
| | | }, |
| | | computed: { |
| | | basemapHelper () { |
| | | return this.$store.state.map.basemapHelper |
| | | } |
| | | }, |
| | | watch: { |
| | | basemapHelper (newVal) { |
| | | if (newVal != null) { |
| | | this.updateBasemapList() |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | updateBasemapList () { |
| | | this.basemapList = this.basemapHelper.getBasemapList() |
| | | }, |
| | | changeBasemap (itm) { |
| | | const code = itm.code |
| | | this.basemapList.forEach((item) => { |
| | | if (item.code === code) { |
| | | console.log(this.currentBaseMapCode) |
| | | if (this.currentBaseMapCode == null || this.currentBaseMapCode !== code) { |
| | | this.currentBaseMapCode = code |
| | | this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, true) |
| | | } else { |
| | | this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, false) |
| | | } |
| | | |
| | | this.basemapHelper.getBasemapList().forEach((item) => { |
| | | item.layer.bringToBack() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | changeChoose (index) { |
| | | this.active = index |
| | | }, |
| | |
| | | height: 45px; |
| | | background: @background-color-tools; |
| | | border: none; |
| | | .base-map-img{ |
| | | position: absolute; |
| | | } |
| | | .base-map-img:hover{ |
| | | cursor:pointer; |
| | | } |
| | | |
| | | img { |
| | | width: 22px; |