zhangchunxia
2024-05-06 a3bc1499023bfcca59d823aefae8c546e36e7a45
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
<template>
  <!-- 运营概况 -->
  <div class="panel">
    <div class="panel-header">运维数据</div>
    <div>
        <div>
            <div class="num-title">
            <div><span class="high-text">总</span>累计用水量</div>
            </div>
            <div class="num-item">
            <span class="num-style color0" :class="{ 'num-bg0': s !== '.' }" v-for="(s, i) in amountTotal" :key="i">{{ s }}</span>
            <!-- <span class="unit-text">m³</span> -->
            </div>
        </div>
        <div>
            <div class="num-title">
                <div><span class="high-text">本</span>年度累计用水量</div>
                </div>
                <div class="num-item">
                <span v-for="(s, i) in amountCurYearTotal" :key="i" class="num-style color2" :class="{ 'num-bg2': s !== '.' }">{{ s }}</span>
                <!-- <span class="unit-text">万m³</span> -->
            </div>
        </div>
        <div>
            <div class="num-title">
                <div><span class="high-text">昨</span>日累计用水量</div>
                </div>
                <div class="num-item">
                <span v-for="(s, i) in amountYesterdayTotal" :key="i" class="num-style color2" :class="{ 'num-bg2': s !== '.' }">{{ s }}</span>
                <!-- <span class="unit-text">万m³</span> -->
            </div>
        </div>
    </div>
  </div>
</template>
<script>
import { getScAmount } from '@/api/largeScreen'
export default {
  name: 'RightTop',
  props: {
    baseInfos: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      devopsData: []
    }
  },
  watch: {
    baseInfos: {
      handler(newValue) {
        this.baseInfos = newValue
      },
      immediate: true
    }
  },
  created() {
    this.getScAmount()
  },
  mounted() {
    // this.getData()
  },
  methods: {
    getScAmount() {
      const param = {"orgTag":"dy"}
      getScAmount(param).then(res=>{
        if (res.succ == 1) {
          this.amountTotal = res.amountTotal.toString().split("")
          this.amountCurYearTotal = res.amountCurYearTotal.toString().split("")
          this.amountYesterdayTotal = res.amountYesterdayTotal.toString().split("")
        } else {
          this.$message({
            type: 'error',
            message: res.message
          })
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.num-title {
  color: #fff;
  font-family: 'screen-font';
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.14rem;
  .high-text {
    font-size: 0.24rem;
    margin-right: 0.05rem;
  }
  .unit-text {
    font-size: 0.12rem;
    font-family: 'element-icons';
  }
}
 
.num-item {
  display: flex;
  // justify-content: space-between;
  overflow: hidden;
  align-items: flex-end;
  .num-style {
    font-size: 0.36rem;
    font-family: 'screen-font';
    padding: 0.05rem;
    background-size: 100% 100% !important;
  }
  .num-bg0 {
    background: url('../../../image/screen/bg_num_blue.png') no-repeat;
 
  }
  .num-bg1 {
    background: url('../../../image/screen/bg_num_green.png') no-repeat;
  }
  .num-bg2 {
    background: url('../../../image/screen/bg_num_cyan.png') no-repeat;
  }
  .color0 {
    color: #36a8ff;
  }
  .color1 {
    color: #00f170;
  }
  .color2 {
    color: #04ddff;
  }
  .unit-text {
    color: #fff;
    margin-left: 5px;
  }
 
}
  .panel-body{
    justify-content: space-around;
  }
  .info-items-top {
    width: 3.4rem;
    margin-bottom: .3rem;
    font-size: .14rem;
    text-align: center;
    .item-text {
      margin-top: 0.2rem;
      color: #fff;
    }
  }
 
  .info-items{
    width: 1.36rem;
    margin-bottom: .1rem;
    // display: flex;
    // justify-content: space-between;
    // align-items: center;
    text-align: center;
    font-size: .14rem;
    .item-text {
      margin-top: 0.3rem;
      color: #fff;
    }
    .info-img {
      width: .6rem;
      height: .6rem;
      img{
        width: 100%;
      }
    }
    .item-label {
      width: .64rem;
      font-size: .14rem;
      color: #fff;
    }
    .item-value {
      font-size: .1rem;
      color: #fff;
    }
    .item-num {
      font-family: 'screen-font';
      font-size: .20rem;
    }
  }
  .dv-decoration-9 {
    color: #fff;
    width: 1.36rem;
    height: 0.26rem;
  }
 
</style>