瀏覽代碼

统计分析-设备类型

彭宇 2 年之前
父節點
當前提交
3092eb842d
共有 2 個文件被更改,包括 19 次插入12 次删除
  1. 7 0
      src/api/bigdata.js
  2. 12 12
      src/views/bigdata/chart-equipmentDistribution.vue

+ 7 - 0
src/api/bigdata.js

@@ -18,6 +18,13 @@ export function getCameaCount() {
     method: 'post',
   })
 }
+// 设备分布
+export function getSbfb() {
+  return request({
+    url: '/center-fire/VisuForestCloudBigDataController/getSbfb',
+    method: 'post',
+  })
+}
 
 
 

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

@@ -12,21 +12,29 @@
 
 <script>
 	import * as echarts from 'echarts';
+  import { getSbfb } from '@/api/bigdata'
 	export default {
 		name: 'camera',
 		data() {
 			return {
-				count: 0
+        source: []
 			}
 		},
 		mounted() {
 			// this.myEcharts1();
-			this.myEcharts2();
+			// this.myEcharts2();
 			// this.myEcharts3();
-
+      this.getSbfb()
 		},
 
 		methods: {
+      getSbfb() {
+        let that = this
+        getSbfb().then(res => {
+          this.source=res.data
+          that.myEcharts2()
+        })
+      },
 			// 出处 http://192.144.199.210:8080/editor/index.html?chart_id=TMyJh73uiXkeu3_v
 			myEcharts1() {
 				var chartDom = document.getElementById('camera1');
@@ -153,15 +161,7 @@
 				const dfColor = ['#92E1FF', '#0097FB', '#30ECA6', '#FFC227', '#FF4848'];
 				option = {
 					dataset: {
-						source: [
-							["类型1", 1200],
-							["类型2", 1000],
-							["类型3", 746],
-							["类型4", 636],
-							["类型5", 581],
-							["类型6", 426],
-							["类型7", 326]
-						],
+						source: this.source,
 					},
 					tooltip: {
 						trigger: 'item',