This commit is contained in:
@@ -230,6 +230,11 @@ export function AlphaDetail({
|
||||
<Tag>{detail.alpha_type ?? "类型未提供"}</Tag>
|
||||
<Tag>{detail.language ?? "语言未提供"}</Tag>
|
||||
<Tag>{detail.status ?? "状态未提供"}</Tag>
|
||||
{detail.check_type === "PPAC_CANDIDATE" && (
|
||||
<Tag color="yellow" size="small" type="light">
|
||||
候选PPAC
|
||||
</Tag>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
@@ -240,6 +245,12 @@ export function AlphaDetail({
|
||||
<Button>在 BRAIN 中打开 ↗</Button>
|
||||
</a>
|
||||
</div>
|
||||
{detail.check_type === "PPAC_CANDIDATE" && (
|
||||
<p className="muted">
|
||||
唯一失败项为 PURE_POWER_POOL_THEME,等待平台开放 PPAC
|
||||
主题后可重新检查提交资格。
|
||||
</p>
|
||||
)}
|
||||
{detail.alpha_type === "SUPER" && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
|
||||
@@ -99,6 +99,7 @@ const checkLabels = {
|
||||
PENDING: "待检查",
|
||||
PRE_CHECK: "预检通过",
|
||||
PASS: "检查通过",
|
||||
PPAC_CANDIDATE: "候选PPAC",
|
||||
FAIL_1: "FAIL=1",
|
||||
FAIL_2: "FAIL≥2",
|
||||
};
|
||||
@@ -205,6 +206,7 @@ export function AlphaPage({
|
||||
const [filterOpen, setFilterOpen] = useState(false);
|
||||
const [selectedViewId, setSelectedViewId] = useState<string | null>(null);
|
||||
const [submissionBlocked, setSubmissionBlocked] = useState(false);
|
||||
const [ppacCandidate, setPpacCandidate] = useState(false);
|
||||
const [submission, setSubmission] = useState<Submission>("UNSUBMITTED");
|
||||
const [syncingScope, setSyncingScope] = useState<Submission | null>(null);
|
||||
const [page, setPage] = useState(1);
|
||||
@@ -274,6 +276,7 @@ export function AlphaPage({
|
||||
management_scope: managementScope,
|
||||
submission,
|
||||
submission_blocked: submissionBlocked || undefined,
|
||||
ppac_candidate: ppacCandidate || undefined,
|
||||
sort,
|
||||
direction,
|
||||
limit: pageSize,
|
||||
@@ -283,6 +286,7 @@ export function AlphaPage({
|
||||
filters,
|
||||
submission,
|
||||
submissionBlocked,
|
||||
ppacCandidate,
|
||||
sort,
|
||||
direction,
|
||||
pageSize,
|
||||
@@ -320,6 +324,7 @@ export function AlphaPage({
|
||||
offset: _offset,
|
||||
submission: nextSubmission,
|
||||
submission_blocked: nextBlocked,
|
||||
ppac_candidate: nextPpacCandidate,
|
||||
...values
|
||||
} = action.filters;
|
||||
const next = Object.fromEntries(
|
||||
@@ -334,6 +339,9 @@ export function AlphaPage({
|
||||
if (nextSubmission === "SUBMITTED" || nextSubmission === "UNSUBMITTED")
|
||||
setSubmission(nextSubmission);
|
||||
setSubmissionBlocked(nextBlocked === true || nextBlocked === "true");
|
||||
setPpacCandidate(
|
||||
nextPpacCandidate === true || nextPpacCandidate === "true",
|
||||
);
|
||||
if (nextSort) setSort(String(nextSort));
|
||||
if (nextDirection) setDirection(String(nextDirection));
|
||||
}
|
||||
@@ -367,7 +375,7 @@ export function AlphaPage({
|
||||
useEffect(() => {
|
||||
setSelected([]);
|
||||
selectionVersions.current = {};
|
||||
}, [filters, submission, submissionBlocked, managementScope]);
|
||||
}, [filters, submission, submissionBlocked, ppacCandidate, managementScope]);
|
||||
useEffect(() => {
|
||||
tablePanel.current?.querySelector(".semi-table-body")?.scrollTo({ top: 0 });
|
||||
}, [query]);
|
||||
@@ -394,6 +402,7 @@ export function AlphaPage({
|
||||
setDirection("desc");
|
||||
setSubmission(value === "SUBMITTED" ? "SUBMITTED" : "UNSUBMITTED");
|
||||
setSubmissionBlocked(value === "SUBMISSION_BLOCKED");
|
||||
setPpacCandidate(value === "PPAC_CANDIDATE");
|
||||
setDraft({});
|
||||
setFilters({});
|
||||
setPage(1);
|
||||
@@ -582,14 +591,18 @@ export function AlphaPage({
|
||||
width: 125,
|
||||
render: (_, row) => (
|
||||
<Tag
|
||||
size="small"
|
||||
type="light"
|
||||
color={
|
||||
row!.check_type?.startsWith("FAIL")
|
||||
? "red"
|
||||
: row!.check_type === "PASS"
|
||||
? "green"
|
||||
: row!.check_type === "PRE_CHECK"
|
||||
? "blue"
|
||||
: "grey"
|
||||
row!.check_type === "PPAC_CANDIDATE"
|
||||
? "yellow"
|
||||
: row!.check_type?.startsWith("FAIL")
|
||||
? "red"
|
||||
: row!.check_type === "PASS"
|
||||
? "green"
|
||||
: row!.check_type === "PRE_CHECK"
|
||||
? "blue"
|
||||
: "grey"
|
||||
}
|
||||
>
|
||||
{checkLabels[row!.check_type] || "待检查"}
|
||||
@@ -1010,6 +1023,7 @@ export function AlphaPage({
|
||||
managementScope={managementScope}
|
||||
submission={submission}
|
||||
submissionBlocked={submissionBlocked}
|
||||
ppacCandidate={ppacCandidate}
|
||||
selectedId={selectedViewId}
|
||||
onSelect={setSelectedViewId}
|
||||
onSubmissionChange={changeSubmission}
|
||||
@@ -1019,6 +1033,7 @@ export function AlphaPage({
|
||||
...filters,
|
||||
submission,
|
||||
submission_blocked: submissionBlocked || undefined,
|
||||
ppac_candidate: ppacCandidate || undefined,
|
||||
sort,
|
||||
direction,
|
||||
limit: pageSize,
|
||||
@@ -1029,6 +1044,7 @@ export function AlphaPage({
|
||||
const {
|
||||
submission: savedSubmission,
|
||||
submission_blocked: savedBlocked,
|
||||
ppac_candidate: savedPpacCandidate,
|
||||
sort: savedSort,
|
||||
direction: savedDirection,
|
||||
limit,
|
||||
@@ -1050,6 +1066,9 @@ export function AlphaPage({
|
||||
setSubmissionBlocked(
|
||||
savedBlocked === true || savedBlocked === "true",
|
||||
);
|
||||
setPpacCandidate(
|
||||
savedPpacCandidate === true || savedPpacCandidate === "true",
|
||||
);
|
||||
setSort(String(savedSort || "date_created"));
|
||||
setDirection(String(savedDirection || "desc"));
|
||||
if (typeof limit === "number") setPageSize(limit);
|
||||
@@ -1336,14 +1355,18 @@ export function AlphaPage({
|
||||
<Empty
|
||||
className="alpha-empty"
|
||||
title={
|
||||
activeFilterCount
|
||||
? "没有符合条件的 Alpha"
|
||||
: "从第一个 Alpha 开始"
|
||||
ppacCandidate
|
||||
? "没有符合条件的候选PPAC"
|
||||
: activeFilterCount
|
||||
? "没有符合条件的 Alpha"
|
||||
: "从第一个 Alpha 开始"
|
||||
}
|
||||
description={
|
||||
activeFilterCount
|
||||
? "调整筛选条件,探索更多信号。"
|
||||
: "连接 WorldQuant 并同步数据,或通过 Alpha ID 导入已有研究。"
|
||||
ppacCandidate
|
||||
? "仅收录未提交且唯一失败项为 PURE_POWER_POOL_THEME 的 Alpha,等待平台开放 PPAC 主题。"
|
||||
: activeFilterCount
|
||||
? "调整筛选条件,探索更多信号。"
|
||||
: "连接 WorldQuant 并同步数据,或通过 Alpha ID 导入已有研究。"
|
||||
}
|
||||
/>
|
||||
}
|
||||
@@ -1351,11 +1374,13 @@ export function AlphaPage({
|
||||
<footer className="table-pagination" aria-label="Alpha 分页">
|
||||
<div className="alpha-table-meta">
|
||||
<span className="muted">
|
||||
{submissionBlocked
|
||||
? "提交受阻"
|
||||
: submission === "UNSUBMITTED"
|
||||
? "待提交"
|
||||
: "已提交"}{" "}
|
||||
{ppacCandidate
|
||||
? "候选PPAC"
|
||||
: submissionBlocked
|
||||
? "提交受阻"
|
||||
: submission === "UNSUBMITTED"
|
||||
? "待提交"
|
||||
: "已提交"}{" "}
|
||||
Alpha{" "}
|
||||
<span className="count-pill">{data.total.toLocaleString()}</span>{" "}
|
||||
条
|
||||
|
||||
@@ -49,6 +49,7 @@ export function SavedViews({
|
||||
columns,
|
||||
submission,
|
||||
submissionBlocked,
|
||||
ppacCandidate,
|
||||
selectedId,
|
||||
onSelect,
|
||||
onSubmissionChange,
|
||||
@@ -61,6 +62,7 @@ export function SavedViews({
|
||||
columns: string[];
|
||||
submission: Submission;
|
||||
submissionBlocked: boolean;
|
||||
ppacCandidate: boolean;
|
||||
selectedId: string | null;
|
||||
onSelect: (id: string | null) => void;
|
||||
onSubmissionChange: (submission: string) => void;
|
||||
@@ -75,6 +77,11 @@ export function SavedViews({
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [revision, setRevision] = useState(0);
|
||||
const current = items.find((item) => item.id === selectedId);
|
||||
const fixedTab = ppacCandidate
|
||||
? "PPAC_CANDIDATE"
|
||||
: submissionBlocked
|
||||
? "SUBMISSION_BLOCKED"
|
||||
: submission;
|
||||
const modified =
|
||||
current &&
|
||||
(filterSignature(filters) !== filterSignature(current.content.filters) ||
|
||||
@@ -165,10 +172,7 @@ export function SavedViews({
|
||||
setItems((previous) =>
|
||||
previous.filter((item) => item.id !== deleting.id),
|
||||
);
|
||||
if (selectedId === deleting.id)
|
||||
onSubmissionChange(
|
||||
submissionBlocked ? "SUBMISSION_BLOCKED" : submission,
|
||||
);
|
||||
if (selectedId === deleting.id) onSubmissionChange(fixedTab);
|
||||
setDeleting(null);
|
||||
Toast.success("视图已删除");
|
||||
} catch (error) {
|
||||
@@ -185,10 +189,7 @@ export function SavedViews({
|
||||
type="card"
|
||||
collapsible="auto"
|
||||
tabPaneMotion={false}
|
||||
activeKey={
|
||||
selectedId ??
|
||||
(submissionBlocked ? "SUBMISSION_BLOCKED" : submission)
|
||||
}
|
||||
activeKey={selectedId ?? fixedTab}
|
||||
onChange={(key) => {
|
||||
const view = items.find((item) => item.id === key);
|
||||
if (view) {
|
||||
@@ -212,6 +213,11 @@ export function SavedViews({
|
||||
tab: "提交受阻",
|
||||
icon: <IconList aria-hidden="true" />,
|
||||
},
|
||||
{
|
||||
itemKey: "PPAC_CANDIDATE",
|
||||
tab: "候选PPAC",
|
||||
icon: <IconList aria-hidden="true" />,
|
||||
},
|
||||
...items.map((view) => ({
|
||||
itemKey: view.id,
|
||||
icon: <IconList aria-hidden="true" />,
|
||||
|
||||
@@ -58,7 +58,13 @@ export type Alpha = {
|
||||
date_created: string | null;
|
||||
date_submitted: string | null;
|
||||
synced_at: string;
|
||||
check_type: "PENDING" | "PRE_CHECK" | "PASS" | "FAIL_1" | "FAIL_2";
|
||||
check_type:
|
||||
| "PENDING"
|
||||
| "PRE_CHECK"
|
||||
| "PASS"
|
||||
| "PPAC_CANDIDATE"
|
||||
| "FAIL_1"
|
||||
| "FAIL_2";
|
||||
failed_checks: string[];
|
||||
neutralization: string | null;
|
||||
sub_universe_sharpe: number | null;
|
||||
|
||||
Reference in New Issue
Block a user