Browse Source

添加粮食储量

mxx 3 years ago
parent
commit
dd1e2a8c44
1 changed files with 20 additions and 135 deletions
  1. 20 135
      src/views/home/index.vue

+ 20 - 135
src/views/home/index.vue

@@ -211,6 +211,7 @@
 
 
     data() {
     data() {
       return {
       return {
+        totalReserves:'',
         inventoryCost:'',
         inventoryCost:'',
         inventoryValue:'',
         inventoryValue:'',
         carCount1:'',
         carCount1:'',
@@ -364,7 +365,7 @@
         this.carCount3 = res[6].biViewInfoList[2].count
         this.carCount3 = res[6].biViewInfoList[2].count
         this.inventoryCost = res[7].biViewInfoList[0].count
         this.inventoryCost = res[7].biViewInfoList[0].count
         this.inventoryValue =  res[7].biViewInfoList[1].count
         this.inventoryValue =  res[7].biViewInfoList[1].count
-
+        this.totalReserves = res[8].biViewInfoList
         this.initCharts()
         this.initCharts()
       })
       })
       // if (this.vesselBankFlag !== 'V') {
       // if (this.vesselBankFlag !== 'V') {
@@ -615,48 +616,18 @@
             app.dialogVisible = true
             app.dialogVisible = true
           })
           })
         }
         }
-
+        debugger
+        console.log(this.totalReserves)
+        let _x = []
+        let _y = []
+        for(let i = 0;i<this.totalReserves.length;i++){
+          _x.push(this.totalReserves[i].name)
+          _y.push(this.totalReserves[i].count)
+        }
+        
         // 柱状图
         // 柱状图
         let myChart7 = app.$echarts.init(this.$refs.myEchart7);
         let myChart7 = app.$echarts.init(this.$refs.myEchart7);
         var zoption = {
         var zoption = {
-          // ----  标题 -----
-          // title: {
-          //   text: '',//主标题
-          //   textStyle: {
-          //     color: 'red'
-          //   },
-          //   subtext: '',//副标题
-          //   subtextStyle: {
-          //     color: 'blue'
-          //   },
-          //   padding: [0, 0, 10, 100]  // 位置
-          // },
-          // ---- legend ----
-          // legend: {
-          //   type: 'plain',  // 图列类型,默认为 'plain'
-          //   top: '1%',  // 图列相对容器的位置 top\bottom\left\right
-          //   selected: {
-          //     // '销量': true  // 图列选择,图形加载出来会显示选择的图列,默认为true
-          //   },
-          //   textStyle: {  // 图列内容样式
-          //     color: '#fff',  // 字体颜色
-          //     backgroundColor: 'black'  // 字体背景色
-          //   },
-          //   tooltip: {  // 图列提示框,默认不显示
-          //     show: true,
-          //     color: '#666'
-          //   },
-          //   data: [   // 图列内容
-          //     {
-          //       name: '', //上方标题内容
-          //       icon: 'circle',
-          //       textStyle: {
-          //         color: '#666',  // 单独设置某一个图列的颜色
-          //         backgroundColor: '#fff' // 单独设置某一个图列的字体背景色
-          //       }
-          //     }
-          //   ]
-          // },
           grid: {
           grid: {
             left: '0',
             left: '0',
             right: '0',
             right: '0',
@@ -677,55 +648,10 @@
               color: '#fff'
               color: '#fff'
             }
             }
           },
           },
-          // ---- gird区域 ---
-          // gird: {
-          //   show: false,    // 是否显示直角坐标系网格
-          //   top: 10,  // 相对位置 top\bottom\left\right
-          //   containLabel: false, // gird 区域是否包含坐标轴的刻度标签
-          //   tooltip: {
-          //     show: true,
-          //     trigger: 'item',   // 触发类型
-          //     textStyle: {
-          //       color: '#666'
-          //     }
-          //   }
-          // },
+        
           //  ------  X轴 ------
           //  ------  X轴 ------
           xAxis: {
           xAxis: {
-            // show: true,  // 是否显示
-            // position: 'bottom',  // x轴的位置
-            // offset: 0, // x轴相对于默认位置的偏移
-            // type: 'category',   // 轴类型, 默认为 'category'
-            // name: '',    // 轴名称
-            // nameLocation: 'end',  // 轴名称相对位置
-            // nameTextStyle: {   // 坐标轴名称样式
-            //   color: '#666',
-            //   padding: [5, 0, 0, -5]
-            // },
-            // nameGap: 30, // 坐标轴名称与轴线之间的距离
-            // nameRotate: 0,  // 坐标轴名字旋转
-            // axisLine: {       // 坐标轴 轴线
-            //   show: true,  // 是否显示
-            //   // symbol: ['none', 'arrow'],  // 是否显示轴线箭头
-            //   // symbolSize: [8, 8], // 箭头大小
-            //   // symbolOffset: [0, 7],  // 箭头位置
-            //   // ------   线 ---------
-            //   lineStyle: {
-            //     color: '#666',
-            //     width: 1,
-            //     type: 'solid'
-            //   }
-            // },
-            // axisTick: {    // 坐标轴 刻度
-            //   show: true,  // 是否显示
-            //   inside: true,  // 是否朝内
-            //   length: 3,     // 长度
-            //   lineStyle: {   // 默认取轴线的样式
-            //     color: '#666',
-            //     width: 1,
-            //     type: 'solid'
-            //   }
-            // },
+          
             axisLabel: { // 坐标轴标签
             axisLabel: { // 坐标轴标签
               show: true, // 是否显示
               show: true, // 是否显示
               inside: false, // 是否朝内
               inside: false, // 是否朝内
@@ -735,58 +661,20 @@
               interval: 0,
               interval: 0,
               rotate: 40
               rotate: 40
             },
             },
-            // splitLine: {    // gird区域中的分割线
-            //   show: false,  // 是否显示
-            //   lineStyle: {
-            //     // color: 'red',
-            //     // width: 1,
-            //     // type: 'solid'
-            //   }
-            // },
+         
             splitArea: { // 网格区域
             splitArea: { // 网格区域
               show: false // 是否显示,默认为false
               show: false // 是否显示,默认为false
             },
             },
-            data: ['玉米', '玉米(潮粮)', '玉米(酒精)', '玉米(机收)', '混合麦', '白小麦', '大豆', '水稻', '高粱', '玉米淀粉', '豆粕']
+            data: _x
           },
           },
           //   ------   y轴  ----------
           //   ------   y轴  ----------
           yAxis: {
           yAxis: {
-            // show: true,  // 是否显示
-            // position: 'left', // y轴位置
-            // offset: 0, // y轴相对于默认位置的偏移
-            // type: 'value',  // 轴类型,默认为 ‘category’
-            // // name: '销量',   // 轴名称
-            // nameLocation: 'end', // 轴名称相对位置value
-            // nameTextStyle: {    // 坐标轴名称样式
-            //   color: '#fff',
-            //   padding: [5, 0, 0, 5]  // 坐标轴名称相对位置
-            // },
-            // nameGap: 15, // 坐标轴名称与轴线之间的距离
-            // nameRotate: 270,  // 坐标轴名字旋转
-
+          
             axisLine: { // 坐标轴 轴线
             axisLine: { // 坐标轴 轴线
               show: false, // 是否显示
               show: false, // 是否显示
-              //  -----   箭头 -----
-              // symbol: ['none', 'arrow'],  // 是否显示轴线箭头
-              // symbolSize: [8, 8],  // 箭头大小
-              // symbolOffset: [0, 7], // 箭头位置
-
-              // ----- 线 -------
-              // lineStyle: {
-              //   color: '#666',
-              //   width: 1,
-              //   type: 'solid'
-              // }
+           
             },
             },
-            // axisTick: {      // 坐标轴的刻度
-            //   show: true,    // 是否显示
-            //   inside: true,  // 是否朝内
-            //   length: 3,      // 长度
-            //   lineStyle: {
-            //     color: '#666',  // 默认取轴线的颜色
-            //     width: 1,
-            //     type: 'solid'
-            //   }
-            // },
+           
             axisLabel: { // 坐标轴的标签
             axisLabel: { // 坐标轴的标签
               show: true, // 是否显示
               show: true, // 是否显示
               inside: false, // 是否朝内
               inside: false, // 是否朝内
@@ -801,10 +689,7 @@
                 width: 1,
                 width: 1,
                 type: 'dashed'
                 type: 'dashed'
               }
               }
-            },
-            // splitArea: {     // 网格区域
-            //   show: false   // 是否显示,默认为false
-            // }
+            }
           },
           },
           //  -------   内容数据 -------
           //  -------   内容数据 -------
           series: [{
           series: [{
@@ -830,7 +715,7 @@
               position: 'top',
               position: 'top',
               color: '#b0b1b3'
               color: '#b0b1b3'
             },
             },
-            data: [3000, 4000, 4200, 4500, 6000, 5600, 4500, 5020, 4500, 5400, 4300]
+            data: _y
           }]
           }]
         };
         };
         myChart7.setOption(zoption)
         myChart7.setOption(zoption)