feat: 完善 Knowledge 前端页面

- 增强知识库列表和详情展示
- 添加文档上传和管理功能
- 优化创建和编辑流程

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 20:34:29 +08:00
parent 11de8c916a
commit fef1c9f302
3 changed files with 670 additions and 103 deletions

View File

@@ -95,6 +95,27 @@
border: 1px solid #374151;
}
/* 文件上传弹窗特殊样式 - 覆盖 kb-dialog */
.file-upload-dialog.kb-dialog :deep(.el-dialog) {
background-color: #1f2937;
border-radius: 12px;
border: 1px solid #374151;
}
.file-upload-dialog.kb-dialog :deep(.el-dialog__header) {
padding: 16px 24px;
border-bottom: 1px solid #374151;
}
.file-upload-dialog.kb-dialog :deep(.el-dialog__title) {
display: none;
}
.file-upload-dialog.kb-dialog :deep(.el-dialog__body) {
padding: 0;
background-color: #0f1419;
}
.kb-dialog :deep(.el-dialog__header) {
padding: 20px 24px;
border-bottom: 1px solid #374151;
@@ -575,23 +596,27 @@
/* 文件上传弹窗布局 */
.file-upload-dialog .el-dialog {
position: absolute !important;
top: 8px !important;
left: 50% !important;
transform: translateX(-50%) !important;
margin-bottom: 8px !important;
max-height: calc(100vh - 16px);
margin: auto !important;
top: 20px !important;
bottom: 20px !important;
height: auto !important;
max-height: calc(100vh - 40px);
overflow: hidden;
}
.file-upload-dialog .el-dialog__body {
padding: 0;
height: calc(100vh - 80px);
max-height: calc(100vh - 80px);
overflow: hidden;
}
.file-upload-layout {
display: flex;
flex-direction: column;
height: 85vh;
height: 100%;
background-color: #0f1419;
overflow: hidden;
}
/* 顶部导航 */
@@ -669,6 +694,26 @@
padding: 12px;
}
.loading-state,
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: #6b7280;
gap: 12px;
}
.loading-state i,
.empty-state i {
font-size: 32px;
}
.empty-state i {
color: #4b5563;
}
.file-item {
display: flex;
align-items: center;
@@ -744,10 +789,41 @@
color: #ef4444;
}
.file-item-status .status-text {
font-size: 12px;
color: #ef4444;
}
.file-item-status.parsing i {
color: #f59e0b;
}
.file-item-delete {
flex-shrink: 0;
width: 24px;
height: 24px;
border-radius: 4px;
border: none;
background: transparent;
color: #6b7280;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: all 0.2s;
margin-left: 4px;
}
.file-item:hover .file-item-delete {
opacity: 1;
}
.file-item-delete:hover {
background-color: rgba(239, 68, 68, 0.15);
color: #ef4444;
}
/* 右侧预览面板 */
.file-preview {
flex: 1;
@@ -756,6 +832,47 @@
background-color: #121218;
}
.preview-empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #6b7280;
gap: 12px;
}
.preview-empty i {
font-size: 48px;
color: #4b5563;
}
.preview-empty span {
font-size: 14px;
}
.preview-loading,
.preview-no-file {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #6b7280;
gap: 12px;
}
.preview-loading i,
.preview-no-file i {
font-size: 48px;
color: #4b5563;
}
.preview-loading span,
.preview-no-file span {
font-size: 14px;
}
.preview-header {
display: flex;
align-items: center;
@@ -817,7 +934,8 @@
background-color: #1a1a1a;
}
.pdf-iframe {
.pdf-iframe,
.pdf-embed {
width: 100%;
height: 100%;
border: none;