diff --git a/web/src/components/common/ui/SelectableButtonGroup.jsx b/web/src/components/common/ui/SelectableButtonGroup.jsx index 3fe249084..dc5c428b5 100644 --- a/web/src/components/common/ui/SelectableButtonGroup.jsx +++ b/web/src/components/common/ui/SelectableButtonGroup.jsx @@ -23,7 +23,6 @@ import { useContainerWidth } from '../../../hooks/common/useContainerWidth'; import { Divider, Button, - Tag, Row, Col, Collapsible, @@ -46,6 +45,7 @@ import { IconChevronDown, IconChevronUp } from '@douyinfe/semi-icons'; * @param {number} collapseHeight 折叠时的高度,默认200 * @param {boolean} withCheckbox 是否启用前缀 Checkbox 来控制激活状态 * @param {boolean} loading 是否处于加载状态 + * @param {string} variant 颜色变体: 'violet' | 'teal' | 'amber' | 'rose' | 'green',不传则使用默认蓝色 */ const SelectableButtonGroup = ({ title, @@ -58,6 +58,7 @@ const SelectableButtonGroup = ({ collapseHeight = 200, withCheckbox = false, loading = false, + variant, }) => { const [isOpen, setIsOpen] = useState(false); const [skeletonCount] = useState(12); @@ -178,9 +179,6 @@ const SelectableButtonGroup = ({ ) : ( {items.map((item) => { - const isDisabled = - item.disabled || - (typeof item.tagCount === 'number' && item.tagCount === 0); const isActive = Array.isArray(activeValue) ? activeValue.includes(item.value) : activeValue === item.value; @@ -194,13 +192,11 @@ const SelectableButtonGroup = ({ }} theme={isActive ? 'light' : 'outline'} type={isActive ? 'primary' : 'tertiary'} - disabled={isDisabled} className='sbg-button' icon={ onChange(item.value)} - disabled={isDisabled} style={{ pointerEvents: 'auto' }} /> } @@ -210,14 +206,9 @@ const SelectableButtonGroup = ({ {item.icon && {item.icon}} {item.tagCount !== undefined && shouldShowTags && ( - + {item.tagCount} - + )} @@ -231,22 +222,16 @@ const SelectableButtonGroup = ({ onClick={() => onChange(item.value)} theme={isActive ? 'light' : 'outline'} type={isActive ? 'primary' : 'tertiary'} - disabled={isDisabled} className='sbg-button' style={{ width: '100%' }} >
{item.icon && {item.icon}} - {item.tagCount !== undefined && shouldShowTags && ( - + {item.tagCount !== undefined && shouldShowTags && item.tagCount !== '' && ( + {item.tagCount} - + )}
@@ -258,7 +243,7 @@ const SelectableButtonGroup = ({ return (
{title && ( diff --git a/web/src/components/table/model-pricing/filter/PricingEndpointTypes.jsx b/web/src/components/table/model-pricing/filter/PricingEndpointTypes.jsx index 0450f576a..0e410bfa8 100644 --- a/web/src/components/table/model-pricing/filter/PricingEndpointTypes.jsx +++ b/web/src/components/table/model-pricing/filter/PricingEndpointTypes.jsx @@ -76,7 +76,6 @@ const PricingEndpointTypes = ({ value: 'all', label: t('全部端点'), tagCount: getEndpointTypeCount('all'), - disabled: models.length === 0, }, ...availableEndpointTypes.map((endpointType) => { const count = getEndpointTypeCount(endpointType); @@ -84,7 +83,6 @@ const PricingEndpointTypes = ({ value: endpointType, label: getEndpointTypeLabel(endpointType), tagCount: count, - disabled: count === 0, }; }), ]; @@ -96,6 +94,7 @@ const PricingEndpointTypes = ({ activeValue={filterEndpointType} onChange={setFilterEndpointType} loading={loading} + variant='green' t={t} /> ); diff --git a/web/src/components/table/model-pricing/filter/PricingGroups.jsx b/web/src/components/table/model-pricing/filter/PricingGroups.jsx index ee32e9b49..5879787a5 100644 --- a/web/src/components/table/model-pricing/filter/PricingGroups.jsx +++ b/web/src/components/table/model-pricing/filter/PricingGroups.jsx @@ -52,20 +52,19 @@ const PricingGroups = ({ .length; let ratioDisplay = ''; if (g === 'all') { - ratioDisplay = t('全部'); + // ratioDisplay = t('全部'); } else { const ratio = groupRatio[g]; if (ratio !== undefined && ratio !== null) { - ratioDisplay = `x${ratio}`; + ratioDisplay = `${ratio}x`; } else { - ratioDisplay = 'x1'; + ratioDisplay = '1x'; } } return { value: g, label: g === 'all' ? t('全部分组') : g, tagCount: ratioDisplay, - disabled: modelCount === 0, }; }); @@ -76,6 +75,7 @@ const PricingGroups = ({ activeValue={filterGroup} onChange={setFilterGroup} loading={loading} + variant='teal' t={t} /> ); diff --git a/web/src/components/table/model-pricing/filter/PricingQuotaTypes.jsx b/web/src/components/table/model-pricing/filter/PricingQuotaTypes.jsx index 814d1260d..b4bafbb10 100644 --- a/web/src/components/table/model-pricing/filter/PricingQuotaTypes.jsx +++ b/web/src/components/table/model-pricing/filter/PricingQuotaTypes.jsx @@ -52,6 +52,7 @@ const PricingQuotaTypes = ({ activeValue={filterQuotaType} onChange={setFilterQuotaType} loading={loading} + variant='amber' t={t} /> ); diff --git a/web/src/components/table/model-pricing/filter/PricingTags.jsx b/web/src/components/table/model-pricing/filter/PricingTags.jsx index 2d61aa90e..4dee91388 100644 --- a/web/src/components/table/model-pricing/filter/PricingTags.jsx +++ b/web/src/components/table/model-pricing/filter/PricingTags.jsx @@ -78,7 +78,6 @@ const PricingTags = ({ value: 'all', label: t('全部标签'), tagCount: getTagCount('all'), - disabled: models.length === 0, }, ]; @@ -88,7 +87,6 @@ const PricingTags = ({ value: tag, label: tag, tagCount: count, - disabled: count === 0, }); }); @@ -102,6 +100,7 @@ const PricingTags = ({ activeValue={filterTag} onChange={setFilterTag} loading={loading} + variant='rose' t={t} /> ); diff --git a/web/src/components/table/model-pricing/filter/PricingVendors.jsx b/web/src/components/table/model-pricing/filter/PricingVendors.jsx index 192d1662e..7890aa74e 100644 --- a/web/src/components/table/model-pricing/filter/PricingVendors.jsx +++ b/web/src/components/table/model-pricing/filter/PricingVendors.jsx @@ -83,7 +83,6 @@ const PricingVendors = ({ value: 'all', label: t('全部供应商'), tagCount: getVendorCount('all'), - disabled: models.length === 0, }, ]; @@ -96,7 +95,6 @@ const PricingVendors = ({ label: vendor, icon: icon ? getLobeHubIcon(icon, 16) : null, tagCount: count, - disabled: count === 0, }); }); @@ -107,7 +105,6 @@ const PricingVendors = ({ value: 'unknown', label: t('未知供应商'), tagCount: count, - disabled: count === 0, }); } @@ -121,6 +118,7 @@ const PricingVendors = ({ activeValue={filterVendor} onChange={setFilterVendor} loading={loading} + variant='violet' t={t} /> ); diff --git a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx index f466816ff..968c4bc8b 100644 --- a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx +++ b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx @@ -113,15 +113,6 @@ const PricingSidebar = ({ t={t} /> - - + + { t={t} /> - - { t={t} /> + + +