Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 87fd0f75
authored
Jun 20, 2025
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
"优化对话组件时间轴渲染逻辑及重叠处理"
1 parent
1ddc9066
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
packageEquity/pages/newReceptionRecords/components/dialogue/dialogue.js
packageEquity/pages/newReceptionRecords/components/dialogue/dialogue.js
View file @
87fd0f7
...
@@ -65,6 +65,7 @@ Component({
...
@@ -65,6 +65,7 @@ Component({
}
}
this
.
barTop
=
barTop
this
.
barTop
=
barTop
this
.
containerHeight
=
containerHeight
this
.
containerHeight
=
containerHeight
let
axisList
=
[]
data
?.
sort
((
a
,
b
)
=>
a
.
offset
-
b
.
offset
).
forEach
(
e
=>
{
data
?.
sort
((
a
,
b
)
=>
a
.
offset
-
b
.
offset
).
forEach
(
e
=>
{
const
{
const
{
offset
:
mergedOffset
,
offset
:
mergedOffset
,
...
@@ -73,19 +74,20 @@ Component({
...
@@ -73,19 +74,20 @@ Component({
e
.
docTop
=
mergedOffset
/
totalDuration
*
containerHeight
e
.
docTop
=
mergedOffset
/
totalDuration
*
containerHeight
e
.
text_id
=
`text_
${
mergedOffset
}
`
e
.
text_id
=
`text_
${
mergedOffset
}
`
e
.
mergedOffset
=
mergedOffset
e
.
mergedOffset
=
mergedOffset
if
(
mergedOffset
!=
null
)
axisList
.
push
(
e
)
})
})
data
?
.
map
((
e
,
index
)
=>
{
axisList
.
map
((
e
,
index
)
=>
{
// 检查并调整 top 值,避免重叠
// 检查并调整 top 值,避免重叠
for
(
let
i
=
0
;
i
<
index
;
i
++
)
{
for
(
let
i
=
0
;
i
<
index
;
i
++
)
{
if
(
e
.
top
<
data
[
i
].
top
+
margin
&&
if
(
e
.
top
<
axisList
[
i
].
top
+
margin
&&
e
.
top
+
margin
>
data
[
i
].
top
)
{
e
.
top
+
margin
>
axisList
[
i
].
top
)
{
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e
.
top
=
data
[
i
].
top
+
margin
;
e
.
top
=
axisList
[
i
].
top
+
margin
;
}
}
}
}
})
})
this
.
setData
({
this
.
setData
({
axisList
:
data
axisList
})
})
},
this
)
},
this
)
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment