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
| <template>
| <div class="bar">
| <div class="line">
| <div
| class="btn"
| :class="currentRian === item.name ? 'active' : ''"
| v-for="item in list"
| :key="item"
| @click="handleClick(item)"
| >
| {{ item.name }}
| </div>
| </div>
| </div>
| </template>
|
| <script setup>
| import { ref, defineEmits, onUnmounted } from "vue"
| const currentRian = ref("")
| const list = ref([
| {
| name: "小雨",
| type: "RainLight",
| },
| {
| name: "大雨",
| type: "RainMid",
| },
| {
| name: "爆雨",
| type: "RainHeavy",
| },
| {
| name: "泥石流",
| type: "Flow",
| },
| ])
| function handleClick(row) {
| currentRian.value = row.name
| ps.emitMessage({ Simulation: true, type: "Ending", EnableWeather: true })
| let desc = { Simulation: true, type: row.type, EnableWeather: true }
| ps.emitMessage(desc)
| }
| onUnmounted(() => {
| ps.emitMessage({ Simulation: true, type: "Ending", EnableWeather: true })
| })
| </script>
|
| <style lang="less" scoped>
| .bar {
| display: flex;
| justify-content: center;
| position: absolute;
| bottom: 100px;
| left: 50%;
| transform: translateX(-50%);
| background: url("@/assets/img/menubar/bar.png");
| width: 838px;
| height: 108px;
| .line {
| margin-top: 35px;
| background: url("@/assets/img/menubar/mid.png");
| width: 723px;
| height: 12px;
| display: flex;
| justify-content: space-between;
| }
| .btn {
| margin-top: -12px;
| width: 105px;
| height: 35px;
| line-height: 35px;
| font-size: 16px;
| font-weight: 700;
| color: #fff;
| text-align: center;
| cursor: pointer;
| background: url("@/assets/img/menubar/btn.png");
| &.active {
| background: url("@/assets/img/menubar/btn-active.png");
| }
| }
| }
| </style>
|
|