feat(knowledge): 完成知识库基本功能开发

This commit is contained in:
v-zhangjc9
2025-05-28 15:06:30 +08:00
parent f7ed3bd270
commit 3ee6303cf5
30 changed files with 1787 additions and 273 deletions

View File

@@ -38,6 +38,8 @@ const Knowledge: React.FC = () => {
type: 'action',
label: '',
icon: 'fa fa-plus',
tooltip: '新增',
tooltipPlacement: 'top',
actionType: 'dialog',
dialog: {
title: '新增知识库',
@@ -111,7 +113,7 @@ const Knowledge: React.FC = () => {
type: 'action',
label: '详情',
level: 'link',
size: 'xs',
size: 'sm',
onEvent: {
click: {
actions: [
@@ -119,7 +121,7 @@ const Knowledge: React.FC = () => {
actionType: 'custom',
// @ts-ignore
script: (context, action, event) => {
navigate(`/ai/knowledge/detail/${context.props.data['name']}`)
navigate(`/ai/knowledge/detail/${context.props.data['id']}`)
},
},
],
@@ -130,7 +132,7 @@ const Knowledge: React.FC = () => {
type: 'action',
label: '导入',
level: 'link',
size: 'xs',
size: 'sm',
onEvent: {
click: {
actions: [
@@ -138,7 +140,7 @@ const Knowledge: React.FC = () => {
actionType: 'custom',
// @ts-ignore
script: (context, action, event) => {
navigate(`/ai/knowledge/import/${context.props.data['name']}`)
navigate(`/ai/knowledge/import/${context.props.data['id']}`)
},
},
],
@@ -150,14 +152,17 @@ const Knowledge: React.FC = () => {
label: '删除',
className: 'text-danger hover:text-red-600',
level: 'link',
size: 'xs',
size: 'sm',
actionType: 'ajax',
api: {
method: 'get',
url: 'http://127.0.0.1:8080/knowledge/delete?name=${name}',
url: 'http://127.0.0.1:8080/knowledge/delete',
headers: {
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
},
data: {
id: '${id}',
},
},
confirmText: '确认删除',
confirmTitle: '删除',