zhangjie %!s(int64=6) %!d(string=hai) anos
pai
achega
46bcace79b

+ 5 - 4
stmms-web/src/main/webapp/WEB-INF/views/modules/report/pdf.jsp

@@ -20,6 +20,7 @@
   </div>
 
 
+
   <!-- template -->
   <!-- page-box -->
   <script id="page-box" type="text/html">
@@ -154,7 +155,7 @@
           <td rowspan="<#:=groups.length#>"><#:=dataList[i].name#></td>
           <# } #>
           <# var levels = groups[j].levels; #>
-          <td><#:=groups[j].name#></td>
+          <td class="td-name"><p><#:=groups[j].name#></p></td>
           <td><#:=groups[j].questionCount#></td>
           <td><#:=groups[j].fullScore#></td>
           <td><#:=groups[j].coefficient#></td>
@@ -214,7 +215,7 @@
           <td rowspan="<#:=groups.length#>"><#:=dataList[i].name#></td>
           <# } #>
           <# var levels = groups[j].levels #>
-          <td><#:=groups[j].name#></td>
+          <td class="td-name"><p><#:=groups[j].name#></p></td>
           <td><#:=groups[j].questionCount#></td>
           <td><#:=groups[j].fullScore#></td>
           <td><#:=groups[j].difficulty#></td>
@@ -302,7 +303,7 @@
           <# if (i == 0) { #>
             <td rowspan="<#:=dataList.length#>">全部</td>
           <# } #>
-          <td><#:=dataItem.name#></td>
+          <td class="td-name"><p><#:=dataItem.name#></p></td>
           <td><#:=dataItem.fullScore#></td>
           <td><#:=dataItem.maxScore#></td>
           <td><#:=dataItem.minScore#></td>
@@ -399,7 +400,7 @@
         </tr>
         <# for (var i = 0; i < dataList.length; i++ )  {#>
         <tr>
-          <td><#:=dataList[i].score#></td>
+          <td><#:=dataList[i].score#><#:=isOneStep ? '' : '-'#></td>
           <td><#:=dataList[i].rangeCount#></td>
           <td><#:=dataList[i].rangeRate#></td>
           <td><#:=dataList[i].sumCount#></td>

+ 42 - 7
stmms-web/src/main/webapp/static/report-pdf/js/chart-render.js

@@ -46,9 +46,21 @@
     if (options) this.initChart().setOption(options, true);
   };
 
+  function getStrLen(str) {
+    var len = 0;
+    for (var i = 0; i < str.length; i++) {
+      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) == 94) {
+        len += 2;
+      } else {
+        len++;
+      }
+    }
+    return len;
+  }
+
   function getBarPointTopicOptions(datas) {
     var yAxisLabels = datas.map(function (item) {
-      return item.name;
+      return [item.name, item.number].join('#');
     });
     var avgDatas = datas.map(function (item) {
       return item.avgScore;
@@ -225,8 +237,13 @@
             }
           },
           axisLabel: {
-            fontSize: 19,
-            margin: 30
+            fontSize: 17,
+            margin: 20,
+            formatter: function (value) {
+              var str = value.split('#');
+              if (str[0].length > 10) str[0] = str[0].substr(0, 10) + '...'
+              return [str[0], str[1]].join(' ')
+            }
           }
         },
         {
@@ -819,6 +836,7 @@
       textStyle: textStyle,
       grid: {
         top: 120,
+        bottom: 100,
         show: true,
         borderColor: "rgba(230,230,230,1)"
       },
@@ -835,7 +853,11 @@
         axisLabel: {
           fontSize: 19,
           margin: 20,
-          interval: 0
+          interval: 0,
+          formatter: function name(value) {
+            var str = sectionArr(value, 9)
+            return str.join('\n')
+          }
         },
         axisLine: {
           lineStyle: {
@@ -889,7 +911,7 @@
 
   function getLineReverseOptions(datas) {
     var yAxisDatas = datas.map(function (item) {
-      return item.name;
+      return [item.name, item.number].join('#');
     });
     var levelDatas = datas.map(function (item) {
       return item.difficulty;
@@ -910,7 +932,7 @@
       textStyle: textStyle,
       grid: {
         top: 150,
-        left: 170,
+        left: 200,
         bottom: 50,
         show: true,
         borderColor: "rgba(230,230,230,1)"
@@ -929,7 +951,12 @@
         axisLabel: {
           fontSize: 17,
           margin: 20,
-          interval: 0
+          interval: 0,
+          formatter: function (value) {
+            var str = value.split('#');
+            if (str[0].length > 10) str[0] = str[0].substr(0, 10) + '...';
+            return [str[0], str[1]].join(' ')
+          }
         },
         axisLine: {
           lineStyle: {
@@ -1064,5 +1091,13 @@
     };
   }
 
+  function sectionArr(arrayList, sectionLength) {
+    var splitArr = [];
+    for (var i = 0, len = arrayList.length; i < len; i += sectionLength) {
+      splitArr.push(arrayList.slice(i, i + sectionLength));
+    }
+    return splitArr;
+  }
+
   window.Charts = Charts;
 })(window);

+ 1 - 1
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.avgScore = tofixed(item.avgScore, 2);
     item.stdevScore = tofixed(item.stdevScore, 2);
     item.coefficient = tofixed(item.coefficient, 2);

+ 9 - 11
stmms-web/src/main/webapp/static/report-pdf/js/linsh.json

@@ -89,17 +89,15 @@
   "basic_teacher": [
     {
       "name": "教师姓名",
-      "total": {
-        "totalCount": 100,
-        "maxScore": 100,
-        "minScore": 50,
-        "excellentCount": 10,
-        "excellentRate": 0.1,
-        "passCount": 20,
-        "passRate": 0.3,
-        "avgScore": 50,
-        "relativeAvgScore": -10
-      },
+      "totalCount": 100,
+      "maxScore": 100,
+      "minScore": 50,
+      "excellentCount": 10,
+      "excellentRate": 0.1,
+      "passCount": 20,
+      "passRate": 0.3,
+      "avgScore": 50,
+      "relativeAvgScore": -10,
       "classes": [
         {
           "name": "班级名称",

+ 2 - 0
stmms-web/src/main/webapp/static/report-pdf/js/teaching.js

@@ -236,6 +236,7 @@ function createRange10TotalScore(datas) {
     });
     var $dom = tmpl(hTmpl, {
       title: item.title,
+      isOneStep: false,
       pageTableClass: "table-ave-5",
       dataList: item.dataList,
       chartId: chartId
@@ -264,6 +265,7 @@ function createRangeTotalScore(datas) {
     sectionArr(item.dataList, 32).forEach(function (elem) {
       var $dom = tmpl(hTmpl, {
         title: item.title,
+        isOneStep: true,
         pageTableClass: "table-ave-5 page-table-pad",
         dataList: elem,
         chartId: ""