fix: 日志等级选择器不再误触发折叠展开

- 折叠onClick从整个标题栏div移到标题文字span上
- 移除不再需要的stopPropagation
This commit is contained in:
yml2213
2026-06-23 09:50:08 +08:00
parent 65683350ea
commit 74251c48c7
@@ -130,10 +130,14 @@ export default function RealtimeLogPanel({
return ( return (
<div style={{ flexShrink: 0, borderTop: `1px solid ${token.colorBorderSecondary}`, ...style }}> <div style={{ flexShrink: 0, borderTop: `1px solid ${token.colorBorderSecondary}`, ...style }}>
<div <div
style={{ display: 'flex', alignItems: 'center', cursor: collapsible ? 'pointer' : 'default', padding: '4px 0', userSelect: 'none' }} style={{ display: 'flex', alignItems: 'center', padding: '4px 0', userSelect: 'none' }}
>
<span
style={{ fontWeight: 500, fontSize: 13, cursor: collapsible ? 'pointer' : 'default' }}
onClick={() => collapsible && setVisible((value) => !value)} onClick={() => collapsible && setVisible((value) => !value)}
> >
<span style={{ fontWeight: 500, fontSize: 13 }}>{title}</span> {title}
</span>
<Select <Select
size="small" size="small"
value={levelFilter} value={levelFilter}
@@ -141,7 +145,6 @@ export default function RealtimeLogPanel({
options={LOG_LEVELS.map((l) => ({ value: l.value, label: l.label }))} options={LOG_LEVELS.map((l) => ({ value: l.value, label: l.label }))}
style={{ marginLeft: 8, width: 80 }} style={{ marginLeft: 8, width: 80 }}
popupMatchSelectWidth={false} popupMatchSelectWidth={false}
onClick={(e) => e.stopPropagation()}
/> />
{collapsible && ( {collapsible && (
visible ? <UpOutlined style={{ marginLeft: 6, fontSize: 10 }} /> : <DownOutlined style={{ marginLeft: 6, fontSize: 10 }} /> visible ? <UpOutlined style={{ marginLeft: 6, fontSize: 10 }} /> : <DownOutlined style={{ marginLeft: 6, fontSize: 10 }} />