fix: pricing 页面默认显示模型原始价格,不乘分组倍率

选择"全部分组"时 groupRatio 固定为 1,只展示 model_ratio 本身的价格。
选择具体分组时仍按分组倍率计算。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 14:15:44 +08:00
parent 656ac88fa1
commit 35cea22a4d

View File

@@ -622,26 +622,9 @@ export const calculateModelPrice = ({
let usedGroupRatio = groupRatio[selectedGroup];
if (selectedGroup === 'all' || usedGroupRatio === undefined) {
// 在模型可用分组中选择倍率最小的分组,若无则使用 1
let minRatio = Number.POSITIVE_INFINITY;
if (
Array.isArray(record.enable_groups) &&
record.enable_groups.length > 0
) {
record.enable_groups.forEach((g) => {
const r = groupRatio[g];
if (r !== undefined && r < minRatio) {
minRatio = r;
usedGroup = g;
usedGroupRatio = r;
}
});
}
// 如果找不到合适分组倍率,回退为 1
if (usedGroupRatio === undefined) {
usedGroupRatio = 1;
}
// 默认视图:显示模型原始价格,不乘分组倍率
usedGroup = 'all';
usedGroupRatio = 1;
}
// 2. 根据计费类型计算价格