Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_course
daiao 5 years ago
commit 358e02c626

@ -10,7 +10,7 @@ class ExportShixunReportService
end end
def filename def filename
@_filename ||= "#{homework.name}-#{work.user.user_extension&.student_id}-#{work.user.real_name}.pdf".gsub(' ', '-').gsub('/', '_') @_filename ||= "#{homework.name}-#{work.user&.student_id}-#{work.user.real_name}.pdf".gsub(' ', '-').gsub('/', '_')
end end
def prepare_binding def prepare_binding

@ -1,5 +1,5 @@
wb = xlsx_package.workbook wb = xlsx_package.workbook
wb.use_autowidth = false # wb.use_autowidth = false
wb.use_shared_strings = true wb.use_shared_strings = true
wb.styles do |s| wb.styles do |s|
@ -9,13 +9,13 @@ wb.styles do |s|
bg_cc = s.add_style :bg_color=> "CCC1DA",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center } bg_cc = s.add_style :bg_color=> "CCC1DA",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center }
bg_ff = s.add_style :bg_color=> "FFC000",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center } bg_ff = s.add_style :bg_color=> "FFC000",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center }
bg_bb = s.add_style :bg_color=> "9BBB59",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center } bg_bb = s.add_style :bg_color=> "9BBB59",:border => { :style => :thick, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center }
bg_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 20,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center } bg_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center }
wb.add_worksheet(:name => "毕设选题情况汇总") do |sheet| wb.add_worksheet(:name => "毕设选题情况汇总") do |sheet|
sheet.sheet_view.show_grid_lines = false sheet.sheet_view.show_grid_lines = false
sheet_title = table_columns sheet_title = table_columns
sheet_title_c = sheet_title.count sheet_title_c = sheet_title.count
sheet.add_row sheet_title, :style => bg_cell sheet.add_row sheet_title,:height => 32, :style => bg_cell
sheet["J1:L1"].each { |c| c.style = bg_db } sheet["J1:L1"].each { |c| c.style = bg_db }
sheet["M1:O1"].each { |c| c.style = bg_cc } sheet["M1:O1"].each { |c| c.style = bg_cc }
sheet["P1:Q1"].each { |c| c.style = bg_d2 } sheet["P1:Q1"].each { |c| c.style = bg_d2 }
@ -23,10 +23,10 @@ wb.styles do |s|
sheet["U1:W1"].each { |c| c.style = bg_bb } sheet["U1:W1"].each { |c| c.style = bg_bb }
if topic_users.count > 0 if topic_users.count > 0
topic_users.each do |user| topic_users.each do |user|
sheet.add_row user, :style => sz_all sheet.add_row user,:height => 18, :style => sz_all
end #each_widh_index end #each_widh_index
else else
sheet.add_row ["--"]*sheet_title_c sheet.add_row ["--"]*sheet_title_c,:height => 18
end end
sheet.column_widths *([15]*sheet.column_info.count) sheet.column_widths *([15]*sheet.column_info.count)

Loading…
Cancel
Save