From 513fe1a93d6e098eb82f15ff7d8d3f34f300c9bc Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 1 Jun 2016 13:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E5=8F=AF?= =?UTF-8?q?=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_title.html.erb | 2 +- .../_evaluation_un_title.html.erb | 8 ++--- .../student_work/_evaluation_un_work.html.erb | 2 +- public/javascripts/resizeable_table.js | 29 ++++++++++--------- public/stylesheets/courses.css | 2 +- public/stylesheets/public.css | 1 + 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index 73bd5d4f2..bcb7f853f 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,4 +1,4 @@ - +
diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index f25edc5ce..1c8de2923 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,16 +1,16 @@ -
序号  
+
- + <% if @homework.homework_type != 3 %> - -
序号  作品名称作品名称 + <%= 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%> <% 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%> <% end%> + <%= 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%> <% 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%> diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index ecdde77d8..0fc4ae480 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -12,7 +12,7 @@ <% if @homework.homework_type != 3 %> - + <%= student_work.user.show_name%> " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> diff --git a/public/javascripts/resizeable_table.js b/public/javascripts/resizeable_table.js index eac4a1f36..6221b501c 100644 --- a/public/javascripts/resizeable_table.js +++ b/public/javascripts/resizeable_table.js @@ -2,7 +2,7 @@ * Created by ttang on 2016/5/24. */ $(document).ready(function(){ - resizeable_table = function(colS,colE,padding){ + resizeable_table = function(colS,colE,p1,p2){ var headerTds = document.getElementById("homework_table").rows[0].cells; var mousedown = false; var resizeable = false; @@ -24,6 +24,7 @@ screenXStart = evt.screenX; tdWidth = targetTd.offsetWidth; tdWidth2 = targetTd.nextElementSibling.offsetWidth; + totalWidth = tdWidth + tdWidth2; } } function onmousemove(event){ @@ -31,18 +32,22 @@ var srcObj = getTarget(evt); var offsetX = evt.offsetX || (evt.clientX - srcObj.getBoundingClientRect().left);//这个比较关键,解决了Firefox无offsetX属性的问题 if (mousedown == true){ - var width = (tdWidth + (evt.screenX - screenXStart)) - 10 + "px";//计算后的新的宽度 - var width2 = (tdWidth2 - (evt.screenX - screenXStart)) - 10 + "px"; - console.log(width, width2); - if (width<60){ - targetTd.style.width = "60px"; - console.log("width<60"); - }else if(width2<60){ - targetTd.nextElementSibling.style.width2 = "60px"; - console.log("width2<60"); + var width = (tdWidth + (evt.screenX - screenXStart)) - p1 + "px";//计算后的新的宽度 + var width2 = (tdWidth2 - (evt.screenX - screenXStart)) - p2 + "px"; + console.log(width, width2, totalWidth); + if (parseInt(width)<0 || parseInt(width2)<58 || tdWidth > totalWidth || tdWidth2 > totalWidth){ + tartgetTd = null; + resizeable = false; + mousedown = false; }else{ targetTd.style.width = width; targetTd.nextElementSibling.style.width = width2; + document.onmouseup = function(event){ + tartgetTd = null; + resizeable = false; + mousedown = false; + document.body.style.cursor='default'; + } } }else{ var trObj = tblObj.rows[0]; @@ -50,10 +55,6 @@ targetTd=srcObj; resizeable = true; srcObj.style.cursor='col-resize';//修改光标样式 - }else if(offsetX <=4 && srcObj.cellIndex > 0){//实际改变前一单元格列宽,但是表格左边框线不可拖动 - targetTd=trObj.cells[srcObj.cellIndex - 1]; - resizeable = true; - srcObj.style.cursor='col-resize'; }else{ resizeable = false; srcObj.style.cursor='default'; diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index a76ec5464..b41696779 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -104,7 +104,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re /*20160520作品列表table*/ .hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle; table-layout:fixed;} -.hwork-table-wrap th {font-size:14px; color:#2d2d2d;} +.hwork-table-wrap th {font-size:14px; color:#2d2d2d; border:1px solid #e1e1e1;} /*作业信息*/ .mt-2 {margin-top:-2px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index a5c1ada12..2ef518bbd 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -56,6 +56,7 @@ h4{ font-size:14px; color:#3b3b3b;} .flow_hidden{ width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .white_space{white-space:nowrap;} .pr {position:relative;} +.hide-text {overflow:hidden; white-space:nowrap;} /* Spacing */ .ml2{ margin-left:2px;}