chengjie il y a 4 jours
Parent
commit
32a931f5ff
2 fichiers modifiés avec 27 ajouts et 1 suppressions
  1. 3 1
      .vscode/settings.json
  2. 24 0
      src/api/miaoguo/miaoguoController.js

+ 3 - 1
.vscode/settings.json

@@ -51,7 +51,9 @@
51 51
         "activityBarTop.inactiveForeground": "#e7e7e799",
52 52
         "commandCenter.foreground": "#e7e7e7",
53 53
         "statusBar.debuggingBackground": "#1857a4",
54
-        "statusBar.debuggingForeground": "#e7e7e7"
54
+        "statusBar.debuggingForeground": "#e7e7e7",
55
+        "activityBar.activeBorder": "#e7e7e7",
56
+        "activityBarTop.activeBorder": "#e7e7e7"
55 57
     },
56 58
     "peacock.color": "#1857a4"
57 59
 }

+ 24 - 0
src/api/miaoguo/miaoguoController.js

@@ -1261,6 +1261,12 @@ export async function GetMiaoguoCardToday2(ctx) {
1261 1261
                     result.CommonNewLength = list1.length;
1262 1262
                     result.CommonOldLength = list3.length;
1263 1263
                 }
1264
+                for (const item of list1)
1265
+                    item.IsUrgentCard = isUrgent ? 1 : 0;
1266
+                for (const item of list2)
1267
+                    item.IsUrgentCard = isUrgent ? 1 : 0;
1268
+                for (const item of list3)
1269
+                    item.IsUrgentCard = isUrgent ? 1 : 0;
1264 1270
                 listNew.push(...list1);
1265 1271
                 listReview.push(...list2);
1266 1272
                 listHistory.push(...list3);
@@ -1286,6 +1292,24 @@ export async function GetMiaoguoCardToday2(ctx) {
1286 1292
                     for (const item of list)
1287 1293
                         item.Content = contentMap.get(item.MiaoguoCardID) || [];
1288 1294
                 }
1295
+
1296
+                // 保证返回列表中每一项的 Content 均为 4 项,否则从列表中剔除,避免前端渲染异常
1297
+                for (const list of [listNew, listReview, listHistory]) {
1298
+                    for (let i = list.length - 1; i >= 0; i--) {
1299
+                        if (!Array.isArray(list[i].Content) || list[i].Content.length !== 4)
1300
+                            list.splice(i, 1);
1301
+                    }
1302
+                }
1303
+
1304
+                // 同步修正剔除后各项数量统计
1305
+                result.UrgentNewLength = listNew.filter(item => item.IsUrgentCard === 1).length;
1306
+                result.UrgentOldLength = listReview.filter(item => item.IsUrgentCard === 1).length + listHistory.filter(item => item.IsUrgentCard === 1).length;
1307
+                result.CommonNewLength = listNew.filter(item => item.IsUrgentCard === 0).length;
1308
+                result.CommonOldLength = listHistory.filter(item => item.IsUrgentCard === 0).length;
1309
+                for (const list of [listNew, listReview, listHistory]) {
1310
+                    for (const item of list)
1311
+                        delete item.IsUrgentCard;
1312
+                }
1289 1313
             }
1290 1314
 
1291 1315
             const dayNumberArr = await miaoguo.GetTaskData(param);