Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pet-business-web
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
刘怀志
pet-business-web
Commits
d35f57c0
Commit
d35f57c0
authored
Sep 20, 2023
by
陈明豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
be741ffc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
index.js
src/utils/index.js
+15
-0
twoLineChart.vue
src/views/data-statistics/echars-components/twoLineChart.vue
+4
-2
No files found.
src/utils/index.js
View file @
d35f57c0
...
@@ -403,3 +403,18 @@ export function moneyFormat(data) {
...
@@ -403,3 +403,18 @@ export function moneyFormat(data) {
}
}
return
result
.
toLocaleString
(
'en-US'
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
2
})
return
result
.
toLocaleString
(
'en-US'
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
2
})
}
}
export
function
moneyFormatWithFix
(
data
,
fixNum
)
{
let
result
=
0
// 判断是不是数字
if
(
typeof
data
===
'number'
&&
!
isNaN
(
data
))
{
result
=
data
}
else
{
let
temp
=
parseFloat
(
data
)
if
(
!
isNaN
(
temp
)){
result
=
temp
}
else
{
return
'-'
}
}
return
result
.
toLocaleString
(
'en-US'
,
{
minimumFractionDigits
:
fixNum
,
maximumFractionDigits
:
fixNum
})
}
src/views/data-statistics/echars-components/twoLineChart.vue
View file @
d35f57c0
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
moneyFormatWithFix
}
from
'@/utils'
export
default
{
export
default
{
name
:
'TwoLineChart'
,
name
:
'TwoLineChart'
,
props
:
{
props
:
{
...
@@ -114,12 +116,12 @@ export default {
...
@@ -114,12 +116,12 @@ export default {
<div style="display: flex">
<div style="display: flex">
<div style="background-color:
${
color1
}
;width: 10px;height: 10px;margin-top: 7px;margin-right:5px;border-radius: 10px"></div>
<div style="background-color:
${
color1
}
;width: 10px;height: 10px;margin-top: 7px;margin-right:5px;border-radius: 10px"></div>
<span>
${
label1
}
</span>
<span>
${
label1
}
</span>
<span style="margin-left: 5px;color:
${
color1
}
">
${
Number
(
axis
[
0
].
value
).
toFixed
(
fixNum1
)}${
unit1
}
</span>
<span style="margin-left: 5px;color:
${
color1
}
">
${
moneyFormatWithFix
(
Number
(
axis
[
0
].
value
),
fixNum1
)}${
unit1
}
</span>
</div>
</div>
<div style="display: flex">
<div style="display: flex">
<div style="background-color:
${
color2
}
;width: 10px;height: 10px;margin-top: 7px;margin-right:5px;border-radius: 10px"></div>
<div style="background-color:
${
color2
}
;width: 10px;height: 10px;margin-top: 7px;margin-right:5px;border-radius: 10px"></div>
<span>
${
label2
}
</span>
<span>
${
label2
}
</span>
<span style="margin-left: 5px;color:
${
color2
}
">
${
Number
(
axis
[
1
].
value
).
toFixed
(
fixNum2
)}${
unit2
}
</span>
<span style="margin-left: 5px;color:
${
color2
}
">
${
moneyFormatWithFix
(
Number
(
axis
[
1
].
value
),
fixNum2
)}${
unit2
}
</span>
</div>
</div>
</div>`
</div>`
}
}
...
...
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