|
@@ -13,30 +13,15 @@ function ArbitrationProcess(option) {
|
|
|
this.markControl.on('task.get.none', this, function(event, context, data) {
|
|
|
this.container.list.empty();
|
|
|
this.markControl.trigger('mark.sidebar.close');
|
|
|
- this.container.addClass('hide');
|
|
|
+ this.container.hide();
|
|
|
});
|
|
|
this.markControl.on('task.get.success', this, function(event, context, data) {
|
|
|
if (context.task.previous != true) {
|
|
|
- var historyList = context.task.arbitrationList;
|
|
|
- this.container.list.empty();
|
|
|
- if (isArray(historyList) && historyList.length > 0) {
|
|
|
- for (var i in historyList) {
|
|
|
- var history = historyList[i];
|
|
|
- var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
|
|
|
- row.find('.history-name').html(history.markerName);
|
|
|
-
|
|
|
- var date = new Date();
|
|
|
- date.setTime(history.markTime);
|
|
|
- row.find('.history-time').html(date.format('hh:mm:ss'));
|
|
|
- row.find('.history-score').html(history.totalScore);
|
|
|
- }
|
|
|
- }
|
|
|
- this.markControl.trigger('mark.sidebar.open');
|
|
|
- this.container.removeClass('hide');
|
|
|
+ this.render(context.task)
|
|
|
}
|
|
|
});
|
|
|
- this.markControl.on('mark.history.open', this, function(event, context, data) {
|
|
|
- this.container.addClass('hide');
|
|
|
+ this.markControl.on('mark.history.close', this, function(event, context, data) {
|
|
|
+ this.init();
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -47,6 +32,24 @@ ArbitrationProcess.prototype.init = function() {
|
|
|
this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
|
|
|
}
|
|
|
|
|
|
+ArbitrationProcess.prototype.render = function(task) {
|
|
|
+ var historyList = task.arbitrationList;
|
|
|
+ this.container.list.empty();
|
|
|
+ if (isArray(historyList) && historyList.length > 0) {
|
|
|
+ for (var i in historyList) {
|
|
|
+ var history = historyList[i];
|
|
|
+ var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
|
|
|
+ row.find('.history-name').html(history.markerName);
|
|
|
+
|
|
|
+ var date = new Date();
|
|
|
+ date.setTime(history.markTime);
|
|
|
+ row.find('.history-time').html(date.format('hh:mm:ss'));
|
|
|
+ row.find('.history-score').html(history.totalScore);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.markControl.trigger('mark.sidebar.open');
|
|
|
+ this.container.show();
|
|
|
+}
|
|
|
|
|
|
ArbitrationProcess.prototype.header_dom = '<div class="header">\
|
|
|
<p class="fl">给分记录</p></div>';
|