From 6b66be9e60b26ff522dd79307060f40bc2649ffd Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 26 Jun 2019 16:52:05 +0800 Subject: [PATCH] fix bug --- app/views/polls/commit_result.xlsx.axlsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/polls/commit_result.xlsx.axlsx b/app/views/polls/commit_result.xlsx.axlsx index 9c91b63a0..3ea0571cb 100644 --- a/app/views/polls/commit_result.xlsx.axlsx +++ b/app/views/polls/commit_result.xlsx.axlsx @@ -30,25 +30,25 @@ wb.styles do |s| sheet_answer_row.push(answer_users_count) sheet_answer_percent.push(answer_percent.to_s) end - sheet.add_row sheet_row, :height =>20,:style => blue_cell - sheet.add_row sheet_answer_row, :height =>20, :style => sz_all - sheet.add_row sheet_answer_percent, :height =>20, :style => sz_all - sheet.add_row sheet_answer_useful, :height =>20, :style => sz_all + sheet.add_row sheet_row, :height =>15,:style => blue_cell + sheet.add_row sheet_answer_row, :height =>15, :style => sz_all + sheet.add_row sheet_answer_percent, :height =>15, :style => sz_all + sheet.add_row sheet_answer_useful, :height =>15, :style => sz_all #合并单元格,但无法填充style # sheet.merge_cells (Axlsx::cell_r(1,sheet.rows.last.row_index) + ':' + Axlsx::cell_r(sheet_row.count-1,sheet.rows.last.row_index)) # sheet.rows[sheet.rows.last.row_index].style = sz_all sheet.add_row [] else #主观题答案 main_show_row = ["第#{q.question_number}题",q.question_title] - sheet.add_row main_show_row,:height =>20, :style => blue_cell + sheet.add_row main_show_row,:height =>15, :style => blue_cell q.poll_votes.each do |v| #主观题的答案 - sheet.add_row ["",v.vote_text.present? ? v.vote_text : "--"],:height =>20, :style => sz_all + sheet.add_row ["",v.vote_text.present? ? v.vote_text : "--"],:height =>15, :style => sz_all end sheet.add_row [], :style => sz_all end end #each_with_index - sheet.add_row poll_users_info, :style => blue_cell + sheet.add_row poll_users_info, :height =>15, :style => blue_cell @poll.poll_users.each_with_index do |u,index| u_user = u.user user_answer_array = [] @@ -86,7 +86,7 @@ wb.styles do |s| user_cell += [user_login,user_name, u_user.mail, user_student_id] end all_user_cell = user_cell + user_answer_array - sheet.add_row all_user_cell, :height =>20,:style => sz_all + sheet.add_row all_user_cell, :height =>15,:style => sz_all end sheet.column_widths *([25]*sheet.column_info.count) sheet.column_info.first.width = 10