Xxxu
2020-07-07 4f953ffc89fc95f83b152e914c5e65938b440f17
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
<template>
  <div>
    <div class="charge-use-title">
        <div style="margin-left:30px;padding-top:8px">
            <img src="~@/assets/img/home/charge_icon.png" style="margin-top:0px" height="13px" width="15px">
            <span style="color:white">充电桩使用数据</span>
        </div>
    </div>
    <div class="charge-use-body">
        <el-row style="padding:20px;padding-bottom:10px" :gutter="5">
            <el-col style="text-align:center;font-size:16px;color:white" :span="6">
                <span>设备数</span>
            </el-col>
            <el-col style="text-align:center;font-size:16px;color:white" :span="6">
                <span>充电时间</span>
            </el-col>
            <el-col style="text-align:center;font-size:16px;color:white" :span="6">
                <span>总金额</span>
            </el-col>
            <el-col style="text-align:center;font-size:16px;color:white" :span="6">
                <span>总收益</span>
            </el-col>
        </el-row>
        <el-row style="padding-left:20px;padding-right:20px;margin-top:0px" :gutter="5">
            <el-col :span="6">
                <div class="use-energy">
                    <span style="color:white">{{deviceNum}}</span>
                    <span style="color:white">台</span>
                </div>
            </el-col>
            <el-col :span="6">
                <div class="charge-time">
                    <span style="color:white">5600h</span>
                </div>
            </el-col>
            <el-col :span="6">
                <div class="total-money">
                    <span style="color:white">2655元</span>
                </div>
            </el-col>
            <el-col :span="6">
                <div class="total-income">
                    <span style="color:white">1322元</span>
                </div>
            </el-col>          
        </el-row>
    </div>
    <div class="charge-use-bottom">
        <span style="color:#9A9D9F">数据截止至2020-01-08 00:00</span>
    </div>
  </div>
</template>
 
<script>
export default {
  data () {
    return {
      streetlightIdList: [],
      deviceNum: 0
    }
  },
  computed: {
    streetlightList () {
      return this.$store.state.home.homeStreetlightList
    }
  },
  watch: {
    streetlightList (curVal, oldVal) {
      var streetlightList = curVal
      let _this = this
      streetlightList.forEach(function (item, index) {
        _this.streetlightIdList.unshift(item.streetlightId)
      })
      this.getChargeInfo()
    }
  },
  components: {},
  activated () {},
 
  methods: {
    getChargeInfo () {
      var list = this.streetlightIdList
      this.$http({
        url: this.$http.adornUrl('/pole/polec2charging/getAllChargeInfo'),
        method: 'post',
        data: this.$http.adornData({
          streetlightIdList: list
        })
      }).then(({ data }) => {
        this.deviceNum = data.list.length
      })
    }
  }
}
</script>
<style>
.charge-use-title {
  height: 30px;
  width: 100%;
  background-image: url(~@/assets/img/content_charts_title.png);
  background-size: 100% 30px;
}
.charge-use-body {
  height: 150px;
  width: 100%;
  background-image: url(~@/assets/img/content_charts_body.png);
  background-size: 100% 120px;
}
.charge-use-bottom {
  text-align: center;
  height: 30px;
  width: 100%;
  background-image: url(~@/assets/img/content_charts_bottom.png);
  background-size: 100% 30px;
}
.use-energy {
  background-image: url(~@/assets/img/home/percent/blue_percent_30.png);
  background-size: 65px 65px;
  /* margin-left: 15%; */
  width: 65px;
  height: 65px;
  padding: 15px;
}
.charge-time {
  background-image: url(~@/assets/img/home/percent/blue_percent_20.png);
  background-size: 65px 65px;
  /* margin-left: 15%; */
  width: 65px;
  height: 65px;
  padding-left: 10px;
  padding-top: 20px;
}
.total-money {
  background-image: url(~@/assets/img/home/percent/red_percent_30.png);
  background-size: 65px 65px;
  /* margin-left: 15%; */
  width: 65px;
  height: 65px;
  padding-left: 10px;
  padding-top: 20px;
}
.total-income {
  background-image: url(~@/assets/img/home/percent/blue_percent_10.png);
  background-size: 65px 65px;
  /* margin-left: 15%; */
  width: 65px;
  height: 65px;
  padding-left: 10px;
  padding-top: 20px;
}
</style>