瀏覽代碼

统计分析

王通 2 年之前
父節點
當前提交
396ffea43a

+ 1 - 1
src/views/bigdata/chart-equipmentDistribution.vue

@@ -3,7 +3,7 @@
   <div class="chart-container">
     <!-- <div id="camera1" style="width: 100%; height:25vh; ">
         </div> -->
-    <div id="camera2" style="width: 100%; height:85vh; ">
+    <div id="camera2" style="width: 100%; height:55vh; ">
     </div>
     <!-- <div id="camera3" style="width: 100%; height:30vh; ">
         </div> -->

+ 18 - 8
src/views/bigdata/chart-equipmentType.vue

@@ -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()
         })
       },

+ 10 - 4
src/views/bigdata/tabbar.vue

@@ -13,7 +13,7 @@
 
 <script>
 
-  import {getZhxx} from '@/api/bigdata'
+  import {getZhxx,selectDeviceType} from '@/api/bigdata'
 
   export default {
     data() {
@@ -143,9 +143,15 @@
           that.regionNum = [];
           that.regionNum.push(...resp.data.event)
           that.regionNum.push(...resp.data.data)
-          for(let i in resp.data.device){
-            that.regionNum.push({value: resp.data.device[i].deviceCount,name: resp.data.device[i].deviceName})
-          }
+            selectDeviceType().then(res => {
+              res.data.forEach(item=>
+              {
+                that.regionNum.push({value: item.deviceCount,name: item.deviceName})
+                })
+            })
+          // for(let i in resp.data.device){
+          //   that.regionNum.push({value: resp.data.device[i].deviceCount,name: resp.data.device[i].deviceName})
+          // }
 
         })
       },