Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
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
冯超鹏
laravelzh
Commits
50418844
Commit
50418844
authored
Dec 20, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新地图,隐患设备,应急物资
parent
76f69fed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
DevicesController.php
app/Http/Controllers/DevicesController.php
+4
-0
index.vue
resources/js/views/map/index.vue
+65
-2
No files found.
app/Http/Controllers/DevicesController.php
View file @
50418844
...
...
@@ -502,6 +502,10 @@ class DevicesController extends Controller
$user_id
=
$request
->
get
(
'uid'
);
$where
[
'device.uid'
]
=
$user_id
;
}
if
(
$request
->
has
(
'devicestatus'
))
{
$devicestatus
=
$request
->
get
(
'devicestatus'
);
$where
[
'device.devicestatus'
]
=
$devicestatus
;
}
$data
=
DB
::
table
(
'device'
)
->
join
(
'status as s'
,
'device.devicepolice'
,
'='
,
's.id'
)
->
select
(
'device.id'
,
'device.uid'
,
'device.nd'
,
'device.deviceinfo'
,
'device.devicenum'
,
'device.devicecoord'
,
'device.devicepolice'
,
'device.deviceremark'
,
'device.devicelinkman'
,
's.status_name'
)
...
...
resources/js/views/map/index.vue
View file @
50418844
...
...
@@ -35,10 +35,28 @@
:events=
"markerClickEvent(marker)"
:check=
"playAudio(marker.devicepolice)"
></el-amap-circle-marker>
<!-- 应急物资 -->
<el-amap-marker
v-for=
"(marker, index) in markersGoods"
:key=
"marker.id+'wz'"
:position=
"marker.mapcenter | rebuildUserCenter(marker.mapcenter)"
:visible=
"markersGoodsVisible"
:content=
"marker.name | rebuildGoodsContent(marker.total, marker.color)"
:vid=
"index"
:clickable=
"true"
:events=
"checkPermission(['manage isadmin']) ? rebuildGoodsEvent(marker) : ''"
:z-index=
"markerUserZIndex"
></el-amap-marker>
<!-- 右上角设备和用户切换按钮 -->
<div
class=
"toolbar"
>
<el-button
v-if=
"leftDeviceName != '全部设备' "
type=
"primary"
size=
"mini"
round
@
click=
"allDevices"
>
全部设备
</el-button>
<el-button
type=
"primary"
size=
"mini"
round
@
click=
"allDevices"
>
全部设备
</el-button>
<!--
<el-button
v-if=
"checkPermission(['manage device'])"
type=
"primary"
size=
"mini"
round
@
click=
"allDevices"
>
全部设备
</el-button>
-->
<el-button
type=
"primary"
size=
"mini"
round
@
click=
"getDangerDeviceList"
>
隐患设备
</el-button>
<el-switch
v-model=
"markersGoodsVisible"
active-text=
"应急物资"
>
</el-switch>
<el-switch
v-model=
"markersDeviceVisible"
active-text=
"设备"
...
...
@@ -139,6 +157,11 @@ VueAMap.initAMapApiLoader({
export
default
{
filters
:
{
rebuildGoodsContent
(
name
,
count
,
color
)
{
let
mcontent
=
'<div class="mapIcon"><span class="mapIcon_title">%name</span><span class="mapIcon_num_all" style="background-color:%color">%num</span></div>'
;
mcontent
=
mcontent
.
replace
(
/%name/
,
name
).
replace
(
/%num/
,
count
).
replace
(
/%color/
,
color
);
return
mcontent
;
},
rebuildContent
(
company
,
deviceCount
,
alarmCount
)
{
let
mcontent
=
'<div class="mapIcon"><span class="mapIcon_title">%name</span><span class="mapIcon_num_all">%num</span><span class="mapIcon_num">%alarm</span></div>'
;
mcontent
=
mcontent
.
replace
(
/%name/
,
company
).
replace
(
/%num/
,
deviceCount
).
replace
(
/%alarm/
,
alarmCount
);
...
...
@@ -186,6 +209,20 @@ export default {
data
(){
const
_this
=
this
;
return
{
markersGoodsVisible
:
false
,
markersGoods
:
[{
id
:
1
,
mapcenter
:
'114.209927,38.224691'
,
name
:
'应急物资1'
,
total
:
200
,
color
:
'#23e610'
,
},
{
id
:
2
,
mapcenter
:
'114.209927,38.221291'
,
name
:
'应急物资2'
,
total
:
20
,
color
:
'#dd000e'
,
}],
audio
:
new
Audio
(
'/audio/alarm.wav'
),
audio_play
:
false
,
intervalId
:
null
,
...
...
@@ -268,6 +305,8 @@ export default {
this
.
leftDeviceName
=
'全部设备'
;
this
.
markersDevice
=
res
.
data
;
this
.
zoom
=
6
;
this
.
markersDeviceVisible
=
true
;
this
.
markerVisible
=
false
;
});
},
getUserDevices
(
center
)
{
...
...
@@ -292,6 +331,18 @@ export default {
},
};
},
// 应急物资
rebuildGoodsEvent
(
marker
)
{
var
mapcenter
=
marker
.
mapcenter
.
replace
(
/
\s
*/g
,
''
);
const
that
=
this
;
const
position
=
mapcenter
.
split
(
','
);
return
{
click
(
e
)
{
that
.
zoom
=
15
;
that
.
center
=
position
;
},
};
},
markerClickEvent
(
marker
)
{
const
that
=
this
;
return
{
...
...
@@ -310,6 +361,18 @@ export default {
});
this
.
dataRefresh
(
uid
);
},
// 获取隐患设备
getDangerDeviceList
()
{
// 停止定时器
this
.
clearIntv
();
devices
({
devicestatus
:
7
})
.
then
(
res
=>
{
this
.
markersDevice
=
res
.
data
;
this
.
markersDeviceVisible
=
true
;
this
.
markerVisible
=
false
;
});
// this.dataRefresh();
},
// 获取设备详细信息
getUserDeviceInfo
(
id
)
{
deviceinfo
(
id
)
...
...
@@ -507,7 +570,7 @@ export default {
.toolbar
{
position
:
fixed
;
top
:
120px
;
right
:
4
0px
;
right
:
10
0px
;
}
.zero-user-devices
{
position
:
fixed
;
...
...
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