|  | @@ -211,7 +211,7 @@
 | 
											
												
													
														|  |            </div>
 |  |            </div>
 | 
											
												
													
														|  |            <el-table :key="accuracy.seeRanking.tableKey" v-loading="accuracy.seeRanking.listLoading"
 |  |            <el-table :key="accuracy.seeRanking.tableKey" v-loading="accuracy.seeRanking.listLoading"
 | 
											
												
													
														|  |              element-loading-text="给我一点时间" :data="accuracy.seeRanking.list" border fit highlight-current-row
 |  |              element-loading-text="给我一点时间" :data="accuracy.seeRanking.list" border fit highlight-current-row
 | 
											
												
													
														|  | -            style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable">
 |  | 
 | 
											
												
													
														|  | 
 |  | +            style="width: 100%;margin-bottom: 50px;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable" height="500">
 | 
											
												
													
														|  |              <el-table-column type="selection" align="center" width="50" />
 |  |              <el-table-column type="selection" align="center" width="50" />
 | 
											
												
													
														|  |              <el-table-column label="排名" min-width="130px" align="center"  type="index"/>
 |  |              <el-table-column label="排名" min-width="130px" align="center"  type="index"/>
 | 
											
												
													
														|  |              <el-table-column label="牧场名称" min-width="130px" align="center" prop="pasture_name" />
 |  |              <el-table-column label="牧场名称" min-width="130px" align="center" prop="pasture_name" />
 | 
											
										
											
												
													
														|  | @@ -231,16 +231,9 @@
 | 
											
												
													
														|  |    </div>
 |  |    </div>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  | -  import {
 |  | 
 | 
											
												
													
														|  | -    postJson,
 |  | 
 | 
											
												
													
														|  | -    getJson
 |  | 
 | 
											
												
													
														|  | -  } from '@/api/common'
 |  | 
 | 
											
												
													
														|  | -  import {
 |  | 
 | 
											
												
													
														|  | -    mapGetters
 |  | 
 | 
											
												
													
														|  | -  } from 'vuex'
 |  | 
 | 
											
												
													
														|  | -  import {
 |  | 
 | 
											
												
													
														|  | -    parseTime
 |  | 
 | 
											
												
													
														|  | -  } from '@/utils/index.js'
 |  | 
 | 
											
												
													
														|  | 
 |  | +  import { postJson, getJson } from '@/api/common'
 | 
											
												
													
														|  | 
 |  | +  import { mapGetters } from 'vuex'
 | 
											
												
													
														|  | 
 |  | +  import { parseTime,json2excel } from '@/utils/index.js'
 | 
											
												
													
														|  |    // import echarts from 'echarts'
 |  |    // import echarts from 'echarts'
 | 
											
												
													
														|  |    import * as echarts from 'echarts';
 |  |    import * as echarts from 'echarts';
 | 
											
												
													
														|  |    require('echarts/theme/macarons')
 |  |    require('echarts/theme/macarons')
 | 
											
										
											
												
													
														|  | @@ -504,7 +497,64 @@
 | 
											
												
													
														|  |            });
 |  |            });
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  | -      handleExport() {},
 |  | 
 | 
											
												
													
														|  | 
 |  | +      handleExport(item) {
 | 
											
												
													
														|  | 
 |  | +        if(item == 'accuracy'){
 | 
											
												
													
														|  | 
 |  | +          var list1 = this.accuracy.chart1.allTable1Data.mixed_fodder_accurate_ratio
 | 
											
												
													
														|  | 
 |  | +          var list2 = this.accuracy.chart1.allTable1Data.mixed_fodder_correct_ratio
 | 
											
												
													
														|  | 
 |  | +          var list3 = this.accuracy.chart1.allTable1Data.sprinkle_fodder_accurate_ratio
 | 
											
												
													
														|  | 
 |  | +          var list4 = this.accuracy.chart1.allTable1Data.sprinkle_fodder_correct_ratio
 | 
											
												
													
														|  | 
 |  | +          var titles = []
 | 
											
												
													
														|  | 
 |  | +          var values = []
 | 
											
												
													
														|  | 
 |  | +          for(let i =0;i<this.accuracy.chart1.tableTitleList1.length;i++){
 | 
											
												
													
														|  | 
 |  | +            titles.push(this.accuracy.chart1.tableTitleList1[i].value)
 | 
											
												
													
														|  | 
 |  | +            values.push(this.accuracy.chart1.tableTitleList1[i].name)
 | 
											
												
													
														|  | 
 |  | +          }
 | 
											
												
													
														|  | 
 |  | +          var excelDatasTabChart1 = [
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              tHeader: titles,
 | 
											
												
													
														|  | 
 |  | +              filterVal: values,
 | 
											
												
													
														|  | 
 |  | +              tableDatas: list1,
 | 
											
												
													
														|  | 
 |  | +              sheetName: '混料准确率'
 | 
											
												
													
														|  | 
 |  | +            },{
 | 
											
												
													
														|  | 
 |  | +              tHeader: titles,
 | 
											
												
													
														|  | 
 |  | +              filterVal: values,
 | 
											
												
													
														|  | 
 |  | +              tableDatas: list2,
 | 
											
												
													
														|  | 
 |  | +              sheetName: '混料正确率'
 | 
											
												
													
														|  | 
 |  | +            },{
 | 
											
												
													
														|  | 
 |  | +              tHeader: titles,
 | 
											
												
													
														|  | 
 |  | +              filterVal: values,
 | 
											
												
													
														|  | 
 |  | +              tableDatas: list3,
 | 
											
												
													
														|  | 
 |  | +              sheetName: '撒料准确率'
 | 
											
												
													
														|  | 
 |  | +            },{
 | 
											
												
													
														|  | 
 |  | +              tHeader: titles,
 | 
											
												
													
														|  | 
 |  | +              filterVal: values,
 | 
											
												
													
														|  | 
 |  | +              tableDatas: list4,
 | 
											
												
													
														|  | 
 |  | +              sheetName: '撒料正确率'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]
 | 
											
												
													
														|  | 
 |  | +          json2excel(excelDatasTabChart1, '准确性分析', true, 'xlsx')
 | 
											
												
													
														|  | 
 |  | +        }else if(item == 'time'){
 | 
											
												
													
														|  | 
 |  | +          var excelDatasTabChart2 = [
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              tHeader: titles,
 | 
											
												
													
														|  | 
 |  | +              filterVal: values,
 | 
											
												
													
														|  | 
 |  | +              tableDatas: list1,
 | 
											
												
													
														|  | 
 |  | +              sheetName: '混料准确率'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]
 | 
											
												
													
														|  | 
 |  | +          json2excel(excelDatasTabChart1, '准确性分析', true, 'xlsx')
 | 
											
												
													
														|  | 
 |  | +        }else if(item == 'abnormal'){
 | 
											
												
													
														|  | 
 |  | +          var excelDatasTabChart3 = [
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              tHeader: ['牧场','栏舍','班次','实际撒料时间'],
 | 
											
												
													
														|  | 
 |  | +              filterVal: ['pasture_name','barn_name','class_number','reality_sprinkle_feed_time'],
 | 
											
												
													
														|  | 
 |  | +              tableDatas: this.abnormal.chart1.tableDataList1,
 | 
											
												
													
														|  | 
 |  | +              sheetName: ' 撒料时间统计分析'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]
 | 
											
												
													
														|  | 
 |  | +          json2excel(excelDatasTabChart3, ' 撒料时间统计分析', true, 'xlsx')
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +      },
 | 
											
												
													
														|  |        handleSeeRanking() {
 |  |        handleSeeRanking() {
 | 
											
												
													
														|  |          this.accuracy.dialogStatus = 'seeRanking'
 |  |          this.accuracy.dialogStatus = 'seeRanking'
 | 
											
												
													
														|  |          this.accuracy.dialogFormVisible = true
 |  |          this.accuracy.dialogFormVisible = true
 | 
											
										
											
												
													
														|  | @@ -709,7 +759,8 @@
 | 
											
												
													
														|  |            }
 |  |            }
 | 
											
												
													
														|  |          })
 |  |          })
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  | -      roadChartLine1(chartLine_data) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +      roadChartLine1(chartLine_data) {
 | 
											
												
													
														|  | 
 |  | +        console.log(chartLine_data,'chartLine_data')
 | 
											
												
													
														|  |          if (this.accuracy.chart1.chartLine != null) {
 |  |          if (this.accuracy.chart1.chartLine != null) {
 | 
											
												
													
														|  |            this.accuracy.chart1.chartLine.dispose()
 |  |            this.accuracy.chart1.chartLine.dispose()
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -731,20 +782,13 @@
 | 
											
												
													
														|  |              containLabel: true
 |  |              containLabel: true
 | 
											
												
													
														|  |            },
 |  |            },
 | 
											
												
													
														|  |            xAxis: [{
 |  |            xAxis: [{
 | 
											
												
													
														|  | -            data: chartLine_data.date_day,
 |  | 
 | 
											
												
													
														|  | 
 |  | +            data: chartLine_data.title,
 | 
											
												
													
														|  |              type: 'category',
 |  |              type: 'category',
 | 
											
												
													
														|  | -            // boundaryGap: false,
 |  | 
 | 
											
												
													
														|  | -            // axisLabel: {
 |  | 
 | 
											
												
													
														|  | -            //   showMinLabel: true,
 |  | 
 | 
											
												
													
														|  | -            // },
 |  | 
 | 
											
												
													
														|  | -            // axisLine: {
 |  | 
 | 
											
												
													
														|  | -            //   lineStyle: {
 |  | 
 | 
											
												
													
														|  | -            //     color: '#666'
 |  | 
 | 
											
												
													
														|  | -            //   }
 |  | 
 | 
											
												
													
														|  | -            // },
 |  | 
 | 
											
												
													
														|  |            }],
 |  |            }],
 | 
											
												
													
														|  |            yAxis: [{
 |  |            yAxis: [{
 | 
											
												
													
														|  |              type: 'value',
 |  |              type: 'value',
 | 
											
												
													
														|  | 
 |  | +            min:0,
 | 
											
												
													
														|  | 
 |  | +            interval:25,
 | 
											
												
													
														|  |              name: '(%)',
 |  |              name: '(%)',
 | 
											
												
													
														|  |              axisLine: {
 |  |              axisLine: {
 | 
											
												
													
														|  |                lineStyle: {
 |  |                lineStyle: {
 | 
											
										
											
												
													
														|  | @@ -752,30 +796,29 @@
 | 
											
												
													
														|  |                }
 |  |                }
 | 
											
												
													
														|  |              },
 |  |              },
 | 
											
												
													
														|  |            }],
 |  |            }],
 | 
											
												
													
														|  | -          color: ['#4b07fa', '#0f96fc', '#ff42a9', '#ff724c', '#05fbf0', '#ffae00', '#b705fa', '#9a60b4', '#3cff00'],
 |  | 
 | 
											
												
													
														|  | -          series: function(e) {
 |  | 
 | 
											
												
													
														|  | -            var serie = [];
 |  | 
 | 
											
												
													
														|  | -            for (var i = 0; i < chartLine_data.pasture_name.length; i++) {
 |  | 
 | 
											
												
													
														|  | -              var item = {
 |  | 
 | 
											
												
													
														|  | -                name: chartLine_data.pasture_name[i],
 |  | 
 | 
											
												
													
														|  | -                data: chartLine_data.data_list[i],
 |  | 
 | 
											
												
													
														|  | -                type: 'bar',
 |  | 
 | 
											
												
													
														|  | -                barMaxWidth: 20, // 每一个都要设置
 |  | 
 | 
											
												
													
														|  | -                barMinWidth: 5,
 |  | 
 | 
											
												
													
														|  | -                // smooth: true,
 |  | 
 | 
											
												
													
														|  | -                // itemStyle: {
 |  | 
 | 
											
												
													
														|  | -                //   borderColor: '#fff',
 |  | 
 | 
											
												
													
														|  | -                //   borderWidth: 2
 |  | 
 | 
											
												
													
														|  | -                // },
 |  | 
 | 
											
												
													
														|  | -                // label: {
 |  | 
 | 
											
												
													
														|  | -                //   // normal: {  show: true },
 |  | 
 | 
											
												
													
														|  | -                // },
 |  | 
 | 
											
												
													
														|  | -              }
 |  | 
 | 
											
												
													
														|  | -              serie.push(item);
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            console.log(serie)
 |  | 
 | 
											
												
													
														|  | -            return serie;
 |  | 
 | 
											
												
													
														|  | -          }()
 |  | 
 | 
											
												
													
														|  | 
 |  | +          color: ['#4b07fa', '#0f96fc', '#ff42a9', '#ff724c', '#05fbf0', '#ffae00', '#b705fa', '#9a60b4', '#3cff00'],
 | 
											
												
													
														|  | 
 |  | +          series: [{
 | 
											
												
													
														|  | 
 |  | +              name: '撒料正确率',
 | 
											
												
													
														|  | 
 |  | +              type: 'bar',
 | 
											
												
													
														|  | 
 |  | +              barWidth:10,
 | 
											
												
													
														|  | 
 |  | +              data: chartLine_data.ratio
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]
 | 
											
												
													
														|  | 
 |  | +          // series: function(e) {
 | 
											
												
													
														|  | 
 |  | +          //   var serie = [];
 | 
											
												
													
														|  | 
 |  | +          //   for (var i = 0; i < chartLine_data.pasture_name.length; i++) {
 | 
											
												
													
														|  | 
 |  | +          //     var item = {
 | 
											
												
													
														|  | 
 |  | +          //       name: chartLine_data.pasture_name[i],
 | 
											
												
													
														|  | 
 |  | +          //       data: chartLine_data.data_list[i],
 | 
											
												
													
														|  | 
 |  | +          //       type: 'bar',
 | 
											
												
													
														|  | 
 |  | +          //       barMaxWidth: 20, // 每一个都要设置
 | 
											
												
													
														|  | 
 |  | +          //       barMinWidth: 5
 | 
											
												
													
														|  | 
 |  | +          //     }
 | 
											
												
													
														|  | 
 |  | +          //     serie.push(item);
 | 
											
												
													
														|  | 
 |  | +          //   }
 | 
											
												
													
														|  | 
 |  | +          //   console.log(serie)
 | 
											
												
													
														|  | 
 |  | +          //   return serie;
 | 
											
												
													
														|  | 
 |  | +          // }()
 | 
											
												
													
														|  |          };
 |  |          };
 | 
											
												
													
														|  |          this.accuracy.chart1.chartLine.setOption(option)
 |  |          this.accuracy.chart1.chartLine.setOption(option)
 | 
											
												
													
														|  |          if (this.accuracy.chart1.chartLine !== null) {
 |  |          if (this.accuracy.chart1.chartLine !== null) {
 | 
											
										
											
												
													
														|  | @@ -865,8 +908,10 @@
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  |        formatter(param) {
 |  |        formatter(param) {
 | 
											
												
													
														|  | 
 |  | +        // console.log(param,'param')
 | 
											
												
													
														|  |          return [
 |  |          return [
 | 
											
												
													
														|  | -            // '类别名称: ' + param.name,
 |  | 
 | 
											
												
													
														|  | 
 |  | +            '执行时间/分钟<br/>'+
 | 
											
												
													
														|  | 
 |  | +             '牧场: '+ param.name,
 | 
											
												
													
														|  |              '最大值: ' + param.data[1],
 |  |              '最大值: ' + param.data[1],
 | 
											
												
													
														|  |              '上四分位数: ' + param.data[2],
 |  |              '上四分位数: ' + param.data[2],
 | 
											
												
													
														|  |              '中位数: ' + param.data[3],
 |  |              '中位数: ' + param.data[3],
 | 
											
										
											
												
													
														|  | @@ -893,6 +938,12 @@
 | 
											
												
													
														|  |                  if(data[0].data !== 0 && data[1].data !== 0){
 |  |                  if(data[0].data !== 0 && data[1].data !== 0){
 | 
											
												
													
														|  |                    rate1 = (a/b * 100).toFixed(2)
 |  |                    rate1 = (a/b * 100).toFixed(2)
 | 
											
												
													
														|  |                    rate2 = 100 - (parseFloat(rate1))
 |  |                    rate2 = 100 - (parseFloat(rate1))
 | 
											
												
													
														|  | 
 |  | +                }else if(data[0].data == 100){
 | 
											
												
													
														|  | 
 |  | +                  rate1 = 100
 | 
											
												
													
														|  | 
 |  | +                  rate2 = 0
 | 
											
												
													
														|  | 
 |  | +                }else if(data[1].data == 100){
 | 
											
												
													
														|  | 
 |  | +                  rate1 = 0
 | 
											
												
													
														|  | 
 |  | +                  rate2 = 100
 | 
											
												
													
														|  |                  }else{
 |  |                  }else{
 | 
											
												
													
														|  |                    rate1 = 0
 |  |                    rate1 = 0
 | 
											
												
													
														|  |                    rate2 = 0
 |  |                    rate2 = 0
 |