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
0f4216f6
authored
Mar 02, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能新增】AI:新增知识库分段的禁用
parent
c2a6b02b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
8 deletions
+60
-8
src/views/ai/knowledge/document/index.vue
+1
-1
src/views/ai/knowledge/segment/index.vue
+59
-7
No files found.
src/views/ai/knowledge/document/index.vue
View file @
0f4216f6
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"
文档
编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"文件名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"文件名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"字符数"
align=
"center"
prop=
"contentLength"
/>
<el-table-column
label=
"字符数"
align=
"center"
prop=
"contentLength"
/>
<el-table-column
label=
"Token 数"
align=
"center"
prop=
"tokens"
/>
<el-table-column
label=
"Token 数"
align=
"center"
prop=
"tokens"
/>
...
...
src/views/ai/knowledge/segment/index.vue
View file @
0f4216f6
...
@@ -50,17 +50,49 @@
...
@@ -50,17 +50,49 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"分段编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"知识库编号"
align=
"center"
prop=
"knowledgeId"
/>
<el-table-column
type=
"expand"
>
<el-table-column
label=
"文档编号"
align=
"center"
prop=
"documentId"
/>
<template
#
default=
"props"
>
<el-table-column
label=
"切片内容"
align=
"center"
prop=
"content"
/>
<div
class=
"content-expand"
style=
"
padding: 10px 20px;
white-space: pre-wrap;
line-height: 1.5;
background-color: #f9f9f9;
border-radius: 4px;
border-left: 3px solid #409eff;
"
>
<div
class=
"content-title"
style=
"margin-bottom: 8px; color: #606266; font-size: 14px; font-weight: bold"
>
完整内容:
</div>
{{
props
.
row
.
content
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"切片内容"
align=
"center"
prop=
"content"
min-width=
"250px"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"字符数"
align=
"center"
prop=
"contentLength"
/>
<el-table-column
label=
"字符数"
align=
"center"
prop=
"contentLength"
/>
<el-table-column
label=
"向量库的id"
align=
"center"
prop=
"vectorId"
/>
<el-table-column
label=
"token 数量"
align=
"center"
prop=
"tokens"
/>
<el-table-column
label=
"token数量"
align=
"center"
prop=
"tokens"
/>
<el-table-column
label=
"召回次数"
align=
"center"
prop=
"retrievalCount"
/>
<el-table-column
label=
"召回次数"
align=
"center"
prop=
"retrievalCount"
/>
<el-table-column
label=
"是否启用"
align=
"center"
prop=
"status"
>
<el-table-column
label=
"是否启用"
align=
"center"
prop=
"status"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.COMMON_STATUS"
:value=
"scope.row.status"
/>
<el-switch
v-model=
"scope.row.status"
:active-value=
"0"
:inactive-value=
"1"
@
change=
"handleStatusChange(scope.row)"
:disabled=
"!checkPermi(['ai:knowledge:update'])"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
...
@@ -109,6 +141,8 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
...
@@ -109,6 +141,8 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
KnowledgeSegmentApi
,
KnowledgeSegmentVO
}
from
'@/api/ai/knowledge/segment'
import
{
KnowledgeSegmentApi
,
KnowledgeSegmentVO
}
from
'@/api/ai/knowledge/segment'
import
KnowledgeSegmentForm
from
'./KnowledgeSegmentForm.vue'
import
KnowledgeSegmentForm
from
'./KnowledgeSegmentForm.vue'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
checkPermi
}
from
'@/utils/permission'
/** AI 知识库分段 列表 */
/** AI 知识库分段 列表 */
defineOptions
({
name
:
'KnowledgeSegment'
})
defineOptions
({
name
:
'KnowledgeSegment'
})
...
@@ -173,6 +207,24 @@ const handleDelete = async (id: number) => {
...
@@ -173,6 +207,24 @@ const handleDelete = async (id: number) => {
}
catch
{}
}
catch
{}
}
}
/** 修改状态操作 */
const
handleStatusChange
=
async
(
row
:
KnowledgeSegmentVO
)
=>
{
try
{
// 修改状态的二次确认
const
text
=
row
.
status
===
CommonStatusEnum
.
ENABLE
?
'启用'
:
'禁用'
await
message
.
confirm
(
'确认要"'
+
text
+
'"该分段吗?'
)
// 发起修改状态
await
KnowledgeSegmentApi
.
updateKnowledgeSegmentStatus
({
id
:
row
.
id
,
status
:
row
.
status
})
message
.
success
(
t
(
'common.updateSuccess'
))
// 刷新列表
await
getList
()
}
catch
{
// 取消后,进行恢复按钮
row
.
status
=
row
.
status
===
CommonStatusEnum
.
ENABLE
?
CommonStatusEnum
.
DISABLE
:
CommonStatusEnum
.
ENABLE
}
}
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
// 如果文档 ID 不存在,显示错误提示并关闭页面
// 如果文档 ID 不存在,显示错误提示并关闭页面
...
...
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