Просмотр исходного кода

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 неделю назад
Родитель
Сommit
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
: '-',
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',


Загрузка…
Отмена
Сохранить