浏览代码

统计分析接口直连

JX.LI 1 年之前
父节点
当前提交
1e7b22616a

+ 24 - 25
src/api/bigdata.js

@@ -4,7 +4,7 @@ import Cookies from 'js-cookie'
 // 事件来源,类型统计
 export function getEventSourceAndTypeStatistics(param) {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/getEventSourceAndTypeStatistics',
+    url: '/center-event/eventreport/getEventSourceAndTypeStatistics',
     method: 'post',
     data: param
   })
@@ -52,7 +52,7 @@ export function getLcfbtj() {
 // 地质灾害易发区
 export function get5() {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/getHazardResources',
+    url: '/center-data/resourceBigData/getHazardResources',
     method: 'post',
     data:{}
   })
@@ -90,8 +90,9 @@ export function getQhyytj(param) {
 //重点区域
 export function getZdqy() {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/selectBigDataImportareaDeptCount',
-    method: 'post'
+    url: '/center-data/resourceBigData/getConstructionGroupByResourcesConservancy',
+    method: 'post',
+    data:{}
   })
 }
 
@@ -112,7 +113,7 @@ export function getSbsbsjsl(param) {
 //珍惜古树
 export function getZxgs() {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/selectBigDataTreesDeptCount',
+    url: '/center-data/resourceBigData/selectDepositResourcesCount',
     method: 'post'
   })
 }
@@ -125,7 +126,7 @@ export function getSjqs(param) {
     param = {day: myDate.getFullYear()}
   }
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/getEventTrend',
+    url: '/center-event/eventreport/getEventTrend',
     data: param,
     method: 'post'
   })
