Browse Source

平台-首页

gzb
wangzhonglu 8 months ago
parent
commit
50b024cd5a

+ 1
- 0
src/assets/echartsMap/china.json
File diff suppressed because it is too large
View File


+ 12522
- 0
src/assets/echartsMap/coordChinaMap.json
File diff suppressed because it is too large
View File


+ 828
- 7
src/views/platformSection/home/index.vue View File

@@ -1,25 +1,786 @@
1 1
 <template>
2 2
   <div class="main_root">
3 3
     <div class="row_item">
4
-      <div class="cell_item left_w max_h"></div>
5
-      <div class="cell_item right_w max_h"></div>
4
+      <div class="cell_item left_w max_h">
5
+        <div class="regin_info">
6
+          <div class="regin_info_item">
7
+            <div class="regin_info_num">
8
+              {{ regionOverviewInfo.devicenum || 0 }}<span>台</span>
9
+            </div>
10
+            <div class="regin_info_title">设备数</div>
11
+          </div>
12
+          <div class="regin_info_item">
13
+            <div class="regin_info_num">
14
+              {{ regionOverviewInfo.usernum || 0 }}<span>人</span>
15
+            </div>
16
+            <div class="regin_info_title">用户数</div>
17
+          </div>
18
+          <div class="regin_info_item">
19
+            <div class="regin_info_num">
20
+              {{ regionOverviewInfo.regionnum || 0 }}<span>个</span>
21
+            </div>
22
+            <div class="regin_info_title">区域数</div>
23
+          </div>
24
+          <div class="regin_info_item">
25
+            <div class="regin_info_num">
26
+              {{ regionOverviewInfo.schoolnum || 0 }}<span>所</span>
27
+            </div>
28
+            <div class="regin_info_title">学校数</div>
29
+          </div>
30
+        </div>
31
+        <div id="mapAreaEcharts"></div>
32
+      </div>
33
+      <div class="cell_item right_w max_h">
34
+        <div class="cell_header">
35
+          <div>区域概况</div>
36
+        </div>
37
+        <div class="content_main">
38
+          <div class="table_wrap">
39
+            <Table
40
+              :max-height="534"
41
+              :columns="regionColumns"
42
+              :data="regionOverviewInfo.regionList"
43
+            ></Table>
44
+          </div>
45
+        </div>
46
+      </div>
6 47
     </div>
7 48
     <div class="row_item">
8
-      <div class="cell_item left_w"></div>
9
-      <div class="cell_item right_w"></div>
49
+      <div class="cell_item left_w device_info">
50
+        <div class="device_info_left">
51
+          <div class="cell_header">
52
+            <div>设备类型</div>
53
+          </div>
54
+          <div class="content_main" id="deviceModelEcharts"></div>
55
+        </div>
56
+        <div class="device_info_right">
57
+          <div class="cell_header">
58
+            <div>客户端版本</div>
59
+          </div>
60
+          <div class="content_main">
61
+            <div id="controlVersionEcharts"></div>
62
+            <div id="appVersionEcharts"></div>
63
+          </div>
64
+        </div>
65
+      </div>
66
+      <div class="cell_item right_w">
67
+        <div class="cell_header">
68
+          <div>应用下载</div>
69
+        </div>
70
+        <div class="content_main" id="appDownloadEcharts"></div>
71
+      </div>
10 72
     </div>
11 73
     <div class="row_item">
12
-      <div class="cell_item"></div>
74
+      <div class="cell_item">
75
+        <div class="cell_header">
76
+          <div>设备活跃度</div>
77
+          <Select
78
+            v-model="deviceActivityInfo.doEvent"
79
+            :transfer="true"
80
+            @on-change="getDeviceActivityList()"
81
+            style="width: 100px; font-size: 14px; font-weight: 400"
82
+          >
83
+            <Option :value="1">最近一月</Option>
84
+            <Option :value="2">最近一周</Option>
85
+          </Select>
86
+        </div>
87
+        <div class="content_main" id="deviceActivityEcharts"></div>
88
+      </div>
13 89
     </div>
14 90
   </div>
