派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-03-08 17e7836b1d0a7bd1a51d44ae071a88423a9f9370
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<template>
  <div class="lefttop-toolbox-panel">
    <div class="init-choose" @click="changeSelect()">
      <img src="@/assets/images/map-pages/icon/toolbox/circle.png" alt="">
    </div>
    <!--    <transition name="fade">-->
    <!--      <ul v-show='selectGroup'>-->
    <!--        <li v-for="(item,i) in imgList" :key="i" @click="toggleActive(i)" :value="total"><img :src="item"/></li>-->
    <!--      </ul>-->
    <!--    </transition>-->
    <div class="el-select-dropdown" v-show='selectGroup'>
      <el-dropdown @command="handleCommand" trigger="click" v-for="(item,i) in imgLists" :key="i" :value="total">
        <transition name="fade">
          <img :src="item.title" :title="item.alt"/>
        </transition>
        <el-dropdown-menu>
          <el-dropdown-item v-for="(ite,index) in item.items" :key="index" :command='ite.headings'>
            <span @click='toggleActive(ite)'>{{ ite.headings }}</span>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>
 
<script>
import circle from '@/assets/images/map-pages/icon/toolbox/circle.png'
import fullscreen from '@/assets/images/map-pages/icon/toolbox/fullscreen.png'
import legend from '@/assets/images/map-pages/icon/toolbox/legend.png'
import location from '@/assets/images/map-pages/icon/toolbox/location.png'
import polygon from '@/assets/images/map-pages/icon/toolbox/polygon.png'
import square from '@/assets/images/map-pages/icon/toolbox/square.png'
 
export default {
  name: 'ToolBoxPanel',
  components: {},
  props: ['map'],
  data () {
    return {
      isPanelVisible: false,
      total: 0,
      activeTools: {},
      imgLists: [
        {
          title: circle,
          alt: '标绘',
          items: [
            { headings: '线标绘' },
            { headings: '面标绘' },
            { headings: '箭头标绘' }
          ]
        },
        {
          title: square,
          alt: '标注',
          items: [
            { headings: '点标注' },
            { headings: '线标注' },
            { headings: '面标注' },
            { headings: '文字标注' },
            { headings: '图标标注' }
          ]
        },
        {
          title: legend,
          alt: '测量',
          items: [
            { headings: '距离测量' },
            { headings: '面积测量' }
          ]
        },
        {
          title: location,
          alt: '切换底图',
          items: [
            { headings: '影像图' },
            { headings: '矢量图' },
            { headings: '地形图' }
          ]
        },
        {
          title: polygon,
          alt: '管网',
          items: [
            { headings: '连通性分析' },
            { headings: '爆管分析' },
            { headings: '流向分析' },
            { headings: '横断面分析' }
          ]
        },
        {
          title: fullscreen,
          alt: '下载',
          items: [
            { headings: '全屏' },
            { headings: 'A4横向' },
            { headings: 'A4纵向' }
          ]
        }
      ],
      form: {
        regionType: '',
        enterprise: ''
      },
      selectGroup: false,
      selectGroupOne: false
    }
  },
  methods: {
    changeSelect () {
      this.selectGroup = !this.selectGroup
    },
    handleClose (done) {
      console.log(done)
    },
    handleClick (tab, event) {
      console.log(tab, event)
    },
    handleCommand (command) {
      console.log(command)
      if (command === '全屏') {
        this.map.toggleFullscreen()
      }
    },
    toggleActive (k) {
      if (k === 'fullscreen') {
        this.map.toggleFullscreen()
      }
    },
    loadData () {
 
    }
  },
  mounted () {
    this.loadData()
  },
  created () {
 
  }
}
</script>
 
<style lang="less">
.lefttop-toolbox-panel {
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 999;
  display: flex;
 
  .init-choose {
    //margin: 15px 5px;
    background: #305B62;
    //margin-top: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px skyblue solid;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
  }
 
  .el-select-dropdown {
    position: absolute;
    z-index: 1;
    width: 250px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    background: #305B62;
    border-radius: 15px;
    padding-inline: 10px;
    padding-inline-start: 30px;
 
    .el-dropdow {
      width: 20%;
    }
 
    @keyframes bounce-in {
      0% {
        transform: scale(0);
        opacity: 0.3;
      }
      100% {
        transform: scale(1);
        opacity: 1;
      }
    }
 
    .fade-enter-active {
      transform-origin: left center;
      animation: bounce-in .2s;
    }
 
    .fade-leave-active {
      transform-origin: left;
      animation: bounce-in .2s reverse;
    }
  }
 
  .el-select-dropdown:last-child {
    margin-left: 10px;
  }
 
  .el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
 
  .el-icon-arrow-down {
    font-size: 12px;
  }
 
}
</style>