diff --git a/web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx b/web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx index 6f03729..188f8a0 100644 --- a/web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx +++ b/web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx @@ -84,7 +84,7 @@ const ModelPricingTable = ({ ? priceData.cachePrice : '-', cacheCreationPrice: - modelData?.quota_type === 0 && priceData.cacheRatio !== 1 + modelData?.quota_type === 0 && priceData.cacheRatio !== 1 && priceData.cacheCreationRatio !== 0 ? priceData.cacheCreationPrice : '-', fixedPrice: modelData?.quota_type === 1 ? priceData.price : '-', @@ -136,6 +136,10 @@ const ModelPricingTable = ({ // 检查是否有缓存价格数据(模型支持缓存时同时显示缓存读取和缓存创建) const hasCachePricing = tableData.some((row) => row.cachePrice !== '-'); + // 检查是否有缓存创建价格数据(有些模型只有缓存读取没有缓存创建) + const hasCacheCreationPricing = tableData.some( + (row) => row.cacheCreationPrice !== '-' + ); // 根据计费类型添加价格列 if (modelData?.quota_type === 0) { @@ -181,8 +185,8 @@ const ModelPricingTable = ({ ), }); } - // 缓存创建价格列(仅在有缓存价格数据时显示,与缓存读取列同时出现) - if (hasCachePricing) { + // 缓存创建价格列(仅在有缓存创建价格数据时显示) + if (hasCachePricing && hasCacheCreationPricing) { columns.push({ title: t('缓存创建'), dataIndex: 'cacheCreationPrice',