feat(ui): 异动监控新增 ST 过滤,默认开启

This commit is contained in:
shy3130
2026-08-23 14:21:06 +08:00
parent fe8cb2ee1d
commit 0b57c33ca2
+13 -1
View File
@@ -54,6 +54,8 @@ export function AbnormalMoves() {
const [minCloseness, setMinCloseness] = useState(0.5)
const [query, setQuery] = useState('')
const [watchlistOnly, setWatchlistOnly] = useState(false)
// 默认过滤 ST/*ST 风险警示股票 (口径与后端 is_st_name 一致: 名称含 ST)
const [excludeSt, setExcludeSt] = useState(true)
const [preview, setPreview] = useState<{ symbol: string; name: string } | null>(null)
const overview = useQuery({
@@ -110,12 +112,13 @@ export function AbnormalMoves() {
}
if (boardFilter !== 'all') list = list.filter(r => r.board === boardFilter)
if (watchlistOnly) list = list.filter(r => watchSymbols.has(r.symbol))
if (excludeSt) list = list.filter(r => !(r.name ?? '').toUpperCase().includes('ST'))
const q = query.trim().toLowerCase()
if (q) {
list = list.filter(r => `${r.symbol} ${r.name ?? ''}`.toLowerCase().includes(q))
}
return list
}, [view, windowFilter, direction, boardFilter, watchlistOnly, watchSymbols, query, minCloseness])
}, [view, windowFilter, direction, boardFilter, watchlistOnly, excludeSt, watchSymbols, query, minCloseness])
const counts = view?.counts
const updating = overview.isFetching
@@ -298,6 +301,15 @@ export function AbnormalMoves() {
/>
</label>
<label className="flex items-center gap-1.5 text-[11px] text-secondary" title="过滤 ST/*ST 风险警示股票">
<input
type="checkbox"
checked={excludeSt}
onChange={e => setExcludeSt(e.target.checked)}
className="h-3 w-3 accent-accent"
/>
ST
</label>
<label className="flex items-center gap-1.5 text-[11px] text-secondary" title="接近度下限 (|偏离|/阈值)">
{(minCloseness * 100).toFixed(0)}%
<input