我的issue导出功能(未完)
This commit is contained in:
parent
2a768cbd49
commit
2c664dcd21
|
@ -127,6 +127,10 @@ class UsersController < ApplicationController
|
||||||
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||||
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
||||||
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
||||||
|
|
||||||
|
# 导出excel的issues
|
||||||
|
@excel_issues = @issues
|
||||||
|
|
||||||
@issue_count = @issues.count
|
@issue_count = @issues.count
|
||||||
@limit = 10
|
@limit = 10
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
|
@ -135,6 +139,10 @@ class UsersController < ApplicationController
|
||||||
@issues = paginateHelper @issues, @limit
|
@issues = paginateHelper @issues, @limit
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{render :layout => 'static_base'}
|
format.html{render :layout => 'static_base'}
|
||||||
|
format.xls{
|
||||||
|
filename = "我的_#{l(:label_issue_list_xls)}.xls"
|
||||||
|
send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||||
|
}
|
||||||
format.api
|
format.api
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
<div style="text-align:left;">
|
<div style="text-align:left;">
|
||||||
<div style="width:auto; display:inline-block;">
|
<div style="width:auto; display:inline-block;">
|
||||||
<ul>
|
<ul>
|
||||||
<a href="javascript:void(0)" class="hw_btn_blue ml10 mt10 mb10" style="visibility:hidden;" alt="导出EXCEL">导出EXCEL</a>
|
<!-- <a href="javascript:void(0)" class="hw_btn_blue ml10 mt10 mb10" style="visibility:hidden;" alt="导出EXCEL">导出EXCEL</a>-->
|
||||||
|
<%= link_to "导出EXCEL", user_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10" %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -269,7 +269,7 @@
|
||||||
<p class="nodata mt10"><%= l(:label_no_data) %></p>
|
<p class="nodata mt10"><%= l(:label_no_data) %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div id="issue_list">
|
<div id="issue_list">
|
||||||
<%= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %>
|
<%= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :excel_issues => @excel_issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue