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 5bd77316
authored
Mar 17, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v1.5.0版本需求
1 parent
d7831549
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
39 deletions
config/webpack.config.js
src/api/services/monitor.js
src/pages/monitor/activeLocation.vue
src/pages/monitor/monitor.vue
src/utils/monitor.js
config/webpack.config.js
View file @
5bd7731
...
...
@@ -172,6 +172,7 @@ module.exports = {
'scss'
:
path
.
resolve
(
__dirname
,
'../src/assets/SCSS'
),
'images'
:
path
.
resolve
(
__dirname
,
'../src/assets/images'
),
'./patterns'
:
path
.
resolve
(
__dirname
,
'../src/assets/images'
),
'@'
:
path
.
resolve
(
__dirname
,
'../src'
)
},
extensions
:
[
'*'
,
'.js'
,
'.vue'
,
'.json'
]
},
...
...
src/api/services/monitor.js
View file @
5bd7731
...
...
@@ -59,6 +59,7 @@ export default {
return
request
(
params
,
'/trialdrive/fence/getBySn'
)
},
// 旧虎哥
/*车辆监控*/
// getCriteriaTreeList (request = {}) {
...
...
@@ -136,3 +137,8 @@ export default {
// return api.get('ecFence/getFenceSnsList', request)
// },
}
// 根据SN获取设备列表信息
export
const
GET_DEVICEINFO_BYSNS
=
params
=>
{
return
request
(
params
,
'/trialdrive/monitor/vehiclelocation'
)
}
src/pages/monitor/activeLocation.vue
View file @
5bd7731
...
...
@@ -4,21 +4,21 @@
<el-breadcrumb-item>
激活位置
</el-breadcrumb-item>
</
template
>
<
template
slot=
"main"
>
<div
class=
"device_list"
>
<div
class=
"device_list"
v-if=
"deviceList && deviceList.length>1"
>
<div
class=
"title"
>
<span>
设备列表(
3
)
</span>
<
i
class=
"el-icon-close i_close"
></i
>
<span>
设备列表(
{{
deviceList
.
length
}}
)
</span>
<
!--
<i
class=
"el-icon-close i_close"
></i>
--
>
</div>
<div
class=
"list_box"
>
<div
class=
"cell"
v-for=
"(item,index) in
3"
:key=
"index
"
>
<div
class=
"cell"
v-for=
"(item,index) in
deviceList"
:key=
"index"
@
click=
"openMapInfoWindow(item.sn, item.vin)
"
>
<div
class=
"top"
>
<i
class=
"i_circle"
></i>
<span>
陈庆红
</span>
<span>
1700151515(无线
)
</span>
<span>
{{
item
.
ownerName
||
''
}}
</span>
<span>
{{
item
.
sn
||
''
}}
(
{{
statusList
[
item
.
source
]
}}
)
</span>
</div>
<div
class=
"bottom"
>
<span>
车架号:
</span>
<span>
LDSKF5522555555
</span>
<span>
{{
item
.
vin
||
''
}}
</span>
</div>
</div>
</div>
...
...
@@ -34,17 +34,23 @@
</v-full-layout>
</template>
<
script
>
import
mapService
from
"utils/mapService.js"
;
import
"utils/mapEvent.js"
;
import
EventBus
from
"../../event-bus"
;
import
remoteLoad
from
"utils/remoteLoad.js"
;
import
{
CONSTANT
}
from
"../../constant"
;
import
mapService
from
"@/utils/mapService.js"
;
import
"@/utils/mapEvent.js"
;
import
EventBus
from
"@/event-bus"
;
import
remoteLoad
from
"@/utils/remoteLoad.js"
;
import
{
CONSTANT
}
from
"@/constant"
;
import
{
GET_DEVICEINFO_BYSNS
}
from
"@/api/services/monitor.js"
;
export
default
{
data
()
{
return
{
AMap
:
null
,
mapObj
:
null
,
checkLoadedTimeoutId
:
""
,
deviceList
:
[],
statusList
:
{
1
:
"有线"
,
0
:
"无线"
,
},
};
},
created
()
{
...
...
@@ -78,11 +84,18 @@ export default {
this
.
mapObj
=
mapService
.
init
(
"map"
);
this
.
isInitMap
=
true
;
let
o
=
history
.
state
;
let
query
=
this
.
$route
.
query
;
// 假性离线报警查看位置点
if
(
query
.
sns
)
{
this
.
getLocation
(
query
.
sns
);
return
false
;
}
console
.
log
(
o
);
if
(
o
.
lng
||
o
.
bsLng
)
{
o
.
elat
=
o
.
lat
;
o
.
elng
=
o
.
lng
;
this
.
addLocation
(
o
);
this
.
addLocation
(
o
,
true
);
}
}
else
{
this
.
checkLoadedTimeoutId
=
check
();
...
...
@@ -93,9 +106,68 @@ export default {
},
// 添加位置点
addLocation
(
row
)
{
addLocation
(
row
,
showInfoWindow
)
{
let
drawData
=
row
;
EventBus
.
$emit
(
"uiMap.monitor.drawMaker"
,
drawData
,
true
);
EventBus
.
$emit
(
"uiMap.monitor.drawMaker"
,
drawData
,
showInfoWindow
);
},
// 获取位置点
getLocation
(
sns
)
{
let
oParams
=
{};
oParams
.
sns
=
sns
;
oParams
.
deviceCode
=
"gps"
;
GET_DEVICEINFO_BYSNS
(
oParams
).
then
((
res
)
=>
{
let
list
=
res
.
data
||
[];
// 循环标记车辆
list
.
map
((
k
)
=>
{
let
o
=
this
.
getMapInfo
(
k
);
if
(
o
.
lng
||
o
.
bsLng
)
{
o
.
elat
=
o
.
lat
;
o
.
elng
=
o
.
lng
;
this
.
addLocation
(
o
,
false
);
}
});
if
(
list
[
0
])
{
this
.
openMapInfoWindow
(
list
[
0
].
sn
,
list
[
0
].
vin
);
}
this
.
deviceList
=
list
;
});
},
// 获取地图数据
getMapInfo
(
row
)
{
let
gpsInfo
=
row
.
gpsLocation
||
{};
let
bsInfo
=
row
.
bsLocation
||
{};
let
oParams
=
{};
oParams
.
sn
=
row
.
sn
||
""
;
//oParams.gpsData
oParams
.
name
=
row
.
ownerName
||
""
;
oParams
.
standNo
=
row
.
vin
||
""
;
oParams
.
source
=
row
.
source
||
""
;
// gps 信息
oParams
.
lng
=
gpsInfo
.
lng
;
oParams
.
lat
=
gpsInfo
.
lat
;
oParams
.
address
=
gpsInfo
.
address
||
""
;
oParams
.
time
=
gpsInfo
.
dateTime
||
""
;
//基站信息
oParams
.
bsLng
=
bsInfo
.
lng
;
oParams
.
bsLat
=
bsInfo
.
lat
;
oParams
.
bsAddress
=
bsInfo
.
address
||
""
;
oParams
.
bsTime
=
bsInfo
.
dateTime
||
""
;
// 定位类型
oParams
.
type
=
2
;
return
oParams
;
},
// 打开车辆弹框
openMapInfoWindow
(
sn
,
vin
)
{
EventBus
.
$emit
(
"uiMap.monitor.openInfoWindow"
,
`
${
sn
}
-
${
vin
}
`
);
},
},
};
...
...
@@ -158,23 +230,23 @@ export default {
.cell
{
position
:
relative
;
padding
:
4px
10px
;
line-height
:
2
;
line-height
:
2
;
cursor
:
pointer
;
.bottom{
padding-left
:
12px
;
.bottom
{
padding-left
:
12px
;
}
}
.cell
:hover
{
background
:
#f2f2f2
;
.cell
:hover
{
background
:
#f2f2f2
;
}
.cell
:after
{
position
:
absolute
;
.cell
:after
{
position
:
absolute
;
display
:
block
;
content
:
""
;
height
:
1px
;
left
:
0
;
right
:
0
;
bottom
:
0
;
content
:
""
;
height
:
1px
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background
:
#f2f2f2
;
}
}
...
...
src/pages/monitor/monitor.vue
View file @
5bd7731
...
...
@@ -158,19 +158,19 @@
</v-full-layout>
</template>
<
script
>
import
"
../..
/assets/spritesmith-generated/sprite.css"
;
import
store
from
"
../..
/vuex/store.js"
;
import
remoteLoad
from
"utils/remoteLoad.js"
;
import
mapService
from
"utils/mapService.js"
;
import
"utils/mapEvent.js"
;
import
EventBus
from
"
../..
/event-bus"
;
import
{
services
}
from
"
../..
/api"
;
import
"
@
/assets/spritesmith-generated/sprite.css"
;
import
store
from
"
@
/vuex/store.js"
;
import
remoteLoad
from
"
@/
utils/remoteLoad.js"
;
import
mapService
from
"
@/
utils/mapService.js"
;
import
"
@/
utils/mapEvent.js"
;
import
EventBus
from
"
@
/event-bus"
;
import
{
services
}
from
"
@
/api"
;
import
mock
from
"../../mock"
;
const
MONITOR_SERVICE
=
services
.
monitor
;
import
{
CONSTANT
}
from
"
../..
/constant"
;
import
{
CONSTANT
}
from
"
@
/constant"
;
import
MapControll
from
"./MapControll.vue"
;
import
{
exportExcel
}
from
"utils"
;
import
{
exportExcel
}
from
"
@/
utils"
;
export
default
{
data
()
{
let
checkFilename
=
(
rule
,
vaule
,
cb
)
=>
{
...
...
@@ -821,6 +821,7 @@ export default {
item
.
eLocateType
=
"gpsLocation"
;
this
.
monitorList
[
item
.
sn
]
=
item
;
this
.
monitorList
.
itemArr
.
unshift
(
item
.
sn
);
console
.
log
(
this
.
monitorList
.
itemArr
);
this
.
getPositionData
();
}
}
...
...
@@ -861,12 +862,17 @@ export default {
let
filterList
=
items
.
filter
((
item
)
=>
{
return
!
this
.
monitorList
[
item
.
sn
];
});
let
arr
=
this
.
monitorList
.
itemArr
||
[];
console
.
log
(
arr
.
length
)
filterList
.
forEach
((
item
)
=>
{
item
.
eLocateType
=
"gpsLocation"
;
this
.
monitorList
[
item
.
sn
]
=
item
;
this
.
monitorList
.
count
++
;
this
.
monitorList
.
itemA
rr
.
unshift
(
item
.
sn
);
a
rr
.
unshift
(
item
.
sn
);
});
console
.
log
(
arr
)
this
.
$set
(
this
.
monitorList
,
"itemArr"
,
arr
);
this
.
getPositionData
();
}
},
...
...
src/utils/monitor.js
View file @
5bd7731
...
...
@@ -74,7 +74,9 @@ 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
);
...
...
@@ -282,6 +284,7 @@ const monitor = {
// 激活位置
drawMaker
(
data
,
autoOpenLastInfoWindow
)
{
let
tag
=
`
${
data
.
sn
}
-
${
data
.
standNo
}
`
;
const
MAP
=
mapService
.
map
const
marker
=
mapService
.
createCarMarker
(
[
parseFloat
(
data
.
lng
||
data
.
bsLng
),
parseFloat
(
data
.
lat
||
data
.
bsLat
)],
...
...
@@ -293,8 +296,8 @@ const monitor = {
data
,
true
)
// this
.markers[tag] = marker;
// this
.infowins[tag] = infoWindow;
monitor
.
markers
[
tag
]
=
marker
;
monitor
.
infowins
[
tag
]
=
infoWindow
;
// 设置图标
mapService
.
setDefaultIcon
(
marker
,
data
.
vehicleIcon
)
...
...
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