Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-convertor-view
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
station
amos-convertor-view
Commits
7435f6e1
Commit
7435f6e1
authored
May 14, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket推送
parent
240cca18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
10 deletions
+46
-10
SafetyExecuteList.js
src/view/panoramic/statistical/SafetyExecuteList.js
+4
-2
SafetyIndex.js
src/view/panoramic/statistical/SafetyIndex.js
+2
-1
index.js
src/view/panoramic/statistical/index.js
+40
-7
No files found.
src/view/panoramic/statistical/SafetyExecuteList.js
View file @
7435f6e1
...
...
@@ -27,9 +27,8 @@ export default class SafetyExecuteList extends Component {
}
componentDidMount
(){
let
{
selectKey
}
=
this
.
state
;
this
.
onlineDayData
();
this
.
safetyExecuteList
(
selectKey
);
this
.
safetyExecuteList
();
}
onlineDayData
=
()
=>
{
...
...
@@ -42,6 +41,9 @@ export default class SafetyExecuteList extends Component {
}
safetyExecuteList
=
(
type
)
=>
{
if
(
!
type
){
type
=
this
.
state
.
selectKey
;
}
let
value
;
safetyExecuteListAction
(
type
).
then
(
data
=>
{
warnTypes
.
some
(
e
=>
{
...
...
src/view/panoramic/statistical/SafetyIndex.js
View file @
7435f6e1
...
...
@@ -29,7 +29,8 @@ export default class SafetyIndex extends Component {
getSafetyIndex
=
()
=>
{
safetyIndexAction
().
then
(
safetyIndexData
=>
{
this
.
setState
({
safetyIndexData
})});
this
.
setState
({
safetyIndexData
});
});
}
getOption
=
()
=>
{
...
...
src/view/panoramic/statistical/index.js
View file @
7435f6e1
...
...
@@ -17,7 +17,40 @@ export default class Statistical extends Component {
handleData
=
(
data
=
{})
=>
{
console
.
log
(
'ws data:'
,
data
);
data
=
JSON
.
stringify
(
data
);
};
let
refreshType
=
data
.
refreshType
;
let
content
=
data
.
content
;
switch
(
refreshType
){
case
'today_safety_index'
:
console
.
log
(
'今日安全指数刷新~~~~~~~~~~~~~~~~~~~~'
);
this
.
safetyIndex
.
getSafetyIndex
();
break
;
case
'fire_safety'
:
console
.
log
(
'消防安全执行刷新~~~~~~~~~~~~~~~~~~~~'
);
this
.
safetyExecute
.
safetyExecuteList
();
break
;
case
'monitor_data'
:
console
.
log
(
'设备状态检测数据刷新~~~~~~~~~~~~~~~~~~~~'
);
this
.
equipStatus
.
equipStatusList
();
break
;
case
'error_status'
:
console
.
log
(
'异常区域刷新~~~~~~~~~~~~~~~~~~~~'
);
break
;
case
'week_safety_index'
:
console
.
log
(
'一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~'
);
break
;
case
'today_check_status'
:
console
.
log
(
'今日巡检情况刷新~~~~~~~~~~~~~~~~~~~~'
);
break
;
case
'today_duty'
:
console
.
log
(
'今日值班刷新~~~~~~~~~~~~~~~~~~~~'
);
break
;
case
'all'
:
console
.
log
(
'首页刷新~~~~~~~~~~~~~~~~~~~~'
);
break
;
default
:
console
.
log
(
refreshType
,
':类型不支持'
);
}
}
render
()
{
...
...
@@ -26,14 +59,14 @@ export default class Statistical extends Component {
<
div
className
=
"statistical"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
<
div
className
=
"statistical-left"
>
<
SafetyIndex
/>
<
SafetyExecuteList
/>
<
EquipStatusList
/>
<
SafetyIndex
ref
=
{
node
=>
this
.
safetyIndex
=
node
}
/
>
<
SafetyExecuteList
ref
=
{
node
=>
this
.
safetyExecute
=
node
}
/
>
<
EquipStatusList
ref
=
{
node
=>
this
.
equipStatus
=
node
}
/
>
<
/div
>
<
div
className
=
"statistical-right"
>
<
SafetyIndexWeek
/>
<
StatisticsCheck
/>
<
StatisticsDuty
/>
<
SafetyIndexWeek
/>
<
StatisticsCheck
/>
<
StatisticsDuty
/>
<
/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