@@ -134,7 +135,7 @@ export function getSjqs(param) {
 //网格分布
 export function getWgfb() {
   return request({
-    url: '/center-water/VisuForestCloudBigDataController/selectBigDataFridLZDeptCount',
+    url: '/center-data/waterBigData/selectBigDataFridLZDeptCount',
     method: 'post',
     data:{type:6}
   })
@@ -161,7 +162,7 @@ export function getTqqs(param) {
 //网格人员
 export function getWgry() {
   return request({
-    url: '/center-water/VisuForestCloudBigDataController/selectBigDataFridLZDeptCount',
+    url: '/center-data/waterBigData/selectBigDataFridLZDeptCount',
     method: 'post',
     data:{type:6}
   })
@@ -170,7 +171,7 @@ export function getWgry() {
 // 土地资源管理信息
 export function getFhd() {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/selectBigDataFireTeamDeptCount',
+    url: '/center-data/resourceBigData/getLandGroupByResources',
     method: 'post'
   })
 }
@@ -184,14 +185,16 @@ export function getQxz() {
 }
 
 //综合信息
-export function getZhxx(param) {
-//暂时传当年,以后再说
-  if (param == null) {
-    let myDate = new Date();
-    param = {day: myDate.getFullYear()}
-  }
+export function getTotal(param) {
+  return request({
+    url: '/center-event/eventreport/getTotal',
+    data: param,
+    method: 'post'
+  })
+}
+export function getResourcesTotal(param) {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/selectBigDataZhxx',
+    url: '/center-data/resourceBigData/getResourcesTotal',
     data: param,
     method: 'post'
   })
@@ -199,23 +202,19 @@ export function getZhxx(param) {
 
 //热力图
 export function getRlt(param) {
-  //暂时传当年,以后再说
-  if (param == null) {
-    let myDate = new Date();
-    param = {day: myDate.getFullYear()}
-  }
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/getHeatMap',
+    url: '/center-event/eventreport/getHeatMap',
     method: 'post',
     data : param
   })
 }
 
 //按时间、事件类别统计事件数据(年度、月份、四类事件数量)
-export function getEventTypeYearStatistics() {
+export function getEventTypeYearStatistics(param) {
   return request({
-    url: '/center-resources/VisuForestCloudBigDataController/getEventTypeYearStatistics',
-    method: 'post'
+    url: '/center-event/eventreport/getEventTypeYearStatistics',
+    method: 'post',
+    data : param
   })
 }
 

+ 6 - 1
src/views/bigdata/bigdata.vue

@@ -223,6 +223,7 @@ import {
   fontConfig
 } from '@/api/login'
 
+  import Cookies from 'js-cookie'
 export default {
   components: {
     bigdataSupermap,
@@ -303,7 +304,11 @@ export default {
     },
     rlt() {
       let that = this
-      getRlt().then(resp => {
+      let param = {
+         eventTypeId:Cookies.get("eventType").split(","),
+         day: new Date().getFullYear()
+      }
+      getRlt(param).then(resp => {
         setTimeout(() => {
           //事件分布
           that.$refs.bigdataSupermap.loadHeatMap(resp.data)

+ 8 - 2
src/views/bigdata/chart-ancientTree.vue

@@ -29,8 +29,14 @@
       zxgs() {
         let that = this
         getZxgs().then(resp => {
-          that.data_num = resp.data.value
-          that.data_name = resp.data.name
+          let name  = []
+          let value = []
+          for (var i = 0; i < resp.data.length; i++) {
+            name.push(resp.data[i].name)
+            value.push(resp.data[i].value)
+          }
+          that.data_num = value
+          that.data_name = name
           that.myEcharts();
         })
       },

+ 2 - 2
src/views/bigdata/chart-event.vue

@@ -14,7 +14,7 @@ import {
 } from '@/api/bigdata'
 
 import * as echarts from 'echarts'
-
+import Cookies from 'js-cookie'
 export default {
   name: 'event',
   data() {
@@ -34,7 +34,7 @@ export default {
     //http://192.144.199.210:8080/editor/index.html?chart_id=K8nTnNyu0caN65uT
     getEventSourceAndTypeStatistics() {
       let that = this
-      getEventSourceAndTypeStatistics({ day: that.year }).then(res => {
+      getEventSourceAndTypeStatistics({ day: that.year,eventTypeId:Cookies.get("eventType").split(",") }).then(res => {
         this.optionData=res.data.source
         this.option2Data=res.data.type
         that.myEcharts()

+ 53 - 39
src/views/bigdata/chart-eventTrend.vue

@@ -8,8 +8,10 @@
 
 <script>
   import * as echarts from 'echarts';
-  import {getSjqs} from '@/api/bigdata.js'
-
+  import {
+    getSjqs
+  } from '@/api/bigdata.js'
+  import Cookies from 'js-cookie'
 
   export default {
     name: 'pit',
@@ -29,7 +31,22 @@
       // 出处 http://192.144.199.210:8080/editor/index.html?chart_id=udduEFcFiEYEEj4Q
       sjqs() {
         let that = this
-        getSjqs().then(resp => {
+        let year = new Date().getFullYear()
+        let yearmonth = []
+        for (var i = 0; i < 12; i++) {
+          let mo = ''
+          if (i < 10) {
+            mo = year + "-0" + i;
+          } else {
+            mo = year + "-" + i;
+          }
+          yearmonth.push(mo)
+        }
+        let data = {
+          yearMonth: yearmonth,
+          eventTypeId: Cookies.get("eventType").split(",")
+        }
+        getSjqs(data).then(resp => {
           that.data_month = resp.data.month
           that.data_num = resp.data.num
           that.myEcharts()
@@ -51,47 +68,44 @@
               fontSize: 10,
               color: '#999',
               verticalAlign: 'bottom',
-              formatter: function (value, index) {
+              formatter: function(value, index) {
                 return `${value.toFixed(2)}%`;
               },
             },
           },
-          series: [
-            {
-              type: 'line',
-              lineStyle: {
-                color: '#C22F43',
-                width: 1,
-                type: 'solid',
-              },
-              areaStyle: {
-                color: {
-                  type: 'linear',
-                  x: 0,
-                  y: 0,
-                  x2: 0,
-                  y2: 1,
-                  colorStops: [
-                    {
-                      offset: 0,
-                      color: 'rgba(194, 47, 67, 1.0)',
-                    },
-                    {
-                      offset: 1,
-                      color: 'rgba(194, 47, 67, 0.03)',
-                    },
-                  ],
-                  global: false,
-                },
-                origin: 'start',
+          series: [{
+            type: 'line',
+            lineStyle: {
+              color: '#C22F43',
+              width: 1,
+              type: 'solid',
+            },
+            areaStyle: {
+              color: {
+                type: 'linear',
+                x: 0,
+                y: 0,
+                x2: 0,
+                y2: 1,
+                colorStops: [{
+                    offset: 0,
+                    color: 'rgba(194, 47, 67, 1.0)',
+                  },
+                  {
+                    offset: 1,
+                    color: 'rgba(194, 47, 67, 0.03)',
+                  },
+                ],
+                global: false,
               },
-              opacity: 0.2,
-              shadowColor: 'rgba(194, 47, 67)',
-              shadowBlur: 0,
-              shadowOffsetX: 0,
-              data: that.data_num,
+              origin: 'start',
             },
-          ],
+            opacity: 0.2,
+            shadowColor: 'rgba(194, 47, 67)',
+            shadowBlur: 0,
+            shadowOffsetX: 0,
+            data: that.data_num,
+          }, ],
         };
         option && myChart.setOption(option);
       },
@@ -110,4 +124,4 @@
     padding-bottom: 10px;
     display: flex;
   }
-</style>
+</style>

+ 119 - 101
src/views/bigdata/chart-fireTypeYear.vue

@@ -1,116 +1,134 @@
 <!-- **************************************NO.18 消防*************************************** -->
 <template>
-	<div class="chart-container">
-		<div id="fireTypeYear" style="width: 100%; height:25vh; ">
-		</div>
-	</div>
+  <div class="chart-container">
+    <div id="fireTypeYear" style="width: 100%; height:25vh; ">
+    </div>
+  </div>
 </template>
 
 <script>
-  import { getEventTypeYearStatistics } from '@/api/bigdata'
-	import * as echarts from 'echarts';
-	export default {
-		name: 'fireTypeYear',
-		data() {
-			return {
-				count: 0
-			}
-		},
-		mounted() {
-			this.getEventTypeYearStatistics();
-		},
+  import {
+    getEventTypeYearStatistics
+  } from '@/api/bigdata'
+  import * as echarts from 'echarts';
+  import Cookies from 'js-cookie'
+  export default {
+    name: 'fireTypeYear',
+    data() {
+      return {
+        count: 0
+      }
+    },
+    mounted() {
+      this.getEventTypeYearStatistics();
+    },
 
-		methods: {
-      getEventTypeYearStatistics(){
-        getEventTypeYearStatistics().then(resp => {
-          this.myEcharts(resp.data.month,resp.data.series);
+    methods: {
+      getEventTypeYearStatistics() {
+        let year = new Date().getFullYear()
+        let yearmonth = []
+        for (var i = 0; i < 12; i++) {
+          let mo = ''
+          if (i < 10) {
+            mo = year + "-0" + i;
+          } else {
+            mo = year + "-" + i;
+          }
+          yearmonth.push(mo)
+        }
+        let data = {
+          yearMonth: yearmonth,
+          eventTypeId: Cookies.get("eventType").split(",")
+        }
+        getEventTypeYearStatistics(data).then(resp => {
+          this.myEcharts(resp.data.month, resp.data.series);
         })
       },
-      myEcharts(xData,seriesData) {
-				var chartDom = document.getElementById('fireTypeYear');
-				var myChart = echarts.init(chartDom);
-				var option;
-				 option = {
-				    tooltip: {
-				        trigger: 'axis',
-				        axisPointer: {
-				            type: 'shadow'
-				        }
-				    },
-				    grid:{
-				        top:'15%',
-				        left:'10%',
-				        right:'10%',
-				        buttom:'15%',
-				    },
-				     xAxis: {
-				        type: 'category',
-				        axisLine: {
-				            lineStyle: {
-				                color: 'rgba(255,255,255,0.12)',
-				            },
-				        },
-				        axisLabel: {
-				            margin: 10,
-				            color: '#e2e9ff',
-                    interval: 0,
-                    rotate: 20,
-				            textStyle: {
-				                fontSize: 10
-				            },
-				        },
-				        axisTick:{
-				            show:false,
-				        },
-				         data: xData
-				    },
-				    yAxis: {
-				        nameTextStyle:{
-				            color:'#fff',
-				        },
-				        type: 'value',
-				         axisLine: {
-				             show:false,
-				            lineStyle: {
-				                color: 'rgba(255,255,255,0.12)'
-				            },
-				        },
-				        axisLabel: {
-							 show:false,
-				            formatter: '{value}',
-				            color: '#e2e9ff',
-				        },
-				         splitLine: {
-				            lineStyle: {
-				                color: 'rgba(255,255,255,0.12)'
-				            }
-				        },
-				        axisTick:{
-				            show:true,
+      myEcharts(xData, seriesData) {
+        var chartDom = document.getElementById('fireTypeYear');
+        var myChart = echarts.init(chartDom);
+        var option;
+        option = {
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'shadow'
+            }
+          },
+          grid: {
+            top: '15%',
+            left: '10%',
+            right: '10%',
+            buttom: '15%',
+          },
+          xAxis: {
+            type: 'category',
+            axisLine: {
+              lineStyle: {
+                color: 'rgba(255,255,255,0.12)',
+              },
+            },
+            axisLabel: {
+              margin: 10,
+              color: '#e2e9ff',
+              interval: 0,
+              rotate: 20,
+              textStyle: {
+                fontSize: 10
+              },
+            },
+            axisTick: {
+              show: false,
+            },
+            data: xData
+          },
+          yAxis: {
+            nameTextStyle: {
+              color: '#fff',
+            },
+            type: 'value',
+            axisLine: {
+              show: false,
+              lineStyle: {
+                color: 'rgba(255,255,255,0.12)'
+              },
+            },
+            axisLabel: {
+              show: false,
+              formatter: '{value}',
+              color: '#e2e9ff',
+            },
+            splitLine: {
+              lineStyle: {
+                color: 'rgba(255,255,255,0.12)'
+              }
+            },
+            axisTick: {
+              show: true,
 
-				            lineStyle:{
-				                color:'#fff',
-				            },
-				        },
-				    },
-				    series: seriesData
-				};
-				option && myChart.setOption(option);
-			},
+              lineStyle: {
+                color: '#fff',
+              },
+            },
+          },
+          series: seriesData
+        };
+        option && myChart.setOption(option);
+      },
 
-		},
+    },
 
 
-	}
+  }
 </script>
 
 <style rel="stylesheet/scss" lang="scss" scoped>
-	.chart-container {
-		width: 100%;
-		height: auto;
-		position: relative;
-		padding-bottom: 10px;
-		display: flex;
-		flex-direction: column;
-	}
-</style>
+  .chart-container {
+    width: 100%;
+    height: auto;
+    position: relative;
+    padding-bottom: 10px;
+    display: flex;
+    flex-direction: column;
+  }
+</style>

+ 27 - 19
src/views/bigdata/tabbar.vue

@@ -12,17 +12,20 @@
 </template>
 
 <script>
+  import {
+    getTotal,
+    getResourcesTotal,
+    selectDeviceType
+  } from '@/api/bigdata.js'
 
-  import {getZhxx,selectDeviceType} from '@/api/bigdata.js'
-
+  import Cookies from 'js-cookie'
   export default {
     data() {
       return {
         //tab默认停留项el-tab-pane > name = "?"
         activeName: 'sp',
         //地区分类tabtitle
-        district: [
-          {
+        district: [{
             label: '四平市',
             name: 'sp',
             id: ''
@@ -54,8 +57,7 @@
           },
         ],
         // 本地区内分类项数量
-        regionNum: [
-          {
+        regionNum: [{
             count: 641,
             name: '事件'
           },
@@ -135,20 +137,26 @@
 
       zhxx() {
         let that = this
-        getZhxx().then(resp => {
-          that.regionNum = [];
-          that.regionNum.push(...resp.data.event)
-          that.regionNum.push(...resp.data.data)
-          selectDeviceType().then(res => {
-            res.data.forEach(item=>
-            {
-              that.regionNum.push({value: item.deviceCount,name: item.deviceName})
+        let data = {
+          type: '7',
+          eventTypeId: Cookies.get("eventType").split(","),
+          day: new Date().getFullYear()
+        }
+        that.regionNum = [];
+        getTotal(data).then(resp => {
+          that.regionNum.push(...resp.data)
+
+        })
+        getResourcesTotal(data).then(resp => {
+          that.regionNum.push(...resp.data)
+        })
+        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})
-          // }
-
         })
       },
 
@@ -167,7 +175,7 @@
     height: 28.5vh;
     padding: 0 1rem 1rem 1rem !important;
     box-shadow: 0 0 1px rgba($color: #163696, $alpha: .1),
-    -0 -0 20px rgba($color: #163696, $alpha: .6) inset;
+      -0 -0 20px rgba($color: #163696, $alpha: .6) inset;
 
     .el-tabs__item {
       color: #fff;