Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AmosBankView
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
bank
AmosBankView
Commits
ec6e2767
Commit
ec6e2767
authored
Jun 11, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加告警页websocket刷新
parent
28c3a66d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
Warnings.js
src/view/bank/situation/warn/Warnings.js
+18
-1
No files found.
src/view/bank/situation/warn/Warnings.js
View file @
ec6e2767
...
@@ -3,6 +3,8 @@ import { Table, Col, Row, Pagination } from 'amos-antd';
...
@@ -3,6 +3,8 @@ import { Table, Col, Row, Pagination } from 'amos-antd';
import
{
Search
,
Icon
}
from
'amos-framework'
;
import
{
Search
,
Icon
}
from
'amos-framework'
;
import
'./../../../../styles/view/biz/situation/warn.scss'
;
import
'./../../../../styles/view/biz/situation/warn.scss'
;
import
{
getWarningsData
,
getWarningsByPageData
,
getWarningsExcelData
}
from
'SERVICES/situationService'
;
import
{
getWarningsData
,
getWarningsByPageData
,
getWarningsExcelData
}
from
'SERVICES/situationService'
;
import
AmosWebSocket
from
'amos-websocket'
;
import
SysWsURL
,
{
completeToken
}
from
'CONSTS/wsUrlConsts'
;
//页面列表
//页面列表
const
columnss
=
()
=>
[
const
columnss
=
()
=>
[
...
@@ -127,9 +129,12 @@ class Warnings extends Component {
...
@@ -127,9 +129,12 @@ class Warnings extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
initData
();
}
initData
=
()
=>
{
if
(
this
.
props
.
location
.
state
)
{
if
(
this
.
props
.
location
.
state
)
{
let
sourceId
=
this
.
props
.
location
.
state
.
sourceId
;
let
sourceId
=
this
.
props
.
location
.
state
.
sourceId
;
console
.
log
(
sourceId
);
this
.
onIconClick
(
null
,
sourceId
.
toString
());
this
.
onIconClick
(
null
,
sourceId
.
toString
());
}
else
{
}
else
{
this
.
getWarningsByPage
();
this
.
getWarningsByPage
();
...
@@ -196,6 +201,16 @@ class Warnings extends Component {
...
@@ -196,6 +201,16 @@ class Warnings extends Component {
window
.
open
(
url
);
window
.
open
(
url
);
}
}
/**
* webSocket接收数据
*/
handleData
=
data
=>
{
if
(
data
){
console
.
log
(
'alarmMarqueeWS'
);
this
.
initData
();
}
};
render
()
{
render
()
{
let
columns
=
columnss
();
let
columns
=
columnss
();
let
{
selectedRowKeys
,
warnings
,
pageItem
}
=
this
.
state
;
let
{
selectedRowKeys
,
warnings
,
pageItem
}
=
this
.
state
;
...
@@ -203,8 +218,10 @@ class Warnings extends Component {
...
@@ -203,8 +218,10 @@ class Warnings extends Component {
selectedRowKeys
,
selectedRowKeys
,
onChange
:
this
.
onSelectChange
onChange
:
this
.
onSelectChange
};
};
const
wsURL
=
completeToken
(
SysWsURL
.
view3dws
);
return
(
return
(
<
div
className
=
"amos-warn"
style
=
{{
overflow
:
'auto'
,
height
:
'100%'
}}
>
<
div
className
=
"amos-warn"
style
=
{{
overflow
:
'auto'
,
height
:
'100%'
}}
>
<
AmosWebSocket
ref
=
{
node
=>
(
this
.
aws
=
node
)}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
<
div
className
=
"amos-warn-up"
>
<
div
className
=
"amos-warn-up"
>
<
Row
>
<
Row
>
<
Col
span
=
{
24
}
className
=
"amos-warn-top"
>
<
Col
span
=
{
24
}
className
=
"amos-warn-top"
>
...
...
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