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
9376374c
authored
Mar 10, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能新增】AI:知识库新建时,模型选择改成 select 下拉
parent
fc9995d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/views/ai/knowledge/knowledge/KnowledgeForm.vue
+13
-2
No files found.
src/views/ai/knowledge/knowledge/KnowledgeForm.vue
View file @
9376374c
...
@@ -18,9 +18,15 @@
...
@@ -18,9 +18,15 @@
placeholder=
"请输入知识库描述"
placeholder=
"请输入知识库描述"
/>
/>
</el-form-item>
</el-form-item>
<!-- TODO @芋艿:增加一个下拉选择 -->
<el-form-item
label=
"向量模型"
prop=
"embeddingModelId"
>
<el-form-item
label=
"向量模型"
prop=
"embeddingModelId"
>
<el-input
v-model=
"formData.embeddingModelId"
placeholder=
"请输入向量模型"
/>
<el-select
v-model=
"formData.embeddingModelId"
placeholder=
"请选择向量模型"
clearable
class=
"!w-full"
>
<el-option
v-for=
"item in modelList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"检索 topK"
prop=
"topK"
>
<el-form-item
label=
"检索 topK"
prop=
"topK"
>
<el-input-number
<el-input-number
...
@@ -64,6 +70,8 @@
...
@@ -64,6 +70,8 @@
import
{
getIntDictOptions
,
DICT_TYPE
}
from
'@/utils/dict'
import
{
getIntDictOptions
,
DICT_TYPE
}
from
'@/utils/dict'
import
{
KnowledgeApi
,
KnowledgeVO
}
from
'@/api/ai/knowledge/knowledge'
import
{
KnowledgeApi
,
KnowledgeVO
}
from
'@/api/ai/knowledge/knowledge'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
ModelApi
,
ModelVO
}
from
'@/api/ai/model/model'
import
{
AiModelTypeEnum
}
from
'../../utils/constants'
/** AI 知识库表单 */
/** AI 知识库表单 */
defineOptions
({
name
:
'KnowledgeForm'
})
defineOptions
({
name
:
'KnowledgeForm'
})
...
@@ -92,6 +100,7 @@ const formRules = reactive({
...
@@ -92,6 +100,7 @@ const formRules = reactive({
status
:
[{
required
:
true
,
message
:
'请选择是否启用'
,
trigger
:
'blur'
}]
status
:
[{
required
:
true
,
message
:
'请选择是否启用'
,
trigger
:
'blur'
}]
})
})
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
const
modelList
=
ref
<
ModelVO
[]
>
([])
// 向量模型选项
/** 打开弹窗 */
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
...
@@ -99,6 +108,8 @@ const open = async (type: string, id?: number) => {
...
@@ -99,6 +108,8 @@ const open = async (type: string, id?: number) => {
dialogTitle
.
value
=
t
(
'action.'
+
type
)
dialogTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
formType
.
value
=
type
resetForm
()
resetForm
()
// 获取向量模型列表
modelList
.
value
=
await
ModelApi
.
getModelSimpleList
(
AiModelTypeEnum
.
EMBEDDING
)
// 修改时,设置数据
// 修改时,设置数据
if
(
id
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
...
...
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