From 9546c1ddd82ac6eb23c8042053757134c8f39676 Mon Sep 17 00:00:00 2001 From: JSR Date: Fri, 20 Mar 2026 19:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E6=94=B9=E4=B8=BA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=BF=90=E8=A1=8C=E5=B9=B6=E7=BB=9F=E4=B8=80=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BoardManager.tsx | 47 ++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/components/BoardManager.tsx b/src/components/BoardManager.tsx index e802e00..34d48d3 100644 --- a/src/components/BoardManager.tsx +++ b/src/components/BoardManager.tsx @@ -15,7 +15,7 @@ import { Typography, message, } from "antd" -import { DeleteOutlined, EditOutlined, PlayCircleOutlined, PlusOutlined, ReloadOutlined } from "@ant-design/icons" +import { DeleteOutlined, EditOutlined, PlusOutlined, ReloadOutlined } from "@ant-design/icons" import { useTranslation } from "react-i18next" type BoardStudentViewMode = "list" | "card" | "grid" @@ -511,6 +511,18 @@ ORDER BY reward_points DESC, score DESC`, [runListQuery] ) + const listConfigSignature = useMemo(() => { + if (!activeBoard) return "" + return JSON.stringify( + activeBoard.lists.map((item) => ({ + id: item.id, + name: item.name, + sql: item.sql, + viewMode: item.viewMode, + })) + ) + }, [activeBoard]) + useEffect(() => { fetchBoards() }, [fetchBoards]) @@ -530,8 +542,11 @@ ORDER BY reward_points DESC, score DESC`, useEffect(() => { if (!activeBoard) return - runAllInBoard(activeBoard).catch(() => void 0) - }, [activeBoardId]) + const timer = window.setTimeout(() => { + runAllInBoard(activeBoard).catch(() => void 0) + }, 260) + return () => window.clearTimeout(timer) + }, [activeBoard?.id, listConfigSignature, runAllInBoard]) useEffect(() => { const onDataUpdated = (e: Event) => { @@ -924,9 +939,6 @@ ORDER BY reward_points DESC, score DESC`, title={{list.name}} extra={ - @@ -1049,6 +1061,15 @@ ORDER BY reward_points DESC, score DESC`, + activeBoard && removeBoard(activeBoard.id)} + disabled={!canManage || !activeBoard} + > + + @@ -1058,8 +1079,6 @@ ORDER BY reward_points DESC, score DESC`, - - - - - removeBoard(activeBoard.id)} disabled={!canManage}> - - - {saving && {t("board.saving")}} - + {saving && {t("board.saving")}} {renderBoardWorkspace()}