统计页面JS实现
This commit is contained in:
parent
df47c09fa4
commit
d76ce0706e
|
@ -624,9 +624,17 @@ class IssuesController < ApplicationController
|
|||
@project_sort = 'issues.updated_on asc'
|
||||
end
|
||||
end
|
||||
|
||||
# 搜索结果
|
||||
@issues_filter = @query.issues(:order => @project_sort)
|
||||
|
||||
# if params[:type] == 1 || params[:type].nil?
|
||||
# @results = @issues_filter
|
||||
# elsif params[:type] == "2"
|
||||
# @results = @issues_filter.collect{|result| result.status_id !=5 }
|
||||
# elsif params[:type] == "3"
|
||||
# @results = @issues_filter.collect{|result| result.status_id !=5 }
|
||||
# end
|
||||
|
||||
#统计
|
||||
@results = {}
|
||||
|
||||
|
|
|
@ -1,164 +1,36 @@
|
|||
|
||||
<div class="myissues_head mb5">
|
||||
<h2 class="ml15">issue统计</h2>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<div>
|
||||
<!-- <ul>
|
||||
<li>所有<a style="cursor: pointer;" onclick="showResultAll();" class="issues_greycirbg_btn "><%#= @issues_filter.count %></a></li>
|
||||
<li>开启<a style="cursor: pointer;" onclick="showResultOpen();" class="issues_greycirbg_btn "><%#= @issue_open_count %></a></li>
|
||||
<li>关闭<a style="cursor: pointer;" onclick="showResultClose();" class="issues_greycirbg_btn "><%#= @issue_close_count %></a></li>
|
||||
</ul>-->
|
||||
<ul class="new_roadmap_nav fl" >
|
||||
<li class="new_roadmap_nav_hover" id="new_roadmap_nav_1" onclick="HoverLi(1);">
|
||||
<%= link_to "所有<span class='new_roadmap_nav_taghover ml5' id='new_roadmap_num_1' onclick='showResultAll();'>#{@issues_filter.count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_1" %>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_2" onclick="HoverLi(2);">
|
||||
<%= link_to "打开<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_2' onclick='showResultOpen();'>#{@issue_open_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_3" onclick="HoverLi(3);">
|
||||
<%= link_to "锁定<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_3'onclick='showResultClose();'>#{@issue_close_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--issues_statistics end-->
|
||||
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fr mt10" >新建</a>
|
||||
</div>
|
||||
<div id="result_all" class="">
|
||||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[0] %></td>
|
||||
<td class="w130"><%= v[2] %></td>
|
||||
<td class="w130"><%= v[4] %></td>
|
||||
<td class="w130"><%= v[1] %></td>
|
||||
<td class="w130"><%= v[3] %></td>
|
||||
<td class="w130"><%= v[5] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @alltotal[0] %></td>
|
||||
<td class="w130"><%= @alltotal[2] %></td>
|
||||
<td class="w130"><%= @alltotal[4] %></td>
|
||||
<td class="w130"><%= @alltotal[1] %></td>
|
||||
<td class="w130"><%= @alltotal[3] %></td>
|
||||
<td class="w130"><%= @alltotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="myissues_head mb5">
|
||||
<h2 class="ml15">issue统计</h2>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<div>
|
||||
<ul class="new_roadmap_nav fl" >
|
||||
<li class="new_roadmap_nav_hover" id="new_roadmap_nav_1" onclick="HoverLi(1);">
|
||||
<%= link_to "所有<span class='new_roadmap_nav_taghover ml5' id='new_roadmap_num_1'>#{@issues_filter.count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_1" %>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_2" onclick="HoverLi(2);">
|
||||
<%= link_to "打开<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_2'>#{@issue_open_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_3" onclick="HoverLi(3);">
|
||||
<%= link_to "锁定<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_3'>#{@issue_close_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--issues_statistics end-->
|
||||
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fr mt10" >新建</a>
|
||||
</div>
|
||||
<div id="merge_record_1" class="">
|
||||
<%= render "issues/statistics_all" %>
|
||||
</div>
|
||||
<div id="merge_record_2" class="undis">
|
||||
<%= render "issues/statistics_open" %>
|
||||
</div>
|
||||
<div id="merge_record_3" class="undis">
|
||||
<%= render "issues/statistics_lock" %>
|
||||
</div>
|
||||
|
||||
<div id="result_open" style="display: none">
|
||||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<% if v[6] > 0 %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[6] %></td>
|
||||
<td class="w130"><%= v[8] %></td>
|
||||
<td class="w130"><%= v[10] %></td>
|
||||
<td class="w130"><%= v[7] %></td>
|
||||
<td class="w130"><%= v[9] %></td>
|
||||
<td class="w130"><%= v[11] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @opentotal[0] %></td>
|
||||
<td class="w130"><%= @opentotal[2] %></td>
|
||||
<td class="w130"><%= @opentotal[4] %></td>
|
||||
<td class="w130"><%= @opentotal[1] %></td>
|
||||
<td class="w130"><%= @opentotal[3] %></td>
|
||||
<td class="w130"><%= @opentotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
<div id="result_close" style="display: none">
|
||||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<% if v[12] > 0 %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[12] %></td>
|
||||
<td class="w130"><%= v[14] %></td>
|
||||
<td class="w130"><%= v[16] %></td>
|
||||
<td class="w130"><%= v[13] %></td>
|
||||
<td class="w130"><%= v[15] %></td>
|
||||
<td class="w130"><%= v[17] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @closetotal[0] %></td>
|
||||
<td class="w130"><%= @closetotal[2] %></td>
|
||||
<td class="w130"><%= @closetotal[4] %></td>
|
||||
<td class="w130"><%= @closetotal[1] %></td>
|
||||
<td class="w130"><%= @closetotal[3] %></td>
|
||||
<td class="w130"><%= @closetotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function showResultAll(){
|
||||
$("#result_all").show();
|
||||
$("#result_open").hide();
|
||||
$("#result_close").hide();
|
||||
}
|
||||
function showResultOpen(){
|
||||
$("#result_all").hide();
|
||||
$("#result_open").show();
|
||||
$("#result_close").hide();
|
||||
|
||||
}
|
||||
function showResultClose(){
|
||||
$("#result_all").hide();
|
||||
$("#result_open").hide();
|
||||
$("#result_close").show();
|
||||
}
|
||||
//issues列表
|
||||
// 导航选择效果
|
||||
function g(o){
|
||||
return document.getElementById(o);
|
||||
}
|
||||
|
@ -168,12 +40,12 @@
|
|||
g('new_roadmap_nav_'+i).className='new_roadmap_nav_nomal';
|
||||
g('new_roadmap_type_'+i).className='new_roadmap_type_nomal';
|
||||
g('new_roadmap_num_'+i).className='new_roadmap_nav_tagnomal';
|
||||
g('new_roadmap_content_'+i).className='undis';
|
||||
g('merge_record_'+i).className='undis';
|
||||
}
|
||||
g('new_roadmap_nav_'+n).className='new_roadmap_nav_hover';
|
||||
g('new_roadmap_type_'+n).className='new_roadmap_type_hover';
|
||||
g('new_roadmap_num_'+n).className='new_roadmap_nav_taghover';
|
||||
g('new_roadmap_content_'+n).className='dis';
|
||||
g('merge_record_'+n).className='dis';
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[0] %></td>
|
||||
<td class="w130"><%= v[2] %></td>
|
||||
<td class="w130"><%= v[4] %></td>
|
||||
<td class="w130"><%= v[1] %></td>
|
||||
<td class="w130"><%= v[3] %></td>
|
||||
<td class="w130"><%= v[5] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @alltotal[0] %></td>
|
||||
<td class="w130"><%= @alltotal[2] %></td>
|
||||
<td class="w130"><%= @alltotal[4] %></td>
|
||||
<td class="w130"><%= @alltotal[1] %></td>
|
||||
<td class="w130"><%= @alltotal[3] %></td>
|
||||
<td class="w130"><%= @alltotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -0,0 +1,37 @@
|
|||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<% if v[12] > 0 %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[12] %></td>
|
||||
<td class="w130"><%= v[14] %></td>
|
||||
<td class="w130"><%= v[16] %></td>
|
||||
<td class="w130"><%= v[13] %></td>
|
||||
<td class="w130"><%= v[15] %></td>
|
||||
<td class="w130"><%= v[17] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @closetotal[0] %></td>
|
||||
<td class="w130"><%= @closetotal[2] %></td>
|
||||
<td class="w130"><%= @closetotal[4] %></td>
|
||||
<td class="w130"><%= @closetotal[1] %></td>
|
||||
<td class="w130"><%= @closetotal[3] %></td>
|
||||
<td class="w130"><%= @closetotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -0,0 +1,37 @@
|
|||
<table class="sy_new_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="dis p10" style="width:166px;">指派给</td>
|
||||
<td class="w130">所有</td>
|
||||
<td class="w130">需求</td>
|
||||
<td class="w130">任务</td>
|
||||
<td class="w130">缺陷</td>
|
||||
<td class="w130">支持</td>
|
||||
<td class="w130">周报</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @results.each do |k,v|%>
|
||||
<% if v[6] > 0 %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;"><%= v[:name] %></td>
|
||||
<td class="w130"><%= v[6] %></td>
|
||||
<td class="w130"><%= v[8] %></td>
|
||||
<td class="w130"><%= v[10] %></td>
|
||||
<td class="w130"><%= v[7] %></td>
|
||||
<td class="w130"><%= v[9] %></td>
|
||||
<td class="w130"><%= v[11] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="hidden dis p10" style="width:166px;">Total</td>
|
||||
<td class="w130"><%= @opentotal[0] %></td>
|
||||
<td class="w130"><%= @opentotal[2] %></td>
|
||||
<td class="w130"><%= @opentotal[4] %></td>
|
||||
<td class="w130"><%= @opentotal[1] %></td>
|
||||
<td class="w130"><%= @opentotal[3] %></td>
|
||||
<td class="w130"><%= @opentotal[5] %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -203,7 +203,7 @@
|
|||
</script>
|
||||
|
||||
<!--缺陷列表开始-->
|
||||
<div id="myissues_con" class="myissues_con ">
|
||||
<div id="myissues_con" class="myissues_con mb10">
|
||||
<div class="clear mb5">
|
||||
<div class="issues_statistics fl clear">
|
||||
<ul>
|
||||
|
|
Loading…
Reference in New Issue