导出实训报告的修改

dev_aliyun_beta
SylorHuang 6 years ago
parent 3519428066
commit b9dafd2772

@ -5,9 +5,10 @@ $(document).on('turbolinks:load', function() {
allowClear: true allowClear: true
}); });
let search_form = $(".search-form");
//导出
$(".shixuns-list-form").on("click","#shixuns-export",function () { $(".shixuns-list-form").on("click","#shixuns-export",function () {
let search_form = $(".search-form");
window.location.href = "/admins/shixuns.xls?" + search_form.serialize(); window.location.href = "/admins/shixuns.xls?" + search_form.serialize();
}) });
} }
}); });

@ -66,15 +66,19 @@
<table class="edu-pop-table head-color edu-txt-center" cellpadding="0" cellspacing="0"> <table class="edu-pop-table head-color edu-txt-center" cellpadding="0" cellspacing="0">
<thead> <thead>
<th width="6%">关卡</th> <th width="6%">关卡</th>
<th width="27%" style="text-align: left;">任务名称</th> <th width="24%" style="text-align: left;">任务名称</th>
<th width="13%">开启时间</th> <th width="12%">开启时间</th>
<th>评测次数</th> <th>评测次数</th>
<th width="13%">完成时间</th> <th width="13%">完成时间</th>
<th width="15%">耗时</th> <th width="15%">耗时</th>
<th>经验值</th> <th>经验值</th>
<th>关卡得分</th>
<th>调分</th>
</thead> </thead>
<tbody> <tbody>
<% @games.each_with_index do |game, index| %> <% @games.each_with_index do |game, index| %>
<% challenge_score = @homework.challenge_score game.challenge_id %>
<% game_score = @work.work_challenge_score game, challenge_score %>
<tr> <tr>
<td><%= index + 1 %></td> <td><%= index + 1 %></td>
<td style="text-align: left;"> <td style="text-align: left;">
@ -88,6 +92,8 @@
<td><%= finished_time game.end_time %></td> <td><%= finished_time game.end_time %></td>
<td><%= ApplicationController.helpers.time_consuming game %></td> <td><%= ApplicationController.helpers.time_consuming game %></td>
<td><%= game.final_score %> / <%= game.challenge.all_score %></td> <td><%= game.final_score %> / <%= game.challenge.all_score %></td>
<td><span class="color-orange"><%= game_score %></span> / <%= challenge_score %></td>
<td><%= game_score %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -22,8 +22,7 @@
</div> </div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_shixun_settings_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
<div class=""> <div class="">
<a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a> <a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a>
</div> </div>

@ -1,5 +1,5 @@
<table class="table text-center shixun-settings-list-table"> <table class="table text-center shixun-settings-list-table">
<thead> <thead class="thead-light">
<th width="4%">序号</th> <th width="4%">序号</th>
<th width="8%">ID</th> <th width="8%">ID</th>
<th width="12%" class="text-left">实训名称</th> <th width="12%" class="text-left">实训名称</th>
@ -19,11 +19,15 @@
</th> </th>
</thead> </thead>
<tbody> <tbody>
<% shixun_settings.each_with_index do |shixun,index| %> <% if shixun_settings.present? %>
<tr id="setting-item-<%= shixun.id %>"> <% shixun_settings.each_with_index do |shixun,index| %>
<% page_no = (@params_page.to_i - 1) * 20 + index + 1 %> <tr id="setting-item-<%= shixun.id %>">
<%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %> <% page_no = (@params_page.to_i - 1) * 20 + index + 1 %>
</tr> <%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

@ -3,7 +3,7 @@
<% end %> <% end %>
<div class="box search-form-container shixuns-list-form"> <div class="box search-form-container shixuns-list-form">
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',remote:true) do %> <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<div class="form-group mr-2"> <div class="form-group mr-2">
<label for="status">状态:</label> <label for="status">状态:</label>
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %> <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
@ -22,7 +22,7 @@
</div> </div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %> <%= link_to "清除",admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
<% end %> <% end %>
<a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a> <a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a>
</div> </div>

@ -14,36 +14,40 @@
<th width="6%">操作</th> <th width="6%">操作</th>
</thead> </thead>
<tbody> <tbody>
<% shixuns.each_with_index do |shixun,index| %> <% if shixuns.present? %>
<tr> <% shixuns.each_with_index do |shixun,index| %>
<td><%= (@params_page.to_i - 1) * 20 + index + 1%></td> <tr>
<td><%= shixun.identifier %></td> <td><%= (@params_page.to_i - 1) * 20 + index + 1%></td>
<td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td> <td><%= shixun.identifier %></td>
<td> <td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
<%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %> <td>
</td> <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
<td> </td>
<% if shixun.try(:fork_from).nil? %> <td>
-- <% if shixun.try(:fork_from).nil? %>
<% else%> --
<%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> <% else%>
<% end%> <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
</td> <% end%>
<td><%= shixun.challenges.where(:st => 0).size %></td> </td>
<td><%= shixun.challenges.where(:st => 1).size %></td> <td><%= shixun.challenges.where(:st => 0).size %></td>
<td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td> <td><%= shixun.challenges.where(:st => 1).size %></td>
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td> <td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>
<td><%= format_time shixun.created_at %></td> <td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td>
<td class="homepage_teacher"> <td><%= format_time shixun.created_at %></td>
<input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> <td class="homepage_teacher">
<label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label> <input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
</td> <label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label>
<td class="operate"> </td>
<% if shixun.status == 0 %> <td class="operate">
<%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %> <% if shixun.status == 0 %>
<% end %> <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
</td> <% end %>
</tr> </td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

Loading…
Cancel
Save