Browse Source

教研报告样式调整

zhangjie 6 years ago
parent
commit
e1f568590a

+ 53 - 46
stmms-web/src/main/webapp/static/report-pdf/js/chart-render.js

@@ -1,4 +1,4 @@
-(function(window, undefined) {
+(function (window, undefined) {
   var chartOption = {
     barPointTopic: getBarPointTopicOptions,
     barPointGrade: getBarPointGradeOptions,
@@ -35,28 +35,28 @@
     this.renderType = renderType || "canvas";
   }
 
-  Charts.prototype.initChart = function() {
+  Charts.prototype.initChart = function () {
     return window.echarts.init(this.dome, "", {
       renderer: this.renderType
     });
   };
 
-  Charts.prototype.renderChart = function() {
+  Charts.prototype.renderChart = function () {
     var options = chartOption[this.chartType](this.dataList);
     if (options) this.initChart().setOption(options, true);
   };
 
   function getBarPointTopicOptions(datas) {
-    var yAxisLabels = datas.map(function(item) {
+    var yAxisLabels = datas.map(function (item) {
       return item.name;
     });
-    var avgDatas = datas.map(function(item) {
+    var avgDatas = datas.map(function (item) {
       return item.avgScore;
     });
-    var stdDatas = datas.map(function(item) {
+    var stdDatas = datas.map(function (item) {
       return item.stdevScore;
     });
-    var scoreRateDatas = datas.map(function(item) {
+    var scoreRateDatas = datas.map(function (item) {
       return item.scoreRate;
     });
 
@@ -101,7 +101,7 @@
     ];
 
     if (datas[0].hasOwnProperty("fullRate") && datas[0].fullRate) {
-      var fullRateDatas = datas.map(function(item) {
+      var fullRateDatas = datas.map(function (item) {
         return item.fullRate;
       });
       legendData.push("满分率");
@@ -170,7 +170,7 @@
           },
           axisLabel: {
             fontSize: 18,
-            formatter: function(value, index) {
+            formatter: function (value, index) {
               if (!index) return "0";
               return value.toFixed(2);
             }
@@ -199,7 +199,7 @@
           },
           axisLabel: {
             fontSize: 18,
-            formatter: function(value, index) {
+            formatter: function (value, index) {
               if (!index) return "";
               return parseInt(value * 100) + "%";
             }
@@ -229,7 +229,7 @@
           },
           axisLabel: {
             fontSize: 19,
-            margin: 50
+            margin: 30
           }
         },
         {
@@ -269,23 +269,23 @@
   }
 
   function getBarPointGradeOptions(datas) {
-    var yAxisLabels = datas.map(function(item) {
+    var yAxisLabels = datas.map(function (item) {
       return item.name;
     });
-    var avgDatas = datas.map(function(item) {
+    var avgDatas = datas.map(function (item) {
       return item.avgScore;
     });
-    var maxDatas = datas.map(function(item) {
+    var maxDatas = datas.map(function (item) {
       return item.maxScore;
     });
-    var minDatas = datas.map(function(item) {
+    var minDatas = datas.map(function (item) {
       return item.minScore;
     });
 
-    var passRateDatas = datas.map(function(item) {
+    var passRateDatas = datas.map(function (item) {
       return Math.round(item.passRate * 100);
     });
-    var excellentRateDatas = datas.map(function(item) {
+    var excellentRateDatas = datas.map(function (item) {
       return Math.round(item.excellentRate * 100);
     });
 
@@ -342,7 +342,7 @@
           axisLabel: {
             fontSize: 18,
             color: "#555",
-            formatter: function(value, index) {
+            formatter: function (value, index) {
               if (!index) return "0";
               return value;
             }
@@ -372,7 +372,7 @@
           axisLabel: {
             fontSize: 18,
             color: "#555",
-            formatter: function(value, index) {
+            formatter: function (value, index) {
               if (!index) return "";
               return (value / 100).toFixed(1);
             }
@@ -403,7 +403,7 @@
           axisLabel: {
             fontSize: 19,
             margin: 30,
-            formatter: function(value) {
+            formatter: function (value) {
               if (value.length > 8) {
                 return [value.substring(0, 8), value.substring(8)].join("\n");
               }
@@ -420,7 +420,7 @@
           axisLabel: {
             show: false,
             fontSize: 19,
-            formatter: function(value) {
+            formatter: function (value) {
               if (value.length > 8) {
                 return [value.substring(0, 8), value.substring(8)].join("\n");
               }
@@ -527,11 +527,11 @@
       "相对平均分"
     ];
 
-    var legendData = datas.map(function(item) {
+    var legendData = datas.map(function (item) {
       return item.name;
     });
 
-    var series = datas.map(function(item, index) {
+    var series = datas.map(function (item, index) {
       return {
         type: "bar",
         data: [
@@ -626,25 +626,25 @@
     var symbolCircle =
       "path://M16,9.2c-3.8,0-6.8,3.1-6.8,6.8s3.1,6.8,6.8,6.8s6.8-3.1,6.8-6.8S19.8,9.2,16,9.2z M29.7,16  c0,7.6-6.1,13.7-13.7,13.7S2.3,23.6,2.3,16S8.4,2.3,16,2.3S29.7,8.4,29.7,16z";
     var classes = datas.classes;
-    var xAxisData = classes.map(function(item) {
+    var xAxisData = classes.map(function (item) {
       return item.name;
     });
-    var avgDatas = classes.map(function(item) {
+    var avgDatas = classes.map(function (item) {
       return item.avgScore;
     });
-    var relateAvgDatas = classes.map(function(item) {
+    var relateAvgDatas = classes.map(function (item) {
       return item.relativeAvgScore;
     });
-    var maxDatas = classes.map(function(item) {
+    var maxDatas = classes.map(function (item) {
       return item.maxScore;
     });
-    var minDatas = classes.map(function(item) {
+    var minDatas = classes.map(function (item) {
       return item.minScore;
     });
-    var passRateDatas = classes.map(function(item) {
+    var passRateDatas = classes.map(function (item) {
       return item.passRate;
     });
-    var excellentRateDatas = classes.map(function(item) {
+    var excellentRateDatas = classes.map(function (item) {
       return item.excellentRate;
     });
 
@@ -695,7 +695,7 @@
           fontSize: 16,
           margin: 12,
           interval: 0,
-          formatter: function(value) {
+          formatter: function (value) {
             if (value.length > 6) {
               return [value.substring(0, 6), value.substring(6)].join("\n");
             }
@@ -748,7 +748,7 @@
           axisLabel: {
             fontSize: 16,
             color: "#555",
-            formatter: function(value) {
+            formatter: function (value) {
               if (!value) return "0";
               return value.toFixed(1);
             }
@@ -801,10 +801,10 @@
   }
 
   function getLineOptions(datas) {
-    var xAxisData = datas.map(function(item) {
+    var xAxisData = datas.map(function (item) {
       return item.name;
     });
-    var levelDatas = datas.map(function(item) {
+    var levelDatas = datas.map(function (item) {
       return item.difficulty;
     });
     var linearColor = new echarts.graphic.LinearGradient(0, 1, 0, 0, [
@@ -821,7 +821,9 @@
       animation: animationIsOpen,
       textStyle: textStyle,
       grid: {
-        top: 120
+        top: 120,
+        show: true,
+        borderColor: "rgba(230,230,230,1)"
       },
       xAxis: {
         type: "category",
@@ -867,7 +869,7 @@
           fontSize: 19,
           margin: 30,
           color: "#555",
-          formatter: function(value, index) {
+          formatter: function (value, index) {
             return value.toFixed(1);
           }
         }
@@ -889,10 +891,10 @@
   }
 
   function getLineReverseOptions(datas) {
-    var yAxisDatas = datas.map(function(item) {
+    var yAxisDatas = datas.map(function (item) {
       return item.name;
     });
-    var levelDatas = datas.map(function(item) {
+    var levelDatas = datas.map(function (item) {
       return item.difficulty;
     });
 
@@ -912,7 +914,9 @@
       grid: {
         top: 150,
         left: 170,
-        bottom: 50
+        bottom: 50,
+        show: true,
+        borderColor: "rgba(230,230,230,1)"
       },
       yAxis: {
         type: "category",
@@ -960,7 +964,7 @@
           fontSize: 16,
           margin: 20,
           color: "#555",
-          formatter: function(value, index) {
+          formatter: function (value, index) {
             return value.toFixed(1);
           }
         }
@@ -982,12 +986,13 @@
   }
 
   function getLineSmoothOptions(datainfo) {
+    var lineColors = colors.slice(0, -1);
     var datas = datainfo.dataList;
-    var lineColor = colors[datainfo.index % colors.length];
-    var xAxisData = datas.map(function(item) {
+    var lineColor = lineColors[datainfo.index % colors.length];
+    var xAxisData = datas.map(function (item) {
       return item.score;
     });
-    var levelDatas = datas.map(function(item) {
+    var levelDatas = datas.map(function (item) {
       return item.rangeRate;
     });
 
@@ -996,7 +1001,9 @@
       textStyle: textStyle,
       grid: {
         top: 110,
-        bottom: 80
+        bottom: 80,
+        show: true,
+        borderColor: "rgba(230,230,230,1)"
       },
       xAxis: {
         type: "category",
@@ -1010,7 +1017,7 @@
           fontSize: 19,
           margin: 20,
           interval: 0,
-          formatter: function(value) {
+          formatter: function (value) {
             return value + "-";
           }
         },
@@ -1039,7 +1046,7 @@
         axisLabel: {
           fontSize: 19,
           margin: 20,
-          formatter: function(value, index) {
+          formatter: function (value, index) {
             return value.toFixed(2);
           }
         }

+ 4 - 4
stmms-web/src/main/webapp/static/report-pdf/js/data-parse.js

@@ -9,7 +9,7 @@ function tofixed(num, precision) {
 // paser functions
 function parseBaseQuestion(datas) {
   return datas.map(function (item) {
-    item.name = item.name + item.number;
+    item.name = item.name + ' ' + item.number;
     item.avgScore = tofixed(item.avgScore, 2);
     item.stdevScore = tofixed(item.stdevScore, 2);
     item.coefficient = tofixed(item.coefficient, 2);
@@ -177,6 +177,6 @@ var basic_question_option = parseBaseQuestionOption(
   dataStatic.basic_question_option
 );
 var range_level = dataStatic.range_level;
- var range_10_totalScore = parseRangeTotalScore(dataStatic.range_10_totalScore);
- var range_1_totalScore = parseRangeTotalScore(dataStatic.range_1_totalScore);
- var range_segment_6 = parseRangeSegment(dataStatic.range_segment_6);
+var range_10_totalScore = parseRangeTotalScore(dataStatic.range_10_totalScore);
+var range_1_totalScore = parseRangeTotalScore(dataStatic.range_1_totalScore);
+var range_segment_6 = parseRangeSegment(dataStatic.range_segment_6);

+ 3 - 4
stmms-web/src/main/webapp/static/report-pdf/js/teaching.js

@@ -32,10 +32,9 @@ function build() {
   createBasicMainQuestion(basic_main_question);
   createBasicQuestionOption(basic_question_option);
   createRangeLevel(range_level);
-
-   createRange10TotalScore(range_10_totalScore);
-   createRangeTotalScore(range_1_totalScore);
-   createRangeSegment(range_segment_6);
+  createRange10TotalScore(range_10_totalScore);
+  createRangeTotalScore(range_1_totalScore);
+  createRangeSegment(range_segment_6);
   createEchart();
   fillCatalogNum();
 }