Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wisdom-property
Project
Project
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
郭铭瑶
wisdom-property
Commits
35326988
Commit
35326988
authored
Mar 17, 2020
by
程卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物业应急指挥体系和运行体征的静态
parent
306eb16a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
3 deletions
+37
-3
common.js
src/util/common.js
+30
-0
emergencyCommand.vue
src/views/components/emergencyCommand.vue
+2
-0
operation.vue
src/views/components/operation.vue
+5
-3
No files found.
src/util/common.js
View file @
35326988
...
@@ -33,4 +33,34 @@ export default {
...
@@ -33,4 +33,34 @@ export default {
return
path
.
reduce
(
reducer
,
obj
)
return
path
.
reduce
(
reducer
,
obj
)
}
}
},
},
/**
* 转换为金钱格式(千分位且保留两位小数)
* @param {Number | String} num [需转换的数字或字符串]
*/
toMoney
(
num
)
{
if
(
!
num
)
{
return
0.00
}
num
=
this
.
toFloat
(
num
).
toFixed
(
2
)
const
arr
=
num
.
toString
().
split
(
'.'
)
let
int
=
(
arr
[
0
]
||
0
).
toString
(),
result
=
''
while
(
int
.
length
>
3
)
{
result
=
','
+
int
.
slice
(
-
3
)
+
result
int
=
int
.
slice
(
0
,
int
.
length
-
3
)
}
if
(
int
)
{
result
=
int
+
result
}
return
`
${
result
}
.
${
arr
[
1
]}
`
},
//
//
// 转换为千位分隔符
//
format
(
num
)
{
var
reg
=
/
\d{1,3}(?=(\d{3})
+$
)
/g
return
(
num
+
''
).
replace
(
reg
,
'$&,'
)
}
}
}
src/views/components/emergencyCommand.vue
View file @
35326988
...
@@ -88,4 +88,6 @@ img
...
@@ -88,4 +88,6 @@ img
color skyblue
color skyblue
span
span
font-size 1.25rem
font-size 1.25rem
color #ffffff
</
style
>
</
style
>
src/views/components/operation.vue
View file @
35326988
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
<div
class=
"operation"
>
<div
class=
"operation"
>
<div
class=
"o-card"
v-for=
"(i,k) in datas"
:key=
"k"
>
<div
class=
"o-card"
v-for=
"(i,k) in datas"
:key=
"k"
>
<div
class=
"p-left"
>
<div
class=
"p-left"
>
<img
:src=
"require('@/assets/images/icon
4
.png')"
alt=
""
>
<img
:src=
"require('@/assets/images/icon
1
.png')"
alt=
""
>
</div>
</div>
<div
class=
"p-right"
>
<div
class=
"p-right"
>
<p>
{{
i
.
title
}}
</p>
<p>
{{
i
.
title
}}
</p>
<span>
{{
i
.
num
}}
</span>
<span>
{{
$com
.
format
(
i
.
num
)
}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -77,6 +77,8 @@ img
...
@@ -77,6 +77,8 @@ img
font-size .8rem
font-size .8rem
color skyblue
color skyblue
span
span
font-size 1.25rem
font-size 1.35rem
font-weight 700
color rgb(109,234,253)
</
style
>
</
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