Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
aitools
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
周成波
aitools
Commits
10f4292f
Commit
10f4292f
authored
Oct 16, 2025
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
701e61fb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
index.vue
src/views/agent_chat/index.vue
+5
-6
No files found.
src/views/agent_chat/index.vue
View file @
10f4292f
...
...
@@ -19,6 +19,7 @@ const title = ref('元芒数字')
// 对话数据
const
chatSessionId
=
ref
(
''
)
const
chatMessages
=
ref
<
Array
<
{
role
:
string
,
content
:
string
}
>>
([])
const
inputMessageRef
=
ref
()
const
inputMessage
=
ref
(
''
)
const
loading
=
ref
(
false
)
...
...
@@ -40,7 +41,8 @@ onMounted(async () => {
const
scrollToBottom
=
()
=>
{
nextTick
(()
=>
{
// 确保在DOM更新后执行
if
(
chatContainerRef
.
value
)
{
chatContainerRef
.
value
.
scrollTop
=
chatContainerRef
.
value
.
scrollHeight
// 这里自动将光标聚焦到输入框
inputMessageRef
.
value
.
focus
()
}
})
}
...
...
@@ -52,7 +54,7 @@ const onInitSubmit = async () => {
let
param
:
any
=
{}
await
aiAgentService
.
commonApi
(
'初始化session'
,
'Cooking Eating shopping buddy/init'
,
param
)
.
then
((
response
)
=>
{
console
.
log
(
response
)
//
console.log(response)
// 初始化成功后清空聊天记录
chatSessionId
.
value
=
response
.
session_id
||
''
chatMessages
.
value
.
push
({
...
...
@@ -209,6 +211,7 @@ const renderMarkdown = (content: string) => {
<!-- 输入区域 -->
<div
class=
"input-container"
>
<el-input
ref=
"inputMessageRef"
v-model=
"inputMessage"
type=
"textarea"
:autosize=
"
{ minRows: 2, maxRows: 4 }"
...
...
@@ -331,10 +334,6 @@ const renderMarkdown = (content: string) => {
max-width
:
80%
;
// 处理Markdown渲染后的元素样式
:deep
(
p
)
{
margin
:
0
0
10px
0
;
}
:deep
(
ul
),
:deep
(
ol
)
{
padding-left
:
20px
;
}
...
...
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