Quellcode durchsuchen

质量月报 - 乙烯/丙烯主产品质量

wangggziwen vor 1 Jahr
Ursprung
Commit
2869eb3559
1 geänderte Dateien mit 85 neuen und 1 gelöschten Zeilen
  1. 85 1
      ui/src/views/production/quality/index.vue

+ 85 - 1
ui/src/views/production/quality/index.vue

@@ -3468,9 +3468,93 @@ export default {
           });
           break;
         case "3":
+          this.disposeChart();
+          let ethyleneArray = [];
+          let ethyleneIndexArray = [];
+          let propyleneArray = [];
+          let propyleneIndexArray = [];
+          let sampleDateArray = [];
           listS4013(this.analysisQueryParams).then(response => {
             let data = response.data;
-            console.log(data)
+            for(let i = 0 ; i < data.length; i++){
+              ethyleneArray.push(data[i].ethylene);
+              ethyleneIndexArray.push("99.95");
+              sampleDateArray.push(data[i].sampleDate);
+            }
+            listS5003(this.analysisQueryParams).then(response => {
+              let data = response.data;
+              for(let i = 0 ; i < data.length; i++){
+                propyleneArray.push(data[i].propylene);
+                propyleneIndexArray.push("99.6");
+              }
+              let option = {
+                title: {
+                  text: dictLabel,
+                  left: 'center',
+                  textStyle: {
+                    fontSize: 16
+                  }
+                },
+                tooltip: {
+                  trigger: 'axis'
+                },
+                legend: {
+                  x: 'center',
+                  y: 'bottom',
+                  data: ['Ethylene', '乙烯指标', 'Propylene', '丙烯指标']
+                },
+                grid: {
+                  top: '10%',
+                  left: '3%',
+                  right: '4%',
+                  bottom: '10%',
+                  containLabel: true
+                },
+                toolbox: {
+                  feature: {
+                    saveAsImage: {}
+                  }
+                },
+                xAxis: {
+                  type: 'category',
+                  boundaryGap: false,
+                  data: sampleDateArray,
+                  axisLabel: {
+                    interval: 0,
+                    rotate: 45
+                  }
+                },
+                yAxis: {
+                  type: 'value',
+                  min: 99.5,
+                  max: 100,
+                },
+                series: [
+                  {
+                    name: 'Ethylene',
+                    type: 'line',
+                    data: ethyleneArray
+                  },
+                  {
+                    name: '乙烯指标',
+                    type: 'line',
+                    data: ethyleneIndexArray
+                  },
+                  {
+                    name: 'Propylene',
+                    type: 'line',
+                    data: propyleneArray
+                  },
+                  {
+                    name: '丙烯指标',
+                    type: 'line',
+                    data: propyleneIndexArray
+                  }
+                ]
+              };
+              this.chart = this.echarts.init(document.getElementById('chart'));
+              this.chart.setOption(option);
+            });
           });
           break;
         case "4":