看板区域改为全高无滚动并自适应剩余空间

This commit is contained in:
JSR
2026-03-20 19:13:56 +08:00
parent 9546c1ddd8
commit f96e52e4c9
+26 -13
View File
@@ -955,7 +955,7 @@ ORDER BY reward_points DESC, score DESC`,
} }
> >
{errorMap[list.id] && <Alert style={{ marginBottom: 12 }} type="error" message={errorMap[list.id]} showIcon />} {errorMap[list.id] && <Alert style={{ marginBottom: 12 }} type="error" message={errorMap[list.id]} showIcon />}
<div style={{ flex: 1, overflow: "auto" }}>{renderStudentView(list)}</div> <div style={{ flex: 1, overflow: "hidden" }}>{renderStudentView(list)}</div>
</Card> </Card>
) )
} }
@@ -1026,18 +1026,27 @@ ORDER BY reward_points DESC, score DESC`,
if (!activeBoard) return <Empty description={t("common.noData")} /> if (!activeBoard) return <Empty description={t("common.noData")} />
return ( return (
<div style={{ height: "calc(100vh - 280px)", minHeight: 480 }}> <div style={{ flex: 1, minHeight: 0, overflow: "hidden" }}>
{renderLayoutNode(activeBoard, activeBoard.layout)} {renderLayoutNode(activeBoard, activeBoard.layout)}
</div> </div>
) )
} }
return ( return (
<div style={{ padding: 24 }}> <div
style={{
padding: 24,
height: "100%",
display: "flex",
flexDirection: "column",
overflow: "hidden",
boxSizing: "border-box",
}}
>
{contextHolder} {contextHolder}
<Space direction="vertical" size={16} style={{ width: "100%" }}> <div style={{ display: "flex", flexDirection: "column", gap: 16, width: "100%", minHeight: 0, flex: 1 }}>
<Space style={{ width: "100%", justifyContent: "space-between" }}> <div style={{ display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center" }}>
<Space align="center"> <Space align="center" size={8}>
<Typography.Title level={2} style={{ margin: 0, color: "var(--ss-text-main)" }}> <Typography.Title level={2} style={{ margin: 0, color: "var(--ss-text-main)" }}>
{t("board.title")} {t("board.title")}
</Typography.Title> </Typography.Title>
@@ -1077,27 +1086,31 @@ ORDER BY reward_points DESC, score DESC`,
{t("board.addBoard")} {t("board.addBoard")}
</Button> </Button>
</Space> </Space>
</Space> </div>
<Tabs <Tabs
type="card" type="card"
activeKey={activeBoardId} activeKey={activeBoardId}
onChange={setActiveBoardId} onChange={setActiveBoardId}
items={boards.map((board) => ({ key: board.id, label: board.name }))} items={boards.map((board) => ({ key: board.id, label: board.name }))}
style={{ marginBottom: 0 }}
/> />
{activeBoard ? ( {activeBoard ? (
<Space direction="vertical" size={16} style={{ width: "100%" }}> <div style={{ width: "100%", minHeight: 0, flex: 1, display: "flex", flexDirection: "column", gap: 8 }}>
{saving && <Typography.Text type="secondary">{t("board.saving")}</Typography.Text>} {saving && (
<Typography.Text type="secondary" style={{ flexShrink: 0 }}>
{t("board.saving")}
</Typography.Text>
)}
{renderBoardWorkspace()} {renderBoardWorkspace()}
</Space> </div>
) : ( ) : (
<Card> <Card style={{ flex: 1 }}>
<Empty description={t("common.noData")} /> <Empty description={t("common.noData")} />
</Card> </Card>
)} )}
</Space> </div>
<Modal <Modal
title={t("board.renameBoard")} title={t("board.renameBoard")}