15 91
 </template>
16 92
 
17 93
 <script>
94
+import {
95
+  ra_list_rv,
96
+  ra_list_dm,
97
+  ra_list_cc,
98
+  ra_list_sc,
99
+  ra_list_ad,
100
+  ra_list_da
101
+} from "@/api/ra";
102
+import * as echarts from "echarts";
103
+import coordChinaMap from "@/assets/echartsMap/coordChinaMap.json";
18 104
 export default {
19 105
   data() {
20
-    return {};
106
+    return {
107
+      // 概况信息
108
+      regionOverviewInfo: {
109
+        usernum: 0,
110
+        devicenum: 0,
111
+        regionnum: 0,
112
+        schoolnum: 0,
113
+        regionList: [],
114
+        provinceList: []
115
+      },
116
+      regionColumns: [
117
+        {
118
+          type: "index",
119
+          title: "序号",
120
+          width: 70,
121
+          align: "center"
122
+        },
123
+        {
124
+          title: "区域名称",
125
+          key: "regionName",
126
+          align: "center"
127
+        },
128
+        {
129
+          title: "学校数",
130
+          key: "schoolnum",
131
+          align: "center"
132
+        },
133
+        {
134
+          title: "设备数",
135
+          key: "devicenum",
136
+          align: "center"
137
+        },
138
+        {
139
+          title: "用户数",
140
+          key: "usernum",
141
+          align: "center"
142
+        }
143
+      ],
144
+      // 设备类型信息
145
+      deviceModelList: [],
146
+      // 客户端版本-管控应用
147
+      controlVersionList: [],
148
+      // 客户端版本-应用商店
149
+      appVersionList: [],
150
+      // 应用下载
151
+      appDownloadList: [],
152
+      // 设备活跃度
153
+      deviceActivityInfo: {
154
+        // 1最近一月2最近一周
155
+        doEvent: 2,
156
+        list: []
157
+      }
158
+    };
159
+  },
160
+  computed: {
161
+    powerParams() {
162
+      return this.$store.getters.powerParams;
163
+    }
164
+  },
165
+  created() {
166
+    this.getRegionOverview();
167
+    this.getDeviceModelList();
168
+    this.getControlVersionList();
169
+    this.getAppVersionList();
170
+    this.getAppDownloadList();
171
+    this.getDeviceActivityList();
21 172
   },
22
-  methods: {}
173
+  methods: {
174
+    // 概况信息
175
+    getRegionOverview() {
176
+      ra_list_rv({
177
+        rtype: this.powerParams.rtype,
178
+        objectid: this.powerParams.objectid
179
+      }).then((data) => {
180
+        if (data.code === 0) {
181
+          this.regionOverviewInfo = data.obj;
182
+          this.initMapEcharts();
183
+        } else {
184
+          this.$Message.error(data.msg);
185
+        }
186
+      });
187
+    },
188
+    initMapEcharts() {
189
+      let _registerMap = echarts.getMap("china");
190
+      if (!_registerMap) {
191
+        echarts.registerMap("china", {
192
+          geoJSON: require("@/assets/echartsMap/china.json")
193
+        });
194
+      }
195
+      let allData = [];
196
+      this.regionOverviewInfo.provinceList.forEach((item) => {
197
+        allData.push({
198
+          label: {
199
+            show: true,
200
+            color: "#fff"
201
+          },
202
+          name: item.areaName.replace(/省|市/g, ""),
203
+          value: item.devicenum,
204
+          numInfo: {
205
+            schoolnum: item.devicenum,
206
+            usernum: item.usernum,
207
+            devicenum: item.devicenum
208
+          }
209
+        });
210
+      });
211
+      let geoCoordMap = coordChinaMap;
212
+      let convertData = (outdata) => {
213
+        let res = [];
214
+        for (let i = 0; i < outdata.length; i++) {
215
+          let geoCoord = geoCoordMap[outdata[i].name];
216
+          if (geoCoord) {
217
+            res.push({
218
+              name: outdata[i].name,
219
+              value: geoCoord.concat(outdata[i].value),
220
+              //单独修改圆环上的文字
221
+              label: {
222
+                formatter: () => {
223
+                  return (
224
+                    outdata[i] &&
225
+                    outdata[i].numInfo &&
226
+                    outdata[i].numInfo.devicenum
227
+                  );
228
+                }
229
+              },
230
+              itemStyle: {
231
+                color: "#FF243A"
232
+              }
233
+            });
234
+          }
235
+        }
236
+        return res;
237
+      };
238
+      let options = {
239
+        tooltip: {
240
+          show: true,
241
+          borderColor: "#6AC8F0",
242
+          // 将tooltip限制在图表内
243
+          confine: true,
244
+          // 将tooltip添加到body下
245
+          appendTo: "body",
246
+          formatter: (params) => {
247
+            return `${params.name}<div>设备数:${
248
+              (params.numInfo && params.numInfo.devicenum) || 0
249
+            } 台</div>
250
+            <div>用户数:${
251
+              (params.numInfo && params.numInfo.usernum) || 0
252
+            } 人</div>
253
+            <div>学校数:${
254
+              (params.numInfo && params.numInfo.schoolnum) || 0
255
+            } 所</div>`;
256
+          }
257
+        },
258
+        visualMap: {
259
+          show: false,
260
+          seriesIndex: [0],
261
+          inRange: {
262
+            color: ["#A5DCF4", "#006edd"]
263
+          }
264
+        },
265
+        geo: {
266
+          map: "china",
267
+          zoom: 1.2,
268
+          show: true,
269
+          roam: false,
270
+          emphasis: {
271
+            label: {
272
+              show: false
273
+            },
274
+            areaColor: "#01215c"
275
+          },
276
+          layoutSize: "100%",
277
+          itemStyle: {
278
+            borderColor: "#0085F7",
279
+            borderWidth: 1
280
+          }
281
+        },
282
+        series: [
283
+          {
284
+            type: "map",
285
+            map: "china",
286
+            aspectScale: 0.75,
287
+            zoom: 1.2,
288
+            label: {
289
+              show: false,
290
+              color: "#fff"
291
+            },
292
+            itemStyle: {
293
+              areaColor: "#0085F7",
294
+              borderColor: "#fff",
295
+              borderWidth: 1
296
+            },
297
+            emphasis: {
298
+              label: {
299
+                show: true,
300
+                color: "#fff"
301
+              },
302
+              itemStyle: { areaColor: "#6AC8F0" }
303
+            },
304
+            select: {
305
+              label: {
306
+                show: true,
307
+                color: "#fff"
308
+              },
309
+              itemStyle: { areaColor: "#A5CC82" }
310
+            },
311
+            data: allData
312
+          },
313
+          {
314
+            type: "scatter",
315
+            coordinateSystem: "geo",
316
+            zlevel: 2,
317
+            rippleEffect: {
318
+              period: 4,
319
+              brushType: "stroke",
320
+              scale: 4
321
+            },
322
+            label: {
323
+              show: true,
324
+              color: "#fff"
325
+            },
326
+            // #FF243A
327
+            symbol: "pin", //定位图标样式
328
+            symbolSize: 60,
329
+            //点的名称和经纬度
330
+            data: convertData(allData)
331
+          }
332
+        ]
333
+      };
334
+      const eInstance = echarts.init(document.getElementById("mapAreaEcharts"));
335
+      eInstance.clear();
336
+      eInstance.setOption(options);
337
+    },
338
+    // 设备类型信息
339
+    getDeviceModelList() {
340
+      ra_list_dm({
341
+        rtype: this.powerParams.rtype,
342
+        objectid: this.powerParams.objectid
343
+      }).then((data) => {
344
+        if (data.code === 0) {
345
+          this.deviceModelList = data.obj;
346
+          this.initDeviceModelEcharts();
347
+        } else {
348
+          this.$Message.error(data.msg);
349
+        }
350
+      });
351
+    },
352
+    initDeviceModelEcharts() {
353
+      let legendNameList = [];
354
+      let seriesDataList = [];
355
+      this.deviceModelList.forEach((item) => {
356
+        legendNameList.push(item.deviceModel);
357
+        seriesDataList.push({
358
+          value: item.devicenum,
359
+          name: item.deviceModel
360
+        });
361
+      });
362
+      const options = {
363
+        tooltip: {
364
+          trigger: "item",
365
+          formatter: (params) => {
366
+            return `${params.name}:${params.value}`;
367
+          }
368
+        },
369
+        legend: {
370
+          bottom: "10",
371
+          left: "center",
372
+          itemWidth: 10,
373
+          itemHeight: 10,
374
+          //图例距离饼图的距离
375
+          itemGap: 10,
376
+          orient: "horizontal",
377
+          data: legendNameList,
378
+          textStyle: {
379
+            color: "#253A70"
380
+          }
381
+        },
382
+        color: ["#52C41A", "#FF811A"],
383
+        series: [
384
+          {
385
+            type: "pie",
386
+            name: "设备类型",
387
+            radius: ["25%", "35%"],
388
+            center: ["50%", "45%"],
389
+            label: {
390
+              formatter: (params) => {
391
+                return `${params.name}\n${params.value}`;
392
+              },
393
+              borderWidth: 1,
394
+              borderRadius: 4,
395
+              color: "#7C8DB5",
396
+              fontSize: 12,
397
+              lineHeight: 18
398
+            },
399
+            data: seriesDataList
400
+          }
401
+        ]
402
+      };
403
+      const eInstance = echarts.init(
404
+        document.getElementById("deviceModelEcharts")
405
+      );
406
+      eInstance.clear();
407
+      eInstance.setOption(options);
408
+    },
409
+    // 客户端版本-管控应用
410
+    getControlVersionList() {
411
+      ra_list_cc({
412
+        rtype: this.powerParams.rtype,
413
+        objectid: this.powerParams.objectid
414
+      }).then((data) => {
415
+        if (data.code === 0) {
416
+          this.controlVersionList = data.obj;
417
+          this.initControlVersionEcharts();
418
+        } else {
419
+          this.$Message.error(data.msg);
420
+        }
421
+      });
422
+    },
423
+    initControlVersionEcharts() {
424
+      let seriesDataList = [];
425
+      this.controlVersionList.forEach((item) => {
426
+        seriesDataList.push({
427
+          value: item.num,
428
+          name: item.cversion
429
+        });
430
+      });
431
+      const options = {
432
+        tooltip: {
433
+          trigger: "item",
434
+          formatter: (params) => {
435
+            return `${params.name}:${params.value}`;
436
+          }
437
+        },
438
+        legend: {
439
+          bottom: "10",
440
+          left: "center",
441
+          itemWidth: 10,
442
+          itemHeight: 10,
443
+          //图例距离饼图的距离
444
+          itemGap: 10,
445
+          orient: "horizontal",
446
+          data: ["管控应用"],
447
+          textStyle: {
448
+            color: "#253A70"
449
+          }
450
+        },
451
+        color: ["#6B30FF", "#FF87C1"],
452
+        series: [
453
+          {
454
+            type: "pie",
455
+            name: "管控应用",
456
+            radius: ["25%", "35%"],
457
+            center: ["50%", "45%"],
458
+            label: {
459
+              formatter: (params) => {
460
+                return `${params.name}\n${params.value}`;
461
+              },
462
+              borderWidth: 1,
463
+              borderRadius: 4,
464
+              color: "#7C8DB5",
465
+              fontSize: 12,
466
+              lineHeight: 18
467
+            },
468
+            data: seriesDataList
469
+          }
470
+        ]
471
+      };
472
+      const eInstance = echarts.init(
473
+        document.getElementById("controlVersionEcharts")
474
+      );
475
+      eInstance.clear();
476
+      eInstance.setOption(options);
477
+    },
478
+    // 客户端版本-应用商店
479
+    getAppVersionList() {
480
+      ra_list_sc({
481
+        rtype: this.powerParams.rtype,
482
+        objectid: this.powerParams.objectid
483
+      }).then((data) => {
484
+        if (data.code === 0) {
485
+          this.appVersionList = data.obj;
486
+          this.initAppEcharts();
487
+        } else {
488
+          this.$Message.error(data.msg);
489
+        }
490
+      });
491
+    },
492
+    initAppEcharts() {
493
+      let seriesDataList = [];
494
+      this.appVersionList.forEach((item) => {
495
+        seriesDataList.push({
496
+          value: item.num,
497
+          name: item.cversion
498
+        });
499
+      });
500
+      const options = {
501
+        tooltip: {
502
+          trigger: "item",
503
+          formatter: (params) => {
504
+            return `${params.name}:${params.value}`;
505
+          }
506
+        },
507
+        legend: {
508
+          bottom: "10",
509
+          left: "center",
510
+          itemWidth: 10,
511
+          itemHeight: 10,
512
+          //图例距离饼图的距离
513
+          itemGap: 10,
514
+          orient: "horizontal",
515
+          data: ["应用商店"],
516
+          textStyle: {
517
+            color: "#253A70"
518
+          }
519
+        },
520
+        color: ["#ED4A99", "#FF87C1"],
521
+        series: [
522
+          {
523
+            type: "pie",
524
+            name: "应用商店",
525
+            radius: ["25%", "35%"],
526
+            center: ["50%", "45%"],
527
+            label: {
528
+              formatter: (params) => {
529
+                return `${params.name}\n${params.value}`;
530
+              },
531
+              borderWidth: 1,
532
+              borderRadius: 4,
533
+              color: "#7C8DB5",
534
+              fontSize: 12,
535
+              lineHeight: 18
536
+            },
537
+            data: seriesDataList
538
+          }
539
+        ]
540
+      };
541
+      const eInstance = echarts.init(
542
+        document.getElementById("appVersionEcharts")
543
+      );
544
+      eInstance.clear();
545
+      eInstance.setOption(options);
546
+    },
547
+    // 应用下载
548
+    getAppDownloadList() {
549
+      ra_list_ad({
550
+        rtype: this.powerParams.rtype,
551
+        objectid: this.powerParams.objectid
552
+      }).then((data) => {
553
+        if (data.code === 0) {
554
+          this.appDownloadList = data.obj;
555
+          this.initAppDownloadEcharts();
556
+        } else {
557
+          this.$Message.error(data.msg);
558
+        }
559
+      });
560
+    },
561
+    initAppDownloadEcharts() {
562
+      let xAxisDataList = [];
563
+      let seriesDataList = [];
564
+      this.appDownloadList.forEach((item) => {
565
+        xAxisDataList.push(item.appName);
566
+        seriesDataList.push(item.num || 0);
567
+      });
568
+      let options = {
569
+        color: ["#339DFF"],
570
+        tooltip: {
571
+          trigger: "item",
572
+          formatter: (params) => {
573
+            return `${params.name}:${params.value}次`;
574
+          }
575
+        },
576
+        legend: {
577
+          bottom: "10",
578
+          left: "center",
579
+          itemWidth: 10,
580
+          itemHeight: 10,
581
+          //图例距离饼图的距离
582
+          itemGap: 10,
583
+          orient: "horizontal",
584
+          data: ["应用名称"],
585
+          textStyle: {
586
+            color: "#253A70"
587
+          }
588
+        },
589
+        grid: {
590
+          top: 50,
591
+          left: 50,
592
+          right: 20,
593
+          bottom: 50,
594
+          containLabel: true
595
+        },
596
+        xAxis: [
597
+          {
598
+            type: "category",
599
+            axisLabel: {
600
+              textStyle: {
601
+                color: "#333"
602
+              },
603
+              interval: 0,
604
+              rotate: 0
605
+            },
606
+            data: xAxisDataList,
607
+            axisTick: {
608
+              alignWithLabel: true
609
+            }
610
+          }
611
+        ],
612
+        yAxis: [
613
+          {
614
+            name: "次",
615
+            minInterval: 1,
616
+            axisLine: {
617
+              show: false
618
+            },
619
+            axisTick: {
620
+              show: false
621
+            },
622
+            splitLine: {
623
+              //网格线
624
+              lineStyle: {
625
+                type: "dotted" //设置网格线类型 dotted:虚线   solid:实线
626
+              },
627
+              show: true //隐藏或显示
628
+            },
629
+            type: "value"
630
+          }
631
+        ],
632
+        series: [
633
+          {
634
+            name: "应用名称",
635
+            type: "bar",
636
+            barWidth: 32,
637
+            barGap: 0,
638
+            label: {
639
+              normal: {
640
+                show: true,
641
+                align: "center",
642
+                verticalAlign: "bottom",
643
+                position: "top",
644
+                distance: 0,
645
+                formatter: `{c}`
646
+              }
647
+            },
648
+            data: seriesDataList
649
+          }
650
+        ]
651
+      };
652
+      const eInstance = echarts.init(
653
+        document.getElementById("appDownloadEcharts")
654
+      );
655
+      eInstance.clear();
656
+      eInstance.setOption(options);
657
+    },
658
+    // 设备活跃度
659
+    getDeviceActivityList() {
660
+      ra_list_da({
661
+        rtype: this.powerParams.rtype,
662
+        objectid: this.powerParams.objectid,
663
+        doEvent: this.deviceActivityInfo.doEvent
664
+      }).then((data) => {
665
+        if (data.code === 0) {
666
+          this.deviceActivityInfo.list = data.obj;
667
+          this.initDeviceActivityEcharts();
668
+        } else {
669
+          this.$Message.error(data.msg);
670
+        }
671
+      });
672
+    },
673
+    initDeviceActivityEcharts() {
674
+      let xAxisDataList = [];
675
+      let seriesDataList = [];
676
+      this.deviceActivityInfo.list.forEach((item) => {
677
+        xAxisDataList.push(item.date);
678
+        seriesDataList.push(item.num || 0);
679
+      });
680
+      let options = {
681
+        color:
682
+          this.deviceActivityInfo.doEvent === 2 ? ["#52C41A"] : ["#339DFF"],
683
+        tooltip: {
684
+          trigger: "item",
685
+          formatter: (params) => {
686
+            return `${params.name}:${params.value}次`;
687
+          }
688
+        },
689
+        legend: {
690
+          show: false
691
+        },
692
+        grid: {
693
+          top: 20,
694
+          left: 50,
695
+          right: 20,
696
+          bottom: 40,
697
+          containLabel: true
698
+        },
699
+        xAxis: [
700
+          {
701
+            type: "category",
702
+            axisLabel: {
703
+              textStyle: {
704
+                color: "#333"
705
+              },
706
+              interval: 0,
707
+              rotate: 0
708
+            },
709
+            data: xAxisDataList,
710
+            axisTick: {
711
+              alignWithLabel: true
712
+            }
713
+          }
714
+        ],
715
+        yAxis: [
716
+          {
717
+            minInterval: 1,
718
+            axisLine: {
719
+              show: false
720
+            },
721
+            axisTick: {
722
+              show: false
723
+            },
724
+            splitLine: {
725
+              //网格线
726
+              lineStyle: {
727
+                type: "dotted" //设置网格线类型 dotted:虚线   solid:实线
728
+              },
729
+              show: true //隐藏或显示
730
+            },
731
+            type: "value"
732
+          }
733
+        ],
734
+        series: [
735
+          {
736
+            name: "设备活跃度",
737
+            type: "line",
738
+            smooth: true,
739
+            areaStyle: {
740
+              normal: {
741
+                color: new echarts.graphic.LinearGradient(
742
+                  0,
743
+                  0,
744
+                  0,
745
+                  1,
746
+                  this.deviceActivityInfo.doEvent === 2
747
+                    ? [
748
+                        { offset: 0, color: "rgba(82, 196, 26, 0.4)" },
749
+                        { offset: 0.5, color: "rgba(82, 196, 26, 0.2)" },
750
+                        { offset: 0.9, color: "rgba(82, 196, 26, 0)" }
751
+                      ]
752
+                    : [
753
+                        { offset: 0, color: "rgba(51, 157, 255, 0.4)" },
754
+                        { offset: 0.5, color: "rgba(51, 157, 255, 0.2)" },
755
+                        { offset: 0.9, color: "rgba(51, 157, 255, 0)" }
756
+                      ],
757
+                  false
758
+                ),
759
+                shadowColor: "rgba(0, 0, 0, 0.1)",
760
+                shadowBlur: 10
761
+              }
762
+            },
763
+            label: {
764
+              normal: {
765
+                show: true,
766
+                align: "center",
767
+                verticalAlign: "bottom",
768
+                position: "top",
769
+                distance: 0,
770
+                formatter: `{c}`
771
+              }
772
+            },
773
+            data: seriesDataList
774
+          }
775
+        ]
776
+      };
777
+      const eInstance = echarts.init(
778
+        document.getElementById("deviceActivityEcharts")
779
+      );
780
+      eInstance.clear();
781
+      eInstance.setOption(options);
782
+    }
783
+  }
23 784
 };
24 785
 </script>
25 786
 
@@ -51,7 +812,67 @@ export default {
51 812
       &.max_h {
52 813
         height: 600px;
53 814
       }
815
+      &.device_info {
816
+        display: flex;
817
+        justify-content: space-between;
818
+        .device_info_left {
819
+          width: 33.33%;
820
+          height: 100%;
821
+        }
822
+        .device_info_right {
823
+          width: 66.66%;
824
+          height: 100%;
825
+        }
826
+      }
827
+      .cell_header {
828
+        position: relative;
829
+        display: flex;
830
+        justify-content: space-between;
831
+        align-items: center;
832
+        margin: 16px;
833
+        font-size: 16px;
834
+        line-height: 1;
835
+        font-weight: bold;
836
+      }
837
+      .content_main {
838
+        width: 100%;
839
+        height: calc(100% - 48px);
840
+        #controlVersionEcharts,
841
+        #appVersionEcharts {
842
+          display: inline-block;
843
+          width: 50%;
844
+          height: 100%;
845
+        }
846
+      }
847
+    }
848
+  }
849
+}
850
+.regin_info {
851
+  display: flex;
852
+  justify-content: flex-start;
853
+  align-items: center;
854
+  margin: 16px;
855
+  .regin_info_item {
856
+    margin-left: 20px;
857
+    margin-right: 30px;
858
+    text-align: center;
859
+    .regin_info_num {
860
+      font-size: 24px;
861
+      font-weight: bold;
862
+      > span {
863
+        margin-left: 4px;
864
+        font-size: 12px;
865
+      }
866
+    }
867
+    .regin_info_title {
868
+      margin-top: 6px;
869
+      font-size: 14px;
870
+      color: #798cb5;
54 871
     }
55 872
   }
56 873
 }
874
+#mapAreaEcharts {
875
+  width: 100%;
876
+  height: calc(100% - 76px);
877
+}
57 878
 </style>

+ 20
- 1
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -860,7 +860,26 @@ export default {
860 860
       const options = {
861 861
         tooltip: {
862 862
           trigger: "item",
863
-          formatter: "{b}: {d}%"
863
+          formatter: (params) => {
864
+            let memoryInfo = {
865
+              value: params.value,
866
+              unit: "B"
867
+            };
868
+            if (memoryInfo.value / 1024 < 1024) {
869
+              memoryInfo.value =
870
+                Math.floor((memoryInfo.value / 1024) * 100) / 100;
871
+              memoryInfo.unit = "KB";
872
+            } else if (memoryInfo.value / 1024 / 1024 < 1024) {
873
+              memoryInfo.value =
874
+                Math.floor((memoryInfo.value / 1024 / 1024) * 100) / 100;
875
+              memoryInfo.unit = "MB";
876
+            } else {
877
+              memoryInfo.value =
878
+                Math.floor((memoryInfo.value / 1024 / 1024 / 1024) * 100) / 100;
879
+              memoryInfo.unit = "GB";
880
+            }
881
+            return `${params.name}:${memoryInfo.value}${memoryInfo.unit}`;
882
+          }
864 883
         },
865 884
         legend: {
866 885
           bottom: "10",

Loading…
Cancel
Save