Commit 6e443d2c by liyijie

feat: 解决前端导入导出参数为空错误的问题

parent d0767b39
...@@ -141,7 +141,7 @@ module TalltyImportExport ...@@ -141,7 +141,7 @@ module TalltyImportExport
end end
def process_options options = {} def process_options options = {}
options = export_options.merge(options).with_indifferent_access options = export_options.merge(options.compact_blank!).with_indifferent_access
@row_height ||= options.delete(:row_height) || 25 @row_height ||= options.delete(:row_height) || 25
@width ||= (options.delete(:width) || 20).to_f @width ||= (options.delete(:width) || 20).to_f
......
...@@ -53,7 +53,7 @@ module TalltyImportExport ...@@ -53,7 +53,7 @@ module TalltyImportExport
end end
def process_options options def process_options options
options = import_options.merge(options).with_indifferent_access options = import_options.merge(options.compact_blank!).with_indifferent_access
@headers = options.delete(:headers) || import_headers @headers = options.delete(:headers) || import_headers
@primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact @primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact
@skip_keys = options.delete(:skip_keys) || @headers.map { |header| header[:skip] ? header[:key].to_sym : nil }.compact @skip_keys = options.delete(:skip_keys) || @headers.map { |header| header[:skip] ? header[:key].to_sym : nil }.compact
......
module TalltyImportExport module TalltyImportExport
VERSION = "1.0.33" VERSION = "1.0.35"
end end
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