陶杰
2024-11-29 0ae255185f422781f8a5cc4c52ad56ee0d3a1e6e
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<template>
  <div class="ITM-left m-l-d flex2">
    <!-- <div class="itm-container-top"> -->
    <!-- <div class="room top-desc">
                <div class="reg-img-1-2"></div>
                <div class="reg-num">
                    <span class="div1">{{ down }}</span>
                </div>
                <div class="desc1">待处理 Critical</div>
            </div>
            <div class="room top-desc">
                <div class="reg-img-1-1"></div>
                <div class="reg-num">
                    <span class="div2">{{ warning }}</span>
                </div>
                <div class="desc1">待处理 Warning</div>
            </div> -->
    <!-- </div> -->
 
    <!-- </div> -->
    <div class="itm-container-bottom">
      <div class="flex top-desc">
        <div class="desc1">网络布局</div>
        <div class="flex">
          <el-input placeholder="请输入ip地址" clearable class="input" @en v-model="searchip"></el-input>
          <el-button class="button" @click="searchAreaByIp">搜索</el-button>
        </div>
      </div>
      <div id="myDiv" class="service-list-arr">
        <div
            class="service-list-arr-item"
            v-for="(item, index) of areas"
            :key="index"
            @click="toArea(item.areaCode)"
        >
          <div class="service-list-arr-item_content" :class="[item.areaStatic&&item.areaStatic.alarm>0?'error':'']">
            {{ item.areaDeviceCount }}
            <!-- <span class="num">个</span> -->
          </div>
          <div class="dot" :class="[item.areaStatic&&item.areaStatic.alarm>0?'error':'']">{{ item.areaCode }}区</div>
        </div>
      </div>
 
      <div class="flex top-desc">
        <div class="desc1">告警预览</div>
      </div>
      <div class="container-equ">
        <itm-line :areas="areas"></itm-line>
      </div>
    </div>
 
    <div v-if="!chartclose" @click="closeself" class="chart-close"></div>
  </div>
</template>
<script>
import itmLine from "./components/chart-itm-line";
import {apiSearchAreaByIp} from "@/api/area";
 
