chengjie недель назад: 2
Родитель
Сommit
a9c64f5026
3 измененных файлов с 22 добавлено и 15 удалено
  1. 1 1
      src/api/mps/mpsCommonController.js
  2. 15 8
      src/api/mps/mpsScoreController.js
  3. 6 6
      src/model/mps.js

+ 1 - 1
src/api/mps/mpsCommonController.js

@@ -408,7 +408,7 @@ export async function GetMPSArticle(ctx) {
408 408
     let articles = [
409 409
         {
410 410
             ID: 27,
411
-            Category: "2025",
411
+            Category: "2026",
412 412
             IsPageShow: 1,
413 413
             Logo: "icon_sys_02.png",
414 414
             Title: "2026新开17所高中介绍(黄埔、徐汇、静安、普陀、闵行……)",

+ 15 - 8
src/api/mps/mpsScoreController.js

@@ -93,14 +93,21 @@ export async function GetMPSDistrictPersonNum(ctx) {
93 93
                 for(let i=0;i<list.length;i++){
94 94
                     list[i].PlanNum=Number(list[i].PlanNum);
95 95
                 }
96
-                arr.push({ "Name": "能上" + list[1].SchoolType2Short, "Year1": list[1].PlanNum, "Year2": list[1].PlanNum - list[0].PlanNum });
97
-                arr.push({ "Name": "能上" + list[5].SchoolType2Short, "Year1": list[5].PlanNum + list[3].PlanNum, "Year2": list[5].PlanNum + list[3].PlanNum - list[4].PlanNum - list[2].PlanNum });
98
-                arr.push({ "Name": "能上" + list[7].SchoolType2Short, "Year1": list[7].PlanNum, "Year2": list[7].PlanNum - list[6].PlanNum });
99
-                arr.push({ "Name": "能上高中总计", "Year1": arr[0].Year1 + arr[1].Year1 + arr[2].Year1, "Year2": arr[0].Year2 + arr[1].Year2 + arr[2].Year2 });
100
-
101
-                arr[0].Rate = Math.round(100 * arr[0].Year1 / arr[3].Year1);
102
-                arr[1].Rate = Math.round(100 * arr[1].Year1 / arr[3].Year1);
103
-                arr[2].Rate = Math.round(100 * arr[2].Year1 / arr[3].Year1);
96
+                
97
+                if (arr[1]){
98
+                    arr.push({ "Name": "能上" + list[1].SchoolType2Short, "Year1": list[1].PlanNum, "Year2": list[1].PlanNum - list[0].PlanNum });
99
+                    arr.push({ "Name": "能上" + list[5].SchoolType2Short, "Year1": list[5].PlanNum + list[3].PlanNum, "Year2": list[5].PlanNum + list[3].PlanNum - list[4].PlanNum - list[2].PlanNum });
100
+                    arr.push({ "Name": "能上" + list[7].SchoolType2Short, "Year1": list[7].PlanNum, "Year2": list[7].PlanNum - list[6].PlanNum });
101
+                    arr.push({ "Name": "能上高中总计", "Year1": arr[0].Year1 + arr[1].Year1 + arr[2].Year1, "Year2": arr[0].Year2 + arr[1].Year2 + arr[2].Year2 });
102
+
103
+                    arr[0].Rate = Math.round(100 * arr[0].Year1 / arr[3].Year1);
104
+                    arr[1].Rate = Math.round(100 * arr[1].Year1 / arr[3].Year1);
105
+                    arr[2].Rate = Math.round(100 * arr[2].Year1 / arr[3].Year1);
106
+                }
107
+                else{
108
+                    arr.push({ "Name": "能上" + list[1].SchoolType2Short, "Year1": list[1].PlanNum, "Year2": '-' });
109
+                    arr[0].Rate="-";
110
+                }
104 111
             }
105 112
 
106 113
             info = {

+ 6 - 6
src/model/mps.js

@@ -224,14 +224,14 @@ class MPS {
224 224
 
225 225
 // 当前年份配置
226 226
 export const ArrYear = [
227
-    // {
228
-    //     Name: "2026",
229
-    //     CSS: ""
230
-    // },
231 227
     {
232
-        Name: "2025",
233
-        IsNullScoreLine: (moment().format("MM-DD") >= "05-30" && moment().format("MM-DD") < "07-14") ? true : false, // 当只有计划没有分数线时
228
+        Name: "2026",
229
+        IsNullScoreLine: (moment().format("MM-DD") >= "05-31" && moment().format("MM-DD") < "07-14") ? true : false, // 当只有计划没有分数线时
234 230
         CSS: "Selected"
231
+    },
232
+    {
233
+        Name: "2025",
234
+        CSS: ""
235 235
     }, {
236 236
         Name: "2024",
237 237
         CSS: ""