Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
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
Administrator
web-monitor
Commits
7135bf24
Commit
7135bf24
authored
Jul 12, 2022
by
yanzhongrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changeTodfm
parent
15c176a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
index.js
src/utils/index.js
+31
-0
type2.vue
src/views/dashboard/components/type2.vue
+7
-2
No files found.
src/utils/index.js
View file @
7135bf24
...
...
@@ -115,3 +115,34 @@ export function param2Obj(url) {
})
return
obj
}
export
function
changeToLngDFM
(
du
)
{
if
(
!
du
)
return
const
arr1
=
du
.
split
(
"."
);
const
d
=
arr1
[
0
];
let
tp
=
"0."
+
arr1
[
1
]
tp
=
String
(
tp
*
60
);
//进行强制类型转换
const
arr2
=
tp
.
split
(
"."
);
const
f
=
arr2
[
0
];
tp
=
"0."
+
arr2
[
1
];
tp
=
tp
*
60
;
const
m
=
tp
.
toFixed
(
2
);
//保留两位小数
const
dfm
=
'东经E'
+
d
+
"°"
+
f
+
"'"
+
m
+
"
\"
"
;
return
dfm
;
}
export
function
changeToLatDFM
(
du
)
{
if
(
!
du
)
return
const
arr1
=
du
.
split
(
"."
);
const
d
=
arr1
[
0
];
let
tp
=
"0."
+
arr1
[
1
]
tp
=
String
(
tp
*
60
);
//进行强制类型转换
const
arr2
=
tp
.
split
(
"."
);
const
f
=
arr2
[
0
];
tp
=
"0."
+
arr2
[
1
];
tp
=
tp
*
60
;
const
m
=
tp
.
toFixed
(
2
);
//保留两位小数
const
dfm
=
'北纬N'
+
d
+
"°"
+
f
+
"'"
+
m
+
"
\"
"
;
return
dfm
;
}
\ No newline at end of file
src/views/dashboard/components/type2.vue
View file @
7135bf24
...
...
@@ -127,7 +127,7 @@
<div
class=
"item_name"
>
站点经度
</div>
</el-col>
<el-col
:span=
"colspan"
>
<div
class=
"item_data"
>
{{
form
.
baseInfo
.
siteLatitude
}}
</div>
<div
class=
"item_data"
>
{{
changeToLngDFM
(
form
.
baseInfo
.
siteLatitude
)
}}
</div>
</el-col>
</el-row>
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -135,7 +135,7 @@
<div
class=
"item_name"
>
站点纬度
</div>
</el-col>
<el-col
:span=
"colspan"
>
<div
class=
"item_data"
>
{{
form
.
baseInfo
.
siteLongitude
}}
</div>
<div
class=
"item_data"
>
{{
changeToLatDFM
(
form
.
baseInfo
.
siteLongitude
)
}}
</div>
</el-col>
</el-row>
<!--
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -235,6 +235,9 @@
</
template
>
<
script
>
import
{
changeToLngDFM
,
changeToLatDFM
}
from
'@/utils/index'
import
{
DetailMixins
}
from
"./mixins"
;
import
{
siteOpen
}
from
"../api"
;
export
default
{
...
...
@@ -276,6 +279,8 @@ export default {
},
},
methods
:
{
changeToLngDFM
,
changeToLatDFM
,
savebtn
()
{
this
.
flag
=
true
;
siteOpen
(
this
.
info
()).
then
((
res
)
=>
{
...
...
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