Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
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
何远江
topsun-baoshen-excel
Commits
bae89b1b
Commit
bae89b1b
authored
Jan 10, 2024
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改解析结果数据格式处理
parent
cf9dff3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
ExcelOperate.vue
...ws/comment-excel/components/ExcelOperate/ExcelOperate.vue
+27
-16
No files found.
src/views/comment-excel/components/ExcelOperate/ExcelOperate.vue
View file @
bae89b1b
...
...
@@ -607,11 +607,11 @@ const setSheetAreaMark = (sheet: any) => {
})
}
// 设置数据说明区
item
.
dataTitles
.
forEach
((
itm
)
=>
{
item
.
dataTitles
?
.
forEach
((
itm
)
=>
{
setRangeBackground
(
itm
,
areaMarksColor
[
'caption'
],
false
)
})
// 设置排除区
item
.
excludeTitles
.
forEach
((
itm
)
=>
{
item
.
excludeTitles
?
.
forEach
((
itm
)
=>
{
setRangeBackground
(
itm
,
areaMarksColor
[
'exclude'
],
false
)
})
})
...
...
@@ -639,22 +639,13 @@ const toRun = async () => {
if
(
!
data
.
result
.
length
)
return
data
.
result
.
forEach
((
item
)
=>
{
for
(
const
key
in
item
)
{
if
(
typeof
item
[
key
]
==
'object'
&&
key
!=
'expendData'
)
{
if
(
!
Reflect
.
has
(
item
,
'expendData'
))
{
item
.
expendData
=
{}
}
item
.
expendData
[
key
]
=
item
[
key
]
delete
item
[
key
]
}
}
const
tableData
:
any
[]
=
[]
data
.
result
.
forEach
((
item
:
any
)
=>
{
tableData
.
push
(
filterTableData
(
item
))
})
console
.
log
(
'data.result'
,
data
.
result
)
runResultData
.
value
=
data
.
result
runResultTitle
.
value
=
filterRunDataTitle
(
data
.
result
).
filter
((
field
)
=>
{
runResultData
.
value
=
tableData
runResultTitle
.
value
=
filterRunDataTitle
(
tableData
).
filter
((
field
)
=>
{
return
field
!=
'sortNum'
&&
field
!=
'数据区'
&&
field
!=
'expendData'
})
// const idx = runResultTitle.value.findIndex((v) => v == 'sortNum')
...
...
@@ -668,6 +659,26 @@ const toRun = async () => {
})
}
}
const
filterTableData
=
(
row
:
any
)
=>
{
const
res
:
Recordable
=
{}
row
.
order
.
forEach
((
itm
)
=>
{
res
[
itm
.
title
]
=
itm
.
value
})
// 是否有附加信息
if
(
row
?.
groups
?.
length
)
{
res
[
'expendData'
]
=
{}
row
.
groups
.
forEach
((
itm
)
=>
{
res
[
'expendData'
][
itm
.
title
]
=
{}
itm
.
item
.
forEach
((
v
)
=>
{
res
[
'expendData'
][
itm
.
title
][
v
.
title
]
=
v
.
value
})
})
}
return
res
}
const
filterRunDataTitle
=
(
data
:
any
)
=>
{
const
titles
=
[]
for
(
const
row
of
data
)
{
...
...
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