feat: integrate chatbox research with datasets and backtests
This commit is contained in:
@@ -38,6 +38,8 @@ import type {
|
||||
import { AlphaDetail } from "../components/AlphaDetail";
|
||||
import { AlphaSyncDialog } from "../components/AlphaSyncDialog";
|
||||
import type { PageContext, AlphaUIAction as UIAction } from "../ai/types";
|
||||
import type { UIAction as WorkspaceAction } from "../ai/types";
|
||||
import { sourceLabel } from "../research/SourceDetails";
|
||||
|
||||
const metricLabels = {
|
||||
sharpe: "Sharpe",
|
||||
@@ -57,8 +59,10 @@ const initialColumns = [
|
||||
"turnover",
|
||||
"correlation",
|
||||
"research",
|
||||
"source",
|
||||
];
|
||||
const columnLabels: Record<string, string> = {
|
||||
source: "研究来源",
|
||||
name: "Alpha",
|
||||
expression: "表达式",
|
||||
region: "地区 / Universe",
|
||||
@@ -89,6 +93,7 @@ export function AlphaPage({
|
||||
onContext,
|
||||
action,
|
||||
onOverlay,
|
||||
onAction,
|
||||
}: {
|
||||
account: Account | null;
|
||||
taskPanelOpen: boolean;
|
||||
@@ -101,6 +106,7 @@ export function AlphaPage({
|
||||
onContext: (context: PageContext) => void;
|
||||
action: UIAction | null;
|
||||
onOverlay: () => void;
|
||||
onAction: (action: WorkspaceAction) => void;
|
||||
}) {
|
||||
const [data, setData] = useState<Page>({
|
||||
items: [],
|
||||
@@ -225,6 +231,7 @@ export function AlphaPage({
|
||||
}, [action, onOverlay]);
|
||||
const refresh = useCallback(() => setLocalVersion((n) => n + 1), []);
|
||||
useEffect(() => {
|
||||
if (!active) return;
|
||||
const controller = new AbortController();
|
||||
setLoading(true);
|
||||
setError("");
|
||||
@@ -245,7 +252,7 @@ export function AlphaPage({
|
||||
if (!controller.signal.aborted) setLoading(false);
|
||||
});
|
||||
return () => controller.abort();
|
||||
}, [query, version, localVersion]);
|
||||
}, [active, query, version, localVersion]);
|
||||
useEffect(() => {
|
||||
setSelected([]);
|
||||
tablePanel.current?.querySelector(".semi-table-body")?.scrollTo({ top: 0 });
|
||||
@@ -348,6 +355,13 @@ export function AlphaPage({
|
||||
</code>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "source",
|
||||
title: "研究来源",
|
||||
width: 150,
|
||||
render: (_, row) =>
|
||||
row!.source_kinds?.map(sourceLabel).join("、") || "暂无本地来源",
|
||||
},
|
||||
{
|
||||
key: "region",
|
||||
title: "地区 / Universe",
|
||||
@@ -594,6 +608,28 @@ export function AlphaPage({
|
||||
{activeFilterCount ? `· ${activeFilterCount} 项已应用` : ""}
|
||||
</summary>
|
||||
<div className="advanced-grid">
|
||||
<label>
|
||||
研究来源
|
||||
<Select
|
||||
aria-label="研究来源筛选"
|
||||
showClear
|
||||
value={draft.source || undefined}
|
||||
optionList={options("source").map((option) => ({
|
||||
...option,
|
||||
label: sourceLabel(option.value),
|
||||
}))}
|
||||
placeholder="全部来源"
|
||||
onChange={(v) => updateDraft("source", v)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
研究编号
|
||||
<Input
|
||||
aria-label="研究编号筛选"
|
||||
value={draft.research_id || ""}
|
||||
onChange={(v) => updateDraft("research_id", v)}
|
||||
/>
|
||||
</label>
|
||||
{[
|
||||
["universe", "Universe"],
|
||||
["alpha_type", "Alpha 类型"],
|
||||
@@ -938,6 +974,7 @@ export function AlphaPage({
|
||||
/>
|
||||
)}
|
||||
<AlphaDetail
|
||||
onAction={onAction}
|
||||
suspended={overlaySuspended}
|
||||
chatOffset={chatOffset}
|
||||
taskPanelOpen={taskPanelOpen}
|
||||
|
||||
Reference in New Issue
Block a user