Browse Source

Merge branch 'dev_190618' of http://git.qmth.com.cn/luoshi/stmms-ft.git into dev_190618

zhangjie 5 years ago
parent
commit
f5ca4afbf9

+ 2 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/report/ReportController.java

@@ -630,6 +630,8 @@ public class ReportController {
             jsonObject.accumulate("excellentRate", r.getExcellentRate());
             jsonObject.accumulate("passCount", r.getPassCount());
             jsonObject.accumulate("passRate", r.getPassRate());
+            jsonObject.accumulate("coefficient", r.getCoefficient());
+            jsonObject.accumulate("difficulty", r.getDifficulty());
             array.add(jsonObject);
         }
         return array.toString();

+ 11 - 5
stmms-web/src/main/webapp/static/mark-new/js/mark-control.js

@@ -288,10 +288,13 @@ MarkControl.prototype.initTriggers = function(option) {
     this.on('task.submit.before', this, function(event, context, eventObject) {
         context.submitting = true;
     });
-    this.on('task.submit.success', this, function(event, context, eventObject) {
+    this.on('history.submit.success', this, function(event, context, eventObject) {
         context.submitting = false;
-        context.task = undefined;
-        self.getTask();
+    });
+    this.on('task.submit.success', this, function(event, context, eventObject) {
+    	context.submitting = false;
+    	context.task = undefined;
+    	self.getTask();
     });
     this.on('task.submit.error', this, function(event, context, eventObject) {
         context.submitting = false;
@@ -308,7 +311,6 @@ MarkControl.prototype.initTriggers = function(option) {
     this.on('mark.setting.change', this, function(event, context, eventObject) {
         self.updateSetting(eventObject);
     });
-
     $(document).keypress(this, function(event) {
         if (self.context.listenKeyboard != false) {
             return self.trigger('key.press', event);
@@ -589,7 +591,11 @@ MarkControl.prototype.submitTask = function(submitUrl) {
                     markControl.context.status = status;
                     markControl.trigger('mark.status.change', status);
                 }
-                markControl.trigger('task.submit.success');
+                if(task.previous==true){
+                	markControl.trigger('history.submit.success',task);
+            	}else{
+            		markControl.trigger('task.submit.success');
+            	}
             }, function(message) {
                 markControl.trigger('task.submit.error', message);
             });

+ 14 - 0
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-history.js

@@ -82,6 +82,12 @@ function MarkHistory(option) {
     this.markControl.on('task.get.success', this, function(event, context, data) {
         this.loading = false;
     });
+    this.markControl.on('history.submit.success', this, function(event, context, task) {
+    	if(task.previous==true){
+    		alert('回评成功');
+    		this.updateTaskScore(task.totalScore);
+    	}
+    });
 }
 
 MarkHistory.prototype.init = function() {
@@ -270,6 +276,14 @@ MarkHistory.prototype.onTaskSelect = function(index) {
     }
 }
 
+MarkHistory.prototype.updateTaskScore = function(score) {
+	this.container.list.find('tr').each(function(index, obj) {
+        if ($(obj).hasClass("active")) {
+        	$(obj).find('td').last().html(score);
+        }
+    });
+}
+
 MarkHistory.prototype.toggle_button_dom = '<a href="#">回评</a>';
 
 MarkHistory.prototype.header_dom = '<div class="header">\

+ 10 - 0
stmms-web/src/main/webapp/static/mark-new/js/modules/sheet-view.js

@@ -18,6 +18,16 @@ function SheetView(option) {
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.render();
     });
+    this.markControl.on('view.sidebar.open', this, function(event, context, eventObject) {
+        if(context.task!=undefined){
+        	this.render(context.task.sheetUrls);
+        }
+    });
+    this.markControl.on('view.sidebar.close', this, function(event, context, eventObject) {
+    	if(context.task!=undefined){
+        	this.render(context.task.sheetUrls);
+        }
+    });
 }
 
 SheetView.prototype.init = function() {

+ 8 - 1
stmms-web/src/main/webapp/static/mark-track/js/mark-control.js

@@ -291,6 +291,9 @@ MarkControl.prototype.initTriggers = function(option) {
     this.on('task.submit.before', this, function(event, context, eventObject) {
         context.submitting = true;
     });
+    this.on('history.submit.success', this, function(event, context, eventObject) {
+        context.submitting = false;
+    });
     this.on('task.submit.success', this, function(event, context, eventObject) {
         context.submitting = false;
         context.task = undefined;
@@ -601,7 +604,11 @@ MarkControl.prototype.submitTask = function(submitUrl) {
                     markControl.trigger('mark.status.change', status);
                 }
                 // markControl.context.task = undefined;
-                markControl.trigger('task.submit.success');
+                if(task.previous==true){
+                	markControl.trigger('history.submit.success',task);
+            	}else{
+            		markControl.trigger('task.submit.success');
+            	}
                 markControl.trigger('mark.specialTag.success');
                 // markControl.getTask();
             }, function(message) {