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
24895bed
authored
Mar 03, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码重构】AI:“聊天模型”重构为“模型”,支持 type 模型类型
parent
2ef484e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue
+6
-6
src/views/ai/model/chatRole/ChatRoleForm.vue
+6
-6
No files found.
src/views/ai/chat/index/components/conversation/ConversationUpdateForm.vue
View file @
24895bed
...
...
@@ -18,10 +18,10 @@
<el-form-item
label=
"模型"
prop=
"modelId"
>
<el-select
v-model=
"formData.modelId"
placeholder=
"请选择模型"
>
<el-option
v-for=
"
chatModel in chatModelList
"
:key=
"
chatM
odel.id"
:label=
"
chatM
odel.name"
:value=
"
chatM
odel.id"
v-for=
"
model in models
"
:key=
"
m
odel.id"
:label=
"
m
odel.name"
:value=
"
m
odel.id"
/>
</el-select>
</el-form-item>
...
...
@@ -85,7 +85,7 @@ const formRules = reactive({
maxContexts
:
[{
required
:
true
,
message
:
'上下文数量不能为空'
,
trigger
:
'blur'
}]
})
const
formRef
=
ref
()
// 表单 Ref
const
chatModelList
=
ref
([]
as
ModelVO
[])
// 聊天模型列表
const
models
=
ref
([]
as
ModelVO
[])
// 聊天模型列表
/** 打开弹窗 */
const
open
=
async
(
id
:
number
)
=>
{
...
...
@@ -107,7 +107,7 @@ const open = async (id: number) => {
}
}
// 获得下拉数据
chatModelList
.
value
=
await
ModelApi
.
getModelSimpleList
(
AiModelTypeEnum
.
CHAT
)
models
.
value
=
await
ModelApi
.
getModelSimpleList
(
AiModelTypeEnum
.
CHAT
)
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
...
...
src/views/ai/model/chatRole/ChatRoleForm.vue
View file @
24895bed
...
...
@@ -16,10 +16,10 @@
<el-form-item
label=
"绑定模型"
prop=
"modelId"
v-if=
"!isUser"
>
<el-select
v-model=
"formData.modelId"
placeholder=
"请选择模型"
clearable
>
<el-option
v-for=
"
chatModel in chatModelList
"
:key=
"
chatM
odel.id"
:label=
"
chatM
odel.name"
:value=
"
chatM
odel.id"
v-for=
"
model in models
"
:key=
"
m
odel.id"
:label=
"
m
odel.name"
:value=
"
m
odel.id"
/>
</el-select>
</el-form-item>
...
...
@@ -95,7 +95,7 @@ const formData = ref({
status
:
CommonStatusEnum
.
ENABLE
})
const
formRef
=
ref
()
// 表单 Ref
const
chatModelList
=
ref
([]
as
ModelVO
[])
// 聊天模型列表
const
models
=
ref
([]
as
ModelVO
[])
// 聊天模型列表
/** 是否【我】自己创建,私有角色 */
const
isUser
=
computed
(()
=>
{
...
...
@@ -129,7 +129,7 @@ const open = async (type: string, id?: number, title?: string) => {
}
}
// 获得下拉数据
chatModelList
.
value
=
await
ModelApi
.
getModelSimpleList
(
AiModelTypeEnum
.
CHAT
)
models
.
value
=
await
ModelApi
.
getModelSimpleList
(
AiModelTypeEnum
.
CHAT
)
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
...
...
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