Browse Source

fix(front): 排序

Go 5 years ago
parent
commit
ce95208386

+ 1 - 1
front/project/www/routes/course/data/page.js

@@ -159,7 +159,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null });
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null });
   }
 
   onOpen(index) {

+ 1 - 1
front/project/www/routes/course/note/page.js

@@ -84,7 +84,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
   }
 
   onChangePage(page) {

+ 1 - 1
front/project/www/routes/my/answer/page.js

@@ -149,7 +149,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
     this.initData();
   }
 

+ 1 - 1
front/project/www/routes/my/collect/page.js

@@ -220,7 +220,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
     this.initData();
   }
 

+ 1 - 0
front/project/www/routes/my/data/page.js

@@ -82,6 +82,7 @@ function pieOption1(value, text, subtext) {
           show: false,
         },
         data: [value, 100 - value],
+        silent: true,
       },
     ],
   };

+ 1 - 1
front/project/www/routes/my/error/page.js

@@ -227,7 +227,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
     this.initData();
   }
 

+ 1 - 1
front/project/www/routes/my/note/page.js

@@ -175,7 +175,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
   }
 
   onChangePage(page) {

+ 1 - 1
front/project/www/routes/my/report/page.js

@@ -584,7 +584,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
     this.initData();
   }
 

+ 1 - 1
front/project/www/routes/my/tools/page.js

@@ -264,7 +264,7 @@ export default class extends Page {
     const { sortMap } = this.state;
     const keys = Object.keys(value);
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null });
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null });
   }
 
   onTabChange(tab) {

+ 1 - 1
front/project/www/routes/question/search/page.js

@@ -110,7 +110,7 @@ export default class extends Page {
     // this.search({ order: keys.length ? keys.join('|') : null, direction: keys.length ? Object.values(value).join('|') : null });
     const { sortMap } = this.state;
     const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
-    this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
+    this.search({ order: keys.length && value[keys[index]] ? keys[index] : null, direction: keys.length ? value[keys[index]] : null }, false);
     this.initData();
   }
 

+ 1 - 0
server/data/src/main/resources/db/migration/V7__update_paper.sql

@@ -0,0 +1 @@
+ALTER TABLE user_paper modify column latest_time datetime DEFAULT NULL COMMENT '最近一次做题时间';

+ 1 - 1
server/gateway-api/src/main/java/com/qxgmat/service/UserPaperService.java

@@ -289,7 +289,7 @@ public class UserPaperService extends AbstractService {
      * @param report
      */
     public void accumulation(UserReport report){
-        userPaperRelationMapper.accumulation(report.getPaperId(), report.getUserNumber(), report.getUserTime(), report.getUserCorrect(), 1, report.getFinishTime(), report.getId());
+        userPaperRelationMapper.accumulation(report.getPaperId(), report.getUserNumber(), report.getUserTime(), report.getUserCorrect(), report.getIsFinish(), report.getFinishTime(), report.getId());
     }
 
     public int countByUser(Integer userId, PaperOrigin origin){

+ 3 - 0
server/gateway-api/src/main/java/com/qxgmat/service/extend/QuestionFlowService.java

@@ -781,6 +781,9 @@ public class QuestionFlowService {
         // 获取最后一次report,并生成结果
         UserReport userReport = userReportService.getLastByPaper(userId, userPaperId);
 
+        // Finish定义提交完成时间,包含restart,理解为endTime
+        userReport.setFinishTime(new Date());
+
         List<UserQuestion> userQuestionList = userQuestionService.listByReport(userId, userReport.getId());
         // 分析做题结果
         StatReport callback = finishCallback.get(PaperModule.ValueOf(userReport.getPaperModule()));