Commit ddd1d79e authored by zhengjiangtao's avatar zhengjiangtao

bug优化

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