Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bf371b32
authored
Sep 18, 2026
by
renyizhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型价格精度调整
parent
5e5b797d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
9 deletions
+42
-9
src/views/computingResource/resourceList.vue
+23
-7
src/views/console/components/model-card.vue
+19
-2
No files found.
src/views/computingResource/resourceList.vue
View file @
bf371b32
...
...
@@ -107,7 +107,7 @@
<div
v-if=
"Number(row?.quotaType) === 1"
>
-
</div>
<div
v-else-if=
"row?.billingMode === 'tiered_expr' && row?.tiers && row.tiers.length > 0"
>
<b>
{{
formatDynamicRange
(
row
.
tiers
)
}}
</b>
<span
style=
"margin-left: 2px; color: #999; font-size: 12px;"
>
/ 1M
</span>
<span
style=
"margin-left: 2px; color: #999; font-size: 12px;"
>
{{
' / '
+
getDynamicPriceUnit
(
row
.
tiers
)
}}
</span>
</div>
<div
v-else
>
<b>
¥
{{
formatPrice
(
row
.
inputPrice
)
}}
</b>
...
...
@@ -120,7 +120,7 @@
<div
v-if=
"Number(row?.quotaType) === 1"
>
-
</div>
<div
v-else-if=
"row?.billingMode === 'tiered_expr' && row?.tiers && row.tiers.length > 0"
>
<b>
{{
formatDynamicRange
(
row
.
tiers
)
}}
</b>
<span
style=
"margin-left: 2px; color: #999; font-size: 12px;"
>
/ 1M
</span>
<span
style=
"margin-left: 2px; color: #999; font-size: 12px;"
>
{{
' / '
+
getDynamicPriceUnit
(
row
.
tiers
)
}}
</span>
</div>
<div
v-else
>
<b>
¥
{{
formatPrice
(
row
.
outputPrice
)
}}
</b>
...
...
@@ -457,15 +457,15 @@
</div>
<div
class=
"tier-cell header-cell"
>
<div
class=
"header-label"
>
输入
</div>
<div
class=
"header-unit"
>
(¥/
1M tokens
)
</div>
<div
class=
"header-unit"
>
(¥/
{{
getDynamicPriceUnit
(
selectedModel
.
tiers
)
}}
)
</div>
</div>
<div
class=
"tier-cell header-cell"
>
<div
class=
"header-label"
>
输出
</div>
<div
class=
"header-unit"
>
(¥/
1M tokens
)
</div>
<div
class=
"header-unit"
>
(¥/
{{
getDynamicPriceUnit
(
selectedModel
.
tiers
)
}}
)
</div>
</div>
<div
v-for=
"col in tierExtraPriceColumns"
:key=
"col.key"
class=
"tier-cell header-cell"
>
<div
class=
"header-label"
>
{{
col
.
label
}}
</div>
<div
class=
"header-unit"
>
(¥/
1M tokens
)
</div>
<div
class=
"header-unit"
>
(¥/
{{
getDynamicPriceUnit
(
selectedModel
.
tiers
)
}}
)
</div>
</div>
</div>
<div
v-for=
"(tier, index) in selectedModel.tiers"
:key=
"index"
class=
"tier-row"
>
...
...
@@ -498,7 +498,7 @@
</
template
>
<!-- 按量计费 -->
<
template
v-
else-if=
"
selectedModelBillingMode !== 'tiered_expr'"
>
<
template
v-
if=
"!selectedModelIsPerCall &&
selectedModelBillingMode !== 'tiered_expr'"
>
<div
class=
"price-item"
>
<span
class=
"price-label"
>
输入价格
</span>
<span
class=
"price-value"
>
¥
{{
formatModelPrice
(
selectedModel
.
inputPrice
)
}}
/ 1M tokens
</span>
...
...
@@ -722,7 +722,7 @@ const tierExtraPriceColumns = computed(() => {
}
// 检查 tokensMultiplier(seedance 风格:u("tokens") * X / 1000000 中的 X)
if
(
tiers
.
some
(
t
=>
t
.
tokensMultiplier
!=
null
&&
Number
(
t
.
tokensMultiplier
)
>
0
))
{
columns
.
push
({
key
:
'tokensMultiplier'
,
label
:
'
每百万token
价格'
})
columns
.
push
({
key
:
'tokensMultiplier'
,
label
:
'价格'
})
}
return
columns
...
...
@@ -1174,6 +1174,22 @@ function formatDynamicRange(tiers) {
return
`¥
${
formatPrice
(
range
.
min
)}
~ ¥
${
formatPrice
(
range
.
max
)}
`
}
// 动态计费模型的价格单位文案:根据第一个具有 tokensMultiplier 的 tier 的 usageUnit 推断。
// token → 1M(每百万 token,后端 multiplier 已带 /1000000 语义)
// second → 秒
// count → 次
// 其他 / 未配置 → 1M(兜底,与 NewAPI 一致)
function
getDynamicPriceUnit
(
tiers
)
{
if
(
!
Array
.
isArray
(
tiers
))
return
'1M'
const
unitTier
=
tiers
.
find
(
t
=>
t
&&
t
.
tokensMultiplier
!=
null
&&
Number
(
t
.
tokensMultiplier
)
>
0
)
if
(
!
unitTier
)
return
'1M'
const
unit
=
unitTier
.
usageUnit
if
(
unit
===
'second'
)
return
'秒'
if
(
unit
===
'count'
)
return
'次'
if
(
unit
===
'token'
)
return
'1M'
return
'1M'
}
function
billingTagText
(
model
)
{
if
(
Number
(
model
?.
quotaType
)
===
1
)
return
'按次收费'
if
(
model
?.
billingMode
===
'tiered_expr'
)
return
'动态计费'
...
...
src/views/console/components/model-card.vue
View file @
bf371b32
...
...
@@ -39,10 +39,10 @@
<template
v-if=
"isPerCall"
>
<span>
每次调用
<b>
¥
{{
formatPrice
(
model
.
inputPrice
)
}}
</b></span>
</
template
>
<!-- 分档计费:显示价格范围(与 NewAPI 卡片一致:¥X ~ ¥Y /
1M token
) -->
<!-- 分档计费:显示价格范围(与 NewAPI 卡片一致:¥X ~ ¥Y /
单位
) -->
<
template
v-else-if=
"hasTieredPrice"
>
<span>
动态价格:
<b>
{{
formatDynamicRange
(
model
.
tiers
)
}}
</b></span>
<span
class=
"unit"
>
/
1M token
</span>
<span
class=
"unit"
>
/
{{
dynamicPriceUnit
}}
</span>
</
template
>
<!-- 按量计费:输入/输出 -->
<
template
v-else
>
...
...
@@ -116,6 +116,23 @@ const hasTieredPrice = computed(() => {
return
isTiered
.
value
&&
props
.
model
?.
tiers
&&
props
.
model
.
tiers
.
length
>
0
})
// 动态计费单位文案。
// token → 1M(每百万 token,后端 multiplier 已带 /1000000 语义)
// second → 秒
// count → 次
// 其他 / 未配置 → 1M(兜底,与 NewAPI 一致)
const
dynamicPriceUnit
=
computed
(()
=>
{
const
tiers
=
props
.
model
?.
tiers
if
(
!
Array
.
isArray
(
tiers
))
return
'1M'
const
unitTier
=
tiers
.
find
(
t
=>
t
&&
t
.
tokensMultiplier
!=
null
&&
Number
(
t
.
tokensMultiplier
)
>
0
)
if
(
!
unitTier
)
return
'1M'
const
unit
=
unitTier
.
usageUnit
if
(
unit
===
'second'
)
return
'秒'
if
(
unit
===
'count'
)
return
'次'
if
(
unit
===
'token'
)
return
'1M'
return
'1M'
})
// 模型标签列表
const
modelTags
=
computed
(()
=>
{
if
(
!
props
.
model
?.
tags
)
return
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment