Blame view

public/bigScreen/js/box2.js 2.65 KB
c89819f7   wuxw   支持跳转至物联网和商城
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
  function _loadAssetRoom() {
  
      let param = {
          params: {
              communityId: vc.getCurrentCommunity().communityId
          }
      }
      vc.http.apiGet(
          '/bigScreen/getAssetsRepair',
          param,
          function (json, res) {
              //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
              let _json = JSON.parse(json);
              if (_json.code == 0) {
                  let _data = _json.data;
                  initRepair(_data.unDealCount, _data.dealingCount, _data.dealedCount);
                  return;
              }
          },
          function (errInfo, error) {
              console.log('请求失败处理');
  
              vc.toast(errInfo);
  
          });
  }
  
  function initRepair(unDealCount, dealingCount, dealedCount) {
      var dom = document.getElementById("box2");
      var myChart = echarts.init(dom);
      var app = {};
      option = null;
      var xAxisData = [];
  
      var emphasisStyle = {
          itemStyle: {
              barBorderWidth: 1,
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              shadowColor: 'rgba(0,0,0,0.5)'
          }
      };
  
      option = {
          tooltip: {
              trigger: 'item',
              formatter: '{a} <br/>{b}: {c} ({d}%)'
          },
          legend: {
              orient: 'vertical',
              left: 10,
              data: ['待处理', '处理中', '已处理']
          },
          color: ['red', 'yellow', 'green'],
          series: [
              {
                  name: '访问来源',
                  type: 'pie',
                  radius: ['50%', '70%'],
                  avoidLabelOverlap: false,
                  label: {
                      show: true,
                      position: 'top'
                  },
                  emphasis: {
                      label: {
                          show: true,
                          fontSize: '30',
                          fontWeight: 'bold'
                      }
                  },
                  labelLine: {
                      show: false
                  },
                  data: [
                      { value: unDealCount, name: '待处理' },
                      { value: dealingCount, name: '处理中' },
                      { value: dealedCount, name: '已处理' }
                  ],
                  itemStyle: {
                      normal: {
                          label: {
                              show: true,
                              formatter: '{b} : {c} '
                          },
                          labelLine: { show: true }
                      }
                  }
              }
          ]
      };
  
      if (option && typeof option === "object") {
          myChart.setOption(option, true);
      }
  
  }
  
  _loadAssetRoom();