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 767f58f5
authored
Apr 27, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复监控页面bug,增加脏数据拦截操作
1 parent
e050ee6d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
21 deletions
src/pages/monitor/fence.vue
src/pages/monitor/monitor.vue
src/utils/mapgeo.js
src/utils/monitor.js
src/pages/monitor/fence.vue
View file @
767f58f
...
...
@@ -33,7 +33,7 @@
<el-date-picker
style=
"width: 100%;"
v-model=
"form.dateRange"
type=
"daterange"
size=
"small"
:clearable=
"false"
:editable=
"false"
:unlink-panels=
"true"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"监控区域"
class=
"row-form-item is-required"
>
<el-form-item
label=
"监控区域"
class=
"row-form-item is-required"
>
<div
class=
"el_radio_group"
>
<div
class=
"radio_cell"
>
<el-radio
:label=
"1"
v-model=
"form.shapeType"
>
圆形
</el-radio>
...
...
@@ -72,7 +72,7 @@
</div>
<!-- <el-alert v-show="showSuccessTips" :title="`保存成功,页面将在${timer}秒后自动关闭`" type="success" :closable="false" show-icon class="show_success_tips"></el-alert> -->
<el-dialog
title=
"提示"
custom-class=
"monitor_dialog"
:visible
.
sync=
"showSuccessTips"
width=
"340px"
append-to-body
:show-close=
"false"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
>
<
!-- <
el-dialog title="提示" custom-class="monitor_dialog" :visible.sync="showSuccessTips" width="340px" append-to-body :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<div class="monitor_dialog_content">
<i class="el-icon-circle-check"></i>
<span class="">{{`保存成功,页面将在${timer}秒后自动关闭`}}</span>
...
...
@@ -80,7 +80,18 @@
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="closePage">立即关闭</el-button>
</span>
</el-dialog>
</el-dialog> -->
<!-- 提示弹框 开始 -->
<div
class=
"monitor_dialog"
v-show=
"showSuccessTips"
>
<div
class=
"monitor_dialog_content"
>
<i
class=
"el-icon-circle-check i_icon"
></i>
<span
class=
"tips"
>
{{`保存成功,页面将在${timer}秒后自动关闭`}}
</span>
<el-button
type=
"primary"
class=
"btn"
size=
"small"
@
click=
"closePage"
>
立即关闭
</el-button>
</div>
<div
class=
"blk"
></div>
</div>
<!-- 提示弹框 end -->
</div>
</template>
...
...
@@ -574,17 +585,38 @@ export default {
</
style
>
<
style
lang=
"scss"
>
.monitor_dialog
{
.el-dialog__header
{
padding
:
10px
!important
;
.el-dialog__title
{
font-size
:
14px
;
}
.blk
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
background
:
#000
;
opacity
:
0.3
;
z-index
:
9998
;
}
.el-dialog__footer
{
padding
:
5px
10px
!important
;
}
.el-dialog__body
{
padding
:
20px
;
.monitor_dialog_content
{
position
:
fixed
;
z-index
:
9999
;
width
:
260px
;
//
height
:
200px
;
border-radius
:
10px
;
background
:
#fff
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
display
:
flex
;
flex-direction
:
column
;
padding
:
30px
20px
;
.i_icon
{
font-size
:
40px
;
color
:
#67c23a
;
}
.tips
{
margin
:
15px
0
;
font-size
:
14px
;
color
:
#999
;
}
}
}
</
style
>
\ No newline at end of file
src/pages/monitor/monitor.vue
View file @
767f58f
...
...
@@ -981,6 +981,7 @@ export default {
/* let _this = this;
arr = arr.filter((item)=>this.monitorList[item.sn]); */
let
snStr
=
this
.
monitorList
.
itemArr
.
join
(
","
);
//arr.map((item)=>item.sn).join(',');
console
.
log
(
snStr
)
if
(
!
snStr
)
return
;
if
(
this
.
resetRefreshCount
||
this
.
remainSearchSnStr
!=
snStr
)
{
this
.
refreshCount
=
1
;
...
...
@@ -1017,13 +1018,14 @@ export default {
this
.
monitorList
.
itemArr
.
indexOf
(
item
.
sn
)
>
-
1
&&
item
.
eLocateType
);
this
.
monitorList
.
count
&&
if
(
this
.
monitorList
.
itemArr
&&
this
.
monitorList
.
itemArr
.
length
>
0
){
this
.
autoOpenLastInfoWindow
=
true
EventBus
.
$emit
(
"uiMap.monitor.draw"
,
drawData
,
this
.
autoOpenLastInfoWindow
);
}
if
(
this
.
autoOpenLastInfoWindow
)
{
this
.
autoOpenLastInfoWindow
=
false
;
}
...
...
src/utils/mapgeo.js
View file @
767f58f
...
...
@@ -12,6 +12,7 @@ const MAPGEO = {
})
},
transferAddressByGroup
(
obj
,
cb
){
console
.
log
(
this
.
geocoder
)
if
(
!
this
.
geocoder
){
this
.
getGeocoder
().
then
(()
=>
{
this
.
transfer
(
obj
,
cb
)
...
...
@@ -21,11 +22,12 @@ const MAPGEO = {
}
},
transfer
(
obj
,
cb
){
console
.
log
(
obj
.
data
)
const
data
=
obj
.
data
;
obj
.
len
=
data
.
length
;
obj
.
times
=
obj
.
len
>
20
?
Math
.
ceil
(
obj
.
len
/
20
):
1
;
obj
.
totalNum
=
0
;
obj
.
realNum
=
0
;
//为了剔除脏数据,脏数据导致解析不回调
for
(
let
i
=
0
;
i
<
obj
.
times
;
i
++
){
let
lnglatArr
=
[];
let
initIdx
=
i
*
20
;
...
...
@@ -33,8 +35,9 @@ const MAPGEO = {
for
(
let
idx
=
initIdx
;
idx
<
maxIdx
;
idx
++
){
// 防止出现gps点:.00000的错误
if
(
Number
(
data
[
idx
].
elng
)
>
0
){
if
(
Number
(
data
[
idx
].
elng
)
>
0
&&
Number
(
data
[
idx
].
elat
)
>
0
){
lnglatArr
.
push
([
data
[
idx
].
elng
,
data
[
idx
].
elat
])
obj
.
realNum
++
;
}
}
(
function
(
initIdx
){
...
...
@@ -44,13 +47,16 @@ const MAPGEO = {
function
geocoderGetAdr
(
arr
,
initIdx
){
const
timeoutId
=
window
.
setTimeout
(()
=>
{
MAPGEO
.
geocoder
.
getAddress
(
arr
,
function
(
status
,
result
)
{
console
.
log
(
result
)
if
(
status
===
'complete'
&&
result
.
info
===
'OK'
)
{
//获取地址成功
result
.
regeocodes
.
forEach
((
item
,
idx
)
=>
{
data
[
initIdx
+
idx
].
transferAddress
=
item
.
formattedAddress
;
obj
.
totalNum
++
;
});
if
(
obj
.
totalNum
===
obj
.
len
){
console
.
log
(
obj
.
totalNum
+
'----'
+
obj
.
realNum
)
if
(
obj
.
totalNum
===
obj
.
realNum
){
cb
&&
cb
(
data
)
//ifPlay && obj.init(data)
//EventBus.$emit('uiMap.replay.transferAdrDone');
...
...
src/utils/monitor.js
View file @
767f58f
...
...
@@ -74,9 +74,7 @@ const monitor = {
});
EventBus
.
$on
(
'uiMap.monitor.openInfoWindow'
,
(
snSourceType
)
=>
{
console
.
log
(
this
.
markers
)
if
(
this
.
markers
[
snSourceType
]){
console
.
log
(
this
.
markers
[
snSourceType
])
const
MAP
=
mapService
.
map
;
const
lnglat
=
this
.
markers
[
snSourceType
].
getPosition
();
this
.
infowins
[
snSourceType
].
open
(
MAP
,
lnglat
);
...
...
@@ -157,7 +155,6 @@ const monitor = {
MAPGEO
.
transferAddressByGroup
({
data
:
transferObj
},
()
=>
{
this
.
data
.
forEach
((
item
,
idx
)
=>
{
console
.
log
(
item
)
let
eLocation
=
item
[
item
.
eLocateType
];
if
(
!
eLocation
.
elng
&&
!
eLocation
.
elat
)
return
;
let
isInfoOpen
=
false
;
...
...
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