王通 пре 2 година
родитељ
комит
7cc02d52c6
2 измењених фајлова са 18 додато и 3 уклоњено
  1. 8 0
      src/api/bigdata.js
  2. 10 3
      src/views/bigdata/chart-equipmentDistribution.vue

+ 8 - 0
src/api/bigdata.js

@@ -19,6 +19,14 @@ export function getCameaCount() {
 }
 
 // 设备分布
+export function selectDeviceType() {
+  return request({
+    url: '/center-monitor/camera/selectDeviceType',
+    method: 'post',
+    data:{}
+  })
+}
+// 设备分布
 export function getSbfb() {
   return request({
     url: '/center-resources/VisuForestCloudBigDataController/getSbfb',

+ 10 - 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,18 @@
     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)
+          })
           that.myEcharts2()
         })
       },
+
       // 出处 http://192.144.199.210:8080/editor/index.html?chart_id=TMyJh73uiXkeu3_v
       myEcharts1() {
         var chartDom = document.getElementById('camera1');