Bladeren bron

回评功能修改为,提交当前任务分数后,停留在当前任务,不再获取下一待评任务;

ting.yin 5 jaren geleden
bovenliggende
commit
264d6da5b9

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

@@ -286,6 +286,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;
@@ -590,7 +593,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.getTask();
             }, 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

@@ -295,6 +295,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;
@@ -606,7 +609,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) {