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
1fafb847
Commit
1fafb847
authored
Jul 18, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实时监测
parent
627db3dd
Pipeline
#87
failed with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
52 deletions
+46
-52
SwooleCommandController.php
app/Http/Controllers/Auth/SwooleCommandController.php
+5
-3
SwooleCommandMeTcpController.php
app/Http/Controllers/Auth/SwooleCommandMeTcpController.php
+1
-1
DevicesController.php
app/Http/Controllers/DevicesController.php
+2
-1
2020_07_18_163830_add_update_time_to_device_table.php
...ons/2020_07_18_163830_add_update_time_to_device_table.php
+6
-5
chemicals.vue
resources/js/views/monitor/chemicals.vue
+16
-21
fire.vue
resources/js/views/monitor/fire.vue
+16
-21
No files found.
app/Http/Controllers/Auth/SwooleCommandController.php
View file @
1fafb847
...
@@ -34,7 +34,8 @@ class SwooleCommandController extends Controller
...
@@ -34,7 +34,8 @@ class SwooleCommandController extends Controller
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
)
->
leftjoin
(
'danwei as dw'
,
'device.devicemonad'
,
'='
,
'dw.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'dw.danwei'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
get
()
->
toArray
();
->
get
()
->
toArray
();
$count
=
$databadevice
$count
=
$databadevice
...
@@ -51,7 +52,8 @@ class SwooleCommandController extends Controller
...
@@ -51,7 +52,8 @@ class SwooleCommandController extends Controller
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
)
->
leftjoin
(
'danwei as dw'
,
'device.devicemonad'
,
'='
,
'dw.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'dw.danwei'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
get
()
->
toArray
();
->
get
()
->
toArray
();
$count
=
$databadevice
$count
=
$databadevice
...
@@ -88,4 +90,4 @@ class SwooleCommandController extends Controller
...
@@ -88,4 +90,4 @@ class SwooleCommandController extends Controller
return
$this
->
jsonErrorData
(
105
,
'当前无报警'
);
return
$this
->
jsonErrorData
(
105
,
'当前无报警'
);
}
}
}
}
}
}
\ No newline at end of file
app/Http/Controllers/Auth/SwooleCommandMeTcpController.php
View file @
1fafb847
...
@@ -137,7 +137,7 @@ class SwooleCommandMeTcpController extends Controller
...
@@ -137,7 +137,7 @@ class SwooleCommandMeTcpController extends Controller
}
}
$updavice
=
DB
::
table
(
'device'
)
$updavice
=
DB
::
table
(
'device'
)
->
where
(
'devicenum'
,
'='
,
$davicedata
[
0
])
->
where
(
'devicenum'
,
'='
,
$davicedata
[
0
])
->
update
([
'devicepolice'
=>
$davicedata
[
1
],
'nd'
=>
$davicedata
[
2
]]);
->
update
([
'devicepolice'
=>
$davicedata
[
1
],
'nd'
=>
$davicedata
[
2
]
,
'update_time'
=>
time
()
]);
}
}
}
}
...
...
app/Http/Controllers/DevicesController.php
View file @
1fafb847
...
@@ -491,7 +491,8 @@ class DevicesController extends Controller
...
@@ -491,7 +491,8 @@ class DevicesController extends Controller
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'device_type as dy'
,
"device.dtype"
,
'='
,
'dy.tid'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'gas as g'
,
"device.status"
,
'='
,
'g.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
leftjoin
(
'status as p'
,
"device.devicepolice"
,
'='
,
'p.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
)
->
leftjoin
(
'danwei as dw'
,
'device.devicemonad'
,
'='
,
'dw.id'
)
->
select
(
'dy.tname'
,
'g.gas'
,
'device.*'
,
'p.status_name'
,
'dw.danwei'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
orderBy
(
'device.id'
,
'desc'
)
->
offset
(
$pagenNum
)
->
offset
(
$pagenNum
)
->
limit
(
$limit
)
->
limit
(
$limit
)
...
...
database/migrations/2020_0
4_15_110521_create
_device_table.php
→
database/migrations/2020_0
7_18_163830_add_update_time_to
_device_table.php
View file @
1fafb847
...
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
...
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Support\Facades\Schema
;
class
Create
DeviceTable
extends
Migration
class
AddUpdateTimeTo
DeviceTable
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
...
@@ -13,9 +13,8 @@ class CreateDeviceTable extends Migration
...
@@ -13,9 +13,8 @@ class CreateDeviceTable extends Migration
*/
*/
public
function
up
()
public
function
up
()
{
{
Schema
::
create
(
'device'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'device'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
integer
(
'update_time'
)
->
default
(
null
)
->
comment
(
'最后更新时间'
);
$table
->
timestamps
();
});
});
}
}
...
@@ -26,6 +25,8 @@ class CreateDeviceTable extends Migration
...
@@ -26,6 +25,8 @@ class CreateDeviceTable extends Migration
*/
*/
public
function
down
()
public
function
down
()
{
{
Schema
::
dropIfExists
(
'device'
);
Schema
::
table
(
'device'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'update_time'
);
});
}
}
}
}
resources/js/views/monitor/chemicals.vue
View file @
1fafb847
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-table
:key=
"tableKey"
v-loading=
"loading"
:data=
"device"
border
fit
highlight-current-rows
>
<el-table
:key=
"tableKey"
v-loading=
"loading"
:data=
"device"
border
fit
highlight-current-rows
>
<el-table-column
align=
"center"
label=
"
id
"
width=
"80"
>
<el-table-column
align=
"center"
label=
"
ID
"
width=
"80"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
<span>
{{
scope
.
row
.
id
}}
</span>
</
template
>
</
template
>
...
@@ -11,44 +11,34 @@
...
@@ -11,44 +11,34 @@
<span
@
click=
"handleCopy(scope.row.devicenum,$event)"
>
{{
scope
.
row
.
devicenum
}}
</span>
<span
@
click=
"handleCopy(scope.row.devicenum,$event)"
>
{{
scope
.
row
.
devicenum
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备类型"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"介质状态"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
gas
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备名称"
width=
"170"
>
<el-table-column
align=
"center"
label=
"设备名称"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
username
}}
</span>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
浓度"
width=
"170
"
>
<el-table-column
align=
"center"
label=
"
设备详情
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
nd
}}
</span>
<span>
{{
scope
.
row
.
deviceinfo
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
是否已删除设备"
width=
"17
0"
>
<el-table-column
align=
"center"
label=
"
设备类型"
width=
"15
0"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
:style=
"
{color:( scope.row.delete==1 ? '#F56C6C' : '#67C23A' )}">
{{
scope
.
row
.
delete
==
1
?
'设备已被丢弃废纸篓'
:
'设备正常'
}}
</span>
<span
>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
设备备注
"
width=
"170"
>
<el-table-column
align=
"center"
label=
"
检测介质
"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceremark
}}
</span>
<span>
{{
scope
.
row
.
gas
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
设备详情
"
width=
"170"
>
<el-table-column
align=
"center"
label=
"
检测值
"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceinfo
}}
</span>
<span>
{{
scope
.
row
.
nd
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
创建时间"
width=
"17
0"
>
<el-table-column
align=
"center"
label=
"
单位"
width=
"10
0"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
d
eviceaddtime
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<span>
{{
scope
.
row
.
d
anwei
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备实时状态"
width=
"170"
>
<el-table-column
align=
"center"
label=
"设备实时状态"
width=
"170"
>
...
@@ -64,6 +54,11 @@
...
@@ -64,6 +54,11 @@
<span
v-if=
"scope.row.status_name!='正常' "
:style=
"
{color:( scope.row.status_name=='正常' ? '#67C23A' : '#F56C6C' )}">
{{
scope
.
row
.
status_name
==
'正常'
?
'正常'
:
'设备异常'
}}
</span>
<span
v-if=
"scope.row.status_name!='正常' "
:style=
"
{color:( scope.row.status_name=='正常' ? '#67C23A' : '#F56C6C' )}">
{{
scope
.
row
.
status_name
==
'正常'
?
'正常'
:
'设备异常'
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"最后更新时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
update_time
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"page"
:
limit
.
sync
=
"limit"
@
pagination
=
"devicelist"
/>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"page"
:
limit
.
sync
=
"limit"
@
pagination
=
"devicelist"
/>
<
/div
>
<
/div
>
...
...
resources/js/views/monitor/fire.vue
View file @
1fafb847
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-table
:key=
"tableKey"
v-loading=
"loading"
:data=
"device"
border
fit
highlight-current-rows
>
<el-table
:key=
"tableKey"
v-loading=
"loading"
:data=
"device"
border
fit
highlight-current-rows
>
<el-table-column
align=
"center"
label=
"
id
"
width=
"80"
>
<el-table-column
align=
"center"
label=
"
ID
"
width=
"80"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
<span>
{{
scope
.
row
.
id
}}
</span>
</
template
>
</
template
>
...
@@ -11,44 +11,34 @@
...
@@ -11,44 +11,34 @@
<span
@
click=
"handleCopy(scope.row.devicenum,$event)"
>
{{
scope
.
row
.
devicenum
}}
</span>
<span
@
click=
"handleCopy(scope.row.devicenum,$event)"
>
{{
scope
.
row
.
devicenum
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备类型"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"介质状态"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
gas
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备名称"
width=
"170"
>
<el-table-column
align=
"center"
label=
"设备名称"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
username
}}
</span>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
浓度"
width=
"170
"
>
<el-table-column
align=
"center"
label=
"
设备详情
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
nd
}}
</span>
<span>
{{
scope
.
row
.
deviceinfo
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
是否已删除设备"
width=
"17
0"
>
<el-table-column
align=
"center"
label=
"
设备类型"
width=
"15
0"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
:style=
"
{color:( scope.row.delete==1 ? '#F56C6C' : '#67C23A' )}">
{{
scope
.
row
.
delete
==
1
?
'设备已被丢弃废纸篓'
:
'设备正常'
}}
</span>
<span
>
{{
scope
.
row
.
tname
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
设备备注
"
width=
"170"
>
<el-table-column
align=
"center"
label=
"
检测介质
"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceremark
}}
</span>
<span>
{{
scope
.
row
.
gas
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
设备详情
"
width=
"170"
>
<el-table-column
align=
"center"
label=
"
检测值
"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceinfo
}}
</span>
<span>
{{
scope
.
row
.
nd
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
创建时间"
width=
"17
0"
>
<el-table-column
align=
"center"
label=
"
单位"
width=
"10
0"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
d
eviceaddtime
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<span>
{{
scope
.
row
.
d
anwei
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备实时状态"
width=
"170"
>
<el-table-column
align=
"center"
label=
"设备实时状态"
width=
"170"
>
...
@@ -64,6 +54,11 @@
...
@@ -64,6 +54,11 @@
<span
v-if=
"scope.row.status_name!='正常' "
:style=
"
{color:( scope.row.status_name=='正常' ? '#67C23A' : '#F56C6C' )}">
{{
scope
.
row
.
status_name
==
'正常'
?
'正常'
:
'设备异常'
}}
</span>
<span
v-if=
"scope.row.status_name!='正常' "
:style=
"
{color:( scope.row.status_name=='正常' ? '#67C23A' : '#F56C6C' )}">
{{
scope
.
row
.
status_name
==
'正常'
?
'正常'
:
'设备异常'
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"最后更新时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
update_time
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"page"
:
limit
.
sync
=
"limit"
@
pagination
=
"devicelist"
/>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"page"
:
limit
.
sync
=
"limit"
@
pagination
=
"devicelist"
/>
<
/div
>
<
/div
>
...
...
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