feat: 新增产线看板功能并优化多端系统体验
1. 新增SSE看板广播机制,业务操作后主动推送刷新事件 2. 新增产线工序横道图与工位状态展示面板 3. 移除dashboard无用的three.js依赖 4. 重构WMS客户端布局与WMS前端资源哈希 5. 新增工位终端时钟图标与大屏自适应布局 6. 新增系统截图脚本与说明书生成工具 7. 修复多处代码细节与空值处理逻辑
This commit is contained in:
@@ -11,33 +11,45 @@ interface ErrorRetryProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
/** 数据加载失败时显示错误与重试按钮的兜底容器,避免空白崩溃。 */
|
||||
/** 数据异常时的兜底容器。
|
||||
* - 演示模式(demo):数据源为本地演示数据,有内容可看,只在顶部显示轻量提示条,不阻断大屏;
|
||||
* - 启动即失败且无任何数据(init + error):才全屏显示错误与重试,避免空白崩溃。 */
|
||||
export function ErrorRetry({ error, mode, loading, onRetry, children }: ErrorRetryProps) {
|
||||
const failed = Boolean(error) && !loading;
|
||||
const failed = mode === 'init' && Boolean(error) && !loading;
|
||||
if (failed) {
|
||||
return (
|
||||
<div style={{ textAlign: 'center', padding: '60px 0' }}>
|
||||
<Empty description={<Typography.Text type="danger">{error}</Typography.Text>} />
|
||||
<Button theme="solid" icon={<IconRefresh />} onClick={onRetry} style={{ marginTop: 16 }}>
|
||||
重试
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
{failed ? (
|
||||
<div style={{ textAlign: 'center', padding: '60px 0' }}>
|
||||
<Empty
|
||||
description={
|
||||
<Typography.Text type="danger">
|
||||
{error}
|
||||
{mode !== 'init' ? `(当前连接方式:${mode === 'sse' ? 'SSE' : 'HTTP 轮询'})` : ''}
|
||||
</Typography.Text>
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
theme="solid"
|
||||
icon={<IconRefresh />}
|
||||
onClick={onRetry}
|
||||
style={{ marginTop: 16 }}
|
||||
>
|
||||
重试
|
||||
</Button>
|
||||
{error && mode === 'demo' && (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
top: 68,
|
||||
right: 18,
|
||||
zIndex: 99,
|
||||
padding: '3px 10px',
|
||||
borderRadius: 10,
|
||||
fontSize: 11,
|
||||
color: 'rgba(245, 200, 106, 0.9)',
|
||||
background: 'rgba(40, 32, 12, 0.55)',
|
||||
border: '1px solid rgba(245, 200, 106, 0.25)',
|
||||
backdropFilter: 'blur(4px)',
|
||||
pointerEvents: 'none',
|
||||
letterSpacing: 0.3,
|
||||
}}
|
||||
>
|
||||
演示数据 · 真实业务数据到位后自动切换
|
||||
</div>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user