+ {t('dangerous_modal.confirm_prompt_prefix')}{' '}
+
+ {this.state.error?.message || '未知渲染错误'} +
+ } + onClick={this.handleReset} + style={{ marginTop: 8 }} + > + 重试组件 + + + } + style={{ margin: '12px 0' }} + /> + ); + } + + return this.props.children; + } +} diff --git a/src/components/skeletons.tsx b/src/components/skeletons.tsx new file mode 100644 index 0000000..5de912a --- /dev/null +++ b/src/components/skeletons.tsx @@ -0,0 +1,93 @@ +import { Card, Skeleton, Table } from 'antd'; + +export interface SkeletonProps { + height?: number | string; + className?: string; +} + +/** + * 图表数据加载中的骨架屏组件 + */ +export function ChartSkeleton({ height = 300, className }: SkeletonProps) { + return ( +