From d26ad9e635d086490b10df15853d0410c4c4cf69 Mon Sep 17 00:00:00 2001 From: fengsilin Date: Fri, 8 May 2026 09:40:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B8=A0=E9=81=93-=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E9=80=89=E6=8B=A9=20+=20=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UserRatioSection 模型输入改为级联下拉,选渠道后自动加载模型列表 - models 信息嵌入 channelOptions 消除冗余 channelMap 状态 - 注释掉首页 HeroSection 统计数据卡片 Co-Authored-By: Claude --- .../table/users/modals/UserRatioSection.jsx | 28 +++++++++++++++---- web/src/pages/Home/components/HeroSection.jsx | 4 +-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/web/src/components/table/users/modals/UserRatioSection.jsx b/web/src/components/table/users/modals/UserRatioSection.jsx index 2e9e3de..bd91586 100644 --- a/web/src/components/table/users/modals/UserRatioSection.jsx +++ b/web/src/components/table/users/modals/UserRatioSection.jsx @@ -21,6 +21,7 @@ const UserRatioSection = ({ userId }) => { const [loading, setLoading] = useState(false); const [addModalVisible, setAddModalVisible] = useState(false); const [channelOptions, setChannelOptions] = useState([]); + const [modelOptions, setModelOptions] = useState([]); const formApiRef = useRef(null); const loadRatios = async () => { @@ -50,6 +51,7 @@ const UserRatioSection = ({ userId }) => { ? `${ch.name} (${ch.remark})` : `${ch.name} (ID: ${ch.id})`, value: ch.id, + models: (ch.models || '').split(',').map((m) => m.trim()).filter(Boolean), })); setChannelOptions(options); } else { @@ -190,12 +192,6 @@ const UserRatioSection = ({ userId }) => { getFormApi={(api) => (formApiRef.current = api)} onSubmit={handleAdd} > - { showClear rules={[{ required: true, message: t('请选择渠道') }]} style={{ width: '100%' }} + onChange={(val) => { + formApiRef.current?.setValue('model_name', undefined); + const selected = channelOptions.find((c) => c.value === val); + if (selected?.models) { + setModelOptions(selected.models.map((m) => ({ label: m, value: m }))); + } else { + setModelOptions([]); + } + }} + /> + { {/* 统计数据 */} -
+ {/*
{stats.map((stat, index) => (
{stat.value} {stat.label}
))} -
+
*/} {/* 右侧功能卡片 */}