作品列表可拖拽

This commit is contained in:
Tim 2016-06-07 15:30:17 +08:00
parent 253d9da345
commit 1d44116841
24 changed files with 3058 additions and 3046 deletions

View File

@ -1,14 +1,14 @@
<table class="hwork-table-wrap" id="homework_table" onmouseenter="resizeable_table(3,4,11,11)">
<table class="hwork-table-wrap" id="homework_table" onmouseenter="<%= @homework.homework_type == 3 ? '' : 'resizeable_table(2,4,1,1)' %>">
<tr class="b_grey hworkH30">
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
<th class="hworkList50">&nbsp;</th>
<% if @homework.homework_type != 3 %>
<th class="hworkList260" style="text-align:left;">作品名称</th>
<th class="hworkList80">
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
<th class="hworkList260 hide-text" style="text-align:left;">作品名称</th>
<th class="hworkList80 hide-text">
<span class="HomeworkStuTitle f14 fb">姓名</span>
</th>
<th class="hworkList80">
<span class="HomeworkStuTitle f14 fb fl">学号</span>
<th class="hworkList80 hide-text">
<span class="HomeworkStuTitle f14 fb">学号</span>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<th class="hworkList260" style="text-align:left;">作品名称</th>

View File

@ -3,26 +3,26 @@
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
<th class="hworkList50">&nbsp;</th>
<% if @homework.homework_type != 3 %>
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10 hide-text' : 'hworkList130 pr10 hide-text'%>" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pr10 hide-text">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%>
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pl5 pr5 hide-text' : 'hworkList130 pl5 pr5 hide-text'%>" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pl5 pr5 hide-text">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "lastname"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pr10 hide-text">
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pl5 pr5 hide-text">
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "student_id"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<th class="hworkList130 pr10" style="text-align:left;">作品名称</th>
<th class="hworkList130 pl5 pr5" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList210' : 'hworkList160'%>">
<span class="c_dark f14 fb">关联项目</span>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pr10" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pl5 pr5" style="text-align:left;">作品名称</th>
<% end %>
<th class="hworkList130">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>

View File

@ -1,2 +1,3 @@
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
$("th").each(function(){$(this).css("width",$(this).width()-1);});

View File

@ -18,6 +18,7 @@
for(var i = colS;i<colE;i++){
addListener(headerTds[i],"mousedown",onmousedown);
addListener(headerTds[i],"mousemove",onmousemove);
addListener(headerTds[i],"mouseup",onmouseup);
}
function onmousedown(event){
@ -47,10 +48,12 @@
}
}else{
var trObj = tblObj.rows[0];
if(srcObj.offsetWidth - offsetX <=4){//实际改变本单元格列宽
if(srcObj.offsetWidth - offsetX <=5){//实际改变本单元格列宽
targetTd=srcObj;
resizeable = true;
srcObj.style.cursor='col-resize';//修改光标样式
for(var i = colS;i<colE;i++){
headerTds[i].style.cursor='col-resize';//修改光标样式
};
}else{
resizeable = false;
mousedown = false;
@ -58,6 +61,12 @@
}
}
}
function onmouseup(event){
tartgetTd = null;
resizeable = false;
mousedown = false;
document.body.style.cursor='default';
}
document.body.onmouseup = function(event){
tartgetTd = null;
resizeable = false;

View File

@ -559,6 +559,8 @@ a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3
.st_box_top a:hover{ color:#1c9ec7;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.sort_up{ display: inline-block; width:8px; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat;}
a.sort_down{ display: inline-block; width:8px; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; }
.st_boxlist{ border-bottom:1px dashed #CCC; height:43px; margin-bottom:10px; }