Commit ddd1d79e authored by zhengjiangtao's avatar zhengjiangtao

bug优化

parent 98de95a9
...@@ -67,7 +67,7 @@ export const downLoadFilePost = (url,searchParam)=>{ ...@@ -67,7 +67,7 @@ export const downLoadFilePost = (url,searchParam)=>{
'X-Access-Token': ls.read(token), 'X-Access-Token': ls.read(token),
'appKey': 'CONVERTER_STATION', 'appKey': 'CONVERTER_STATION',
'product': 'CONVERTER_STATION_WEB', 'product': 'CONVERTER_STATION_WEB',
'token':ls.read(token) 'token': ls.read(token)
}, },
body: JSON.stringify(searchParam) body: JSON.stringify(searchParam)
}).then(e => { }).then(e => {
......
...@@ -86,7 +86,7 @@ class ConvertorView3DRoot extends Basic { ...@@ -86,7 +86,7 @@ class ConvertorView3DRoot extends Basic {
render() { render() {
const { isEdit } = this.state; const { isEdit } = this.state;
const { isPermissionControl = false, bizPerActionBars = {} } = this.props; const { isPermissionControl = false, bizPerActionBars = [] } = this.props;
return ( return (
<div style={{ height: '100%' }}> <div style={{ height: '100%' }}>
{ isEdit ? '' : <Statistical /> } { isEdit ? '' : <Statistical /> }
...@@ -110,6 +110,6 @@ ConvertorView3DRoot.propTypes = { ...@@ -110,6 +110,6 @@ ConvertorView3DRoot.propTypes = {
subscribe: PropTypes.func, subscribe: PropTypes.func,
trigger: PropTypes.func, trigger: PropTypes.func,
isPermissionControl: PropTypes.bool, isPermissionControl: PropTypes.bool,
bizPerActionBars: PropTypes.object bizPerActionBars: PropTypes.array
}; };
export default ConvertorView3DRoot; export default ConvertorView3DRoot;
...@@ -162,7 +162,7 @@ MaskContent.propTypes = { ...@@ -162,7 +162,7 @@ MaskContent.propTypes = {
sideControlShow: PropTypes.bool, sideControlShow: PropTypes.bool,
isShowActionBar: PropTypes.bool, isShowActionBar: PropTypes.bool,
headerName: PropTypes.string, headerName: PropTypes.string,
setHeaderName: PropTypes.string, setHeaderName: PropTypes.func,
handleExceptModel: PropTypes.func, handleExceptModel: PropTypes.func,
errorAreaId: PropTypes.number, errorAreaId: PropTypes.number,
editModelChange: PropTypes.func, editModelChange: PropTypes.func,
...@@ -170,7 +170,7 @@ MaskContent.propTypes = { ...@@ -170,7 +170,7 @@ MaskContent.propTypes = {
isPermissionControl: PropTypes.bool, isPermissionControl: PropTypes.bool,
isInitModel: PropTypes.bool, isInitModel: PropTypes.bool,
isPanoramic: PropTypes.bool, isPanoramic: PropTypes.bool,
bizPerActionBars: PropTypes.arrays, bizPerActionBars: PropTypes.array,
initModalback: PropTypes.func initModalback: PropTypes.func
}; };
......
...@@ -234,7 +234,7 @@ class PointsPool extends Component { ...@@ -234,7 +234,7 @@ class PointsPool extends Component {
PointsPool.propTypes = { PointsPool.propTypes = {
subscribe: PropTypes.func, subscribe: PropTypes.func,
updateMarker: PropTypes.func, updateMarker: PropTypes.func,
markers: PropTypes.object, markers: PropTypes.any,
isEditMode: PropTypes.bool, isEditMode: PropTypes.bool,
selectPoints: PropTypes.object, selectPoints: PropTypes.object,
stagePilot: PropTypes.object, stagePilot: PropTypes.object,
......
...@@ -119,7 +119,7 @@ class View3D extends Component { ...@@ -119,7 +119,7 @@ class View3D extends Component {
//编辑模式 //编辑模式
drawing: false,//画线状态 drawing: false,//画线状态
selectArea: {},//选中区域 selectArea: {},//选中区域
selectPoints: '',//选中点 selectPoints: {},//选中点
treeData: [],//左树 treeData: [],//左树
pointTypeArr: [], pointTypeArr: [],
routePathData: [], //区域线位置 routePathData: [], //区域线位置
...@@ -1587,7 +1587,7 @@ class View3D extends Component { ...@@ -1587,7 +1587,7 @@ class View3D extends Component {
polygonRegion.visible = true; polygonRegion.visible = true;
} }
selectPolygonRegion =(exceptionAreas,id)=> { selectPolygonRegion =(exceptionAreas, id) => {
const regionConf = { const regionConf = {
// regionColor: '#76d015', // 区域颜色 // regionColor: '#76d015', // 区域颜色
// lineColor: '#ffffff', // 边框颜色 // lineColor: '#ffffff', // 边框颜色
...@@ -1596,9 +1596,9 @@ class View3D extends Component { ...@@ -1596,9 +1596,9 @@ class View3D extends Component {
lineColor: '#00FF70', // 边框颜色 lineColor: '#00FF70', // 边框颜色
regionOpacity: 0.3 regionOpacity: 0.3
}; };
if (id && exceptionAreas){ if (Number(id) && exceptionAreas){
return exceptionAreas.map((area,index) =>{ return exceptionAreas.map((area,index) =>{
if (area.id === id){ if (area.id === Number(id)){
const { routePath: points = [] } = area.routePath; const { routePath: points = [] } = area.routePath;
return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.selectonRectCreated(e)} />; return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.selectonRectCreated(e)} />;
} }
...@@ -1639,7 +1639,7 @@ class View3D extends Component { ...@@ -1639,7 +1639,7 @@ class View3D extends Component {
errorAreaId: '', errorAreaId: '',
dragItem: '', dragItem: '',
selectArea: {}, selectArea: {},
selectPoints: '', selectPoints: {},
showRightPanel: false, showRightPanel: false,
routePathData: [], routePathData: [],
isOutterView: true, //恢复marker显示 isOutterView: true, //恢复marker显示
...@@ -1706,7 +1706,7 @@ class View3D extends Component { ...@@ -1706,7 +1706,7 @@ class View3D extends Component {
} }
setHeaderName =(name)=>{ setHeaderName =(name)=>{
this.setState({ headerName: name }); this.setState({ headerName: name.toString() });
} }
prevProcessTarget = (object) => { prevProcessTarget = (object) => {
...@@ -1878,7 +1878,7 @@ class View3D extends Component { ...@@ -1878,7 +1878,7 @@ class View3D extends Component {
headerName={headerName} headerName={headerName}
setHeaderName={this.setHeaderName} setHeaderName={this.setHeaderName}
onActionItemClick={this.onActionItemClick} onActionItemClick={this.onActionItemClick}
errorAreaId={errorAreaId} errorAreaId={Number(errorAreaId)}
handleExceptModel={this.handleExceptModel} handleExceptModel={this.handleExceptModel}
editModelChange={editModelChange} editModelChange={editModelChange}
focusPosition={this.focusPosition} focusPosition={this.focusPosition}
...@@ -1970,7 +1970,7 @@ View3D.propTypes = { ...@@ -1970,7 +1970,7 @@ View3D.propTypes = {
planStart: PropTypes.func, planStart: PropTypes.func,
editModelChange: PropTypes.func, editModelChange: PropTypes.func,
isPermissionControl: PropTypes.bool, isPermissionControl: PropTypes.bool,
bizPerActionBars: PropTypes.arrays bizPerActionBars: PropTypes.array
}; };
export default View3D; export default View3D;
...@@ -18,7 +18,7 @@ class ActionBar extends Component { ...@@ -18,7 +18,7 @@ class ActionBar extends Component {
getActionBars =()=>{ getActionBars =()=>{
const { isPermissionControl = false, bizPerActionBars = {} ,isInitModel = false } = this.props; const { isPermissionControl = false, bizPerActionBars = [], isInitModel = false } = this.props;
if (isInitModel){ if (isInitModel){
return actionBackBars; return actionBackBars;
} else { } else {
...@@ -73,9 +73,9 @@ ActionBar.propTypes = { ...@@ -73,9 +73,9 @@ ActionBar.propTypes = {
animationProps: PropTypes.object, animationProps: PropTypes.object,
onActionItemClick: PropTypes.func, onActionItemClick: PropTypes.func,
trigger: PropTypes.func, trigger: PropTypes.func,
activeAction: PropTypes, activeAction: PropTypes.any,
isPermissionControl: PropTypes.bool, isPermissionControl: PropTypes.bool,
bizPerActionBars: PropTypes.arrays bizPerActionBars: PropTypes.array
}; };
export default ActionBar; export default ActionBar;
...@@ -217,7 +217,7 @@ class PointLeftTree extends Component { ...@@ -217,7 +217,7 @@ class PointLeftTree extends Component {
} }
PointLeftTree.propTypes = { PointLeftTree.propTypes = {
markers: PropTypes.object markers: PropTypes.any
}; };
export default PointLeftTree; export default PointLeftTree;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import { equipStatusListAction } from './../../../services/panoramicService'; import { equipStatusListAction } from './../../../services/panoramicService';
import { equipStatusIconMapper } from './../../../consts/imgStatic'; import { equipStatusIconMapper } from './../../../consts/imgStatic';
const AmosConfig = endConf.AmosConfig;
const serviceName = AmosConfig.sysConf.serviceName;
const projectName = AmosConfig.sysConf.projectName;
const getIcon = (status)=>{ const getIcon = (status)=>{
return equipStatusIconMapper[`equip_${status}`]; return equipStatusIconMapper[`equip_${status}`];
}; };
const topic = `/${serviceName}/${projectName}/data/refresh/monitorData`;
/**
* 订阅主题
*/
@withSubscribeMQTT({
topic
})
/** /**
* 设备状态消息 * 设备状态消息
*/ */
...@@ -23,6 +38,14 @@ export default class EquipStatusList extends Component { ...@@ -23,6 +38,14 @@ export default class EquipStatusList extends Component {
this.equipStatusList(); this.equipStatusList();
} }
componentWillReceiveProps(data) {
const result = data.data;
const _this = this;
if (result) {
result && _this.setState({ equipStatusList: result });
}
}
equipStatusList = () => { equipStatusList = () => {
equipStatusListAction().then(data => { equipStatusListAction().then(data => {
this.setState({ this.setState({
...@@ -54,3 +77,7 @@ export default class EquipStatusList extends Component { ...@@ -54,3 +77,7 @@ export default class EquipStatusList extends Component {
} }
} }
EquipStatusList.prototypes = {
data: PropTypes.array
};
import React, { Component } from 'react'; import React, { Component } from 'react';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import imgStatic from './../../../consts/imgStatic'; import imgStatic from './../../../consts/imgStatic';
import { onlineDayAction, safetyExecuteListAction } from './../../../services/panoramicService'; import { onlineDayAction, safetyExecuteListAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
...@@ -7,6 +10,16 @@ import { eventTopics } from './../../consts'; ...@@ -7,6 +10,16 @@ import { eventTopics } from './../../consts';
import { tirggerPlanTopic } from './../../dataProcessor'; import { tirggerPlanTopic } from './../../dataProcessor';
const panoramicIcon = imgStatic.panoramicIcon; const panoramicIcon = imgStatic.panoramicIcon;
const AmosConfig = endConf.AmosConfig;
const serviceName = AmosConfig.sysConf.serviceName;
const projectName = AmosConfig.sysConf.projectName;
const topic = `/${serviceName}/${projectName}/data/refresh/fireSafety`;
@withSubscribeMQTT({
topic
})
/** /**
* 告警列表 * 告警列表
...@@ -30,6 +43,20 @@ export default class SafetyExecuteList extends Component { ...@@ -30,6 +43,20 @@ export default class SafetyExecuteList extends Component {
this.safetyExecuteList(); this.safetyExecuteList();
} }
componentWillReceiveProps( data ) {
const result = Array(data.data);
const _this = this;
if (!result) {
const type = result[0].type;
const { selectKey } = this.state;
if (type === selectKey) {
_this.setState({
alarmData: result || []
});
}
}
}
onlineDayData = () => { onlineDayData = () => {
onlineDayAction().then(data => { onlineDayAction().then(data => {
this.setState({ this.setState({
...@@ -154,3 +181,7 @@ export default class SafetyExecuteList extends Component { ...@@ -154,3 +181,7 @@ export default class SafetyExecuteList extends Component {
); );
} }
} }
SafetyExecuteList.prototypes = {
data: PropTypes.any
};
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import { safetyIndexAction } from './../../../services/panoramicService'; import { safetyIndexAction } from './../../../services/panoramicService';
import imgStatic from './../../../consts/imgStatic'; import imgStatic from './../../../consts/imgStatic';
import ModelContent from './ModelContent'; import ModelContent from './ModelContent';
import { warnController } from './conf'; import { warnController } from './conf';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
import { queryContingencyWater } from '../../../services/3dService';
const panoramicIcon = imgStatic.panoramicIcon; const panoramicIcon = imgStatic.panoramicIcon;
const colorLevel = { 1: 'red',2: 'yellow',3: 'blue', 4: 'blue' }; const colorLevel = { 1: 'red',2: 'yellow',3: 'blue', 4: 'blue' };
const AmosConfig = endConf.AmosConfig;
const serviceName = AmosConfig.sysConf.serviceName;
const projectName = AmosConfig.sysConf.projectName;
const topic = `/${serviceName}/${projectName}/data/refresh/todaySafetyIndex`;
/**
* 订阅主题
*/
@withSubscribeMQTT({
topic
})
/** /**
* 今日安全指数 * 今日安全指数
...@@ -18,7 +33,8 @@ export default class SafetyIndex extends Component { ...@@ -18,7 +33,8 @@ export default class SafetyIndex extends Component {
super(props); super(props);
this.state = { this.state = {
safetyIndexData: {}, safetyIndexData: {},
modelVisable: false modelVisable: false,
test: ''
}; };
} }
...@@ -26,6 +42,18 @@ export default class SafetyIndex extends Component { ...@@ -26,6 +42,18 @@ export default class SafetyIndex extends Component {
this.getSafetyIndex(); this.getSafetyIndex();
} }
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps(data) {
const result = data.data;
const _this = this;
if (result) {
result && _this.setState({ safetyIndexData: result });
}
}
getSafetyIndex = () => { getSafetyIndex = () => {
safetyIndexAction().then(safetyIndexData => { safetyIndexAction().then(safetyIndexData => {
this.setState({ safetyIndexData }); this.setState({ safetyIndexData });
...@@ -94,7 +122,7 @@ export default class SafetyIndex extends Component { ...@@ -94,7 +122,7 @@ export default class SafetyIndex extends Component {
data: [{ value: safetyIndexData.safetyIndex, name: safetyIndexData.safetyTips }] data: [{ value: safetyIndexData.safetyIndex, name: safetyIndexData.safetyTips }]
} }
] ]
} };
} }
modelOpen = (flag) =>{ modelOpen = (flag) =>{
...@@ -134,7 +162,7 @@ export default class SafetyIndex extends Component { ...@@ -134,7 +162,7 @@ export default class SafetyIndex extends Component {
<img className="safetyIndex-safetyrate" src={panoramicIcon.safetyrate} alt="safetyrate" /> <img className="safetyIndex-safetyrate" src={panoramicIcon.safetyrate} alt="safetyrate" />
</div> </div>
<div className='safetyIndex-content' onClick={() => this.modelOpen(true)}> <div className='safetyIndex-content' onClick={() => this.modelOpen(true)}>
<div className='safetyIndex-content-title'>今日安全指数 </div> <div className='safetyIndex-content-title'>今日安全指数</div>
<div className='safetyIndex-content-row'> <div className='safetyIndex-content-row'>
<div className='number-large'>{safetyIndexData.safetyIndex}</div> <div className='number-large'>{safetyIndexData.safetyIndex}</div>
<span className='number-unit'>&nbsp;&nbsp; <span className='number-unit'>&nbsp;&nbsp;
...@@ -155,3 +183,7 @@ export default class SafetyIndex extends Component { ...@@ -155,3 +183,7 @@ export default class SafetyIndex extends Component {
); );
} }
} }
SafetyIndex.prototypes = {
data: PropTypes.object
};
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import echarts from 'echarts/lib/echarts'; import echarts from 'echarts/lib/echarts';
import { safetyIndexWeekAction } from './../../../services/panoramicService'; import { safetyIndexWeekAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
const AmosConfig = endConf.AmosConfig;
const serviceName = AmosConfig.sysConf.serviceName;
const projectName = AmosConfig.sysConf.projectName;
/** /**
* 一周安全指数 * 一周安全指数
*/ */
const topic = `/${serviceName}/${projectName}/data/refresh/weekSafetyIndex`;
const option = { const option = {
xAxis: { xAxis: {
type: 'category', type: 'category',
...@@ -76,6 +85,10 @@ const option = { ...@@ -76,6 +85,10 @@ const option = {
] ]
}; };
@withSubscribeMQTT({
topic
})
class SafetyIndexWeek extends Component { class SafetyIndexWeek extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -88,13 +101,16 @@ class SafetyIndexWeek extends Component { ...@@ -88,13 +101,16 @@ class SafetyIndexWeek extends Component {
this.safetyIndexWeekData(); this.safetyIndexWeekData();
} }
safetyIndexWeekData = () => { componentWillReceiveProps( data ) {
safetyIndexWeekAction().then(data => {
this.setState({ const result = data.data;
data if (result) {
}); const _this = this;
}); _this.setState({ data: result });
}; }
}
getOptionsx = map => { getOptionsx = map => {
return { return {
...@@ -203,13 +219,29 @@ class SafetyIndexWeek extends Component { ...@@ -203,13 +219,29 @@ class SafetyIndexWeek extends Component {
}; };
}; };
safetyIndexWeekData = () => {
safetyIndexWeekAction().then(data => {
this.setState({
data
});
});
};
handleData = data => { handleData = data => {
let map = new Map(); let map = new Map();
let dates = []; let dates = [];
let values = []; let values = [];
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
let time2 = item.date.substring(5); let time2 = '';
if (item.date.length === 10) {
time2 = item.date.substring(5);
} else {
const time = new Date(item.date);
const timeStr = time.toJSON();
time2 = timeStr.substring(5, 10);
}
dates.push(time2); dates.push(time2);
values.push(item.value); values.push(item.value);
}); });
...@@ -236,6 +268,8 @@ class SafetyIndexWeek extends Component { ...@@ -236,6 +268,8 @@ class SafetyIndexWeek extends Component {
} }
} }
SafetyIndexWeek.propTypes = {}; SafetyIndexWeek.propTypes = {
data: PropTypes.any
};
export default SafetyIndexWeek; export default SafetyIndexWeek;
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import { statisticsCheckAction } from './../../../services/panoramicService'; import { statisticsCheckAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
const AmosConfig = endConf.AmosConfig;
const serviceName = AmosConfig.sysConf.serviceName;
const projectName = AmosConfig.sysConf.projectName;
const topic = `${serviceName}/${projectName}/data/refresh/today_check_status`;
const option = { const option = {
tooltip: { tooltip: {
...@@ -53,7 +60,9 @@ const option = { ...@@ -53,7 +60,9 @@ const option = {
] ]
}; };
@withSubscribeMQTT({
topic
})
/** /**
* 今日巡检统计 * 今日巡检统计
...@@ -71,12 +80,15 @@ class StatisticsCheck extends Component { ...@@ -71,12 +80,15 @@ class StatisticsCheck extends Component {
this.statisticsCheckData(); this.statisticsCheckData();
} }
statisticsCheckData = () => { componentWillReceiveProps( reaultData ) {
statisticsCheckAction().then(data => { if (reaultData) {
this.setState({ const { topic , result } = reaultData;
data // if (result) {
}); // this.setState({
}); // data: result
// });
// }
}
} }
getOptionsx = (data) => { getOptionsx = (data) => {
...@@ -121,7 +133,15 @@ class StatisticsCheck extends Component { ...@@ -121,7 +133,15 @@ class StatisticsCheck extends Component {
data: data data: data
} }
] ]
};; };
}
statisticsCheckData = () => {
statisticsCheckAction().then(data => {
this.setState({
data
});
});
} }
...@@ -130,7 +150,7 @@ class StatisticsCheck extends Component { ...@@ -130,7 +150,7 @@ class StatisticsCheck extends Component {
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
map.set(item.name, item.value); map.set(item.name, item.value);
}) });
} }
return map; return map;
} }
...@@ -145,15 +165,15 @@ class StatisticsCheck extends Component { ...@@ -145,15 +165,15 @@ class StatisticsCheck extends Component {
render() { render() {
let { data } = this.state; let { data } = this.state;
let map = this.handleData(data); let map = this.handleData(data);
let weikaishi = map.get("未开始"); let weikaishi = map.get('未开始');
let hege = map.get("合格"); let hege = map.get('合格');
let buhege = map.get("不合格"); let buhege = map.get('不合格');
let loujian = map.get("漏检"); let loujian = map.get('漏检');
return ( return (
<div className="statisticsCheck"> <div className="statisticsCheck">
<div className="check-content"> <div className="check-content">
<div className="content-xj-top"> <div className="content-xj-top">
<span className='titleIcon' style={this.rederStyle('textleft')}></span> 今日巡 <span className='titleIcon' style={this.rederStyle('textleft')} /> 今日巡
</div> </div>
<div className="content-xj-middle"> <div className="content-xj-middle">
<ReactEcharts option={this.getOptionsx(data)} eventpool={this.onclick} className="div-echars" /> <ReactEcharts option={this.getOptionsx(data)} eventpool={this.onclick} className="div-echars" />
...@@ -196,7 +216,7 @@ class StatisticsCheck extends Component { ...@@ -196,7 +216,7 @@ class StatisticsCheck extends Component {
StatisticsCheck.propTypes = { StatisticsCheck.propTypes = {
reaultData: PropTypes.any
}; };
export default StatisticsCheck; export default StatisticsCheck;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { withSubscribeMQTT } from 'amos-mqtt';
import * as endConf from 'amos-processor/lib/config/endconf';
import PropTypes from 'prop-types';
import { statisticsDutyAction } from './../../../services/panoramicService'; import { statisticsDutyAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
const AmosConfig = endConf.AmosConfig;
const dutyServiceName = AmosConfig.sysConf.dutyServiceName;
const projectName = AmosConfig.sysConf.projectName;
const topic = `/${dutyServiceName}/${projectName}/dutyChange`;
console.log('============================', topic);
/** /**
* 今日值班统计 * 今日值班统计
*/ */
@withSubscribeMQTT({
topic
})
class StatisticsDuty extends Component { class StatisticsDuty extends Component {
...@@ -20,6 +31,13 @@ class StatisticsDuty extends Component { ...@@ -20,6 +31,13 @@ class StatisticsDuty extends Component {
this.statisticsDutyData(); this.statisticsDutyData();
} }
componentWillReceiveProps( data ) {
const result = data.data;
if ( result && result === 'dutyChange') {
this.statisticsDutyData();
}
}
statisticsDutyData = () => { statisticsDutyData = () => {
statisticsDutyAction().then(data => { statisticsDutyAction().then(data => {
this.setState({ this.setState({
...@@ -67,7 +85,7 @@ class StatisticsDuty extends Component { ...@@ -67,7 +85,7 @@ class StatisticsDuty extends Component {
} }
StatisticsDuty.propTypes = { StatisticsDuty.propTypes = {
reaultData: PropTypes.any
}; };
export default StatisticsDuty; export default StatisticsDuty;
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { PubSub } from 'ray-eventpool'; import { PubSub } from 'ray-eventpool';
import { MQTTProvider } from 'amos-mqtt';
import EquipStatusList from './EquipStatusList'; import EquipStatusList from './EquipStatusList';
import SafetyExecuteList from './SafetyExecuteList'; import SafetyExecuteList from './SafetyExecuteList';
import SafetyIndex from './SafetyIndex'; import SafetyIndex from './SafetyIndex';
...@@ -14,6 +15,9 @@ import { eventTopics } from './../../consts'; ...@@ -14,6 +15,9 @@ import { eventTopics } from './../../consts';
/** /**
* 全景监控统计 * 全景监控统计
*/ */
const wsurl = 'ws://172.16.10.85:8083/mqtt';
export default class Statistical extends Component { export default class Statistical extends Component {
constructor(props) { constructor(props) {
...@@ -75,8 +79,9 @@ export default class Statistical extends Component { ...@@ -75,8 +79,9 @@ export default class Statistical extends Component {
render() { render() {
const wsURL = completeToken(SysWsURL.convertorView3d); const wsURL = completeToken(SysWsURL.convertorView3d);
return ( return (
<MQTTProvider url={wsurl}>
<div className="statistical"> <div className="statistical">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData.bind(this)} reconnect debug /> {/*<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData.bind(this)} reconnect debug />*/}
<div className="statistical-left"> <div className="statistical-left">
<SafetyIndex ref={node => this.safetyIndex = node} /> <SafetyIndex ref={node => this.safetyIndex = node} />
<SafetyExecuteList ref={node => this.safetyExecute = node} /> <SafetyExecuteList ref={node => this.safetyExecute = node} />
...@@ -88,6 +93,7 @@ export default class Statistical extends Component { ...@@ -88,6 +93,7 @@ export default class Statistical extends Component {
<StatisticsDuty ref={node => this.statisticsDuty = node} /> <StatisticsDuty ref={node => this.statisticsDuty = node} />
</div> </div>
</div> </div>
</MQTTProvider>
); );
} }
} }
......
...@@ -42,7 +42,7 @@ class PointDialog extends Component { ...@@ -42,7 +42,7 @@ class PointDialog extends Component {
} }
onOpenClick = marker => { onOpenClick = marker => {
const { id, type } = marker.extData || {}; const { id, type, originId } = marker.extData || {};
// if (type === 'risk') { // if (type === 'risk') {
if (type === 'patrol') { if (type === 'patrol') {
this.setState( this.setState(
...@@ -51,7 +51,7 @@ class PointDialog extends Component { ...@@ -51,7 +51,7 @@ class PointDialog extends Component {
}, },
() => { () => {
pointInfoAction(id, type).then(d => { pointInfoAction(id, type).then(d => {
d.markerExtData = { dialogId: id, type }; d.markerExtData = { dialogId: id, type, originId };
this.setState({ markerData: d }); this.setState({ markerData: d });
}); });
this.getTableData(id); this.getTableData(id);
...@@ -59,7 +59,7 @@ class PointDialog extends Component { ...@@ -59,7 +59,7 @@ class PointDialog extends Component {
); );
} else if (type in dialogEum) { } else if (type in dialogEum) {
let markerData = {}; let markerData = {};
markerData.markerExtData = { dialogId: id, type }; markerData.markerExtData = { dialogId: id, type, originId };
this.setState({ markerData, modal: true }); this.setState({ markerData, modal: true });
} else if (type in bussinessEum) { } else if (type in bussinessEum) {
this.tirggerTransBussiness(id, type); this.tirggerTransBussiness(id, type);
...@@ -120,7 +120,7 @@ class PointDialog extends Component { ...@@ -120,7 +120,7 @@ class PointDialog extends Component {
}; };
getContext = markerData => { getContext = markerData => {
const { type, dialogId } = markerData.markerExtData || {}; const { type, dialogId, originId } = markerData.markerExtData || {};
let obj = {}; let obj = {};
switch (type) { switch (type) {
case 'monitorEquipment': case 'monitorEquipment':
...@@ -145,7 +145,7 @@ class PointDialog extends Component { ...@@ -145,7 +145,7 @@ class PointDialog extends Component {
obj = <FireDetectorModal type="fireDetection" dialogId={dialogId} />; obj = <FireDetectorModal type="fireDetection" dialogId={dialogId} />;
break; break;
case 'riskSource': case 'riskSource':
obj = <RiskWarnModal riskSourceId={dialogId} />; obj = <RiskWarnModal riskSourceId={originId} />;
break; break;
case 'video': case 'video':
obj = <FireEquipmentModal type="video" dialogId={dialogId} />; obj = <FireEquipmentModal type="video" dialogId={dialogId} />;
......
...@@ -44,7 +44,7 @@ class RiskWarnModal extends Component { ...@@ -44,7 +44,7 @@ class RiskWarnModal extends Component {
queryRiskSoureWarning =(riskSourceId)=>{ queryRiskSoureWarning =(riskSourceId)=>{
queryRiskSoureWarningAction(riskSourceId).then(data =>{ queryRiskSoureWarningAction(riskSourceId).then(data =>{
this.setState({dataList: data.fmeaList, riskSourceInfo: data.riskSourceInfo, inputitemContent: data.inputitemContent, alarm: data.fire_equipment}); this.setState({ dataList: data.fmeaList, riskSourceInfo: data.riskSourceInfo, inputitemContent: data.inputitemContent, alarm: data.fire_equipment });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment