From 51d22bba943f93316cb2dfdb591720840471fdb9 Mon Sep 17 00:00:00 2001 From: JSR Date: Fri, 27 Mar 2026 21:00:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B2=89=E6=B5=B8=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BA=95=E9=83=A8=E6=82=AC=E6=B5=AE=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ContentArea.tsx | 1 + src/components/Home.tsx | 508 ++++++++++++++++++++++----------- 2 files changed, 343 insertions(+), 166 deletions(-) diff --git a/src/components/ContentArea.tsx b/src/components/ContentArea.tsx index 008e8f4..bfd617f 100644 --- a/src/components/ContentArea.tsx +++ b/src/components/ContentArea.tsx @@ -270,6 +270,7 @@ export function ContentArea({ } /> diff --git a/src/components/Home.tsx b/src/components/Home.tsx index a085f1d..c516f4f 100644 --- a/src/components/Home.tsx +++ b/src/components/Home.tsx @@ -91,9 +91,14 @@ const T9_KEY_MAP: Record = { interface HomeProps { canEdit: boolean isPortraitMode?: boolean + immersiveMode?: boolean } -export const Home: React.FC = ({ canEdit, isPortraitMode = false }) => { +export const Home: React.FC = ({ + canEdit, + isPortraitMode = false, + immersiveMode = false, +}) => { const { t } = useTranslation() const breakpoint = useResponsive() const isMobile = breakpoint === "xs" || breakpoint === "sm" @@ -2136,17 +2141,22 @@ export const Home: React.FC = ({ canEdit, isPortraitMode = false }) = }, []) const batchToolbar = rewardMode ? null : !batchMode ? ( - ) : ( - @@ -2154,10 +2164,13 @@ export const Home: React.FC = ({ canEdit, isPortraitMode = false }) = type="primary" onClick={handleOpenBatchOperation} disabled={!canEdit || selectedStudentIds.length === 0} + style={{ borderRadius: "999px" }} > {t("home.batchOperate")} - + ) @@ -2165,6 +2178,7 @@ export const Home: React.FC = ({ canEdit, isPortraitMode = false }) =
= ({ canEdit, isPortraitMode = false }) = {contextHolder}
= ({ canEdit, isPortraitMode = false }) = flexWrap: "wrap", }} > -
-

- {rewardMode ? t("rewardExchange.title") : t("home.title")} -

-

- {t("home.subtitle", { count: students.length })} -

-
+ {!immersiveMode && ( + <> +
+

+ {rewardMode ? t("rewardExchange.title") : t("home.title")} +

+

+ {t("home.subtitle", { count: students.length })} +

+
- -
- setSearchKeyword(e.target.value)} - onFocus={() => { - if (!disableSearchKeyboard) setShowPinyinKeyboard(true) + { - if (!disableSearchKeyboard) setShowPinyinKeyboard(true) - }} - onKeyDown={(e) => { - if (e.key === "Escape") setShowPinyinKeyboard(false) - }} - placeholder={t("home.searchPlaceholder")} - prefix={} - allowClear - style={{ width: "100%" }} - /> - {!disableSearchKeyboard && showPinyinKeyboard && ( + >
-
- {searchKeyboardLayout === "qwerty26" - ? qwertyKeyRows.map((row, rowIndex) => ( -
- {row.map((keyItem) => ( - - ))} -
- )) - : t9KeyRows.map((row, rowIndex) => ( -
- {row.map((keyItem) => ( - + ))} +
+ )) + : t9KeyRows.map((row, rowIndex) => ( +
- {keyItem.digit === "⌫" ? "⌫" : `${keyItem.digit} ${keyItem.letters}`} - + {row.map((keyItem) => ( + + ))} +
))} -
- ))} -
+
+
+ )}
- )} - - setLayoutType(v as LayoutType)} - style={{ - width: isMobile ? "calc(50% - 8px)" : isTablet ? "130px" : "140px", - minWidth: isMobile ? "100px" : "120px", - flexShrink: isMobile ? 1 : 0, - }} - options={[ - { value: "grouped", label: t("home.layoutBy.grouped") }, - { value: "squareGrid", label: t("home.layoutBy.squareGrid") }, - ]} - /> - - - {batchToolbar} - + setLayoutType(v as LayoutType)} + style={{ + width: isMobile ? "calc(50% - 8px)" : isTablet ? "130px" : "140px", + minWidth: isMobile ? "100px" : "120px", + flexShrink: isMobile ? 1 : 0, + }} + options={[ + { value: "grouped", label: t("home.layoutBy.grouped") }, + { value: "squareGrid", label: t("home.layoutBy.squareGrid") }, + ]} + /> + + + {batchToolbar} + + + )} {renderQuickNav()} @@ -2449,6 +2467,164 @@ export const Home: React.FC = ({ canEdit, isPortraitMode = false }) = )} + {immersiveMode && ( +
+
+ setSearchKeyword(e.target.value)} + onFocus={() => { + if (!disableSearchKeyboard) setShowPinyinKeyboard(true) + }} + onClick={() => { + if (!disableSearchKeyboard) setShowPinyinKeyboard(true) + }} + onKeyDown={(e) => { + if (e.key === "Escape") setShowPinyinKeyboard(false) + }} + placeholder={t("home.searchPlaceholder")} + prefix={} + allowClear + style={{ width: isPortraitMode ? "170px" : "220px", borderRadius: "999px", flexShrink: 0 }} + /> + setLayoutType(v as LayoutType)} + style={{ width: 126, flexShrink: 0 }} + options={[ + { value: "grouped", label: t("home.layoutBy.grouped") }, + { value: "squareGrid", label: t("home.layoutBy.squareGrid") }, + ]} + /> + + +
{batchToolbar}
+ {!disableSearchKeyboard && showPinyinKeyboard && ( +
+
+ {searchKeyboardLayout === "qwerty26" + ? qwertyKeyRows.map((row, rowIndex) => ( +
+ {row.map((keyItem) => ( + + ))} +
+ )) + : t9KeyRows.map((row, rowIndex) => ( +
+ {row.map((keyItem) => ( + + ))} +
+ ))} +
+
+ )} +
+
+ )} + {isPortraitMode ? (