Commit d08d72c1 by Ivan Lan

fix: 修复导出 merge

parent 06c3deb9
......@@ -142,11 +142,11 @@ module TalltyImportExport
if header[:merge].present? && last_row.present? && _data == last_row[col_index]
# 这里使用二维数组,每个数组里都是列内容相同的各行
merge_column_hash[col_index] ||= []
if merge_column_hash[col_index].last&.last == index + first_content_row_index - 1
if merge_column_hash[col_index].last&.last == index + first_content_row_index - 1 - 1
# 说明内容和上面的是延续的,继续加入之前的数组
merge_column_hash[col_index].last << index + first_content_row_index
merge_column_hash[col_index].last << index + first_content_row_index - 1
else
merge_column_hash[col_index] << [index + first_content_row_index - 1, index + first_content_row_index]
merge_column_hash[col_index] << [index + first_content_row_index - 1 - 1, index + first_content_row_index - 1]
end
end
row.push(_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment