2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
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
<template>
<div class="BottomMenuContainer">
  <ul class="clearfix">
    <li class="inline" v-for="menu in bottomMenu" :key="menu.code" :style="{background: 'no-repeat url(' + require('@assets/img/riskMonitor/menu/' + menu.code + (activeOne === menu.code ? 'A' : '') + '.png') + ')'}" @click="routerPush(menu)">{{menu.name}}</li>
  </ul>
</div>
</template>
 
<script>
export default {
  name: 'bottomMenu',
  components: {},
  data() {
    return {
      activeOne: '',
      bottomMenu: [{
        name: '热力安全',
        code: 'thermal',
        path: '/thermal'
      }, {
        name: '供水安全',
        code: 'waterSupply',
        path: '/waterSupply'
      }, {
        name: '燃气安全',
        code: 'gas',
        path: '/gas'
      }, {
        name: '综合态势',
        code: 'integrated',
        path: '/integrated'
      }, {
        name: '内涝监测',
        code: 'waterlogging',
        path: '/waterlogging'
      }, {
        name: '消防安全',
        code: 'fire',
        path: '/fire'
      }, {
        name: '综合管廊',
        code: 'pipeRack',
        path: '/pipeRack'
      }]
    }
  },
  watch: {
    $route(newV) {
      this.activeOne = newV.name
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.activeOne = this.$route.name
    },
    routerPush(menu) {
      // const {
      //   path,
      //   code
      // } = menu
      // this.$router.push('/riskMonitor' + path)
      this.activeOne = menu.code
    }
  }
}
</script>
 
<style lang="scss" scoped>
.BottomMenuContainer {
  width: 100%;
  height: 100%;
  position: relative;
 
  ul {
    position: absolute;
    width: 100%;
    left: 0;
    bottom: 64px;
    text-align: center;
    li {
      width: 110px;
      height: 140px;
      margin: 0 18px;
      cursor: pointer;
      color: #FFF;
      padding-top: 90px;
      box-sizing: border-box;
      font-size: 16px;
      font-weight: bold;
    }
  }
}
</style>