Riku
2025-07-13 4b275f2093954cc58bbc23e4fc67e67d6fe81c0b
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
<template>
  <div v-show="status == 0" class="map-mode-change p-events-auto">
    <template v-for="(item, index) in menu" :key="item.path">
      <a :class="btnClz(item.selected)" @click="navTo(index)">
        <div>{{ item.name }}</div>
      </a>
      <!-- <a class="btn-selected mode-btn m-r-8" @click="navTo(index)">
        <div>{{ item.name }}</div>
      </a> -->
    </template>
    <!-- <a class="mode-btn btn-selected">
      <div>污染溯源</div>
    </a>
    <a class="mode-btn btn-unselected margin-left-8">
      <div>走航监测</div>
    </a>
    <a class="mode-btn btn-unselected margin-left-8">
      <div>网格化监测</div>
    </a> -->
    <!-- <div class="flexbox-col">
      <a id="btn_more" class="btn-unselected margin-left-8">
        <div id="mode_selected">其他模式</div>
      </a>
      <div
        id="mode_others"
        class="flexbox-col"
        style="display: none; position: absolute; margin-top: 40px"
      >
        <a id="btn_gridmonitor" class="mode-btn mode-btn-other btn-unselected margin-left-8">
          <div>网格化监测</div>
        </a>
        <a id="btn_electricity" class="mode-btn mode-btn-other btn-unselected margin-left-8">
          <div>用电量监测</div>
        </a>
        <a id="btn_weight" class="mode-btn mode-btn-other btn-unselected margin-left-8">
          <div>风险模型</div>
        </a>
      </div>
    </div> -->
  </div>
</template>
 
<script>
import { mapState } from 'pinia';
import { useMapAnimationStore } from '@/stores/map-animation';
 
export default {
  data() {
    return {
      menu: [
        {
          name: '污染溯源',
          path: 'hmode',
          selected: true
        },
        {
          name: '走航监测',
          path: 'rmode'
        },
        {
          name: '走航融合',
          path: 'underwaymix'
        }
        // {
        //   name: '污染溯源2',
        //   path: 'hmode2'
        // }
        // {
        //   name: '网格化监测',
        //   path: 'gridmonitor'
        // }
        // {
        //   name: '用电量监测',
        //   path: 'emode'
        // },
        // {
        //   name: '风险模型',
        //   path: 'riskmode'
        // },
      ]
    };
  },
  computed: {
    ...mapState(useMapAnimationStore, ['status'])
  },
  methods: {
    btnClz(selected) {
      return (
        'mode-btn ' + (selected ? 'btn-selected ' : 'btn-unselected ') + 'm-r-8'
      );
    },
    navTo(index) {
      const m = this.menu;
      m.forEach((e) => {
        e.selected = false;
      });
      m[index].selected = true;
      this.$router.push(m[index].path);
    }
  },
  mounted() {
    this.navTo(0);
  }
};
</script>
<style scoped>
.map-mode-change {
  display: inline-flex;
  position: relative;
  /* left: 10px; */
  /* top: 104px; */
  padding: 0 10px;
  font-size: 1rem;
  font-weight: 900;
  /* background-color: #ffffffad; */
}
 
.map-mode-change a:hover {
  color: antiquewhite;
}
 
.mode-btn {
  white-space: nowrap;
  background-color: green;
}
 
.map-mode-change .btn-selected {
  color: #ffffff;
  padding: 4px 16px;
  cursor: pointer;
  border: 2px solid var(--border-color);
  background-color: #23dad1;
  transform: skew(-30deg);
  text-decoration: none;
  /* -moz-border-radius: 6px; Old Firefox */
  /* box-shadow: 5px 0px 2.5px #888888; */
}
 
.map-mode-change .btn-selected div {
  transform: skew(30deg);
}
 
.map-mode-change .btn-unselected {
  color: #5555557e;
  padding: 4px 16px;
  cursor: pointer;
  background-color: #ffffff;
  border: 2px solid #00000015;
  transform: skew(-30deg);
  text-decoration: none;
  /* -moz-border-radius: 6px; Old Firefox */
  /* box-shadow: 5px 0px 2.5px #888888; */
}
 
.map-mode-change .btn-unselected div {
  transform: skew(30deg);
}
</style>