王通 преди 2 години
родител
ревизия
a58698fe83
променени са 2 файла, в които са добавени 20 реда и са изтрити 3 реда
  1. 8 0
      src/api/bigdata.js
  2. 12 3
      src/views/bigdata/chart-equipmentDistribution.vue

+ 8 - 0
src/api/bigdata.js

@@ -44,6 +44,14 @@ export function getZhxx(param) {
     method: 'post',
   })
 }
+// 设备分布
+export function selectDeviceType() {
+  return request({
+    url: '/center-monitor/camera/selectDeviceType',
+    method: 'post',
+    data:{}
+  })
+}
 
 //起火原因统计
 export function getQhyytj(param) {

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

@@ -12,7 +12,7 @@
 
 <script>
   import * as echarts from 'echarts';
-  import {getSbfb} from '@/api/bigdata'
+  import {selectDeviceType} from '@/api/bigdata'
 
   export default {
     name: 'camera',
@@ -31,11 +31,19 @@
     methods: {
       getSbfb() {
         let that = this
-        getSbfb().then(res => {
-          this.source = res.data
+        selectDeviceType().then(res => {
+
+          res.data.forEach(item=> {
+            const param = Object.assign({})
+            param.name = item.deviceName
+            param.数量=item.deviceCount
+            this.source.push(param)
+          })
+          console.log(this.source)
           that.myEcharts2()
         })
       },
+
       // 出处 http://192.144.199.210:8080/editor/index.html?chart_id=TMyJh73uiXkeu3_v
       myEcharts1() {
         var chartDom = document.getElementById('camera1');
@@ -243,6 +251,7 @@
                   offset: 1,
                   color: "rgba(41,244,236,1)"
                 },
+
               ]),
               borderColor: "#a2f9f7",
               shadowBlur: 16,