export default {
  components: {itmLine},
  props: {
    areas: [],
    chartclose: false,
  },
  data() {
    return {
      num: 0,
      timer: null,
      down: 0,
      warning: 0,
      searchip: '',
    };
  },
  methods: {
    //获取数据
    closeself() {
      this.$emit("show", false);
    },
    toArea(areacode) {
      this.$router.push({path: "/area", query: {code: areacode}});
    },
    async searchAreaByIp() {
      if (this.searchip.trim()) {
        this.$modal.loading()
        const res = await apiSearchAreaByIp(this.searchip.trim())
        console.log('res', res)
        this.$modal.closeLoading()
        if (res && res.areaCode) {
          await this.$modal.confirm('此ip位于' + res.areaCode + '区,桥架端口:' + (res.networkPort||'-') + ',是否前往?')
          this.$router.push({path: "/area", query: {code: res.areaCode, networkPort: res.networkPort || ''}});
 
        } else {
          // this.$message.warning('未找到对应区域')
          await this.$modal.confirm('未找到对应区域是否前往交换机机柜引导页面?')
          this.$router.push({path: "/switch-board"});
        }
      }
    },
  },
  mounted() {
  },
  destroyed() {
  },
};
</script>
<style lang="scss" scoped>
.ITM-left {
  /* background: #e9f4fd; */
 
  width: 31.67rem;
  padding-left: $width-screen3-margin-d;
  padding-right: $width-screen3-margin-d;
  // padding-top: $width-screen3-margin-d * 1;
  position: fixed;
  padding-left: 0;
  top: calc($height-header - 2rem);
 
  /* max-height: 100vh; */
  /* overflow-y: scroll; */
  padding-left: $width-screen3-margin-d;
  padding-right: $width-screen3-margin-d;
  // padding-top: $width-screen3-margin-d * 1;
  position: fixed;
  width: 47.8rem;
  padding-left: $width-screen3-margin-d;
  padding-right: $width-screen3-margin-d;
  // padding-top: $width-screen3-margin-d * 1;
  position: fixed;
  /* position: absolute; */
  /* right: - 36rem; */
  /* right: 162.336rem; */
  left: -1rem;
 
  /* zoom: 0.8; */
  /* top: 2.818rem; */
  zoom: 1.12;
 
  /* top: 0; */
  /* top: calc($height-header - 0rem); */
  .chart-close {
    width: 2.6rem;
    height: 2.6rem;
    position: absolute;
    right: 5rem;
    top: 5rem;
    background-size: 100% 100%;
    background-image: url("../../assets/area/chart-cloase.svg");
    cursor: pointer;
    z-index: 3;
  }
 
  .itm-container-top {
    background: #e9f4fd;
    box-shadow: 0.5rem 0.33rem 2rem 0rem rgba(198, 212, 228, 0.38),
    inset 0rem 0.17rem 0.25rem 0rem rgba(255, 255, 255, 0.5);
    border-radius: 0.83rem;
    //padding: 2.5rem;
    height: 15.67rem;
    padding-top: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
 
    .room {
      width: 14.7rem;
    }
  }
 
  .itm-container-bottom {
    background: #e9f4fd;
    box-shadow: 0.5rem 0.33rem 2rem 0rem rgba(198, 212, 228, 0.38),
    inset 0rem 0.17rem 0.25rem 0rem rgba(255, 255, 255, 0.5);
    border-radius: 0.83rem;
    padding: 2.5rem;
    margin-top: 2rem;
    height: 86.3rem;
    max-height: 86.3rem;
    padding-top: 1rem;
    overflow-y: scroll;
 
    .service-list-arr {
      //background-color: #f2f8fd;
      //overflow: hidden;
      min-height: 62.3rem;
      width: 41rem;
      margin-left: -1rem;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      padding-top: 2rem;
 
      .service-list-arr-item {
        align-items: center;
        margin: 0 auto;
        margin-bottom: 1.2rem;
        position: relative;
 
        //width: 9.45rem;
        .service-list-arr-item_content {
          font-size: 2.8rem;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 600;
 
          text-align: center;
          font-family: Impact;
          color: #278afa;
          line-height: 8.7rem;
          background-image: url("../../assets/main-map/num_bg.png");
          width: 8.7rem;
          height: 8.7rem;
          background-size: 100% 100%;
 
          .num {
            font-size: 1.39rem;
            font-family: PingFangSC, PingFang SC;
            font-weight: 600;
            color: #117aee;
            line-height: 2rem;
          }
        }
 
        .service-list-arr-item_content.error {
          color: #fa2727;
        }
 
        .dot {
          line-height: 3.2rem;
          font-size: 2.11rem;
          font-family: PingFangSC, PingFang SC;
          font-weight: 600;
          color: #012b5e;
          line-height: 3.2rem;
          text-align: center;
        }
 
        .dot.error {
          color: #fa2727;
        }
      }
 
      .service-list-arr-item:hover::before {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
 
        content: "";
        background-color: #059ce293;
      }
 
      .service-list-arr-item:last-child {
        margin-left: 1rem;
      }
 
      .div2 {
        font-size: 2rem;
        font-family: Impact;
        color: #fda928;
        line-height: 2.42rem;
        text-align: center;
        margin-left: auto;
        margin-right: 0;
      }
    }
 
    //overflow-x: unset;
    .top-desc {
      margin-bottom: 1rem;
 
      .reg-img-1-1 {
        margin-top: 0.8rem;
        margin: 0 auto;
        background-size: 100% 100%;
        width: 6.42rem;
        height: 6.42rem;
        background-image: url("../../assets/screen/screen2/reg-img-1-1.png");
      }
 
      .reg-img-1-2 {
        margin: 0 auto;
        background-size: 100% 100%;
        width: 6.42rem;
        height: 6.42rem;
        background-image: url("../../assets/screen/screen2/reg-img-1-2.png");
      }
 
      .desc1 {
        font-size: 2.33rem;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #012b5e;
        line-height: 3.33rem;
        margin-top: 0.8rem;
        // margin: 1rem;
        margin-top: 1.5rem;
      }
 
      .input {
        margin-top: 1.3rem;
        height: 3.33rem;
        lin-height: 3.33rem;;
        margin-left: 1.5rem;
        width: 20rem;
      }
 
      .button {
        margin-top: 1.3rem;
        //height: 3.33rem;
        //lin-height: 3.33rem;;
      }
 
      .reg-num {
        text-align: center;
        margin: 0 auto;
        margin-top: 1.5rem;
 
        .div1 {
          font-size: 2rem;
          font-family: Impact;
          color: #c10b0b;
          line-height: 2.42rem;
          text-align: center;
          margin-left: auto;
          margin-right: 0;
        }
      }
    }
  }
}
</style>