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
4 years ago
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新地图,隐患设备,应急物资
parent
76f69fed
Show 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
...
@@ -502,6 +502,10 @@ class DevicesController extends Controller
$user_id
=
$request
->
get
(
'uid'
);
$user_id
=
$request
->
get
(
'uid'
);
$where
[
'device.uid'
]
=
$user_id
;
$where
[
'device.uid'
]
=
$user_id
;
}
}
if
(
$request
->
has
(
'devicestatus'
))
{
$devicestatus
=
$request
->
get
(
'devicestatus'
);
$where
[
'device.devicestatus'
]
=
$devicestatus
;
}
$data
=
DB
::
table
(
'device'
)
$data
=
DB
::
table
(
'device'
)
->
join
(
'status as s'
,
'device.devicepolice'
,
'='
,
's.id'
)
->
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'
)
->
select
(
'device.id'
,
'device.uid'
,
'device.nd'
,
'device.deviceinfo'
,
'device.devicenum'
,
'device.devicecoord'
,
'device.devicepolice'
,
'device.deviceremark'
,
'device.devicelinkman'
,
's.status_name'
)
...
...
This diff is collapsed.
Click to expand it.
resources/js/views/map/index.vue
View file @
50418844
...
@@ -35,10 +35,28 @@
...
@@ -35,10 +35,28 @@
:events=
"markerClickEvent(marker)"
:events=
"markerClickEvent(marker)"
:check=
"playAudio(marker.devicepolice)"
:check=
"playAudio(marker.devicepolice)"
></el-amap-circle-marker>
></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"
>
<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
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
<el-switch
v-model=
"markersDeviceVisible"
v-model=
"markersDeviceVisible"
active-text=
"设备"
active-text=
"设备"
...
@@ -139,6 +157,11 @@ VueAMap.initAMapApiLoader({
...
@@ -139,6 +157,11 @@ VueAMap.initAMapApiLoader({
export
default
{
export
default
{
filters
:
{
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
)
{
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>'
;
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
);
mcontent
=
mcontent
.
replace
(
/%name/
,
company
).
replace
(
/%num/
,
deviceCount
).
replace
(
/%alarm/
,
alarmCount
);
...
@@ -186,6 +209,20 @@ export default {
...
@@ -186,6 +209,20 @@ export default {
data
(){
data
(){
const
_this
=
this
;
const
_this
=
this
;
return
{
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
:
new
Audio
(
'/audio/alarm.wav'
),
audio_play
:
false
,
audio_play
:
false
,
intervalId
:
null
,
intervalId
:
null
,
...
@@ -268,6 +305,8 @@ export default {
...
@@ -268,6 +305,8 @@ export default {
this
.
leftDeviceName
=
'全部设备'
;
this
.
leftDeviceName
=
'全部设备'
;
this
.
markersDevice
=
res
.
data
;
this
.
markersDevice
=
res
.
data
;
this
.
zoom
=
6
;
this
.
zoom
=
6
;
this
.
markersDeviceVisible
=
true
;
this
.
markerVisible
=
false
;
});
});
},
},
getUserDevices
(
center
)
{
getUserDevices
(
center
)
{
...
@@ -292,6 +331,18 @@ export default {
...
@@ -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
)
{
markerClickEvent
(
marker
)
{
const
that
=
this
;
const
that
=
this
;
return
{
return
{
...
@@ -310,6 +361,18 @@ export default {
...
@@ -310,6 +361,18 @@ export default {
});
});
this
.
dataRefresh
(
uid
);
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
)
{
getUserDeviceInfo
(
id
)
{
deviceinfo
(
id
)
deviceinfo
(
id
)
...
@@ -507,7 +570,7 @@ export default {
...
@@ -507,7 +570,7 @@ export default {
.toolbar
{
.toolbar
{
position
:
fixed
;
position
:
fixed
;
top
:
120px
;
top
:
120px
;
right
:
4
0px
;
right
:
10
0px
;
}
}
.zero-user-devices
{
.zero-user-devices
{
position
:
fixed
;
position
:
fixed
;
...
...
This diff is collapsed.
Click to expand it.
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