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}
))} -
+
*/} {/* 右侧功能卡片 */}