feat(knowledge): add knowledge base detail page components and hooks

refactor(knowledge): restructure knowledge detail page with new components
feat(components): add FileUploadDialog for file upload functionality
feat(hooks): implement document management hooks for CRUD operations
This commit is contained in:
2025-10-14 15:42:40 +08:00
parent 34181cf025
commit 7384ae36d0
12 changed files with 1456 additions and 356 deletions

View File

@@ -0,0 +1,70 @@
import React from 'react';
import { SpeedDial, SpeedDialAction } from '@mui/material';
import {
Settings as SettingsIcon,
Search as TestIcon,
Settings as ConfigIcon,
} from '@mui/icons-material';
interface FloatingActionButtonsProps {
onTestClick: () => void;
onConfigClick: () => void;
}
const FloatingActionButtons: React.FC<FloatingActionButtonsProps> = ({
onTestClick,
onConfigClick,
}) => {
const actions = [
{
icon: <TestIcon />,
name: '检索测试',
onClick: onTestClick,
},
{
icon: <ConfigIcon />,
name: '配置设置',
onClick: onConfigClick,
},
];
return (
<SpeedDial
ariaLabel="知识库操作"
sx={{
position: 'fixed',
bottom: 128,
right: 64,
'& .MuiSpeedDial-fab': {
bgcolor: 'primary.main',
'&:hover': {
bgcolor: 'primary.dark',
},
},
}}
icon={<SettingsIcon />}
>
{actions.map((action) => (
<SpeedDialAction
key={action.name}
icon={action.icon}
slotProps={{
tooltip: {
title: action.name,
sx: {
bgcolor: 'primary.main',
color: 'white',
":hover": {
bgcolor: 'primary.dark',
},
},
},
}}
onClick={action.onClick}
/>
))}
</SpeedDial>
);
};
export default FloatingActionButtons;