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:
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user