明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_front
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
jt_front
Commits
6e2f55bc
Commit
6e2f55bc
authored
Dec 05, 2025
by
chenron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
f989b20b
Pipeline
#104180
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
CommonComplete.vue
src/components/CommonComplete.vue
+33
-7
No files found.
src/components/CommonComplete.vue
View file @
6e2f55bc
...
...
@@ -30,19 +30,15 @@
<p
class=
"comparison"
>
累计同期环比
</p>
<p
class=
"comparison-value"
:class=
"
{ 'down-trend': i
tem.title === '运营成本'
}"
:class=
"
{ 'down-trend': i
sDownTrend(item.compareValue)
}"
>
{{
item
.
compareValue
}}
<el-icon
class=
"trend-icon"
:class=
"
{ 'down-trend': i
tem.title === '运营成本'
}"
:class=
"
{ 'down-trend': i
sDownTrend(item.compareValue)
}"
>
<span
v-if=
"item.compareValue !== '*'"
>
<Bottom
v-if=
"
item.title === '运营成本' || item.title === '利润总额'
"
/>
<Bottom
v-if=
"isDownTrend(item.compareValue)"
/>
<Top
v-else
/>
</span>
</el-icon>
...
...
@@ -57,12 +53,42 @@
<
script
setup
>
import
{
onMounted
,
reactive
,
watch
,
ref
}
from
"vue"
;
import
{
Top
,
Bottom
}
from
"@element-plus/icons-vue"
;
const
props
=
defineProps
({
numberList
:
{
type
:
Array
,
default
:
()
=>
[],
},
});
// 判断是否为下降趋势
const
isDownTrend
=
(
compareValue
)
=>
{
if
(
!
compareValue
||
compareValue
===
'*'
)
return
false
;
// 处理百分比值
const
value
=
compareValue
.
toString
();
// 如果包含负号,表示下降
if
(
value
.
includes
(
'-'
))
{
return
true
;
}
// 如果包含百分号,提取数值判断
if
(
value
.
includes
(
'%'
))
{
const
numValue
=
parseFloat
(
value
.
replace
(
'%'
,
''
));
return
numValue
<
0
;
}
// 如果是纯数字
const
numValue
=
parseFloat
(
value
);
if
(
!
isNaN
(
numValue
))
{
return
numValue
<
0
;
}
// 默认情况下,根据业务逻辑判断(运营成本下降是好的,显示绿色)
// 这里简化处理,如果负数则下降,正数则上升
return
false
;
};
</
script
>
<
style
scoped
lang=
"less"
>
...
...
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