派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-02-25 7af991bc50092c018f3a2996d730274a168079cb
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
<!--主题菜单选项-->
<template>
<div class="menu-special">
  <div style="color: white;z-index: 1000;">
      <img src="/assets/images/menu/earth.png" style="width: 2rem;height: 2rem;background-size: 100% 100%;padding-right: 1rem;display: inline; " @click="toggle()"  >
    <div id="menu-special-context" class="menu-special-context">
      <div class="menu-special-item"   v-for="item in SpecialList" :key="item.id">
        <img :src="item.icon" style="width: 1.2rem;height: 1.2rem;" >
        {{item.name}}
      </div>
    </div>
 
  </div>
</div>
</template>
 
<script>
export default {
  name: 'MenuSpecial',
  data () {
    return {
      SpecialList: [{
        name: '污染源',
        id: 1,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '废水监测',
        id: 2,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '废气监测',
        id: 3,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '固废管理',
        id: 4,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '环境风险',
        id: 5,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '土壤及地下水',
        id: 6,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '污雨水管网',
        id: 7,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '预警报警',
        id: 8,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '指标统计',
        id: 9,
        check: false,
        icon: '/assets/images/menu/special.png'
      }, {
        name: '应急地图',
        id: 10,
        check: false,
        icon: '/assets/images/menu/special.png'
      }]
    }
  },
  methods: {
    toggle () {
      console.log('toggle')
      const el = document.getElementById('menu-special-context')
      console.log(el.clientWidth + ':' + el.offsetHeight)
      if (el.clientWidth > 0) {
        el.style.width = '0'
      } else {
        el.style.width = 'auto'
      }
    }
  }
 
}
</script>
 
<style lang="less" scoped>
.menu-special{
  position: absolute;
  left: 1rem;
  bottom:10rem;
  height: 2rem;
  font-size: 1rem;
  z-index: 1000;
  font-family: 'Arial Normal', 'Arial';
  font-weight: 400;
  font-style: normal;
  .menu-special-context{
 
    display: inline;
    transition: height 1s;
    .menu-special-item{
      display: inline;background: url('/assets/images/menu/menu-background.svg') no-repeat;
      background-size: 100% 100%;
      padding: 0 1rem 0 1rem;
      font-size: 1rem;
      vertical-align: top;
      /*line-height: 2rem;*/
      /*height: 2rem;*/
    }
  }
 
}
</style>