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
<template>
  <div>
    <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 totayNum" :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 totalNum" :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 totalNum" :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 class="unit-text">万m³</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: 70vh"></div>
    </div>
  </div>
</template>
<script>
import * as echarts from 'echarts'
import echartsGL from 'echarts-gl'
import datajson from './jimunai'
// import { listWsStation, listWsStationCount } from '@/cpx_sewage/api/operationManage/siteOverview'
// import { getLargeScreenProcessInfo } from '@/cpx_sewage/api/largeScreen/largeScreen'
export default {
  data() {
    return {
      totayNum: '3216', // 今日累计处理量
      yearNum: '25.2', // 本年累计处理量
      totalNum: '25.2', // 总累计处理量
      myChart: null,
      stationData: [],
      processData: [],
      data:[
        { name: '托普铁热克乡', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '托普铁热克镇', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '吉木乃镇', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '喀尔交乡', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '乌拉斯特镇', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '托斯特乡', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '恰勒什海乡', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '别斯铁热克乡', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 },
        { name: '兵团一八六团', value: (Math.random() * 1000 + 100).toFixed(0), num: 0 }
        // 托普铁热克镇、吉木乃镇、喀尔交乡、托斯特乡、兵团一八六团、别斯铁热克乡、恰勒什海乡、托普铁热克乡
      ]
    }
  },
  created() {
    // this.handData()
    // 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: {
    getData() {
      getLargeScreenProcessInfo().then(res => {
        this.processData = res.data || []
        this.processData.forEach(ele => {
          if (ele.code === 'waterProcessToday') {
            this.totayNum = ele.count
          }
          if (ele.code === 'waterProcessSum') {
            this.totalNum = ele.count
          }
          ele.firstEle = ele.name.slice(0, 1)
          ele.endEle = ele.name.slice(1, -1)
        })
      })
    },
    handData() {
      this.totayNum = [...this.totayNum]
      this.yearNum = [...this.yearNum]
      this.totalNum = [...this.totalNum]
    },
    initCharts() {
      const charts = echarts.init(this.$refs['mapcontainer'])
      let airData = this.data
      const option = {
        visualMap: {
          show: false,
          min: 200,
          max: 1000,
          calculable: true, // 拖拽手柄
          realtime: false,
          inRange: {
            color: ['#2884db', '#244779'],
            show: false
          },
          textStyle: {
            color: '#000'
          }
        },
        tooltip: {
          trigger: 'item',
          backgroundColor: 'rgba(0, 0, 0, 0)',
          // formatter: function(params) {
          //   if (typeof params.value[2] == 'undefined') {
          //     return params.name + ' : ' + params.value
          //   } else {
          //     return params.name + ' : ' + params.value[2]
          //   }
          // }
          formatter: function(params) {
            let res = ''
            res += `<div style="max-height:0.8rem;border-radius:5px;border-top:1px solid #02bcf4;border-right:1px solid #02bcf4;border-bottom:1px solid #0893eb;border-left:5px solid #0990ef;padding:.1rem .2rem;max-width:2rem;background:rgba(4,26,52,0.7);">
                  <div>
                    <p style="color:#fff;">${params.name}</p>
                    <p>
                    <span>${params.data.num}</span>
                    </p>
                  </div>
                </div>`
            return res
          }
        },
        geo: {
          itemStyle: {
            normal: {
              areaColor: '#000'
            }
          }
        },
        series: [
          {
            tooltip: {
              trigger: 'item'
            },
            zlevel: 1,
            name: 'china',
            type: 'map3D',
            map: 'china',
            boxDepth: 130, // 地图倾斜度
            regionHeight: 4, // 地图厚度
            label: {
              show: true, // 是否显示市
              // textStyle: {
              //   color: '#fff', // 文字颜色
              //   fontSize: 12, // 文字大小
              //   fontFamily: '微软雅黑',
              //   backgroundColor: 'rgba(0,10,34,0)', // 透明度0清空文字背景
              //   borderColor: '#000a22'
              // },
              normal: {
                show: true,
                // formatter: '{b}: {c}',
                formatter: function(value) {
                  // return value.value
                  // value.data.num = value.data.num == 0 ? '' : value.data.num
                  // if (value.data.num == 0) {
                  //   console.log('aaa')
                  //   return ''
                  // } else {
                  //   return '22222'
                  // }
                  if (value.data.num == 0 || value.data.num == '0') {
                    return ' '
                  } else {
                    return value.data.num
                  }
                },
                textStyle: {
                  color: '#fff',
                  fontSize: 14,
                  fontFamily: '微软雅黑',
                  backgroundColor: 'rgba(0,0,0,0)', // 透明度0清空文字背景
                  borderColor: '#000'
                }
              }
            },
            itemStyle: {
              opacity: 0.9, // 透明度
              borderWidth: 0.8, // 分界线宽度
              borderColor: '#000' // 分界线颜色
            },
            groundplane: {
              show: false
            },
            data: airData,
            // shading: 'realistic',
            // 真实感材质相关配置 shading: 'realistic'时有效
            realisticMaterial: {
              detailTexture: '#000', // 纹理贴图
              textureTiling: 1, // 纹理平铺,1是拉伸,数字表示纹理平铺次数
              roughness: 1, // 材质粗糙度,0完全光滑,1完全粗糙
              metalness: 1, // 0材质是非金属 ,1金属
              roughnessAdjust: 0
            },
            viewControl: {
              projection: 'perspective',
              distance: 120,
              center: [-5, -22, 0]
              // center: [0, -10, 0]
            }
          }
        ],
        // dataRange: {
        //     show: false,
        //     splitList: splitList
        // },
        animation: false
      }
 
      // 地图注册,第一个参数的名字必须和option.geo.map一致
      echarts.registerMap('china', datajson)
      charts.setOption(option)
      // charts.on('click', function(value) {
      //   console.log(23232,value);
      // })
    },
    // 获取乡镇站点数据
    getStationList() {
      const self = this
      listWsStationCount({
        // stationTypeCode: 'zdgw'
      }).then((res) => {
        this.stationData = res.data.treeData
        // console.log(res.data.treeData)
        this.data = this.data.map((item, index, arr) => {
          // console.log(item.name)
          // var test = this.stationData.find(function(ele) {
          //   console.log('ele', ele.name)
          //   return item.name === ele.name
          // })
          // console.log(test)
          this.stationData.forEach(ele => {
            // console.log('ele', ele)
            if (item.name === ele.name) {
              item.num = ele.notOnline + ele.online
            }
          })
          return item
        })
      })
    }
  }
}
</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;
  }
}
</style>