From c5e283b1bd6ec664871c71fd38ce53f6467be314 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 4 Jul 2019 15:05:52 +0800 Subject: [PATCH 1/4] fix bug --- app/views/graduation_topics/export.xlsx.axlsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/graduation_topics/export.xlsx.axlsx b/app/views/graduation_topics/export.xlsx.axlsx index f1d7e8e74..ff5b58b11 100644 --- a/app/views/graduation_topics/export.xlsx.axlsx +++ b/app/views/graduation_topics/export.xlsx.axlsx @@ -15,7 +15,7 @@ wb.styles do |s| sheet.sheet_view.show_grid_lines = false sheet_title = table_columns sheet_title_c = sheet_title.count - sheet.add_row sheet_title, :style => bg_cell + sheet.add_row sheet_title, :style => bg_cell,:height => 15 sheet["J1:L1"].each { |c| c.style = bg_db } sheet["M1:O1"].each { |c| c.style = bg_cc } sheet["P1:Q1"].each { |c| c.style = bg_d2 } From e07d595aabf76c4a24c68e651beb899227830fe5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 4 Jul 2019 15:09:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/export_shixun_report_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/export_shixun_report_service.rb b/app/services/export_shixun_report_service.rb index 4c8dab6aa..f9da3d6f2 100644 --- a/app/services/export_shixun_report_service.rb +++ b/app/services/export_shixun_report_service.rb @@ -10,7 +10,7 @@ class ExportShixunReportService end 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 def prepare_binding From d5049dfc74eb0edadeacbc617f82bb3ab04e8bbc Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 4 Jul 2019 15:11:10 +0800 Subject: [PATCH 3/4] fix bug --- app/views/graduation_topics/export.xlsx.axlsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/graduation_topics/export.xlsx.axlsx b/app/views/graduation_topics/export.xlsx.axlsx index ff5b58b11..77e9bec5a 100644 --- a/app/views/graduation_topics/export.xlsx.axlsx +++ b/app/views/graduation_topics/export.xlsx.axlsx @@ -1,5 +1,5 @@ wb = xlsx_package.workbook -wb.use_autowidth = false +# wb.use_autowidth = false wb.use_shared_strings = true 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_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_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| sheet.sheet_view.show_grid_lines = false sheet_title = table_columns sheet_title_c = sheet_title.count - sheet.add_row sheet_title, :style => bg_cell,:height => 15 + sheet.add_row sheet_title,:height => 30, :style => bg_cell sheet["J1:L1"].each { |c| c.style = bg_db } sheet["M1:O1"].each { |c| c.style = bg_cc } 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 } if topic_users.count > 0 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 else - sheet.add_row ["--"]*sheet_title_c + sheet.add_row ["--"]*sheet_title_c,:height => 18 end sheet.column_widths *([15]*sheet.column_info.count) From d27bb78d32b989017468852b3b685c492869693b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 4 Jul 2019 15:14:00 +0800 Subject: [PATCH 4/4] fix bug --- app/views/graduation_topics/export.xlsx.axlsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/graduation_topics/export.xlsx.axlsx b/app/views/graduation_topics/export.xlsx.axlsx index 77e9bec5a..2da608f6a 100644 --- a/app/views/graduation_topics/export.xlsx.axlsx +++ b/app/views/graduation_topics/export.xlsx.axlsx @@ -15,7 +15,7 @@ wb.styles do |s| sheet.sheet_view.show_grid_lines = false sheet_title = table_columns sheet_title_c = sheet_title.count - sheet.add_row sheet_title,:height => 30, :style => bg_cell + sheet.add_row sheet_title,:height => 32, :style => bg_cell sheet["J1:L1"].each { |c| c.style = bg_db } sheet["M1:O1"].each { |c| c.style = bg_cc } sheet["P1:Q1"].each { |c| c.style = bg_d2 }