Prechádzať zdrojové kódy

修改自动报表获取最新的数据不对问题

zhoupeng 1 rok pred
rodič
commit
91bcdcac40

+ 1 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/task/ReportTableTask.java

@@ -794,6 +794,7 @@ public class ReportTableTask {
                         ));
                     }
                 }
+                reportChart.setReportChartItemList(reportChartItemList);
             }
             reportTable.setReportChartList(reportChartList);
         }

+ 2 - 1
chuanyi_client2/src/views/my_report/index.vue

@@ -1317,7 +1317,8 @@ export default {
         let axisLabel = {};
         axisLabel.rotate = 20;
         xAxis.axisLabel = axisLabel
-        xAxis.data = (reportChartItemList && reportChartItemList.length > 0) ? reportChartItemList[0].valueTimeList.split(",") : []
+        xAxis.data = (reportChartItemList && reportChartItemList.length > 0) ?
+            ((reportChartItemList[0].valueTimeList) ? reportChartItemList[0].valueTimeList.split(",") : []) : []
         // xAxis.data = xAxis.data.slice(0, 7)
         for (let i in reportChartItemList) {
           let name = reportChartItemList[i].describe ? reportChartItemList[i].describe : reportChartItemList[i].itemName

+ 2 - 3
chuanyi_client2/src/views/run_config/index.vue

@@ -1454,8 +1454,6 @@ export default {
           }
         }
       }
-      console.log("----")
-      console.log(info)
       if (chartType != 'pie') {
         // x 轴
         let xAxis = info.option.xAxis
@@ -1465,7 +1463,8 @@ export default {
         let axisLabel = {};
         axisLabel.rotate = 20;
         xAxis.axisLabel = axisLabel
-        xAxis.data = (reportChartItemList && reportChartItemList.length > 0) ? reportChartItemList[0].valueTimeList.split(",") : []
+        xAxis.data = (reportChartItemList && reportChartItemList.length > 0) ?
+            ((reportChartItemList[0].valueTimeList) ? reportChartItemList[0].valueTimeList.split(",") : []) : []
         // xAxis.data = xAxis.data.slice(0, 7)
         for (let i in reportChartItemList) {
           let name = reportChartItemList[i].describe ? reportChartItemList[i].describe : reportChartItemList[i].itemName