Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-manage-shell
Project
Overview
Details
Activity
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
姜雷
dcxy-manage-shell
Commits
67bbb13f
Commit
67bbb13f
authored
Apr 30, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保留两位小数并靠右显示
parent
a3d5b1c9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
CampusRankChart.vue
src/containers/Dashboard/CampusRank/CampusRankChart.vue
+7
-1
SeviceRatioChart.vue
src/containers/Dashboard/SeviceRatio/SeviceRatioChart.vue
+6
-1
extends.js
src/utils/extends.js
+2
-0
index.js
src/utils/index.js
+13
-0
No files found.
src/containers/Dashboard/CampusRank/CampusRankChart.vue
View file @
67bbb13f
...
@@ -60,6 +60,7 @@ export default {
...
@@ -60,6 +60,7 @@ export default {
itemTpl
:
(
value
,
color
,
checked
,
index
)
=>
{
itemTpl
:
(
value
,
color
,
checked
,
index
)
=>
{
const
obj
=
this
.
data
[
index
];
const
obj
=
this
.
data
[
index
];
checked
=
checked
?
'checked'
:
'unChecked'
;
checked
=
checked
?
'checked'
:
'unChecked'
;
let
price
=
this
.
$formatPrice
(
obj
.
count
);
return
`
return
`
<li
<li
class="g2-legend-list-item item-
${
index
}
${
checked
}
"
class="g2-legend-list-item item-
${
index
}
${
checked
}
"
...
@@ -72,7 +73,7 @@ export default {
...
@@ -72,7 +73,7 @@ export default {
style="display:inline-block;margin-right:10px;background-color:
${
color
}
;"
style="display:inline-block;margin-right:10px;background-color:
${
color
}
;"
></i>
></i>
<span class="g2-legend-text" title="
${
value
}
">
${
value
}
: </span>
<span class="g2-legend-text" title="
${
value
}
">
${
value
}
: </span>
<span>
${
obj
.
count
.
toFixed
(
2
)}
</span>
<span
class="g2-legend-price"
>
${
obj
.
count
.
toFixed
(
2
)}
</span>
</li>
</li>
`
;
`
;
},
},
...
@@ -209,5 +210,10 @@ export default {
...
@@ -209,5 +210,10 @@ export default {
white-space
:
nowrap
;
white-space
:
nowrap
;
vertical-align
:
middle
;
vertical-align
:
middle
;
}
}
.g2-legend-price
{
display
:
inline-block
;
width
:
90px
;
text-align
:
right
;
}
}
}
</
style
>
</
style
>
src/containers/Dashboard/SeviceRatio/SeviceRatioChart.vue
View file @
67bbb13f
...
@@ -67,7 +67,7 @@ export default {
...
@@ -67,7 +67,7 @@ export default {
style="display:inline-block;margin-right:10px;background-color:
${
color
}
;"
style="display:inline-block;margin-right:10px;background-color:
${
color
}
;"
></i>
></i>
<span class="g2-legend-text">
${
value
}
: </span>
<span class="g2-legend-text">
${
value
}
: </span>
<span
>
${
obj
.
count
}
</span>
<span
class="g2-legend-price">
${
obj
.
count
.
toFixed
(
2
)
}
</span>
</li>
</li>
`
;
`
;
},
},
...
@@ -151,6 +151,11 @@ export default {
...
@@ -151,6 +151,11 @@ export default {
.SeviceRatio-serviceName
{
.SeviceRatio-serviceName
{
font-size
:
16px
;
font-size
:
16px
;
}
}
.g2-legend-price
{
display
:
inline-block
;
width
:
72px
;
text-align
:
right
;
}
}
}
@media
screen
and
(
max-width
:
$bigScreenWidth
)
{
@media
screen
and
(
max-width
:
$bigScreenWidth
)
{
#SeviceRatio
{
#SeviceRatio
{
...
...
src/utils/extends.js
View file @
67bbb13f
...
@@ -5,6 +5,7 @@ import {
...
@@ -5,6 +5,7 @@ import {
formatePhone
,
formatePhone
,
allowLetterNumber
,
allowLetterNumber
,
formatterMoneyToDouble
,
formatterMoneyToDouble
,
formatPrice
,
}
from
'@/utils/index'
;
}
from
'@/utils/index'
;
import
rymUi
from
'rym-element-ui'
;
import
rymUi
from
'rym-element-ui'
;
import
'rym-element-ui/lib/rymUi.css'
;
import
'rym-element-ui/lib/rymUi.css'
;
...
@@ -31,6 +32,7 @@ const extendVue = Vue => {
...
@@ -31,6 +32,7 @@ const extendVue = Vue => {
Vue
.
prototype
.
$getFilters
=
getFilters
;
Vue
.
prototype
.
$getFilters
=
getFilters
;
Vue
.
prototype
.
$allowLetterNumber
=
allowLetterNumber
;
Vue
.
prototype
.
$allowLetterNumber
=
allowLetterNumber
;
Vue
.
prototype
.
$formatterMoneyToDouble
=
formatterMoneyToDouble
;
Vue
.
prototype
.
$formatterMoneyToDouble
=
formatterMoneyToDouble
;
Vue
.
prototype
.
$formatPrice
=
formatPrice
;
Vue
.
component
(
'UserCard'
,
UserCard
);
Vue
.
component
(
'UserCard'
,
UserCard
);
Vue
.
component
(
'UserInfo'
,
UserInfo
);
Vue
.
component
(
'UserInfo'
,
UserInfo
);
...
...
src/utils/index.js
View file @
67bbb13f
...
@@ -355,3 +355,16 @@ export const allowLetterNumber = value => {
...
@@ -355,3 +355,16 @@ export const allowLetterNumber = value => {
export
const
formatterMoneyToDouble
=
val
=>
{
export
const
formatterMoneyToDouble
=
val
=>
{
return
val
?
Number
(
val
).
toFixed
(
2
)
:
Number
(
0
).
toFixed
(
2
);
return
val
?
Number
(
val
).
toFixed
(
2
)
:
Number
(
0
).
toFixed
(
2
);
};
};
export
const
formatPrice
=
price
=>
{
var
result
=
[],
counter
=
0
;
price
=
(
price
||
0
).
toString
().
split
(
''
);
for
(
var
i
=
price
.
length
-
1
;
i
>=
0
;
i
--
)
{
counter
++
;
result
.
unshift
(
price
[
i
]);
if
(
!
(
counter
%
3
)
&&
i
!=
0
)
{
result
.
unshift
(
','
);
}
}
return
result
.
join
(
''
);
};
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