diff --git a/web/src/components/table/model-pricing/modal/components/ModelChannelList.jsx b/web/src/components/table/model-pricing/modal/components/ModelChannelList.jsx index ae8916a..63684c1 100644 --- a/web/src/components/table/model-pricing/modal/components/ModelChannelList.jsx +++ b/web/src/components/table/model-pricing/modal/components/ModelChannelList.jsx @@ -304,46 +304,43 @@ const ModelChannelList = ({ : null; items.push(makeItem(t('输入价格'), effInputRate, modelData?.model_ratio, false)); - // 输出价格:仅当全局模型配置了 completion_ratio 时才展示 + // 输出价格:渠道有 completion_ratio 即可展示(不强制要求全局配置) if ( hasRatioValue(channel.model_ratio) && - hasRatioValue(channel.completion_ratio) && - hasRatioValue(modelData?.completion_ratio) + hasRatioValue(channel.completion_ratio) ) { const effOut = Number(channel.model_ratio) * Number(channel.completion_ratio) * costDisc + globalMr * globalCR * markupRate; - const rootOut = hasRatioValue(modelData?.model_ratio) + const rootOut = hasRatioValue(modelData?.model_ratio) && hasRatioValue(modelData?.completion_ratio) ? Number(modelData.model_ratio) * Number(modelData.completion_ratio) : null; items.push(makeItem(t('输出价格'), effOut, rootOut, false)); } - // 缓存读取价格:仅当全局模型配置了 cache_ratio 时才展示 + // 缓存读取价格:渠道有 cache_ratio 即可展示(不强制要求全局配置) if ( hasRatioValue(channel.model_ratio) && - hasRatioValue(channel.cache_ratio) && - hasRatioValue(modelData?.cache_ratio) + hasRatioValue(channel.cache_ratio) ) { const effCacheRate = Number(channel.model_ratio) * Number(channel.cache_ratio) * costDisc + globalMr * globalCacheR * markupRate; - const rootC = hasRatioValue(modelData?.model_ratio) + const rootC = hasRatioValue(modelData?.model_ratio) && hasRatioValue(modelData?.cache_ratio) ? Number(modelData.model_ratio) * Number(modelData.cache_ratio) : null; items.push(makeItem(t('缓存读取价格'), effCacheRate, rootC, false)); } - // 缓存创建价格:仅当全局模型配置了 create_cache_ratio 时才展示 + // 缓存创建价格:渠道有 create_cache_ratio 即可展示(不强制要求全局配置) if ( hasRatioValue(channel.model_ratio) && - hasRatioValue(channel.create_cache_ratio) && - hasRatioValue(modelData?.create_cache_ratio) + hasRatioValue(channel.create_cache_ratio) ) { const effCreateCacheRate = Number(channel.model_ratio) * Number(channel.create_cache_ratio) * costDisc + globalMr * globalCreateCacheR * markupRate; - const rootCC = hasRatioValue(modelData?.model_ratio) + const rootCC = hasRatioValue(modelData?.model_ratio) && hasRatioValue(modelData?.create_cache_ratio) ? Number(modelData.model_ratio) * Number(modelData.create_cache_ratio) : null; items.push(makeItem(t('缓存创建价格'), effCreateCacheRate, rootCC, false));