Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb472f67
authored
Mar 22, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
929f55a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
23 deletions
src/pages/monitor/zoneCar.vue
src/pages/monitor/zoneCar.vue
View file @
cb472f6
...
@@ -53,7 +53,10 @@
...
@@ -53,7 +53,10 @@
<el-form-item
label=
"设备号"
>
<el-form-item
label=
"设备号"
>
<div
class=
"device_label"
slot=
"label"
>
<div
class=
"device_label"
slot=
"label"
>
<span>
设备号
</span>
<span>
设备号
</span>
<el-tooltip
content=
"请先设备号精准搜索设备定位后,再进行“选择区域”操作"
placement=
"top"
>
<el-tooltip
content=
"请先设备号精准搜索设备定位后,再进行“选择区域”操作"
placement=
"top"
>
<i
class=
"el-icon-warning-outline"
></i>
<i
class=
"el-icon-warning-outline"
></i>
</el-tooltip>
</el-tooltip>
</div>
</div>
...
@@ -74,7 +77,7 @@
...
@@ -74,7 +77,7 @@
</div>
</div>
<el-form-item
label=
""
>
<el-form-item
label=
""
>
<div>
<div>
<el-button
class=
"area_btn"
@
click=
"
searchAddess
"
<el-button
class=
"area_btn"
@
click=
"
chooseArea
"
>
选择区域
</el-button
>
选择区域
</el-button
>
>
<span
class=
"clear_link"
@
click=
"onClear"
>
清除
</span>
<span
class=
"clear_link"
@
click=
"onClear"
>
清除
</span>
...
@@ -95,6 +98,7 @@
...
@@ -95,6 +98,7 @@
type=
"primary"
type=
"primary"
class=
"search_btn"
class=
"search_btn"
:loading=
"loading"
:loading=
"loading"
:disabled=
"!rectangle"
@
click=
"getAreaLocation"
@
click=
"getAreaLocation"
>
查询
</el-button
>
查询
</el-button
>
>
...
@@ -232,7 +236,8 @@ export default {
...
@@ -232,7 +236,8 @@ export default {
{
field
:
"finalGpsTime"
,
title
:
"最后GPS定位时间"
},
{
field
:
"finalGpsTime"
,
title
:
"最后GPS定位时间"
},
{
field
:
"finalGpsAddress"
,
title
:
"最后GPS定位地址"
,
width
:
"300px"
},
{
field
:
"finalGpsAddress"
,
title
:
"最后GPS定位地址"
,
width
:
"300px"
},
],
],
drawDone
:
false
,
drawDone
:
false
,
location
:{}
,
// 设备维度查询的位置点
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -328,7 +333,7 @@ export default {
...
@@ -328,7 +333,7 @@ export default {
* 垂直距离lath(所求点在已知点上方(北方)为正,否则为负)
* 垂直距离lath(所求点在已知点上方(北方)为正,否则为负)
* 水平距离longw(所求点在已知点右方(东方)为正,否则为负)
* 水平距离longw(所求点在已知点右方(东方)为正,否则为负)
* lat = latitude + lath / (ARC * math.pi / 180);
* lat = latitude + lath / (ARC * math.pi / 180);
* l
o
ng = longitude + longw / (ARC * math.cos(latitude) * math.pi / 180);
* lng = longitude + longw / (ARC * math.cos(latitude) * math.pi / 180);
*/
*/
getLngLat
(
lng
,
lat
,
w
)
{
getLngLat
(
lng
,
lat
,
w
)
{
let
ARC
=
6371.393
*
1000
;
let
ARC
=
6371.393
*
1000
;
...
@@ -371,22 +376,26 @@ export default {
...
@@ -371,22 +376,26 @@ export default {
});
});
},
},
//
查询
//
选择区域
async
searchAddess
()
{
async
chooseArea
()
{
console
.
log
(
this
.
form
)
;
let
_type
=
this
.
menuId
;
let
o
=
this
.
form
;
let
o
=
this
.
form
;
let
location
=
{};
let
location
=
{};
let
address
=
`
${
o
.
name
||
""
}${
o
.
address
||
""
}
`
;
if
(
_type
==
1
)
{
let
{
status
,
result
}
=
await
this
.
getAddressLngLat
(
address
);
let
address
=
`
${
o
.
name
||
""
}${
o
.
address
||
""
}
`
;
if
(
status
===
"complete"
&&
result
.
info
===
"OK"
)
{
let
{
status
,
result
}
=
await
this
.
getAddressLngLat
(
address
);
// 以解析出来经纬度为中心点来画矩形
if
(
status
===
"complete"
&&
result
.
info
===
"OK"
)
{
let
arr
=
result
.
geocodes
?
result
.
geocodes
:
[];
// 以解析出来经纬度为中心点来画矩形
location
=
arr
[
0
]
?
arr
[
0
].
location
:
{};
let
arr
=
result
.
geocodes
?
result
.
geocodes
:
[];
}
else
{
location
=
arr
[
0
]
?
arr
[
0
].
location
:
{};
// 如果解析不出来经纬度,则以地图中心点来画矩形
}
else
{
location
=
this
.
map
.
getCenter
();
// 如果解析不出来经纬度,则以地图中心点来画矩形
location
=
this
.
map
.
getCenter
();
}
}
else
{
location
=
this
.
location
}
}
console
.
log
(
location
)
let
lnglats
=
this
.
getLngLat
(
location
.
lng
,
location
.
lat
);
let
lnglats
=
this
.
getLngLat
(
location
.
lng
,
location
.
lat
);
this
.
drawRectangle
(
lnglats
);
this
.
drawRectangle
(
lnglats
);
},
},
...
@@ -439,6 +448,7 @@ export default {
...
@@ -439,6 +448,7 @@ export default {
this
.
rectangleHeight
=
0
;
this
.
rectangleHeight
=
0
;
this
.
rectangleWidth
=
0
;
this
.
rectangleWidth
=
0
;
this
.
form
=
{};
this
.
form
=
{};
this
.
deviceList
=
[];
this
.
$refs
.
citySelect
.
reset
();
this
.
$refs
.
citySelect
.
reset
();
},
},
...
@@ -543,15 +553,15 @@ export default {
...
@@ -543,15 +553,15 @@ export default {
// 设备号查车
// 设备号查车
async
getLocation
()
{
async
getLocation
()
{
let
params
=
{};
let
params
=
{};
this
.
clearMap
()
this
.
clearMap
()
;
params
.
sns
=
this
.
form
.
sn
;
params
.
sns
=
this
.
form
.
sn
;
params
.
deviceCode
=
"gps"
;
params
.
deviceCode
=
"gps"
;
let
res
=
await
GET_DEVICEINFO_BYSNS
(
params
);
let
res
=
await
GET_DEVICEINFO_BYSNS
(
params
);
let
list
=
res
.
data
||
[];
let
list
=
res
.
data
||
[];
if
(
list
.
length
<=
0
)
{
if
(
list
.
length
<=
0
)
{
showToast
({
showToast
({
message
:
'暂无车辆'
message
:
"暂无车辆"
,
})
})
;
return
false
;
return
false
;
}
}
let
arr
=
[];
let
arr
=
[];
...
@@ -571,6 +581,7 @@ export default {
...
@@ -571,6 +581,7 @@ export default {
// this.autoOpenLastInfoWindow = false;
// this.autoOpenLastInfoWindow = false;
// }
// }
//this.addLocation(o, this.autoOpenLastInfoWindow);
//this.addLocation(o, this.autoOpenLastInfoWindow);
this
.
location
=
o
;
});
});
this
.
addMarkers
(
arr
);
this
.
addMarkers
(
arr
);
},
},
...
@@ -641,9 +652,9 @@ export default {
...
@@ -641,9 +652,9 @@ export default {
});
});
markers
.
push
(
labelMarker
);
markers
.
push
(
labelMarker
);
});
});
layer
.
add
(
markers
);
layer
.
add
(
markers
);
console
.
log
(
'画点结束'
,
new
Date
().
getTime
());
console
.
log
(
"画点结束"
,
new
Date
().
getTime
());
this
.
drawDone
=
true
;
this
.
drawDone
=
true
;
this
.
map
.
setFitView
();
this
.
map
.
setFitView
();
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment