瀏覽代碼

统计分析

王通 2 年之前
父節點
當前提交
5810f4717a
共有 2 個文件被更改,包括 20 次插入6 次删除
  1. 8 0
      src/api/bigdata.js
  2. 12 6
      src/views/bigdata/chart-equipmentDistribution.vue

+ 8 - 0
src/api/bigdata.js

@@ -44,6 +44,14 @@ export function getZhxx(param) {
   })
 }
 
+// 设备分布
+export function selectDeviceType() {
+  return request({
+    url: '/center-monitor/camera/selectDeviceType',
+    method: 'post',
+    data:{}
+  })
+}
 //起火原因
 export function getQhyy(param) {
   //暂时传当年,以后再说

+ 12 - 6
src/views/bigdata/chart-equipmentDistribution.vue

@@ -12,7 +12,7 @@
 
 <script>
   import * as echarts from 'echarts';
-  import {getSbfb} from '@/api/bigdata'
+  import {getSbfb,selectDeviceType} from '@/api/bigdata'
 
   export default {
     name: 'camera',
@@ -32,11 +32,17 @@
 
     methods: {
       sbfb() {
-        let that = this
-        getSbfb().then(resp => {
-          that.data_sbfb = resp.data;
-          that.myEcharts2();
-        })
+          let that = this
+          selectDeviceType().then(res => {
+            res.data.forEach(item=> {
+              const param = Object.assign({})
+              param.name = item.deviceName
+              param.数量=item.deviceCount
+              this.source.push(param)
+            })
+            that.myEcharts2()
+          })
+        },
       },
       // 出处 http://192.144.199.210:8080/editor/index.html?chart_id=TMyJh73uiXkeu3_v
       myEcharts1() {