Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tallty_import_export
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
tallty_import_export
Commits
92dd9f82
Commit
92dd9f82
authored
Dec 08, 2024
by
rxqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:udpate cell
parent
7f5e7e64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
cell.rb
lib/tallty_import_export/export_payload/cell.rb
+10
-2
No files found.
lib/tallty_import_export/export_payload/cell.rb
View file @
92dd9f82
...
...
@@ -44,7 +44,11 @@ class TalltyImportExport::ExportPayload::Cell
def
divise
if
@header
.
children
.
present?
&&
@value
.
value
new_cells
=
@header
.
children
.
map
do
|
child_header
|
val
=
@value_handler
.
call
(
@value
.
value
,
child_header
.
as_json
.
symbolize_keys
,
keep_array:
true
)
# 分离 header 属性,保留 proc
header_attrs
=
child_header
.
as_json
.
symbolize_keys
header_attrs
[
:proc
]
=
child_header
.
proc
if
child_header
.
proc
.
present?
val
=
@value_handler
.
call
(
@value
.
value
,
header_attrs
,
keep_array:
true
)
if
(
child_header
.
children
.
present?
&&
val
.
is_a?
(
Array
))
val
.
map
do
|
val
|
cell
=
TalltyImportExport
::
ExportPayload
::
Cell
.
new
(
...
...
@@ -57,7 +61,11 @@ class TalltyImportExport::ExportPayload::Cell
cell
end
else
val
=
@value_handler
.
call
(
@value
.
value
,
child_header
.
as_json
.
symbolize_keys
)
# 这里也需要保留 proc
header_attrs
=
child_header
.
as_json
.
symbolize_keys
header_attrs
[
:proc
]
=
child_header
.
proc
if
child_header
.
proc
.
present?
val
=
@value_handler
.
call
(
@value
.
value
,
header_attrs
)
TalltyImportExport
::
ExportPayload
::
Cell
.
new
(
child_header
,
TalltyImportExport
::
ExportPayload
::
Value
.
new
(
val
,
@value
.
chain
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment