1
Surpriseplus
2022-09-16 8d1a91c23df335b090e38b2edd15203aa3b03da9
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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
<template>
  <div class="equipment">
    <div class="title">
      <span>特种设备</span>
      <img src="../../../assets/img/zonlan (9).png" alt="" />
    </div>
    <div class="content">
      <!-- <div class="btn_box">
        <el-select v-model="value" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-select v-model="value" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-button icon="el-icon-search">查询</el-button>
      </div> -->
      <div class="details">
        <div class="left">
          <div class="title">全市定检率</div>
          <div class="details_box" id="details_pie"></div>
          <div class="details_box" id="details_PC"></div>
        </div>
        <div class="right">
          <div class="title">
            设备总数: <i>{{ val1 }}</i>
          </div>
          <div class="details_box">
            <div class="list">
              <div class="ico"></div>
              <span>压力管道</span>
              <i>{{ val2 }}</i>
            </div>
 
            <div class="list">
              <div class="ico"></div>
              <span>压力容器</span>
              <i>{{ val3 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>锅炉</span>
              <i>{{ val4 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>客运索道</span>
              <i>{{ val5 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>起重机械</span>
              <i>{{ val6 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>电梯</span>
              <i>{{ val7 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>大型游乐设施</span>
              <i>{{ val8 }}</i>
            </div>
            <div class="list">
              <div class="ico"></div>
              <span>场(厂)专用机动车辆</span>
              <i>{{ val9 }}</i>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      value: "",
      val1: null,
      val2: null,
      val3: null,
      val4: null,
      val5: null,
      val6: null,
      val7: null,
      val8: null,
      val9: null,
      val10: null,
    };
  },
  //方法集合
  methods: {
    async drawLine() {
      const { data: dt } = await this.$http.get(
        "/jeecg-boot/specialeq/specialeq/queryall"
      );
      var valueData = dt.result;
      var data = [];
      for (var i in valueData) {
        if (valueData[i].name == "全市定检率") {
          data.push({
            name: "装备制造",
            value: parseFloat(valueData[i].value),
          });
        } else if (valueData[i].name == "设备总数") {
          this.val1 = valueData[i].value;
        } else if (valueData[i].name == "压力管道") {
          this.val2 = valueData[i].value;
        } else if (valueData[i].name == "压力容器") {
          this.val3 = valueData[i].value;
        } else if (valueData[i].name == "锅炉") {
          this.val4 = valueData[i].value;
        } else if (valueData[i].name == "客运索道") {
          this.val5 = valueData[i].value;
        } else if (valueData[i].name == "起重机械") {
          this.val6 = valueData[i].value;
        } else if (valueData[i].name == "电梯") {
          this.val7 = valueData[i].value;
        } else if (valueData[i].name == "大型游乐设施") {
          this.val8 = valueData[i].value;
        } else if (valueData[i].name == "场(厂)专用机动车辆") {
          this.val9 = valueData[i].value;
        }
      }
 
      let Chart = this.$echarts.init(document.getElementById("details_pie"));
      let ChartOne = this.$echarts.init(document.getElementById("details_PC"));
      var titleArr = [],
        seriesArr = [];
      var colors = [["#00FF9B", "#dfeaff"]];
      data.forEach(function (item, index) {
        seriesArr.push({
          name: item.name,
          type: "pie",
          clockWise: false,
          radius: [100, 110],
          itemStyle: {
            normal: {
              color: colors[index][0],
              shadowColor: colors[index][0],
              shadowBlur: 0,
              label: {
                show: false,
              },
              labelLine: {
                show: false,
              },
            },
          },
          hoverAnimation: false,
          center: ["50%", "50%"],
          data: [
            {
              value: item.value,
              label: {
                normal: {
                  formatter: function (params) {
                    return params.value + "%";
                  },
                  position: "center",
                  show: true,
                  textStyle: {
                    fontSize: "30",
                    fontWeight: "bold",
                    color: "#fff",
                  },
                },
              },
            },
            {
              value: 100 - item.value,
              name: "invisible",
              itemStyle: {
                normal: {
                  color: colors[index][1],
                },
                emphasis: {
                  color: colors[index][1],
                },
              },
            },
          ],
        });
      });
 
      let option = {
        backgroundColor: "#113A78",
        title: titleArr,
        series: seriesArr,
      };
      let optionONE = {
        title: titleArr,
        series: seriesArr,
      };
      // 绘制图表
      Chart.setOption(option);
      ChartOne.setOption(optionONE);
    },
  },
  mounted() {
    this.drawLine();
  },
  created() {},
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.equipment {
  overflow: hidden;
  height: 50%;
  background: rgba(8, 32, 58, 0.7);
  box-sizing: border-box;
  .title {
    width: 100%;
    position: relative;
    img {
      width: 100%;
    }
    span {
      font-size: 78px;
      font-weight: 400;
      color: #ffe86b;
      background: linear-gradient(0deg, #bce7ff 0%, #69efff 98.6572265625%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      position: absolute;
      left: 50%;
      top: 0;
      transform: translateX(-50%);
    }
  }
  .content {
    .btn_box {
      padding-top: 66px;
      display: flex;
      align-items: center;
      .el-select {
        margin-right: 22px;
      }
      .el-button {
        width: 194px;
        height: 96px;
        font-size: 48px;
        font-weight: 400;
        color: #ffffff;
        // border-radius: 10px;
        background: rgba(0, 186, 255, 0.26);
      }
    }
    .details {
      padding-top: 47px;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      .left {
        width: 29%;
        .title {
          width: 100%;
          height: 152px;
          background: rgba(4, 141, 43, 0.5);
          font-size: 68px;
          font-weight: bold;
          color: #eff7ff;
          text-align: center;
          line-height: 152px;
        }
        .details_box {
          height: 788px;
          width: 100%;
        }
        #details_PC {
          display: none;
        }
      }
      .right {
        width: 69%;
        .title {
          margin-bottom: 32px;
          width: 100%;
          height: 152px;
          background: rgba(110, 148, 247, 0.5);
          font-size: 68px;
          font-weight: bold;
          color: #eff7ff;
          text-align: center;
          line-height: 152px;
          i {
            color: #fedc85;
          }
        }
        .details_box {
          height: 788px;
          width: 100%;
          display: flex;
          justify-content: space-between;
          flex-wrap: wrap;
 
          .list {
            width: 49%;
            height: 120px;
            background: url("../../../assets/img/设备.png") no-repeat center;
            background-size: 100% 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            .ico {
              width: 58px;
              height: 62px;
              background: url("../../../assets/img/压力管道.png") no-repeat
                center;
              background-size: 100% 100%;
              margin-right: 64px;
              margin-left: 30px;
            }
            span {
              font-size: 58px;
              font-weight: 500;
              color: #feffff;
            }
            i {
              margin-right: 58px;
              margin-left: auto;
              font-size: 63px;
              font-weight: 400;
              font-style: italic;
              color: #ffee98;
            }
          }
          .list:nth-child(2) {
            .ico {
              background: url("../../../assets/img/压力容器.png") no-repeat
                center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(3) {
            .ico {
              background: url("../../../assets/img/锅炉.png") no-repeat center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(4) {
            .ico {
              background: url("../../../assets/img/客运索道.png") no-repeat
                center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(5) {
            .ico {
              background: url("../../../assets/img/塔吊.png") no-repeat center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(6) {
            .ico {
              background: url("../../../assets/img/消防电梯.png") no-repeat
                center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(7) {
            width: 100%;
            background: url("../../../assets/img/设备 拷贝 7.png") no-repeat
              center;
            background-size: 100% 100%;
            .ico {
              background: url("../../../assets/img/游乐设施.png") no-repeat
                center;
              background-size: 100% 100%;
            }
          }
          .list:nth-child(8) {
            width: 100%;
            background: url("../../../assets/img/设备 拷贝 7.png") no-repeat
              center;
            background-size: 100% 100%;
            .ico {
              width: 58px;
              height: 62px;
              background: url("../../../assets/img/机动车辆保险.png") no-repeat
                center;
              background-size: 100% 100%;
            }
          }
        }
      }
    }
  }
  .content /deep/.el-select {
    // position: absolute;
    // top: 60px;
    // right: 60px;
    background-color: #053469;
    width: 412px;
    height: 96px;
    .el-input {
      background-color: #053469;
      width: 100%;
      height: 100%;
      .el-input__inner {
        background-color: #053469;
        width: 100%;
        height: 100%;
        color: #fff;
        font-size: 40px;
      }
      .el-input__suffix {
        padding-right: 28px;
      }
    }
    .selectFrom {
      height: auto;
 
      .el-select-dropdown__item {
        font-size: 40px !important;
        //   padding: 80px 0 !important;
        margin-top: 20px;
 
        margin-bottom: 20px;
      }
    }
  }
}
@media only screen and (max-width: 2560px) {
  .equipment {
    height: auto;
    overflow: visible;
    background: transparent;
    .content {
      .btn_box {
        display: none;
        .el-button {
          width: calc(194px * 2);
          font-size: 48px;
          font-weight: 400;
          color: #ffffff;
          // border-radius: 10px;
          background: rgba(0, 186, 255, 0.26);
        }
      }
      .details {
        .left {
          width: 100%;
          #details_pie {
            display: none;
          }
          #details_PC {
            display: block;
          }
          .title {
            height: calc(152px * 2);
 
            line-height: calc(152px * 2);
            background: none;
          }
          .details_box {
            height: calc(788px * 2);
          }
        }
        .right {
          width: 100%;
          margin-top: 10%;
          .title {
            height: calc(152px * 2);
 
            line-height: calc(152px * 2);
          }
          .details_box {
            height: calc(788px * 2);
 
            .list {
              height: calc(120px * 2);
 
              .ico {
                width: calc(58px * 2);
                height: calc(62px * 2);
                margin-right: calc(64px * 2);
                margin-left: calc(30px * 5);
              }
              i {
                margin-right: calc(58px * 2);
              }
            }
          }
        }
      }
    }
    .content /deep/.el-select {
      width: calc(412px * 2);
    }
  }
}
</style>