feat(knowledge): add knowledge base management with dialog system

- Implement knowledge base list, create, and detail pages
- Add dialog provider and components for confirmation and alerts
- Include knowledge card and grid view components
- Enhance header with user menu and logout functionality
- Implement knowledge operations hooks for CRUD operations
This commit is contained in:
2025-10-13 12:26:10 +08:00
parent d475a0e982
commit 5c937df5ed
18 changed files with 2151 additions and 184 deletions

View File

@@ -1,3 +1,5 @@
import React from 'react';
export interface Pagination {
current: number;
pageSize: number;
@@ -23,3 +25,35 @@ export interface ResponseType {
message?: string;
data?: any;
}
// Dialog相关接口定义
export interface IDialogConfig {
title?: string;
content?: React.ReactNode;
type?: 'info' | 'success' | 'warning' | 'error' | 'confirm';
confirmText?: string;
cancelText?: string;
showCancel?: boolean;
maskClosable?: boolean;
width?: number | string;
onConfirm?: () => void | Promise<void>;
onCancel?: () => void;
}
export interface IDialogInstance {
id: string;
config: IDialogConfig;
resolve: (value: boolean) => void;
reject: (reason?: any) => void;
}
export interface IDialogContextValue {
dialogs: IDialogInstance[];
openDialog: (config: IDialogConfig) => Promise<boolean>;
closeDialog: (id: string, result?: boolean) => void;
confirm: (config: Omit<IDialogConfig, 'type'>) => Promise<boolean>;
info: (config: Omit<IDialogConfig, 'type'>) => Promise<boolean>;
success: (config: Omit<IDialogConfig, 'type'>) => Promise<boolean>;
warning: (config: Omit<IDialogConfig, 'type'>) => Promise<boolean>;
error: (config: Omit<IDialogConfig, 'type'>) => Promise<boolean>;
}