Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
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
poc
poc-fe
Commits
48611576
Commit
48611576
authored
Nov 08, 2024
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(首页): 历史记录应用优化
parent
ded9373a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
history-menu-sidebar.vue
src/views/home/components/history-menu-sidebar.vue
+16
-6
home.vue
src/views/home/home.vue
+1
-0
No files found.
src/views/home/components/history-menu-sidebar.vue
View file @
48611576
...
@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'
...
@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'
interface
Props
{
interface
Props
{
currentFetchEventSourceController
:
AbortController
|
null
currentFetchEventSourceController
:
AbortController
|
null
currentSessionId
:
string
}
}
interface
SessionHistoryRecordItem
{
interface
SessionHistoryRecordItem
{
...
@@ -125,6 +126,8 @@ function onHistoryRecordListUpdate() {
...
@@ -125,6 +126,8 @@ function onHistoryRecordListUpdate() {
}
}
function
handleRecordItemApply
(
dialogsId
:
string
)
{
function
handleRecordItemApply
(
dialogsId
:
string
)
{
if
(
props
.
currentSessionId
===
dialogsId
)
return
''
if
(
isAgentResponding
.
value
)
{
if
(
isAgentResponding
.
value
)
{
window
.
$message
.
ctWarning
(
t
(
'home_module.interrupt_the_conversation_and_apply_the_history_prompt'
)).
then
(()
=>
{
window
.
$message
.
ctWarning
(
t
(
'home_module.interrupt_the_conversation_and_apply_the_history_prompt'
)).
then
(()
=>
{
props
.
currentFetchEventSourceController
&&
props
.
currentFetchEventSourceController
.
abort
()
props
.
currentFetchEventSourceController
&&
props
.
currentFetchEventSourceController
.
abort
()
...
@@ -139,9 +142,11 @@ function handleRecordItemApply(dialogsId: string) {
...
@@ -139,9 +142,11 @@ function handleRecordItemApply(dialogsId: string) {
},
300
)
},
300
)
})
})
}
else
{
}
else
{
window
.
$message
.
ctWarning
(
t
(
'home_module.history_record_item_apply_tip'
),
t
(
'common_module.tip'
)).
then
(()
=>
{
// window.$message.ctWarning(t('home_module.history_record_item_apply_tip'), t('common_module.tip')).then(() => {
// emit('getMessageRecordList', dialogsId)
// })
emit
(
'getMessageRecordList'
,
dialogsId
)
emit
(
'getMessageRecordList'
,
dialogsId
)
})
}
}
}
}
...
@@ -169,7 +174,7 @@ defineExpose({
...
@@ -169,7 +174,7 @@ defineExpose({
</h2>
</h2>
</div>
-->
</div>
-->
<div
class=
"px-[
10
px]"
>
<div
class=
"px-[
4
px]"
>
<div
class=
"h-[40px]"
>
<div
class=
"h-[40px]"
>
<Transition
name=
"history-record-edit"
mode=
"out-in"
>
<Transition
name=
"history-record-edit"
mode=
"out-in"
>
<h2
v-if=
"!isHistoryListEdit"
class=
"flex items-center justify-between"
>
<h2
v-if=
"!isHistoryListEdit"
class=
"flex items-center justify-between"
>
...
@@ -215,11 +220,16 @@ defineExpose({
...
@@ -215,11 +220,16 @@ defineExpose({
<Transition
name=
"history-record-edit"
mode=
"out-in"
>
<Transition
name=
"history-record-edit"
mode=
"out-in"
>
<li
<li
v-if=
"!isHistoryListEdit"
v-if=
"!isHistoryListEdit"
class=
"group mb-[20px] flex cursor-pointer items-center transition last:mb-0 hover:text-[#5D5D5D]"
class=
"group mb-[10px] flex cursor-pointer items-center rounded-[4px] px-[6px] py-[5px] transition last:mb-0"
:class=
"
{
'hover:text-[#5D5D5D]': currentSessionId !== recordItem.dialogsId,
'bg-[#D7D9F8]': currentSessionId === recordItem.dialogsId,
}"
@click="handleRecordItemApply(recordItem.dialogsId)"
@click="handleRecordItemApply(recordItem.dialogsId)"
>
>
<i
<i
class=
"iconfont icon-bubble mr-[5px] !text-[14px] text-[#010eff] transition group-hover:text-[#000BDE]"
class=
"iconfont icon-bubble mr-[5px] !text-[14px] text-[#010eff] transition"
:class=
"
{ 'group-hover:text-[#000BDE]': currentSessionId !== recordItem.dialogsId }"
>
</i>
>
</i>
<span
class=
"flex-1 truncate text-[14px]"
>
{{
recordItem
.
content
}}
</span>
<span
class=
"flex-1 truncate text-[14px]"
>
{{
recordItem
.
content
}}
</span>
</li>
</li>
...
...
src/views/home/home.vue
View file @
48611576
...
@@ -233,6 +233,7 @@ function onGetMessageRecordList(recordId: string) {
...
@@ -233,6 +233,7 @@ function onGetMessageRecordList(recordId: string) {
v-model=
"isShowHistoryMenu"
v-model=
"isShowHistoryMenu"
v-model:is-agent-responding=
"isAgentResponding"
v-model:is-agent-responding=
"isAgentResponding"
:current-fetch-event-source-controller=
"currentFetchEventSourceController"
:current-fetch-event-source-controller=
"currentFetchEventSourceController"
:current-session-id=
"currentSessionId"
@
get-message-record-list=
"onGetMessageRecordList"
@
get-message-record-list=
"onGetMessageRecordList"
@
create-new-session=
"onCreateNewSession"
@
create-new-session=
"onCreateNewSession"
@
history-record-list-update=
"onHistoryRecordListUpdate"
@
history-record-list-update=
"onHistoryRecordListUpdate"
...
...
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