瀏覽代碼

feat(pricing): hide cache creation price when ratio is 0

- Add cacheCreationRatio !== 0 check for row data
- Add hasCacheCreationPricing check for column visibility
- Models with cache read but no cache creation (e.g. Gemini) no longer
  show empty cache creation price column

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
fengsilin 1 周之前
父節點
當前提交
7b34fbc88a
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. +7
    -3
      web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx

+ 7
- 3
web/src/components/table/model-pricing/modal/components/ModelPricingTable.jsx 查看文件

@@ -84,7 +84,7 @@ const ModelPricingTable = ({
? priceData.cachePrice ? priceData.cachePrice
: '-', : '-',
cacheCreationPrice: cacheCreationPrice:
modelData?.quota_type === 0 && priceData.cacheRatio !== 1
modelData?.quota_type === 0 && priceData.cacheRatio !== 1 && priceData.cacheCreationRatio !== 0
? priceData.cacheCreationPrice ? priceData.cacheCreationPrice
: '-', : '-',
fixedPrice: modelData?.quota_type === 1 ? priceData.price : '-', fixedPrice: modelData?.quota_type === 1 ? priceData.price : '-',
@@ -136,6 +136,10 @@ const ModelPricingTable = ({


// 检查是否有缓存价格数据(模型支持缓存时同时显示缓存读取和缓存创建) // 检查是否有缓存价格数据(模型支持缓存时同时显示缓存读取和缓存创建)
const hasCachePricing = tableData.some((row) => row.cachePrice !== '-'); const hasCachePricing = tableData.some((row) => row.cachePrice !== '-');
// 检查是否有缓存创建价格数据(有些模型只有缓存读取没有缓存创建)
const hasCacheCreationPricing = tableData.some(
(row) => row.cacheCreationPrice !== '-'
);


// 根据计费类型添加价格列 // 根据计费类型添加价格列
if (modelData?.quota_type === 0) { if (modelData?.quota_type === 0) {
@@ -181,8 +185,8 @@ const ModelPricingTable = ({
), ),
}); });
} }
// 缓存创建价格列(仅在有缓存价格数据时显示,与缓存读取列同时出现
if (hasCachePricing) {
// 缓存创建价格列(仅在有缓存创建价格数据时显示)
if (hasCachePricing && hasCacheCreationPricing) {
columns.push({ columns.push({
title: t('缓存创建'), title: t('缓存创建'),
dataIndex: 'cacheCreationPrice', dataIndex: 'cacheCreationPrice',


Loading…
取消
儲存