Commit d0767b39 by liyijie

feat: fix import_headers_result

......@@ -113,13 +113,17 @@ module TalltyImportExport
# TODO: 这里,对于import_headers,后面还是不要传参数了
# 需要合并proc,前端没有办法把proc传过来
def import_headers_result
import_header_hash = import_headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
@headers.map do |header|
key = header[:key]
if import_header_hash.dig(key, :proc).present?
header[:proc] = import_header_hash.dig(key, :proc)
if @headers.present?
import_header_hash = import_headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
@headers.map do |header|
key = header[:key]
if import_header_hash.dig(key, :proc).present?
header[:proc] = import_header_hash.dig(key, :proc)
end
header
end
header
else
@headers = import_headers
end
rescue
@headers
......
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