Browse Source

bug修复与功能优化

1.修复普通阅卷模式图片渲染宽度问题
2.重构普通阅卷模式下特殊标记组件的事件传递
3.修复缩略图无法快速定位bug
4.修复回评关闭时无法切换到新任务的bug
5.修复全局内存锁初始化bug
luoshi 6 years ago
parent
commit
7b5f0b39ef

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkLockService.java

@@ -95,7 +95,7 @@ public class MarkLockService {
         if (lock == null) {
         if (lock == null) {
             synchronized (map) {
             synchronized (map) {
                 lock = map.get(key);
                 lock = map.get(key);
-                if (lock != null) {
+                if (lock == null) {
                     lock = new AtomicBoolean(false);
                     lock = new AtomicBoolean(false);
                     map.put(key, lock);
                     map.put(key, lock);
                 }
                 }

+ 3 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markNew.jsp

@@ -31,6 +31,7 @@
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/warning-info.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/warning-info.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/thumbnail.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/thumbnail.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/single-image-view.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/single-image-view.js"></script>
+<script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/simple-image-view.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/change-name.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/change-name.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/tag-process.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/tag-process.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/view-sidebar.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/view-sidebar.js"></script>
@@ -52,6 +53,7 @@
 				forceSpecialTag : '${forceSpecialTag}',
 				forceSpecialTag : '${forceSpecialTag}',
 				modules : {
 				modules : {
 					'single-image-view' : {},
 					'single-image-view' : {},
+			        //'simple-image-view' : {},
 					'image-builder': {},
 					'image-builder': {},
 					'mark-status': {
 					'mark-status': {
 						simple : false,
 						simple : false,
@@ -64,7 +66,7 @@
 						showScoreBoard : false,
 						showScoreBoard : false,
 						autoSubmit : false,
 						autoSubmit : false,
 						needConfirm : false,
 						needConfirm : false,
-              //        	showTotalScore:true
+						//showTotalScore:true
 					},
 					},
 					'sheet-view' : {
 					'sheet-view' : {
 						server : '${sheetServer}'
 						server : '${sheetServer}'

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

@@ -10,8 +10,7 @@ function MarkControl(option) {
         staticServer: option.staticServer,
         staticServer: option.staticServer,
         isFinish: false,
         isFinish: false,
         prefetching: false,
         prefetching: false,
-        prefetchTask: [],
-        forceSpecialTag:option.forceSpecialTag
+        prefetchTask: []
     };
     };
     //初始化容器结构
     //初始化容器结构
     this.initContainer();
     this.initContainer();
@@ -510,17 +509,15 @@ MarkControl.prototype.submitTask = function(submitUrl) {
         task.arbitrationList = undefined;
         task.arbitrationList = undefined;
 
 
         this.trigger('task.submit.before');
         this.trigger('task.submit.before');
-        this.trigger('mark.specialTag.before');
         
         
         //开启强制标记
         //开启强制标记
-        if(markControl.context.forceSpecialTag){
+        if(this.option.forceSpecialTag===true){
         	console.log(task);
         	console.log(task);
         	if(task.tagList==undefined ||task.tagList==null ||task.tagList.length <= 0){
         	if(task.tagList==undefined ||task.tagList==null ||task.tagList.length <= 0){
-        		return ;
+        		return;
         	}
         	}
         }
         }
         
         
-        
         if (this.taskControl != undefined) {
         if (this.taskControl != undefined) {
             //已定义任务引擎
             //已定义任务引擎
             this.taskControl.submit(task, function(status) {
             this.taskControl.submit(task, function(status) {
@@ -547,7 +544,6 @@ MarkControl.prototype.submitTask = function(submitUrl) {
                     if (result.success == true) {
                     if (result.success == true) {
                         //markControl.context.task = undefined;
                         //markControl.context.task = undefined;
                         markControl.trigger('task.submit.success');
                         markControl.trigger('task.submit.success');
-                        markControl.trigger('mark.specialTag.success');
                         //markControl.getTask();
                         //markControl.getTask();
                     } else {
                     } else {
                         markControl.trigger('task.submit.error', result.message);
                         markControl.trigger('task.submit.error', result.message);
@@ -559,7 +555,6 @@ MarkControl.prototype.submitTask = function(submitUrl) {
             });
             });
         } else {
         } else {
             markControl.trigger('task.submit.success');
             markControl.trigger('task.submit.success');
-            markControl.trigger('mark.specialTag.success');
             //markControl.getTask();
             //markControl.getTask();
         }
         }
     }
     }

+ 9 - 7
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-board.js

@@ -107,15 +107,17 @@ function MarkBoard(option) {
 MarkBoard.prototype.init = function() {
 MarkBoard.prototype.init = function() {
     this.stepBoard = getDom(this.step_board_dom, this.markControl).appendTo(this.markControl.container.centerContent);
     this.stepBoard = getDom(this.step_board_dom, this.markControl).appendTo(this.markControl.container.centerContent);
     this.stepBoard.height(this.markControl.container.centerContent.height());
     this.stepBoard.height(this.markControl.container.centerContent.height());
+    
     this.stepBoard.selectiveHeader = this.stepBoard.find('#step-board-selective-header');
     this.stepBoard.selectiveHeader = this.stepBoard.find('#step-board-selective-header');
     this.stepBoard.stepHolder = this.stepBoard.find('.step-list');
     this.stepBoard.stepHolder = this.stepBoard.find('.step-list');
-    this.stepBoard.stepHolder.height(this.markControl.container.centerContent.height() - 90);
-    this.stepBoard.stepHolder.perfectScrollbar({
-        wheelSpeed: 20,
-        useKeyboard: false,
-        minScrollbarLength: 30,
-        suppressScrollX: true
-    });
+    this.stepBoard.stepHolder.height(this.markControl.container.centerContent.height() - 120);
+    this.stepBoard.stepHolder.css('overflow', 'scroll');
+    //this.stepBoard.stepHolder.perfectScrollbar({
+    //    wheelSpeed: 20,
+    //    useKeyboard: false,
+    //    minScrollbarLength: 30,
+    //    suppressScrollX: true
+    //});
 
 
     this.scoreBoard = getDom(this.scoreBoard_dom, this.markControl).appendTo(this.markControl.container);
     this.scoreBoard = getDom(this.scoreBoard_dom, this.markControl).appendTo(this.markControl.container);
     this.scoreBoard.header = getDom(this.scoreBoard_header_dom, this.markControl).appendTo(this.scoreBoard).find('#score-board-header');
     this.scoreBoard.header = getDom(this.scoreBoard_header_dom, this.markControl).appendTo(this.scoreBoard).find('#score-board-header');

+ 3 - 2
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-history.js

@@ -84,10 +84,11 @@ MarkHistory.prototype.init = function() {
     this.container.paginator = getDom(this.paginator_dom, this.markControl).appendTo(this.container);
     this.container.paginator = getDom(this.paginator_dom, this.markControl).appendTo(this.container);
     this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
     this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
 
 
+	var self = this;
     this.container.header.find('#close-history-button').click(this, function(event) {
     this.container.header.find('#close-history-button').click(this, function(event) {
         event.data.toggle(false);
         event.data.toggle(false);
-        this.markControl.context.task = undefined;
-        this.markControl.getTask();
+        self.markControl.context.task = undefined;
+        self.markControl.getTask();
     })
     })
     this.container.paginator.find('#last-page-button').click(this, function(event) {
     this.container.paginator.find('#last-page-button').click(this, function(event) {
         var markHistory = event.data;
         var markHistory = event.data;

+ 15 - 15
stmms-web/src/main/webapp/static/mark-new/js/modules/simple-image-view.js

@@ -1,11 +1,11 @@
 //简单多张图片排列显示模块
 //简单多张图片排列显示模块
-var single_image_view = function(option, success) {
-    var object = new SingleImageView(option);
+var simple_image_view = function(option, success) {
+    var object = new SimpleImageView(option);
     success();
     success();
     return object;
     return object;
 }
 }
 
 
-function SingleImageView(option) {
+function SimpleImageView(option) {
     this.markControl = option.markControl;
     this.markControl = option.markControl;
     this.defaultZoom = 100;
     this.defaultZoom = 100;
     this.loading = false;
     this.loading = false;
@@ -60,7 +60,7 @@ function SingleImageView(option) {
     });
     });
 }
 }
 
 
-SingleImageView.prototype.init = function() {
+SimpleImageView.prototype.init = function() {
     this.configCache = {};
     this.configCache = {};
 
 
     //this.container = getDom(this.container_dom).appendTo(this.markControl.container.imageContent);
     //this.container = getDom(this.container_dom).appendTo(this.markControl.container.imageContent);
@@ -113,7 +113,7 @@ SingleImageView.prototype.init = function() {
     });
     });
 }
 }
 
 
-SingleImageView.prototype.render = function() {
+SimpleImageView.prototype.render = function() {
     if (this.task != undefined) {
     if (this.task != undefined) {
         var config = this.configCache[this.task.blockId];
         var config = this.configCache[this.task.blockId];
         if (config == undefined) {
         if (config == undefined) {
@@ -135,7 +135,7 @@ SingleImageView.prototype.render = function() {
     }
     }
 }
 }
 
 
-SingleImageView.prototype.loadImage = function() {
+SimpleImageView.prototype.loadImage = function() {
     if (this.task.imageData != undefined && this.loading == false) {
     if (this.task.imageData != undefined && this.loading == false) {
         this.loading = true;
         this.loading = true;
         if (this.iviewer == undefined) {
         if (this.iviewer == undefined) {
@@ -168,7 +168,7 @@ SingleImageView.prototype.loadImage = function() {
     }
     }
 }
 }
 
 
-SingleImageView.prototype.onImageLoad = function() {
+SimpleImageView.prototype.onImageLoad = function() {
     this.loading = false;
     this.loading = false;
     this.container.scrollTop(0);
     this.container.scrollTop(0);
     if (this.currentConfig != undefined && this.currentConfig.zoom != undefined && this.currentConfig.zoom != this.defaultZoom) {
     if (this.currentConfig != undefined && this.currentConfig.zoom != undefined && this.currentConfig.zoom != this.defaultZoom) {
@@ -192,7 +192,7 @@ SingleImageView.prototype.onImageLoad = function() {
     this.markControl.trigger('task.load.finish');
     this.markControl.trigger('task.load.finish');
 }
 }
 
 
-SingleImageView.prototype.onZoomSet = function(zoom) {
+SimpleImageView.prototype.onZoomSet = function(zoom) {
     if (this.loading == false && this.currentConfig != undefined) {
     if (this.loading == false && this.currentConfig != undefined) {
         this.currentConfig.zoom = zoom;
         this.currentConfig.zoom = zoom;
         this.updateScrollTop(this.currentConfig.scrollTop);
         this.updateScrollTop(this.currentConfig.scrollTop);
@@ -200,20 +200,20 @@ SingleImageView.prototype.onZoomSet = function(zoom) {
     }
     }
 }
 }
 
 
-SingleImageView.prototype.onStopDrag = function(point) {
+SimpleImageView.prototype.onStopDrag = function(point) {
     if (this.loading == false) {
     if (this.loading == false) {
         this.currentConfig.dx = point.x;
         this.currentConfig.dx = point.x;
         this.currentConfig.dy = point.y;
         this.currentConfig.dy = point.y;
     }
     }
 }
 }
 
 
-SingleImageView.prototype.onRotate = function(angle) {
+SimpleImageView.prototype.onRotate = function(angle) {
     if (this.loading == false) {
     if (this.loading == false) {
         this.currentConfig.rotate = angle;
         this.currentConfig.rotate = angle;
     }
     }
 }
 }
 
 
-SingleImageView.prototype.updateScrollTop = function(scrollTopPercent) {
+SimpleImageView.prototype.updateScrollTop = function(scrollTopPercent) {
     var height = this.imageHolder.height();
     var height = this.imageHolder.height();
     var minHeight = this.container.height();
     var minHeight = this.container.height();
     if (scrollTopPercent != undefined && scrollTopPercent >= 0 && scrollTopPercent <= 1 && height > minHeight) {
     if (scrollTopPercent != undefined && scrollTopPercent >= 0 && scrollTopPercent <= 1 && height > minHeight) {
@@ -225,7 +225,7 @@ SingleImageView.prototype.updateScrollTop = function(scrollTopPercent) {
     }
     }
 }
 }
 
 
-SingleImageView.prototype.updateScrollLeft = function(scrollLeftPercent) {
+SimpleImageView.prototype.updateScrollLeft = function(scrollLeftPercent) {
     var width = this.imageHolder.width();
     var width = this.imageHolder.width();
     var minWidth = this.container.width();
     var minWidth = this.container.width();
     if (scrollLeftPercent != undefined && scrollLeftPercent >= 0 && scrollLeftPercent <= 1 && width > minWidth) {
     if (scrollLeftPercent != undefined && scrollLeftPercent >= 0 && scrollLeftPercent <= 1 && width > minWidth) {
@@ -237,9 +237,9 @@ SingleImageView.prototype.updateScrollLeft = function(scrollLeftPercent) {
     }
     }
 }
 }
 
 
-SingleImageView.prototype.container_dom = '<div class="image-content"></div>';
+SimpleImageView.prototype.container_dom = '<div class="image-content"></div>';
 
 
-SingleImageView.prototype.image_control_dom = '<em>\
+SimpleImageView.prototype.image_control_dom = '<em>\
 <a href="#" class="btn zoom-out-button">放大</a>\
 <a href="#" class="btn zoom-out-button">放大</a>\
 <a href="#" class="btn zoom-in-button">缩小</a>\
 <a href="#" class="btn zoom-in-button">缩小</a>\
 <a href="#" class="btn zoom-fit-button">适应</a>\
 <a href="#" class="btn zoom-fit-button">适应</a>\
@@ -247,4 +247,4 @@ SingleImageView.prototype.image_control_dom = '<em>\
 <a href="#" class="btn rotate-button">旋转</a>\
 <a href="#" class="btn rotate-button">旋转</a>\
 </em>';
 </em>';
 
 
-SingleImageView.prototype.image_holder_dom = '<div style="position: relative;"></div>';
+SimpleImageView.prototype.image_holder_dom = '<div style="position: relative;"></div>';

+ 42 - 38
stmms-web/src/main/webapp/static/mark-new/js/modules/single-image-view.js

@@ -9,7 +9,20 @@ function SingleImageView(option) {
     this.markControl = option.markControl;
     this.markControl = option.markControl;
     this.init();
     this.init();
     this.markControl.on('center.width.change', this, function(event, context, eventObject) {
     this.markControl.on('center.width.change', this, function(event, context, eventObject) {
-        //this.container.perfectScrollbar('update');
+        this.reloadImage();
+        this.markControl.trigger('image.reload.event');
+    });
+    this.markControl.on('step.board.show', this, function(event, context, eventObject) {
+        this.container.removeClass('span12');
+        this.container.addClass('span10');
+        this.reloadImage();
+        this.markControl.trigger('image.reload.event');
+    });
+    this.markControl.on('step.board.hide', this, function(event, context, eventObject) {
+        this.container.removeClass('span10');
+        this.container.addClass('span12');
+        this.reloadImage();
+        this.markControl.trigger('image.reload.event');
     });
     });
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.task = undefined;
         this.task = undefined;
@@ -26,47 +39,34 @@ function SingleImageView(option) {
         this.image = undefined;
         this.image = undefined;
         this.render();
         this.render();
     });
     });
-    this.markControl.on('mark.track.show', this, function(event, context, track){
-        if(this.task != undefined && track != undefined){
-        	this.drawScore(track);
+    this.markControl.on('mark.tag.show', this, function(event, context, tag){
+        if(this.task != undefined && tag != undefined){
+        	this.drawTag(tag);
         }
         }
     });
     });
-    this.markControl.on('mark.specialTag.show', this, function(event, context, specialTag){
-        if(this.task != undefined && specialTag != undefined){
-        	this.drawTag(specialTag);
-        }
-    });
-    this.markControl.on('mark.track.clear', this, function(event, context, track){
+    this.markControl.on('mark.tag.clear', this, function(event, context, track){
         this.reloadImage();
         this.reloadImage();
-        //显示特殊标记的历史痕迹
-        this.markControl.trigger('show.specialTag.event');
+        this.markControl.trigger('image.reload.event');
     });
     });
-    this.markControl.on('mark.specialTag.clear', this, function(event, context, track){
-        this.reloadImage();
-        this.markControl.trigger('show.track.event');
+    this.markControl.on('image.position.change', this, function(event, context, topPercent) {
+        if (this.task != undefined) {
+            this.updateScrollTop(topPercent);
+        }
     });
     });
 }
 }
 
 
 SingleImageView.prototype.init = function() {
 SingleImageView.prototype.init = function() {
     var self = this;
     var self = this;
-    this.container = getDom(this.container_dom, this.markControl).appendTo(this.markControl.container.centerContent);
+    this.container = this.markControl.container.imageContent;
     this.container.height(this.markControl.container.centerContent.height());
     this.container.height(this.markControl.container.centerContent.height());
-    //this.container.perfectScrollbar({
-    //    wheelSpeed: 20
-    //});
-    this.markControl.addNavGroup('答卷', this.container);
+    this.container.css('overflow','scroll');
     
     
-    this.canvas = this.container.find('canvas')[0];
+    this.canvas = $('<canvas></canvas>').appendTo(this.container)[0];
     this.ctx = this.canvas.getContext("2d");
     this.ctx = this.canvas.getContext("2d");
     
     
     $(this.canvas).click(function(event){
     $(this.canvas).click(function(event){
         if(self.task != undefined){
         if(self.task != undefined){
-        	self.markControl.trigger('mark.track.set', {
-        		positionX: ((event.pageX - $(self.canvas).offset().left)/$(self.canvas).width()).toFixed(3),
-                positionY: ((event.pageY - $(self.canvas).offset().top)/$(self.canvas).height()).toFixed(3)
-        	});
-
-        	self.markControl.trigger('mark.specialTag.set', {
+        	self.markControl.trigger('image.click.event', {
         		positionX: ((event.pageX - $(self.canvas).offset().left)/$(self.canvas).width()).toFixed(3),
         		positionX: ((event.pageX - $(self.canvas).offset().left)/$(self.canvas).width()).toFixed(3),
                 positionY: ((event.pageY - $(self.canvas).offset().top)/$(self.canvas).height()).toFixed(3)
                 positionY: ((event.pageY - $(self.canvas).offset().top)/$(self.canvas).height()).toFixed(3)
         	});
         	});
@@ -95,24 +95,28 @@ SingleImageView.prototype.render = function() {
 
 
 SingleImageView.prototype.reloadImage = function() {
 SingleImageView.prototype.reloadImage = function() {
     if(this.image != undefined){
     if(this.image != undefined){
+    	this.canvas.width = Math.min(this.container.width(), this.image.width);
+        this.canvas.height = this.canvas.width * this.image.height / this.image.width;
         this.ctx.drawImage(this.image, 0, 0, this.image.width, this.image.height, 0, 0, this.canvas.width, this.canvas.height);
         this.ctx.drawImage(this.image, 0, 0, this.image.width, this.image.height, 0, 0, this.canvas.width, this.canvas.height);
     }
     }
 }
 }
 
 
-SingleImageView.prototype.drawScore = function(track){
-    if(track != undefined && track.positionX > 0 && track.positionY > 0){
+SingleImageView.prototype.drawTag = function(tag){
+    if(tag!=undefined && tag.positionX>0 && tag.positionY>0){
         this.ctx.font ="60px Arial";
         this.ctx.font ="60px Arial";
         this.ctx.fillStyle = 'red';
         this.ctx.fillStyle = 'red';
-        this.ctx.fillText(track.score, track.positionX*this.canvas.width, track.positionY*this.canvas.height);
+        this.ctx.fillText(tag.content, tag.positionX*this.canvas.width, tag.positionY*this.canvas.height);
     }
     }
 }
 }
 
 
-SingleImageView.prototype.drawTag = function(specialTag){
-    if(specialTag != undefined && specialTag.positionX > 0 && specialTag.positionY > 0){
-        this.ctx.font ="60px Arial";
-        this.ctx.fillStyle = 'red';
-        this.ctx.fillText(specialTag.tagName, specialTag.positionX*this.canvas.width, specialTag.positionY*this.canvas.height);
+SingleImageView.prototype.updateScrollTop = function(scrollTopPercent) {
+    var height = this.canvas.height;
+    var minHeight = this.container.height();
+    if (scrollTopPercent != undefined && scrollTopPercent >= 0 && scrollTopPercent <= 1 && height > minHeight) {
+        var left = height * (1 - scrollTopPercent);
+        var scrollTop = left > minHeight ? (height - left) : (height - minHeight);
+        this.container.scrollTop(scrollTop);
+    } else {
+        this.container.scrollTop(0);
     }
     }
-}
-
-SingleImageView.prototype.container_dom = '<div style="overflow: scroll; width: 100%"><canvas></canvas></div>';
+}

+ 64 - 79
stmms-web/src/main/webapp/static/mark-new/js/modules/specialTag.js

@@ -9,59 +9,48 @@ function SpecialTag(option) {
     this.markControl = option.markControl;
     this.markControl = option.markControl;
     this.maxWidth = option.width != undefined ? option.width : 200;
     this.maxWidth = option.width != undefined ? option.width : 200;
     this.show = false;
     this.show = false;
-    this.tagList = [];
-    this.specialTag = undefined;
+    this.tagName = undefined;
     this.init();
     this.init();
-    this.markControl.on('mark.specialTag.set', this, function(event, context, specialTag) {
-        if(this.specialTag != undefined && this.tagList != undefined){
-            specialTag.tagName = this.specialTag;
-            this.tagList.push(specialTag);
-            this.markControl.trigger('mark.specialTag.show', specialTag);
-        }
-    })
-    //提交保存之前
-    this.markControl.on('mark.specialTag.before', this, function(event, context, eventObject) {
+    this.markControl.on('task.get.before', this, function(event, context, eventObject) {
+        this.task = undefined;
+        this.reset();
+    });
+    this.markControl.on('task.get.success', this, function(event, context, eventObject) {
         this.task = context.task;
         this.task = context.task;
-        if (this.tagList.length > 0) {
-            this.task.tagList = this.tagList;
-        } else {
-            this.task.tagList = undefined;
+        if(this.task.tagList==undefined){
+        	this.task.tagList=[];
         }
         }
     });
     });
-    //提交保存成功后
-    this.markControl.on('mark.specialTag.success', this, function(event, context, eventObject) {
-        this.markControl.trigger('clear.specialTag.click');
-        this.specialTag = undefined;
-        this.tagList = [];
+    this.markControl.on('task.get.none', this, function(event, context, eventObject) {
+        this.task = undefined;
     });
     });
-
-    //禁止 特殊标识使用
-    this.markControl.on('click.track.before', this, function(event, context, eventObject) {
-        this.specialTag = undefined;
-        this.markControl.trigger('clear.specialTag.click');
-    });
-
-    //显示痕迹
-    this.markControl.on('show.specialTag.event', this, function(event, context, eventObject) {
-        this.task = context.task;
-        if(this.task != undefined ){
-            if(this.tagList.length == 0 && this.task.tagList != null && this.task.tagList.length>0){
-                this.tagList = this.task.tagList;
-            }
-            for(var j = 0; j <this.tagList.length; j++) {
-                this.markControl.trigger('mark.specialTag.show', this.tagList[j]);
+    this.markControl.on('image.click.event', this, function(event, context, eventObject) {
+        if(this.task!=undefined && this.tagName!=undefined){
+        	var specialTag = {
+        		tagName : this.tagName,
+        		positionX : eventObject.positionX,
+        		positionY : eventObject.positionY
+        	}
+            this.task.tagList.push(specialTag);
+            this.markControl.trigger('mark.tag.show', {
+                	content: specialTag.tagName,
+                	positionX: specialTag.positionX,
+                	positionY: specialTag.positionY
+            });
+        }
+    })
+    //图片重新加载后,恢复显示所有标记
+    this.markControl.on('image.reload.event', this, function(event, context, eventObject) {
+        if(this.task != undefined){
+            for(var i = 0; i <this.task.tagList.length; i++) {
+                this.markControl.trigger('mark.tag.show', {
+                	content: this.task.tagList[i].tagName,
+                	positionX: this.task.tagList[i].positionX,
+                	positionY: this.task.tagList[i].positionY
+                });
             }
             }
         }
         }
     });
     });
-
-    //清除按钮选中
-    this.markControl.on('clear.specialTag.click', this, function(event, context, eventObject) {
-        this.specialTag = undefined;
-        var aList = this.onclickList.find('a');
-        for(var i =0 ;i < aList.length;i++){
-                $(aList[i]).removeClass('selected');
-        }
-    })
 }
 }
 
 
 SpecialTag.prototype.init = function() {
 SpecialTag.prototype.init = function() {
@@ -70,7 +59,7 @@ SpecialTag.prototype.init = function() {
     this.container.width(this.maxWidth);
     this.container.width(this.maxWidth);
     this.container.offset({
     this.container.offset({
         top: 100,
         top: 100,
-        left:800
+        left: 800
     });
     });
     this.container.header = getDom(this.container_header_dom, this.markControl).appendTo(this.container);
     this.container.header = getDom(this.container_header_dom, this.markControl).appendTo(this.container);
     this.container.header.width('100%');
     this.container.header.width('100%');
@@ -80,44 +69,35 @@ SpecialTag.prototype.init = function() {
 
 
     this.onclickList = this.container.content.find('#problem-list');
     this.onclickList = this.container.content.find('#problem-list');
 
 
-    this.clearList = this.container.content.find('#clear');
-
     this.container.draggable({
     this.container.draggable({
         containment: "window"
         containment: "window"
     });
     });
 
 
     this.onclickList.find('a').click(function () {
     this.onclickList.find('a').click(function () {
-        self.specialTag = undefined;
-        self.markControl.trigger('click.specialTag.before');
-        if($(this).hasClass('selected')){
-            $(this).removeClass('selected');
-        }else {
-            self.specialTag = $(this).attr('value');
-            $(this).addClass('selected');
-            var aList = self.onclickList.find('a');
-            for(var i =0 ;i < aList.length;i++){
-                if($(aList[i]).attr('value') != $(this).attr('value')){
-                    $(aList[i]).removeClass('selected');
-                }
-            }
+        self.tagName = undefined;
+        if(self.task!=undefined){
+        	if($(this).hasClass('selected')){
+        		self.tagName = undefined;
+        		$(this).removeClass('selected');
+        	}else{
+        		self.tagName = $(this).attr('value');
+        		self.onclickList.find('a').removeClass('selected');
+        		$(this).addClass('selected');
+        	}
         }
         }
     });
     });
-
-    this.clearList.find('a').click(function () {
-        self.markControl.trigger('clear.specialTag.click');
-        self.markControl.trigger('click.specialTag.before');
-        if(self.tagList != undefined && self.tagList.length>0){
-            self.markControl.trigger('mark.specialTag.clear');
-            if($(this).attr('class') == 'goBack'){
-                    self.tagList.pop();
-                    self.markControl.trigger('show.specialTag.event');
-                }else if($(this).attr('class') == 'clearAll'){
-                    self.tagList = [];
-                    self.task.tagList = [];
-            }
-        }
+    this.container.find('#undo-button').click(function(){
+    	if(self.task!=undefined){
+    		self.task.tagList.pop();
+    		self.markControl.trigger('mark.tag.clear');
+    	}
+    });
+    this.container.find('#clear-button').click(function(){
+    	if(self.task!=undefined){
+    		self.task.tagList=[];
+    		self.markControl.trigger('mark.tag.clear');
+    	}
     });
     });
-
     this.container.header.find('#close-button').click(function() {
     this.container.header.find('#close-button').click(function() {
         self.toggle(false);
         self.toggle(false);
     });
     });
@@ -134,7 +114,6 @@ SpecialTag.prototype.init = function() {
 }
 }
 
 
 SpecialTag.prototype.toggle = function(show) {
 SpecialTag.prototype.toggle = function(show) {
-    this.specialTag = undefined;
     if (show == true) {
     if (show == true) {
         this.show = true;
         this.show = true;
         this.container.show();
         this.container.show();
@@ -144,6 +123,11 @@ SpecialTag.prototype.toggle = function(show) {
     }
     }
 }
 }
 
 
+SpecialTag.prototype.reset = function() {
+    this.tagName = $(this).attr('value');
+    this.onclickList.find('a').removeClass('selected');
+}
+
 SpecialTag.prototype.container_dom = '<div class="score-board score-board-popover" style="display:none"></div>';
 SpecialTag.prototype.container_dom = '<div class="score-board score-board-popover" style="display:none"></div>';
 
 
 SpecialTag.prototype.container_header_dom = '<div class="header" style="border-radius: 15px 15px 0px 0px;">\
 SpecialTag.prototype.container_header_dom = '<div class="header" style="border-radius: 15px 15px 0px 0px;">\
@@ -155,8 +139,9 @@ SpecialTag.prototype.container_content_dom = '<div class="content popover-conten
 <p id="problem-list" class="popover-list buttonCss">\
 <p id="problem-list" class="popover-list buttonCss">\
     <a href="#" value="√">√</a>\
     <a href="#" value="√">√</a>\
     <a href="#" value="X">×</a>\
     <a href="#" value="X">×</a>\
-    <a href="#" value="乄">乄</a>\
-    </p><p id="clear"><a href="#" class="goBack" style="margin-left: 20px;">回&nbsp;&nbsp;&nbsp;退</a><a href="#" class="clearAll">全部清除</a></p></div>';
+    <a href="#" value="乄">乄</a></p>\
+<p><a href="#" id="undo-button" style="margin-left: 20px;">回&nbsp;&nbsp;&nbsp;退</a>\
+<a href="#" id="clear-button">全部清除</a></p></div>';
 
 
 SpecialTag.prototype.control_dom = '<h3 class="popover-title">特殊标记</h3>\
 SpecialTag.prototype.control_dom = '<h3 class="popover-title">特殊标记</h3>\
 <div class="popover-content"><p id="problem-list" class="popover-list">\
 <div class="popover-content"><p id="problem-list" class="popover-list">\