Commit fac6e334 by liyijie

feat: 更新支持xls格式

parent 3c1be135
......@@ -2,6 +2,7 @@ module TalltyImportExport
class Excel
require 'redis-objects'
require 'roo'
require 'roo-xls'
attr_reader :uid, :cache
......
module TalltyImportExport
class Import
require 'roo'
require 'roo-xls'
attr_reader :klass, :context, :primary_keys, :associations
def initialize klass
......@@ -53,7 +54,7 @@ module TalltyImportExport
end
else
file_path = xlsx_file.is_a?(String) ? xlsx_file : xlsx_file.path
xlsx = ::Roo::Excelx.new(file_path)
xlsx = ::Roo::Spreadsheet.open(file_path, extension: File.extname(file_path) == '.xls' ? :xls : :xlsx)
xlsx.each_with_pagename do |_sheetname, sheet|
sheet.each(**@excel_hash).with_index do |line_info, index|
next if index == 0
......
module TalltyImportExport
VERSION = "1.0.35"
VERSION = "1.1.1"
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