guonan
2025-04-16 0face36fd79ce30127c80d131b1bc41106133f3b
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
<template>
  <div class="navigation">
    <div class="navigation-contents" v-show="!simBtn">
      <div
        class="navigation-item bg1"
        :class="{ 'bg1-active': currentIndexs == 1 }"
        @click="handleClickHome(1)"
      >
        综合展示
      </div>
      <div
        class="navigation-item bg2"
        :class="{ 'bg2-active': currentIndexs == 2 }"
        @click="handleClickHome(2)"
        style="margin-left: 15%"
      >
        模拟仿真
      </div>
    </div>
    <div class="navigation-content" v-show="simBtn">
      <div
        class="navigation-item bg1"
        :class="{ 'bg1-active': currentIndex == 1 }"
        @click="handleClick(1)"
      >
        隐患概览
      </div>
      <div
        class="navigation-item bg2"
        :class="{ 'bg2-active': currentIndex == 2 }"
        @click="handleClick(2)"
      >
        综合监测
      </div>
      <div
        class="navigation-item bg3"
        :class="{ 'bg3-active': currentIndex == 3 }"
        @click="handleClick(3)"
      >
        仿真推演
      </div>
      <div
        class="navigation-item bg4"
        :class="{ 'bg4-active': currentIndex == 4 }"
        @click="handleClick(4)"
      >
        模拟评价
      </div>
    </div>
    <div class="navigation-bg"></div>
  </div>
</template>
 
<script setup>
import { useRouter } from "vue-router";
import { useSimStore } from "@/store/simulation";
import { ref } from "vue";
 
const simBtn = ref(false);
const currentIndexs = ref(1);
 
const router = useRouter();
const simStore = useSimStore();
const isShow = ref(false);
const { handleNavClick } = simStore;
const currentIndex = ref(0);
const handleClick = (index) => {
  handleNavClick(index);
  currentIndex.value = index;
  // 处理特定城市逻辑
  if (index === 1) {
    isShow.value = !isShow.value;
    let desc = null;
    if (defaultCity === "北京市") {
      desc = {
        func_name: "HiddenFronTag",
        Name: "channel",
        visibility: isShow.value,
      };
    } else {
      desc = {
        Simulation: true,
        type: "POI",
        tag: "POI-GS",
        Visible: isShow.value,
      };
    }
    ps.emitMessage(desc);
  }
 
  // 路由跳转
  const routes = ["", "/yhgl", "/zhjc", "/mnfz", "/mnpg"];
  router.push(routes[index]);
};
const handleClickHome = (index) => {
  if (index === 1) {
    router.push("/");
  } else {
    simBtn.value = true;
  }
};
</script>
 
<style lang="less" scoped>
@import url("../../assets/css/navigation.css");
</style>