DESKTOP-GJP2N7J\lx
2023-08-11 49cd08187c9c49df199a954bd0a5a5bca40f8f1a
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
<template>
  <div style="position:relative">
    <div style="display: flex; justify-content: space-around; margin-bottom: 1vh">
      <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 v-for="(item,index) in processData" :key="index">
        <div class="num-title">
          <div><span class="high-text">{{ item.firstEle }}</span>{{ item.endEle }}</div>
 
        </div>
        <div class="num-item">
          <span class="num-style color0" :class="[{ 'num-bg0': s !== '.' && index==0 },{ 'num-bg2': s !== '.' && index==1 },{'color2':index==1}]" v-for="(s, i) in item.count" :key="i">{{ s }}</span>
          <span class="unit-text">{{ item.unit }}</span>
        </div>
      </div> -->
    </div>
    <div>
      <!-- <div id="echartMap" style="width: 500px; height: 500px"></div> -->
      <!--地图-->
      <div id="mapcontainer" ref="mapcontainer" style="width: 9rem; height: 80vh"></div>
      <div class="map-infos">
        <dv-border-box-13>
          <div class="map-title">吉木乃县</div>
          <div class="map-item">
            <div class="item-title">安装水表数量:</div> <div class="item-num">328个</div>
          </div>
          <div class="map-item">
            <div class="item-title">累计用水量:</div> <div class="item-num">2943.8 m³</div>
          </div>
          <div class="map-item">
            <div class="item-title">当前欠费数量:</div><div class="item-num">3 户</div>
          </div>
        </dv-border-box-13>
      </div>
    </div>
  </div>
</template>
<script>
import * as echarts from 'echarts'
import echartsGL from 'echarts-gl'
import datajson from './jimunai'
import { getScAmount } from '@/api/largeScreen'
// import { getLargeScreenProcessInfo } from '@/cpx_sewage/api/largeScreen/largeScreen'
export default {
  data() {
    return {
      amountTotal: [], // 今日累计处理量
      amountCurYearTotal: [], // 本年累计处理量
      amountYesterdayTotal: [], // 总累计处理量
      myChart: null,
      stationData: [],
      processData: [],
      data:[
        { name: '托普铁热克乡', value: (Math.random() * 1000 + 100).toFixed(0), centroid: [87.047533,47.875751], num: 1 },
        { name: '托普铁热克镇', value: (Math.random() * 1000 + 100).toFixed(0), centroid: [85.885448,47.439013],num: 1 },
        { name: '吉木乃镇', value: (Math.random() * 1000 + 100).toFixed(0),centroid: [85.882013,47.44893], num: 0 },
        { name: '喀尔交乡', value: (Math.random() * 1000 + 100).toFixed(0), centroid: [86.410528,47.201893],num: 0 },
        { name: '乌拉斯特镇', value: (Math.random() * 1000 + 100).toFixed(0),centroid: [85.782084,47.669236], num: 5 },
        { name: '托斯特乡', value: (Math.random() * 1000 + 100).toFixed(0), centroid: [86.13412,47.285077],num: 0 },
        { name: '恰勒什海乡', value: (Math.random() * 1000 + 100).toFixed(0),centroid: [86.153288,47.535675], num: 0 },
        { name: '别斯铁热克乡', value: (Math.random() * 1000 + 100).toFixed(0),centroid: [85.88913,47.309702], num: 0 },
        { name: '兵团一八六团', value: (Math.random() * 1000 + 100).toFixed(0),centroid: [85.678458,47.556221], num: 0 }
        // 托普铁热克镇、吉木乃镇、喀尔交乡、托斯特乡、兵团一八六团、别斯铁热克乡、恰勒什海乡、托普铁热克乡
      ]
    }
  },
  created() {
    this.getScAmount()
    // setTimeout(this.initChart, 5000)
    // this.initChart()
    // this.totalNum = (+this.baseInfos.totalProcess / 10000).toFixed(2)
  },
  props: {
    baseInfos: {
      type: Object,
      default: () => {}
    }
  },
  watch: {
 
 
  },
  mounted() {
    // this.getData()
    this.$nextTick(() => {
      // this.getStationList()
      this.initCharts()
    })
  },
  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
          })
        }
      })
    },
    initCharts() {
      const charts = echarts.init(this.$refs['mapcontainer'])
      let airData = this.data
      const option = {
        visualMap: {
         type: 'continuous',
         show: false,
         showLabel: true,
         left: '50',
         min: 0,
         inRange: {
            color: ['#0B3B79', '#146fd7']
         },
        //  seriesIndex:'0'
      },
      tooltip: {
         show: false
      },
      geo: {
         show: true,
         map: 'HUMAP',
         selectedMode: 'single',
         zoom:  1,
         roam: false,
         label: {
            normal: {
               show: false, // 省份名展示
               color: '#FFF',
            },
            emphasis: {
               show: true
            }
         },
         itemStyle: { // 最外层轮廓
            normal: {
               borderColor: '#2FB5FA',
               borderWidth: 2,
               shadowColor: '#01273F',
               shadowOffsetX: 0,
               shadowOffsetY: 10
            }
         }
      },
      series: [
         {
            name: 'light',
            zlevel: 30,
            type: 'effectScatter',
            coordinateSystem: 'geo',
            data: airData,
            symbolSize: [8, 4],
            show:true,
            // encode: {
            //    value: 2
            // },
            showEffectOn: 'render', // 绘制完成后显示特效
            rippleEffect: {
               brushType: 'stroke',
              //  color: '#0efacc',
              //  period: 9,
              //  scale: 5
            },
            label: {
               show: false,
               color: '#FFF',
               formatter: '{b}',
               offset: [0, -12]
            },
            hoverAnimation: true,
         },
         {
            type: 'map',
            zlevel: 20,
            map: 'HUMAP',
            roam: false,
            zoom: 1,
            showLegendSymbol: true, // 存在legend时显示
            label: {
               show: true,
               color: '#fff'
            },
            itemStyle: {
               normal: {
                  borderColor: '#2FB5FA',
                  borderWidth: 2
               },
               emphasis: {
                  areaColor: '#2C7FD6',
                  label: {
                     show: true
                  }
               }
            },
            data: airData
         },
      ]
 
      }
      const dealWithData = (data) => {
      return data.map(item => {
         return {
            name: item.name,
            value: item.value,
            centroid: item.centroid,
            center: item.centroid
            // adcode: item.properties.adcode,
         }
      })
   }
   let dataValue = dealWithData(airData)
   option.series[1].data = dataValue;
   option.series[0].data = dataValue.map(item => {
      return {
         name: item.name,
         value: item.value,
         itemStyle: {
            normal: {
               color: '#0efacc'
            }
         },
        //  adcode: item.adcode,
      }
   })
      // 地图注册,第一个参数的名字必须和option.geo.map一致
      echarts.registerMap('HUMAP', datajson)
      charts.setOption(option)
 
    }
  }
}
</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;
  }
 
}
.map-infos {
    // border: 1px dashed #ddd;
    width: 4.0rem;
    position: absolute;
    top: 1rem;
    right: 0.5rem;
    // margin-top: 0.5rem;
    font-size: .2rem;
    color: #d0cbcb;
  }
.map-title {
  padding: 0.15rem;
  text-align: center;
}
.map-item {
  display: flex;
  padding: 0.15rem;
  font-size: .2rem;
  align-items: center;
  .item-title {
    width: 50%;
    font-size: 0.1rem;
    letter-spacing: 2px;
  }
  .item-num {
    font-family: 'screen-font';
  }
}
.dv-border-box-13 {
  padding: .2rem;
}
</style>