From 9f6d1bb7687aa461527f7f4ee42b669db71aa5dc Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Fri, 20 Mar 2026 09:03:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=92=E5=BA=8F=E4=B8=AA=E6=80=A7?= =?UTF-8?q?=E5=8C=96=E6=96=B0=E5=A2=9E=E6=8E=92=E5=BA=8F=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/SettingsModal.jsx | 26 ++++- app/components/SortSettingModal.jsx | 56 ++++++++++ app/page.jsx | 158 ++++++++++++++++++++-------- components/ui/radio-group.jsx | 46 ++++++++ 4 files changed, 243 insertions(+), 43 deletions(-) create mode 100644 components/ui/radio-group.jsx diff --git a/app/components/SettingsModal.jsx b/app/components/SettingsModal.jsx index 3087a53..2847ed2 100644 --- a/app/components/SettingsModal.jsx +++ b/app/components/SettingsModal.jsx @@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "react"; import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog'; import { Progress } from '@/components/ui/progress'; +import { Switch } from '@/components/ui/switch'; import ConfirmModal from './ConfirmModal'; import { ResetIcon, SettingsIcon } from './Icons'; @@ -19,10 +20,13 @@ export default function SettingsModal({ containerWidth = 1200, setContainerWidth, onResetContainerWidth, + showMarketIndex = true, + setShowMarketIndex, }) { const [sliderDragging, setSliderDragging] = useState(false); const [resetWidthConfirmOpen, setResetWidthConfirmOpen] = useState(false); const [localSeconds, setLocalSeconds] = useState(tempSeconds); + const [localShowMarketIndex, setLocalShowMarketIndex] = useState(showMarketIndex); const pageWidthTrackRef = useRef(null); const clampedWidth = Math.min(2000, Math.max(600, Number(containerWidth) || 1200)); @@ -55,6 +59,10 @@ export default function SettingsModal({ setLocalSeconds(tempSeconds); }, [tempSeconds]); + useEffect(() => { + setLocalShowMarketIndex(showMarketIndex); + }, [showMarketIndex]); + return ( )} + +
数据导出
@@ -188,7 +212,7 @@ export default function SettingsModal({
- + {showMarketIndex && ( + + )}
@@ -4085,40 +4114,81 @@ export default function HomePage() { 排序 -
- {sortRules.filter((s) => s.enabled).map((s) => ( - + ))} +
+ )}
@@ -4740,6 +4810,8 @@ export default function HomePage() { containerWidth={containerWidth} setContainerWidth={setContainerWidth} onResetContainerWidth={handleResetContainerWidth} + showMarketIndex={showMarketIndex} + setShowMarketIndex={setShowMarketIndex} /> )} @@ -4792,6 +4864,8 @@ export default function HomePage() { isMobile={isMobile} rules={sortRules} onChangeRules={setSortRules} + sortDisplayMode={sortDisplayMode} + onChangeSortDisplayMode={setSortDisplayMode} onResetRules={() => setSortRules(DEFAULT_SORT_RULES)} /> diff --git a/components/ui/radio-group.jsx b/components/ui/radio-group.jsx new file mode 100644 index 0000000..1bfefc5 --- /dev/null +++ b/components/ui/radio-group.jsx @@ -0,0 +1,46 @@ +"use client" + +import * as React from "react" +import { CircleIcon } from "lucide-react" +import { RadioGroup as RadioGroupPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +const RadioGroup = React.forwardRef(({ className, ...props }, ref) => ( + +)) +RadioGroup.displayName = RadioGroupPrimitive.Root.displayName + +const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => ( + + + + + +)) +RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName + +export { RadioGroup, RadioGroupItem }