Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
水玉婷
ai-wechat
Commits
8344d1e2
Commit
8344d1e2
authored
Mar 10, 2026
by
水玉婷
Browse files
feat:修复历史记录滚动无限初始化ssebug
parent
45a26348
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/views/History.vue
View file @
8344d1e2
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
<p>
暂无历史记录
</p>
<p>
暂无历史记录
</p>
</div>
</div>
</div>
</div>
<div
class=
"history-list-
head
er"
v-if=
"totalCount > 0"
>
<div
class=
"history-list-
foot
er"
v-if=
"totalCount > 0"
>
<span
class=
"total-count"
>
共
{{
totalCount
}}
条记录
</span>
<span
class=
"total-count"
>
共
{{
totalCount
}}
条记录
</span>
<span
class=
"display-count"
>
显示最近
{{
displayLimit
}}
条
</span>
<span
class=
"display-count"
>
显示最近
{{
displayLimit
}}
条
</span>
</div>
</div>
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
:token=
"userToken"
:token=
"userToken"
:appCode=
"appCode"
:appCode=
"appCode"
customClass=
"chat-history"
customClass=
"chat-history"
:key=
"
currentS
ession
Id
"
:key=
"
s
ession
Key
"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -148,6 +148,7 @@ const isHistoryPanelOpen = ref(false);
...
@@ -148,6 +148,7 @@ const isHistoryPanelOpen = ref(false);
const
searchKeyword
=
ref
(
''
);
const
searchKeyword
=
ref
(
''
);
const
currentSessionId
=
ref
(
''
);
const
currentSessionId
=
ref
(
''
);
const
currentSessionDetail
=
ref
({
title
:
''
});
const
currentSessionDetail
=
ref
({
title
:
''
});
const
sessionKey
=
ref
(
''
);
// 专门用于AiChat组件的key
// 分页相关数据
// 分页相关数据
const
currentPage
=
ref
(
1
);
const
currentPage
=
ref
(
1
);
...
@@ -378,13 +379,15 @@ const filterHistory = () => {
...
@@ -378,13 +379,15 @@ const filterHistory = () => {
const
selectSession
=
(
session
:
any
)
=>
{
const
selectSession
=
(
session
:
any
)
=>
{
currentSessionId
.
value
=
session
.
id
;
currentSessionId
.
value
=
session
.
id
;
currentSessionDetail
.
value
=
{
title
:
session
.
title
};
currentSessionDetail
.
value
=
{
title
:
session
.
title
};
sessionKey
.
value
=
session
.
id
;
// 使用会话ID作为key
isHistoryPanelOpen
.
value
=
false
;
isHistoryPanelOpen
.
value
=
false
;
};
};
const
createNewChat
=
()
=>
{
const
createNewChat
=
()
=>
{
// 生成新的会话ID
// 生成新的会话ID
currentSessionId
.
value
=
''
currentSessionId
.
value
=
''
;
currentSessionDetail
.
value
=
{
title
:
'
新对话
'
};
currentSessionDetail
.
value
=
{
title
:
'
新对话
'
};
sessionKey
.
value
=
`new-
${
Date
.
now
()}
`
;
// 生成唯一的key用于新建会话
isHistoryPanelOpen
.
value
=
false
;
isHistoryPanelOpen
.
value
=
false
;
};
};
...
@@ -583,7 +586,7 @@ onMounted(() => {
...
@@ -583,7 +586,7 @@ onMounted(() => {
}
}
}
}
.history-list-
head
er {
.history-list-
foot
er {
display: flex;
display: flex;
justify-content: space-between;
justify-content: space-between;
align-items: center;
align-items: center;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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