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
34068ebf
authored
Jun 24, 2026
by
renyizhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
条件乘数
parent
e8278a8e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
5 deletions
+93
-5
src/views/computingResource/resourceList.vue
+93
-5
No files found.
src/views/computingResource/resourceList.vue
View file @
34068ebf
...
...
@@ -365,7 +365,7 @@
</div>
<!-- 价格信息 -->
<div
class=
"model-detail-section"
>
<div
v-if=
"selectedModelBillingMode === 'tiered_expr'"
class=
"model-detail-section"
>
<div
class=
"section-title"
>
动态计费
</div>
<div
class=
"section-desc"
>
价格根据用量档位和请求条件动态调整
</div>
</div>
...
...
@@ -395,8 +395,22 @@
</div>
</
template
>
<!-- 条件乘数 -->
<
template
v-if=
"selectedModelBillingMode === 'tiered_expr' && selectedModel.conditionMultipliers && selectedModel.conditionMultipliers.length > 0"
>
<div
class=
"model-detail-section"
>
<div
class=
"section-title"
>
条件乘数
</div>
<div
class=
"section-desc"
>
满足条件时,整单价格乘以相应倍率
</div>
</div>
<div
class=
"condition-multipliers"
>
<div
v-for=
"(cm, index) in selectedModel.conditionMultipliers"
:key=
"index"
class=
"condition-item"
>
<div
class=
"condition-desc"
>
{{
formatConditionDesc
(
cm
.
description
)
}}
</div>
<div
class=
"condition-multiplier"
>
{{
cm
.
multiplier
}}
x
</div>
</div>
</div>
</
template
>
<!-- 按量计费 -->
<
template
v-else
>
<
template
v-else
-if=
"selectedModelBillingMode !== 'tiered_expr'"
>
<div
class=
"price-item"
>
<span
class=
"price-label"
>
输入价格
</span>
<span
class=
"price-value"
>
¥
{{
formatModelPrice
(
selectedModel
.
inputPrice
)
}}
/ 1M tokens
</span>
...
...
@@ -488,7 +502,10 @@ const selectedModelIcon = computed(() => {
const
selectedModelIsPerCall
=
computed
(()
=>
Number
(
selectedModel
.
value
?.
quotaType
)
===
1
)
const
selectedModelBillingMode
=
computed
(()
=>
selectedModel
.
value
?.
billingMode
||
''
)
const
selectedModelBillingMode
=
computed
(()
=>
{
const
mode
=
selectedModel
.
value
?.
billingMode
||
''
return
mode
})
const
selectedModelTags
=
computed
(()
=>
{
if
(
!
selectedModel
.
value
?.
tags
)
return
[]
...
...
@@ -505,6 +522,46 @@ function formatModelPrice(price) {
return
num
.
toFixed
(
4
)
}
// 格式化条件描述
function
formatConditionDesc
(
desc
)
{
if
(
!
desc
)
return
''
let
result
=
desc
// 转换时间范围: (小时 ≥ 20 或 小时
<
8
)
->
小时
20
:
00
~
8
:
00
result
=
result
.
replace
(
/
\(
小时
\s
*≥
\s
*
(\d
+
)\s
*或
\s
*小时
\s
*<
\s
*
(\d
+
)\)
/g
,
(
_
,
h1
,
h2
)
=>
{
return
`小时
${
h1
}
:00~
${
h2
}
:00`
})
result
=
result
.
replace
(
/
\(
分钟
\s
*≥
\s
*
(\d
+
)\s
*或
\s
*分钟
\s
*<
\s
*
(\d
+
)\)
/g
,
(
_
,
m1
,
m2
)
=>
{
return
`分钟
${
m1
}
:00~
${
m2
}
:00`
})
// 转换星期范围: (星期 ≥ X 或 星期
<
Y
)
->
星期
X
~
Y
result
=
result
.
replace
(
/
\(
星期
\s
*≥
\s
*
(\d
+
)\s
*或
\s
*星期
\s
*<
\s
*
(\d
+
)\)
/g
,
(
_
,
w1
,
w2
)
=>
{
return
`星期
${
w1
}
~
${
w2
}
`
})
// 转换月份范围: (月份 ≥ X 或 月份
<
Y
)
->
月份
X
~
Y
result
=
result
.
replace
(
/
\(
月份
\s
*≥
\s
*
(\d
+
)\s
*或
\s
*月份
\s
*<
\s
*
(\d
+
)\)
/g
,
(
_
,
m1
,
m2
)
=>
{
return
`月份
${
m1
}
~
${
m2
}
`
})
// 转换日期范围: (日期 ≥ X 或 日期
<
Y
)
->
日期
X
~
Y
result
=
result
.
replace
(
/
\(
日期
\s
*≥
\s
*
(\d
+
)\s
*或
\s
*日期
\s
*<
\s
*
(\d
+
)\)
/g
,
(
_
,
d1
,
d2
)
=>
{
return
`日期
${
d1
}
~
${
d2
}
`
})
// 转换 ≠ nil 为 "存在"
result
=
result
.
replace
(
/请求参数
\s
+
(\w
+
)\s
*≠
\s
*nil/g
,
'请求参数 $1 存在'
)
result
=
result
.
replace
(
/请求头
\s
+
(\w
+
)\s
*≠
\s
*nil/g
,
'请求头 $1 存在'
)
result
=
result
.
replace
(
/请求头
\s
+
(\w
+
)\s
*≠
\s
*""/g
,
'请求头 $1 存在'
)
// 转换 ≠ "" 为 "存在"
result
=
result
.
replace
(
/请求头
\s
+
(\w
+
)\s
*≠
\s
*""/g
,
'请求头 $1 存在'
)
return
result
}
const
tagColors
=
[
'primary'
,
'success'
,
'warning'
,
'danger'
,
''
]
...
...
@@ -529,7 +586,6 @@ watch(() => route.query.type, (value, oldValue) => {
})
async
function
handleCheckProtocol
()
{
console
.
log
(
'点击'
)
protocol
.
value
=
true
// nextTick(() => {
// PDFObject.embed("https://luhu-ltx.oss-cn-shenzhen.aliyuncs.com/20250828/文字文稿1_1756349853834.pdf", "#pdf-container", {
...
...
@@ -821,7 +877,6 @@ const selectedTags = ref([])
function
getModelList
()
{
modelsWithPricing
().
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
models
.
value
=
res
.
data
||
[]
})
}
...
...
@@ -1500,4 +1555,37 @@ onMounted(() => {
color
:
#909399
;
margin-top
:
4px
;
}
/* 条件乘数 */
.condition-multipliers
{
border
:
1px
solid
#ebeef5
;
border-radius
:
8px
;
overflow
:
hidden
;
margin-bottom
:
16px
;
}
.condition-item
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
12px
16px
;
border-bottom
:
1px
solid
#ebeef5
;
}
.condition-item
:last-child
{
border-bottom
:
none
;
}
.condition-desc
{
font-size
:
13px
;
color
:
#303233
;
flex
:
1
;
}
.condition-multiplier
{
font-size
:
14px
;
color
:
#ee5a52
;
font-weight
:
600
;
margin-left
:
16px
;
}
</
style
>
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