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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<template>
  <div class="societyGovern">
    <div class="topBtnRow">
      <!-- <button class="buttonStyle" @click="chenge('OverviewScenicSpots')">景区概览</button>
      <button class="buttonStyle" @click="chenge('MonitoringEarlyWarning')">监测预警</button>
      <button class="buttonStyle" @click="chenge('VideoFusion')">视频融合</button>
      <button class="buttonStyle" style="margin-right: 0px;" @click="chenge('PopularAttractions')">热门景点</button> -->
      <!-- <div class="topBtn" :style="{ backgroundImage: 'url(' + (active == 1 ? coverImgUrl : uncoverImgUrl) + ')' }"
        @click="chenge('OverviewScenicSpots', '1')">
        景区概览</div>
      <div class="topBtn" :style="{ backgroundImage: 'url(' + (active == 2 ? coverImgUrl : uncoverImgUrl) + ')' }"
        @click="chenge('MonitoringEarlyWarning', '2')">
        监测预警</div>
      <div class="topBtn" :style="{ backgroundImage: 'url(' + (active == 3 ? coverImgUrl : uncoverImgUrl) + ')' }"
        @click="chenge('VideoFusion', '3')">
        视频融合</div>
      <div class="topBtn" :style="{ backgroundImage: 'url(' + (active == 4 ? coverImgUrl : uncoverImgUrl) + ')' }"
        @click="chenge('PopularAttractions', '4')">
        热门景点</div> -->
    </div>
    <OverviewScenicSpots v-show="typeIdx == 1" class="subassembly"></OverviewScenicSpots>
    <MonitoringEarlyWarning v-show="typeIdx == 2" class="subassembly"></MonitoringEarlyWarning>
    <PopularAttractions v-show="typeIdx == 3" class="subassembly"></PopularAttractions>
    <VideoFusion v-show="typeIdx == 4" class="subassembly"></VideoFusion>
  </div>
</template>
 
<script>
import MonitoringEarlyWarning from "./subassembly/MonitoringEarlyWarning.vue";
import OverviewScenicSpots from "./subassembly/OverviewScenicSpots.vue";
import PopularAttractions from "./subassembly/PopularAttractions.vue";
import VideoFusion from "./subassembly/VideoFusion.vue";
 
import publicToilets from "./publicToilets.vue";
import manholeCoverMag from "./manholeCoverMag.vue";
import manholeCoverWarning from "./manholeCoverWarning.vue";
import videoSurveillance from "./videoSurveillance.vue";
import waterPointDetection from "./waterPointDetection.vue";
export default {
  name: "societyGovern",
  components: {
    VideoFusion,
    PopularAttractions,
    OverviewScenicSpots,
    MonitoringEarlyWarning,
    publicToilets,
    manholeCoverMag,
    manholeCoverWarning,
    videoSurveillance,
    waterPointDetection
  },
  data() {
    return {
      echertGroup: {
        OverviewScenicSpots: false,
        PopularAttractions: false,
        VideoFusion: false,
        MonitoringEarlyWarning: false,
      },
      coverImgUrl: require('@/assets/img/park_btn_active.png'),
      uncoverImgUrl: require('@/assets/img/park_btn.png'),
      active: 0,
      typeIdx: 1,
    }
  },
  methods: {
    chenge(str, index) {
      if (this.active == index) {
        this.active = 0
      } else {
        this.active = index
      }
      for (let key in this.echertGroup) this.echertGroup[key] = false
      this.echertGroup[str] = true
      this.$store.commit("changeEchartsUpdata", this.$store.state.echartsUpdata + 1);
    }
  },
  watch: {
    "$store.state.currentMenu": function (val)  {
      let index = 0
      console.log("type",val)
      switch (val) {
        case '景区概览':
          index = 1
          break;
 
        case '监测预警':
          index = 2
          break;
 
        case '融合监控':
          index = 3
          break;
 
        case '热门景点':
          index = 4
          break;
 
        default:
          index = 0
          break;
      }
      if (this.typeIdx == index) {
        // this.typeIdx = 0
      } else {
        this.typeIdx = index
      }
      console.log(this.typeIdx)
 
      this.$nextTick(() => [
        window.dispatchEvent(new Event('resize'))//初始化echarts
      ])
    }
  },
 
 
}
</script>
 
<style scoped lang="less">
.societyGovern {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
 
  .topBtnRow {
    position: absolute;
    bottom: 140px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    pointer-events: all;
    display: flex;
    flex-direction: row;
    justify-content: center;
 
    .topBtn {
      width: 104.5px;
      height: 38px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      /*
      //align-items: center;
      */
      line-height: 3;
      font-size: 11px;
      color: #ffffff;
      cursor: pointer;
 
      background-image: url("~@/assets/img/topBtnBack.png");
      background-repeat: no-repeat;
      background-size: 100% 100%;
      letter-spacing: 1.1px;
      text-shadow: -0.87px 0.5px 4px 0px rgba(5, 27, 54, 0.42);
      font-weight: 700;
    }
  }
 
  .subassembly {
    height: 100%;
    width: 100%;
    pointer-events: none;
  }
 
  .bottom {
    position: absolute;
    bottom: 150px;
    width: 40%;
    height: 40px;
    left: 50%;
    margin-left: -20%;
    pointer-events: auto;
 
    .buttonStyle {
      width: 22%;
      height: 100%;
      color: #fff;
      margin-right: 4%;
      background-color: rgba(60, 60, 60, 0.5);
      border: 1px solid #aaa;
    }
 
    .buttonStyle:hover {
      background-color: rgba(90, 90, 90, 0.5);
      cursor: pointer;
    }
  }
 
  .aside {
    width: 20%;
    height: auto;
    padding-top: 80px;
    padding-bottom: 60px;
    color: aliceblue;
 
    .asideContent {
      height: 952.5px;
      background-color: rgba(24, 47, 78, 0.5);
      border-radius: 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
  }
}
</style>