Browse Source

森林资源储蓄量读取真实接口

gcz 3 years ago
parent
commit
6d9bdb72b5
3 changed files with 64 additions and 16 deletions
  1. 37 0
      src/dataSchema/page1Char1Schema.js
  2. 12 12
      src/service/index.js
  3. 15 4
      src/views/index.vue

+ 37 - 0
src/dataSchema/page1Char1Schema.js

@@ -0,0 +1,37 @@
+/*
+ * @LastEditors: gcz
+ */
+import themeColor from "./color"
+let page1Char1Schema = {
+    title: {
+        text: '储蓄量(立方米)',
+        textStyle: {
+            color: themeColor.mainColor,
+        }
+
+    },
+    tooltip: {},
+    xAxis: {
+        data: ['清镇林场', '三都林场', '榕江林场', '水东林场', '甜蜜林场', '贵阳林场'],
+        axisLabel: {
+            color: "rgba(255, 255, 255, 1)"
+        }
+    },
+    yAxis: {
+        axisLabel: {
+            color: "rgba(255, 255, 255, 1)"
+        }
+    },
+    series: [
+        {
+            name: '储蓄量',
+            type: 'bar',
+            data: [5000, 6000, 3000, 9000, 4500, 7000],
+            itemStyle: {
+                color: '#02EEFF'
+            }
+
+        }
+    ]
+}
+export default page1Char1Schema

+ 12 - 12
src/service/index.js

@@ -47,12 +47,12 @@ export const smallInfo = (data) =>
     })
 
 // 查询统计概况
-export const page1numerical = (data) =>
-    callApi({
-        url: 'forest/statis',
-        data,
-        prefixUrl: 'api2',
-    })
+// export const page1numerical = (data) =>
+//     callApi({
+//         url: 'forest/statis',
+//         data,
+//         prefixUrl: 'api2',
+//     })
 
 // 查询蓄积量统计
 export const page1echarts01 = (data) =>
@@ -63,12 +63,12 @@ export const page1echarts01 = (data) =>
     })
 
 // 查询面积统计
-export const page1echarts02 = (data) =>
-    callApi({
-        url: 'forest/area',
-        data,
-        prefixUrl: 'api2',
-    })
+// export const page1echarts02 = (data) =>
+//     callApi({
+//         url: 'forest/area',
+//         data,
+//         prefixUrl: 'api2',
+//     })
 
 // 查询样地列表
 export const forestSample = (data) =>

+ 15 - 4
src/views/index.vue

@@ -89,10 +89,12 @@
   } from "../service/index";
 
   import scrollBoardSchema from '../dataSchema/scrollBoardSchema';
+  import page1Char1Schema from '../dataSchema/page1Char1Schema';
   import page1Char2Schema from '../dataSchema/page1Char2Schema';
   import page2Char1Schema from '../dataSchema/page2Char1Schema';
   import page2Char2Schema from '../dataSchema/page2Char2Schema';
   import page6Char1Schema from '../dataSchema/page6Char1Schema';
+  
 
   // import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data';
   export default {
@@ -130,7 +132,7 @@
           // {msg:'测试1!'},
           // {msg:'测试22222222!'},
         ],
-        page1Char1:{},
+        page1Char1:page1Char1Schema,
         page1Char2:page1Char2Schema,
         page2Char1:page2Char1Schema,
         page2Char2:page2Char2Schema,
@@ -206,11 +208,20 @@
         }
       },
       getPage1echarts01(){
-        page1echarts01().then(res=>{
-          // console.log('res',res);
+        let param = {
+          cityId:this.vuexSelectCity,
+          countyId:this.vuexSelectDistrict,
+          townId:this.vuexSelectStreet,
+        }
+        page1echarts01(param).then(res=>{
+          this.page1Char1.xAxis.data = res.data.map(item => {
+            return item.name
+          })
+          this.page1Char1.series[0].data = res.data.map(item => {
+            return item.number
+          })
           let charUuid = this.$refs.page1Char1.mid;
           this.$refs.page1Char1.intChar(charUuid)
-          this.page1Char1 = res.data;
         }).catch(err=>{
           console.log('getPage1echarts01 err',err);
         })