refactor(selection): replace concept sector filter with sub-industry
- pin the selection sector vocabulary to industry: the /sectors endpoint no longer accepts sector_type, and the port, adapter, and use case all resolve counts and member codes with sector_type="industry" - relabel the results filter to 细分行业 and drop concept-type plumbing from the frontend API, query keys, and types - show only 细分行业 in the signal detail panel; remove the concept-board chips and keep the snapshot-date tooltip on the industry line - update backend and frontend tests to the industry vocabulary and record the revised scope in the task PRD
This commit is contained in:
@@ -19,8 +19,6 @@ const SelectionChart = lazy(() =>
|
||||
})),
|
||||
)
|
||||
|
||||
const displayedConceptCount = 8
|
||||
|
||||
interface SignalDetailPanelProps {
|
||||
stock: SelectionStockResult | undefined
|
||||
}
|
||||
@@ -71,16 +69,13 @@ export function SignalDetailPanel({ stock }: SignalDetailPanelProps) {
|
||||
]
|
||||
|
||||
const membership =
|
||||
membershipQuery.data?.status === "success" ? membershipQuery.data : undefined
|
||||
membershipQuery.data?.status === "success"
|
||||
? membershipQuery.data
|
||||
: undefined
|
||||
const industries = membership?.industries ?? []
|
||||
const concepts = membership?.concepts ?? []
|
||||
const extraConceptCount = Math.max(
|
||||
0,
|
||||
concepts.length - displayedConceptCount,
|
||||
)
|
||||
const sectorSnapshotTitle =
|
||||
const industrySnapshotTitle =
|
||||
membership?.trade_date != null
|
||||
? `板块成分截至 ${membership.trade_date}`
|
||||
? `细分行业成分截至 ${membership.trade_date}`
|
||||
: undefined
|
||||
|
||||
return (
|
||||
@@ -138,30 +133,13 @@ export function SignalDetailPanel({ stock }: SignalDetailPanelProps) {
|
||||
</p>
|
||||
|
||||
{industries.length > 0 && (
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
行业:{industries.map((industry) => industry.name).join("、")}
|
||||
</p>
|
||||
)}
|
||||
{concepts.length > 0 && (
|
||||
<div
|
||||
className="mt-2 flex flex-wrap items-center gap-1"
|
||||
title={sectorSnapshotTitle}
|
||||
<p
|
||||
className="mt-1 text-xs text-muted-foreground"
|
||||
title={industrySnapshotTitle}
|
||||
>
|
||||
<span className="text-xs text-muted-foreground">板块</span>
|
||||
{concepts.slice(0, displayedConceptCount).map((concept) => (
|
||||
<span
|
||||
className="rounded bg-muted px-1.5 py-0.5 text-xs"
|
||||
key={concept.code}
|
||||
>
|
||||
{concept.name}
|
||||
</span>
|
||||
))}
|
||||
{extraConceptCount > 0 && (
|
||||
<span className="text-xs text-muted-foreground">
|
||||
等 {concepts.length} 个
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
细分行业:
|
||||
{industries.map((industry) => industry.name).join("、")}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<dl className="mt-3 divide-y divide-border/60 border-y border-border/60 text-xs">
|
||||
|
||||
Reference in New Issue
Block a user