Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
da860c42
Commit
da860c42
authored
Aug 20, 2025
by
weiw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理一下 历史记录 数据排列问题
parent
803563af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/store/conversationSlice.helper.ts
+12
-12
No files found.
src/store/conversationSlice.helper.ts
View file @
da860c42
...
@@ -12,8 +12,8 @@ export function processConversationData(records: Conversation[]): Conversation[]
...
@@ -12,8 +12,8 @@ export function processConversationData(records: Conversation[]): Conversation[]
records
.
forEach
((
item
)
=>
{
records
.
forEach
((
item
)
=>
{
const
endDate
=
new
Date
(
item
.
endTime
)
const
endDate
=
new
Date
(
item
.
endTime
)
let
timeLabel
=
''
// 今天的数据
if
(
isToday
(
endDate
))
{
if
(
isToday
(
endDate
))
{
if
(
!
hasToday
)
{
if
(
!
hasToday
)
{
processedData
.
push
({
processedData
.
push
({
...
@@ -24,8 +24,11 @@ export function processConversationData(records: Conversation[]): Conversation[]
...
@@ -24,8 +24,11 @@ export function processConversationData(records: Conversation[]): Conversation[]
}
as
any
)
}
as
any
)
hasToday
=
true
hasToday
=
true
}
}
timeLabel
=
'今天'
processedData
.
push
({
...
item
,
})
}
}
// 最近一周但不是今天的数据
else
if
(
isThisWeek
(
endDate
,
{
weekStartsOn
:
1
}))
{
else
if
(
isThisWeek
(
endDate
,
{
weekStartsOn
:
1
}))
{
if
(
!
hasThisWeek
)
{
if
(
!
hasThisWeek
)
{
processedData
.
push
({
processedData
.
push
({
...
@@ -36,8 +39,11 @@ export function processConversationData(records: Conversation[]): Conversation[]
...
@@ -36,8 +39,11 @@ export function processConversationData(records: Conversation[]): Conversation[]
}
as
Conversation
)
}
as
Conversation
)
hasThisWeek
=
true
hasThisWeek
=
true
}
}
timeLabel
=
'最近一周'
processedData
.
push
({
...
item
,
})
}
}
// 最近30天但不是本周的数据
else
if
(
isWithinInterval
(
endDate
,
{
start
:
thirtyDaysAgo
,
end
:
today
}))
{
else
if
(
isWithinInterval
(
endDate
,
{
start
:
thirtyDaysAgo
,
end
:
today
}))
{
if
(
!
hasLast30Days
)
{
if
(
!
hasLast30Days
)
{
processedData
.
push
({
processedData
.
push
({
...
@@ -48,16 +54,10 @@ export function processConversationData(records: Conversation[]): Conversation[]
...
@@ -48,16 +54,10 @@ export function processConversationData(records: Conversation[]): Conversation[]
}
as
Conversation
)
}
as
Conversation
)
hasLast30Days
=
true
hasLast30Days
=
true
}
}
// eslint-disable-next-line unused-imports/no-unused-vars
processedData
.
push
({
timeLabel
=
'最近30天'
...
item
,
})
}
}
else
{
return
}
processedData
.
push
({
...
item
,
})
})
})
return
processedData
return
processedData
...
...
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