Ver código fonte

王子文 生产日报趋势分析

wangggziwen 2 anos atrás
pai
commit
e3345a9846

+ 2 - 1
master/src/main/java/com/ruoyi/project/production/mapper/TDailyProductionReportMapper.java

@@ -84,7 +84,8 @@ public interface TDailyProductionReportMapper
     @Select("select d.${fieldName} as valueData, d.report_date as dateData " +
             "from t_daily_production_report d " +
             "where d.REPORT_DATE >= to_date('${startDate}', 'yyyy-mm-dd') " +
-            "and d.REPORT_DATE <= to_date('${endDate}', 'yyyy-mm-dd')")
+            "and d.REPORT_DATE <= to_date('${endDate}', 'yyyy-mm-dd') " +
+            "order by d.report_date")
     List<AnalysisDataVO> selectAnalysisData(@Param("fieldName") String fieldName,
                                             @Param("startDate") String startDate,
                                             @Param("endDate") String endDate);

+ 9 - 5
ui/src/views/production/daily/index.vue

@@ -2819,7 +2819,7 @@
       </div>
     </el-dialog>
     <!-- 趋势分析对话框 -->
-    <el-dialog :title="analysis.title" :visible.sync="analysis.open" width="1000px" append-to-body>
+    <el-dialog @close="disposeChart" :title="analysis.title" :visible.sync="analysis.open" width="1000px" append-to-body>
       <el-form :model="analysisQueryParams" ref="queryForm" :inline="true" label-width="68px">
         <el-form-item label="开始日期" prop="startDate">
           <el-date-picker
@@ -4024,6 +4024,10 @@ export default {
   // },
   mixins: [echartMixins],
   methods: {
+    disposeChart() {
+      this.echarts.dispose(this.chart);
+      console.log("dispose了。。。");
+    },
     handleAnalysisQuery() {
       this.echarts.dispose(this.chart);
       this.valueList = [];
@@ -4048,7 +4052,7 @@ export default {
             right: 80,
           },
           xAxis: {
-            data: this.dateList.reverse(),
+            data: this.dateList,
             name: '日期'
           },
           yAxis: {
@@ -4061,7 +4065,7 @@ export default {
                 show: true,
                 position: 'top'
               },
-              data: this.valueList.reverse(),
+              data: this.valueList,
               type: 'line',
               smooth: true,
               symbolSize: 15,
@@ -4092,7 +4096,7 @@ export default {
             right: 80,
           },
           xAxis: {
-            data: this.dateList.reverse(),
+            data: this.dateList,
             name: '日期'
           },
           yAxis: {
@@ -4105,7 +4109,7 @@ export default {
                 show: true,
                 position: 'top'
               },
-              data: this.valueList.reverse(),
+              data: this.valueList,
               type: 'line',
               smooth: true,
               symbolSize: 15,