|
@@ -8,7 +8,7 @@
|
|
|
|
|
|
<script>
|
|
|
import * as echarts from 'echarts';
|
|
|
- import {getSblxtj} from '@/api/bigdata'
|
|
|
+ import {getSblxtj,selectDeviceType} from '@/api/bigdata'
|
|
|
|
|
|
export default {
|
|
|
name: 'enterprise',
|
|
@@ -36,16 +36,26 @@
|
|
|
},
|
|
|
sblxtj() {
|
|
|
let that = this
|
|
|
- getSblxtj().then(resp => {
|
|
|
- that.data_sblxtj_deviceCount = resp.data.deviceCount
|
|
|
- that.data_sblxtj_deviceType = resp.data.deviceType
|
|
|
- for (let i = 0; i < resp.data.deviceCount.length; i++) {
|
|
|
+ selectDeviceType().then(resp => {
|
|
|
+ resp.data.forEach(item=>
|
|
|
+ {
|
|
|
+ that.data_sblxtj_deviceCount.push(item.deviceCount)
|
|
|
+ that.data_sblxtj_deviceType.push(item.deviceName)
|
|
|
that.deviceTypeCount.push({
|
|
|
- value: resp.data.deviceCount[i],
|
|
|
- name: resp.data.deviceType[i],
|
|
|
+ value: item.deviceCount,
|
|
|
+ name: item.deviceName,
|
|
|
itemStyle: { color: that.color16() }
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
+ // that.data_sblxtj_deviceCount = resp.data.deviceCount
|
|
|
+ // that.data_sblxtj_deviceType = resp.data.deviceType
|
|
|
+ // for (let i = 0; i < resp.data.deviceCount.length; i++) {
|
|
|
+ // that.deviceTypeCount.push({
|
|
|
+ // value: resp.data.deviceCount[i],
|
|
|
+ // name: resp.data.deviceType[i],
|
|
|
+ // itemStyle: { color: that.color16() }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
that.myEcharts()
|
|
|
})
|
|
|
},
|