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
33e7dd87
Commit
33e7dd87
authored
Sep 03, 2020
by
zhengjiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mqtt
parent
2dec7931
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
23 deletions
+151
-23
LayerPool.js
src/view/3dview/LayerPool.js
+21
-3
MaskContent.js
src/view/3dview/MaskContent.js
+23
-4
index.js
src/view/3dview/index.js
+11
-7
IncidenceSeverityMatrix.js
...zview/situation/riskAssessment/IncidenceSeverityMatrix.js
+31
-1
RiskDegreeHistogram.js
...w/bizview/situation/riskAssessment/RiskDegreeHistogram.js
+34
-5
RiskDegreePie.js
src/view/bizview/situation/riskAssessment/RiskDegreePie.js
+31
-3
No files found.
src/view/3dview/LayerPool.js
View file @
33e7dd87
...
@@ -11,6 +11,7 @@ import TopView from './preControl/topNews/TopView';
...
@@ -11,6 +11,7 @@ import TopView from './preControl/topNews/TopView';
import
MonitorView
from
'./preControl/monitor/MonitorView'
;
import
MonitorView
from
'./preControl/monitor/MonitorView'
;
import
Water
from
'./preControl/water/Water'
;
import
Water
from
'./preControl/water/Water'
;
import
{
eventTopics
}
from
'./consts'
;
import
{
eventTopics
}
from
'./consts'
;
import
{
withSubscribeMQTT
}
from
'amos-mqtt'
;
const
eventConnect
=
Connect
.
eventConnect
;
const
eventConnect
=
Connect
.
eventConnect
;
const
AmosConfig
=
endConf
.
AmosConfig
;
const
AmosConfig
=
endConf
.
AmosConfig
;
...
@@ -29,6 +30,12 @@ const sidepaneStyles = {
...
@@ -29,6 +30,12 @@ const sidepaneStyles = {
}
}
};
};
/**
* 订阅主题
*/
@
withSubscribeMQTT
({
topic
:
'/data/refresh/layerPool'
})
@
eventConnect
@
eventConnect
class
LayerPool
extends
Component
{
class
LayerPool
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -67,8 +74,18 @@ class LayerPool extends Component {
...
@@ -67,8 +74,18 @@ class LayerPool extends Component {
this
.
_bindPubSubEvents
();
this
.
_bindPubSubEvents
();
}
}
componentWillReceiveProps
(
nextProps
)
{
// componentWillReceiveProps(nextProps) {
this
.
setState
({
planStarted
:
nextProps
.
planStarted
});
// this.setState({ planStarted: nextProps.planStarted });
// }
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps
({
data
})
{
if
(
data
)
{
const
{
topic
,
dataList
}
=
data
;
this
.
setState
({
planStarted
:
dataList
.
planStarted
});
}
}
}
onCancal
=
()
=>
{
onCancal
=
()
=>
{
...
@@ -98,7 +115,7 @@ class LayerPool extends Component {
...
@@ -98,7 +115,7 @@ class LayerPool extends Component {
let
wsURL
=
AmosConfig
.
wsURI
.
baseURI
+
'plan'
;
let
wsURL
=
AmosConfig
.
wsURI
.
baseURI
+
'plan'
;
return
(
return
(
<
div
className
=
"layer-pool"
>
<
div
className
=
"layer-pool"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
{
/**<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> */
}
<
SidePane
<
SidePane
className
=
{
displayDetail
?
'precontrol-sidePlan-detail-display'
:
'precontrol-sidePlan-detail'
}
className
=
{
displayDetail
?
'precontrol-sidePlan-detail-display'
:
'precontrol-sidePlan-detail'
}
left
=
{
false
}
left
=
{
false
}
...
@@ -132,6 +149,7 @@ class LayerPool extends Component {
...
@@ -132,6 +149,7 @@ class LayerPool extends Component {
}
}
}
}
LayerPool
.
propTypes
=
{
LayerPool
.
propTypes
=
{
data
:
PropTypes
.
array
,
planStart
:
PropTypes
.
func
,
planStart
:
PropTypes
.
func
,
animationProps
:
PropTypes
.
any
,
animationProps
:
PropTypes
.
any
,
subscribe
:
PropTypes
.
func
,
subscribe
:
PropTypes
.
func
,
...
...
src/view/3dview/MaskContent.js
View file @
33e7dd87
...
@@ -11,9 +11,17 @@ import globalMsg from './pagefactory/msgFactory';
...
@@ -11,9 +11,17 @@ import globalMsg from './pagefactory/msgFactory';
import
{
eventTopics
,
rulesDataFactory
}
from
'./consts'
;
import
{
eventTopics
,
rulesDataFactory
}
from
'./consts'
;
import
LayerPool
from
'./LayerPool'
;
import
LayerPool
from
'./LayerPool'
;
import
TopMsg
from
'./sideControl/TopMsg'
;
import
TopMsg
from
'./sideControl/TopMsg'
;
import
{
withSubscribeMQTT
}
from
'amos-mqtt'
;
const
eventConnect
=
Connect
.
eventConnect
;
const
eventConnect
=
Connect
.
eventConnect
;
/**
* 订阅主题
*/
@
withSubscribeMQTT
({
topic
:
'/data/refresh/maskContent'
})
@
eventConnect
@
eventConnect
class
MaskContent
extends
Component
{
class
MaskContent
extends
Component
{
...
@@ -22,11 +30,21 @@ class MaskContent extends Component {
...
@@ -22,11 +30,21 @@ class MaskContent extends Component {
}
}
componentWillReceiveProps
=
(
nextProps
)
=>
{
//
componentWillReceiveProps = (nextProps) => {
this
.
setState
({
planStarted
:
nextProps
.
planStarted
});
//
this.setState({ planStarted: nextProps.planStarted });
}
//
}
/**
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps
({
data
})
{
if
(
data
)
{
const
{
topic
,
dataList
}
=
data
;
this
.
setState
({
planStarted
:
dataList
.
planStarted
});
}
}
/**
* 监控视图消息 (规则 ws)
* 监控视图消息 (规则 ws)
*/
*/
handleData
=
data
=>
{
handleData
=
data
=>
{
...
@@ -73,7 +91,7 @@ class MaskContent extends Component {
...
@@ -73,7 +91,7 @@ class MaskContent extends Component {
};
};
return
(
return
(
<
div
className
=
"mask-content"
>
<
div
className
=
"mask-content"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
{
/**<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> */
}
<
SideControl
multiple
=
{
multiple
}
onItemClick
=
{
onItemClick
}
layerConfig
=
{
layerConfig
}
animationProps
=
{
controlAnimation
}
/
>
<
SideControl
multiple
=
{
multiple
}
onItemClick
=
{
onItemClick
}
layerConfig
=
{
layerConfig
}
animationProps
=
{
controlAnimation
}
/
>
<
DataPane
animationProps
=
{
datapaneAnim
}
/
>
<
DataPane
animationProps
=
{
datapaneAnim
}
/
>
<
TopMsg
alarmStart
=
{
alarmStart
}
/
>
<
TopMsg
alarmStart
=
{
alarmStart
}
/
>
...
@@ -86,6 +104,7 @@ class MaskContent extends Component {
...
@@ -86,6 +104,7 @@ class MaskContent extends Component {
}
}
MaskContent
.
propTypes
=
{
MaskContent
.
propTypes
=
{
data
:
PropTypes
.
array
,
layerConfig
:
PropTypes
.
object
,
layerConfig
:
PropTypes
.
object
,
onItemClick
:
PropTypes
.
func
,
onItemClick
:
PropTypes
.
func
,
// 是否支持多选
// 是否支持多选
...
...
src/view/3dview/index.js
View file @
33e7dd87
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
Connect
,
Modal
}
from
'amos-framework'
;
import
{
Connect
,
Modal
}
from
'amos-framework'
;
import
AmosWebSocket
from
'amos-websocket'
;
//
import AmosWebSocket from 'amos-websocket';
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
PilotController
from
'amos-viz/lib/board/PilotController'
;
import
PilotController
from
'amos-viz/lib/board/PilotController'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../consts/wsUrlConsts'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../consts/wsUrlConsts'
;
import
ScreenSaverView
from
'./screenSaver/ScreenSaverView'
;
import
ScreenSaverView
from
'./screenSaver/ScreenSaverView'
;
import
{
MQTTProvider
}
from
'amos-mqtt'
;
// import Three3dView from './Three3dView';
// import Three3dView from './Three3dView';
import
Three3dView
from
'./View3D'
;
import
Three3dView
from
'./View3D'
;
...
@@ -13,6 +14,7 @@ import { eventTopics } from './consts';
...
@@ -13,6 +14,7 @@ import { eventTopics } from './consts';
const
eventConnect
=
Connect
.
eventConnect
;
const
eventConnect
=
Connect
.
eventConnect
;
const
AmosConfig
=
endConf
.
AmosConfig
;
const
AmosConfig
=
endConf
.
AmosConfig
;
const
wsurl
=
AmosConfig
.
wsURI
.
mqttURI
;
const
enableScreenSaver
=
AmosConfig
.
screenSaverConf
.
enable
;
const
enableScreenSaver
=
AmosConfig
.
screenSaverConf
.
enable
;
const
delayTime
=
AmosConfig
.
screenSaverConf
.
delayTime
;
const
delayTime
=
AmosConfig
.
screenSaverConf
.
delayTime
;
...
@@ -87,13 +89,15 @@ class View3DRoot extends Component {
...
@@ -87,13 +89,15 @@ class View3DRoot extends Component {
};
};
render
()
{
render
()
{
const
wsURL
=
completeToken
(
SysWsURL
.
view3dws
);
//
const wsURL = completeToken(SysWsURL.view3dws);
return
(
return
(
<
div
className
=
"sys-view-3d"
>
<
MQTTProvider
url
=
{
wsurl
}
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
<
div
className
=
"sys-view-3d"
>
<
Three3dView
onLoadCompleted
=
{
this
.
onLoadCompleted
}
hiddenScreenSaver
=
{
this
.
hiddenScreenSaver
}
/
>
{
/**<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> */
}
{
this
.
getScreenSaver
()}
<
Three3dView
onLoadCompleted
=
{
this
.
onLoadCompleted
}
hiddenScreenSaver
=
{
this
.
hiddenScreenSaver
}
/
>
<
/div
>
{
this
.
getScreenSaver
()}
<
/div
>
<
/MQTTProvider
>
);
);
}
}
}
}
...
...
src/view/bizview/situation/riskAssessment/IncidenceSeverityMatrix.js
View file @
33e7dd87
...
@@ -2,7 +2,15 @@ import React, { Component } from 'react';
...
@@ -2,7 +2,15 @@ import React, { Component } from 'react';
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
AmosEcharts
from
'amos-viz/lib/echarts'
;
import
AmosEcharts
from
'amos-viz/lib/echarts'
;
import
{
queryRiskSourceMatrixAction
}
from
'./../../../../services/situationService'
;
import
{
queryRiskSourceMatrixAction
}
from
'./../../../../services/situationService'
;
import
{
withSubscribeMQTT
}
from
'amos-mqtt'
;
/**
* 订阅主题
*/
@
withSubscribeMQTT
({
topic
:
'/data/refresh/incidenceSeverityMatrix'
})
/**
/**
* 发生率/严重度矩阵
* 发生率/严重度矩阵
* @class IncidenceSeverityMatrix
* @class IncidenceSeverityMatrix
...
@@ -22,6 +30,26 @@ class IncidenceSeverityMatrix extends Component {
...
@@ -22,6 +30,26 @@ class IncidenceSeverityMatrix extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
queryRiskSourceMatrix
();
this
.
queryRiskSourceMatrix
();
}
}
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps
({
data
})
{
if
(
data
)
{
const
{
topic
,
dataList
}
=
data
;
dataList
&&
dataList
.
map
(
e
=>
{
this
.
classifyPoints
(
e
);
});
let
{
dataAll
,
dangerPoints
,
safePoints
,
warnPoints
}
=
this
.
state
;
dataAll
.
push
(
dangerPoints
);
dataAll
.
push
(
warnPoints
);
dataAll
.
push
(
safePoints
);
this
.
setState
({
dataAll
});
}
}
getOptions
()
{
getOptions
()
{
return
{
return
{
...
@@ -200,7 +228,9 @@ class IncidenceSeverityMatrix extends Component {
...
@@ -200,7 +228,9 @@ class IncidenceSeverityMatrix extends Component {
}
}
}
}
IncidenceSeverityMatrix
.
propTypes
=
{};
IncidenceSeverityMatrix
.
propTypes
=
{
data
:
PropTypes
.
array
};
IncidenceSeverityMatrix
.
defaultProps
=
{
IncidenceSeverityMatrix
.
defaultProps
=
{
data
:
{},
data
:
{},
...
...
src/view/bizview/situation/riskAssessment/RiskDegreeHistogram.js
View file @
33e7dd87
...
@@ -5,6 +5,7 @@ import AmosWebSocket from 'amos-websocket';
...
@@ -5,6 +5,7 @@ import AmosWebSocket from 'amos-websocket';
import
{
Connect
}
from
'amos-framework'
;
import
{
Connect
}
from
'amos-framework'
;
import
{
queryRiskSourceRpnCountAction
}
from
'./../../../../services/situationService'
;
import
{
queryRiskSourceRpnCountAction
}
from
'./../../../../services/situationService'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../../../consts/wsUrlConsts'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../../../consts/wsUrlConsts'
;
import
{
withSubscribeMQTT
}
from
'amos-mqtt'
;
const
eventConnect
=
Connect
.
eventConnect
;
const
eventConnect
=
Connect
.
eventConnect
;
const
labelOption
=
{
const
labelOption
=
{
...
@@ -18,6 +19,13 @@ const labelOption = {
...
@@ -18,6 +19,13 @@ const labelOption = {
}
}
};
};
/**
* 订阅主题
*/
@
withSubscribeMQTT
({
topic
:
'/data/refresh/riskDegreeHistogram'
})
/**
/**
* 风险度(RPN) TOP10
* 风险度(RPN) TOP10
*
*
...
@@ -38,10 +46,29 @@ class RiskDegreeHistogram extends Component {
...
@@ -38,10 +46,29 @@ class RiskDegreeHistogram extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getBarViewContent
();
this
.
getBarViewContent
();
}
}
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps
({
data
})
{
if
(
data
)
{
const
{
topic
,
dataList
}
=
data
;
let
riskNameList
=
[];
let
rpniData
=
[];
let
rpnrData
=
[];
dataList
&&
dataList
.
map
(
e
=>
{
riskNameList
.
push
(
e
.
name
);
rpniData
.
push
(
e
.
rpni
);
rpnrData
.
push
(
e
.
rpn
);
});
this
.
setState
({
riskNameList
:
riskNameList
.
reverse
(),
rpniData
:
rpniData
.
reverse
(),
rpnrData
:
rpnrData
.
reverse
()
});
}
componentWillReceiveProps
()
{
}
}
getBarViewContent
()
{
getBarViewContent
()
{
queryRiskSourceRpnCountAction
().
then
(
queryRiskSourceRpnCountAction
().
then
(
data
=>
{
data
=>
{
...
@@ -129,17 +156,19 @@ class RiskDegreeHistogram extends Component {
...
@@ -129,17 +156,19 @@ class RiskDegreeHistogram extends Component {
render
()
{
render
()
{
const
option
=
this
.
getOptions
();
const
option
=
this
.
getOptions
();
const
wsURL
=
completeToken
(
SysWsURL
.
rulews
);
//
const wsURL = completeToken(SysWsURL.rulews);
return
(
return
(
<
div
className
=
"risk-degree-rpn-histogram"
>
<
div
className
=
"risk-degree-rpn-histogram"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
{
/**<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> */
}
<
AmosEcharts
option
=
{
option
}
/
>
<
AmosEcharts
option
=
{
option
}
/
>
<
/div
>
<
/div
>
);
);
}
}
}
}
RiskDegreeHistogram
.
propTypes
=
{};
RiskDegreeHistogram
.
propTypes
=
{
data
:
PropTypes
.
array
};
RiskDegreeHistogram
.
defaultProps
=
{
RiskDegreeHistogram
.
defaultProps
=
{
data
:
{},
data
:
{},
...
...
src/view/bizview/situation/riskAssessment/RiskDegreePie.js
View file @
33e7dd87
...
@@ -5,9 +5,17 @@ import AmosWebSocket from 'amos-websocket';
...
@@ -5,9 +5,17 @@ import AmosWebSocket from 'amos-websocket';
import
{
Connect
}
from
'amos-framework'
;
import
{
Connect
}
from
'amos-framework'
;
import
{
getRiskRiseUprateAction
}
from
'./../../../../services/situationService'
;
import
{
getRiskRiseUprateAction
}
from
'./../../../../services/situationService'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../../../consts/wsUrlConsts'
;
import
SysWsURL
,
{
completeToken
}
from
'./../../../../consts/wsUrlConsts'
;
import
{
withSubscribeMQTT
}
from
'amos-mqtt'
;
const
eventConnect
=
Connect
.
eventConnect
;
const
eventConnect
=
Connect
.
eventConnect
;
/**
* 订阅主题
*/
@
withSubscribeMQTT
({
topic
:
'/data/refresh/riskDegreePie'
})
/**
/**
* 巡检点统计
* 巡检点统计
* @class MonthlyInspection
* @class MonthlyInspection
...
@@ -26,7 +34,25 @@ class RiskDegreePie extends Component {
...
@@ -26,7 +34,25 @@ class RiskDegreePie extends Component {
componentWillMount
()
{
componentWillMount
()
{
this
.
getRiskRiseUprate
();
this
.
getRiskRiseUprate
();
}
}
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps
({
data
})
{
if
(
data
)
{
const
{
topic
,
dataList
}
=
data
;
let
{
monthData
,
seasonData
,
yearData
}
=
this
.
state
;
monthData
=
dataList
.
month
;
seasonData
=
dataList
.
season
;
yearData
=
dataList
.
year
;
this
.
setState
({
monthData
,
seasonData
,
yearData
});
}
}
getRiskRiseUprate
()
{
getRiskRiseUprate
()
{
getRiskRiseUprateAction
().
then
(
getRiskRiseUprateAction
().
then
(
data
=>
{
data
=>
{
...
@@ -253,13 +279,13 @@ class RiskDegreePie extends Component {
...
@@ -253,13 +279,13 @@ class RiskDegreePie extends Component {
render
()
{
render
()
{
let
{
monthData
,
seasonData
,
yearData
}
=
this
.
state
;
let
{
monthData
,
seasonData
,
yearData
}
=
this
.
state
;
const
wsURL
=
completeToken
(
SysWsURL
.
rulews
);
//
const wsURL = completeToken(SysWsURL.rulews);
let
monthOption
=
this
.
getMonthOptions
(
'month'
,
monthData
);
let
monthOption
=
this
.
getMonthOptions
(
'month'
,
monthData
);
let
seasonOption
=
this
.
getSeasonOptions
(
'season'
,
seasonData
);
let
seasonOption
=
this
.
getSeasonOptions
(
'season'
,
seasonData
);
let
yearOption
=
this
.
getYearOptions
(
'year'
,
yearData
);
let
yearOption
=
this
.
getYearOptions
(
'year'
,
yearData
);
return
(
return
(
<
div
className
=
"risk-degree-pie"
>
<
div
className
=
"risk-degree-pie"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
{
/**<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> */
}
<
div
className
=
"risk-degree-pie1"
>
<
div
className
=
"risk-degree-pie1"
>
<
AmosEcharts
option
=
{
monthOption
}
/
>
<
AmosEcharts
option
=
{
monthOption
}
/
>
<
span
>
本月风险上升率
|
{
monthData
.
type0Rate
}
{
monthData
.
countOfType0
}
个
<
/span
>
<
span
>
本月风险上升率
|
{
monthData
.
type0Rate
}
{
monthData
.
countOfType0
}
个
<
/span
>
...
@@ -277,7 +303,9 @@ class RiskDegreePie extends Component {
...
@@ -277,7 +303,9 @@ class RiskDegreePie extends Component {
}
}
}
}
RiskDegreePie
.
propTypes
=
{};
RiskDegreePie
.
propTypes
=
{
data
:
PropTypes
.
array
};
RiskDegreePie
.
defaultProps
=
{
RiskDegreePie
.
defaultProps
=
{
data
:
{},
data
:
{},
...
...
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