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 @@ - - - - - 柱状图 - - - - - - - - - - - -
-
-

柱状图

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