From 1e3fbb421f86eed70c961e3501cc2d77da50aab5 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Fri, 14 Jul 2023 10:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E7=9A=84=E6=8A=98=E7=8E=B0=E3=80=81?= =?UTF-8?q?=E6=9F=B1=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PageController.java | 9 +- .../LineOrBarChart.html} | 26 ++- .../pages/depository/inEchart/BarChart.html | 215 ------------------ 3 files changed, 16 insertions(+), 234 deletions(-) rename src/main/resources/templates/pages/depository/{inEchart/LineChart.html => InAndOut_echart/LineOrBarChart.html} (90%) delete mode 100644 src/main/resources/templates/pages/depository/inEchart/BarChart.html diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 36d42b77..71689cd2 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -3948,13 +3948,8 @@ public class PageController { public ModelAndView echartForTable(String type, String echartType) { ModelAndView mv = new ModelAndView(); mv.addObject("type", type); - if ("line".equals(echartType)) { - - mv.setViewName("pages/depository/inEchart/LineChart"); - } else if ("bar".equals(echartType)) { - - mv.setViewName("pages/depository/inEchart/BarChart"); - } + mv.addObject("echartType", echartType); + mv.setViewName("pages/depository/InAndOut_echart/LineOrBarChart"); return mv; } diff --git a/src/main/resources/templates/pages/depository/inEchart/LineChart.html b/src/main/resources/templates/pages/depository/InAndOut_echart/LineOrBarChart.html similarity index 90% rename from src/main/resources/templates/pages/depository/inEchart/LineChart.html rename to src/main/resources/templates/pages/depository/InAndOut_echart/LineOrBarChart.html index dc87bb57..ed20dd60 100644 --- a/src/main/resources/templates/pages/depository/inEchart/LineChart.html +++ b/src/main/resources/templates/pages/depository/InAndOut_echart/LineOrBarChart.html @@ -42,6 +42,7 @@

折线图

+ @@ -51,7 +52,7 @@ -
+
@@ -79,9 +80,10 @@ let type = $("#type").val(); + let echartType = $("#echartType").val(); // 折线图 - let LineChart = echarts.init(document.getElementById('echarts-line')); - let LineChartOption = { + let EChart = echarts.init(document.getElementById('echarts')); + let EChartOption = { xAxis: { type: 'category', data: [] @@ -92,7 +94,7 @@ series: [ { data: [], - type: 'line' + type: '' } ], toolbox: { @@ -112,7 +114,7 @@ content:'
', success:function(){ var fullchart = echarts.init(window.top.document.getElementById('fullChart')); - fullchart.setOption(LineChartOption) + fullchart.setOption(EChartOption) } }) } @@ -131,7 +133,7 @@ $(function () { let req = {}; req.type = type; - req.echartType = "line"; + req.echartType = echartType; getThisUserDepository(); initBarChartByDateType(req); }); @@ -143,7 +145,7 @@ req.type = type; req.depositoryId = $("#selectDepositoryForChart").val(); req.dateType = "month"; - req.echartType = "line"; + req.echartType = echartType; initBarChartByDateType(req); }); // 按天加载 @@ -152,7 +154,7 @@ req.type = type; req.depositoryId = $("#selectDepositoryForChart").val(); req.dateType = "day"; - req.echartType = "line"; + req.echartType = echartType; initBarChartByDateType(req); }); @@ -161,7 +163,7 @@ let req = {}; req.depositoryId = value; req.type = type; - req.echartType = "line"; + req.echartType = echartType; initBarChartByDateType(req); }); @@ -181,9 +183,9 @@ // 日期名称 let dayNames = data.dayNames; let series = data.data; - LineChartOption.xAxis.data = dayNames; - LineChartOption.series = series; - LineChart.setOption(LineChartOption); + EChartOption.xAxis.data = dayNames; + EChartOption.series = series; + EChart.setOption(EChartOption); } }) }; diff --git a/src/main/resources/templates/pages/depository/inEchart/BarChart.html b/src/main/resources/templates/pages/depository/inEchart/BarChart.html deleted file mode 100644 index 18f22bc6..00000000 --- a/src/main/resources/templates/pages/depository/inEchart/BarChart.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - 柱状图 - - - - - - - - - - - -
-
-

柱状图

-
- - - - -
-
-
-
-
- - - - - - - -