Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
27569a74
authored
May 14, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【增加】对话 modal 拉取
parent
20b7403a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
src/views/ai/chat/index.vue
+26
-9
No files found.
src/views/ai/chat/index.vue
View file @
27569a74
...
@@ -67,9 +67,19 @@
...
@@ -67,9 +67,19 @@
标题......
标题......
</div>
</div>
<div>
<div>
<el-button>
3.5-turbo-0125
<!-- <el-button>3.5-turbo-0125-->
<Icon
icon=
"ep:setting"
/>
<!-- <Icon icon="ep:setting"/>-->
<!-- </el-button>-->
<el-dropdown
style=
"margin-right: 12px;"
@
command=
"modalClick"
>
<el-button
type=
"primary"
>
GPT3.5
<Icon
icon=
"ep:setting"
style=
"margin-left: 10px;"
/>
</el-button>
</el-button>
<
template
#
dropdown
>
<el-dropdown-menu
v-for=
"(item, index) in modalList"
:key=
"index"
>
<el-dropdown-item
:command=
"item.model"
>
{{
item
.
model
}}
</el-dropdown-item>
</el-dropdown-menu>
</
template
>
</el-dropdown>
<el-button>
<el-button>
<Icon
icon=
"ep:user"
/>
<Icon
icon=
"ep:user"
/>
</el-button>
</el-button>
...
@@ -166,6 +176,7 @@
...
@@ -166,6 +176,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ChatMessageApi
,
ChatMessageSendVO
,
ChatMessageVO
}
from
"@/api/ai/chat/message"
import
{
ChatMessageApi
,
ChatMessageSendVO
,
ChatMessageVO
}
from
"@/api/ai/chat/message"
import
{
ChatModelApi
,
ChatModelVO
}
from
"@/api/ai/model/chatModel"
import
{
formatDate
}
from
"@/utils/formatTime"
import
{
formatDate
}
from
"@/utils/formatTime"
import
{
useClipboard
}
from
"@vueuse/core"
;
import
{
useClipboard
}
from
"@vueuse/core"
;
// 转换 markdown
// 转换 markdown
...
@@ -219,6 +230,8 @@ const isScrolling = ref(false)//用于判断用户是否在滚动
...
@@ -219,6 +230,8 @@ const isScrolling = ref(false)//用于判断用户是否在滚动
/** chat message 列表 */
/** chat message 列表 */
// defineOptions({ name: 'chatMessageList' })
// defineOptions({ name: 'chatMessageList' })
const
list
=
ref
<
ChatMessageVO
[]
>
([])
// 列表的数据
const
list
=
ref
<
ChatMessageVO
[]
>
([])
// 列表的数据
const
modalList
=
ref
<
ChatModelVO
[]
>
([])
// 列表的数据
const
changeConversation
=
(
conversation
)
=>
{
const
changeConversation
=
(
conversation
)
=>
{
console
.
log
(
conversation
)
console
.
log
(
conversation
)
...
@@ -392,8 +405,19 @@ const stopStream = async () => {
...
@@ -392,8 +405,19 @@ const stopStream = async () => {
conversationInProgress
.
value
=
false
conversationInProgress
.
value
=
false
}
}
const
modalClick
=
async
(
command
)
=>
{
console
.
log
(
'22'
,
command
)
}
const
getModalList
=
async
()
=>
{
// 获取模型 as unknown as ChatModelVO
modalList
.
value
=
await
ChatModelApi
.
getChatModelSimpleList
(
0
)
as
unknown
as
ChatModelVO
[]
}
/** 初始化 **/
/** 初始化 **/
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 获取模型
getModalList
();
// 获取列表数据
// 获取列表数据
messageList
();
messageList
();
// scrollToBottom();
// scrollToBottom();
...
@@ -411,13 +435,6 @@ onMounted(async () => {
...
@@ -411,13 +435,6 @@ onMounted(async () => {
})
})
}
}
})
})
// marked.use({
// async: false,
// pedantic: false,
// gfm: true,
// tokenizer: new Tokenizer(),
// renderer: renderer,
// });
})
})
...
...
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