Commit 469ef37c authored by suhuiguang's avatar suhuiguang

1.修改刷新列表异常,执行天数,代码整理

parent 47800763
...@@ -6,10 +6,9 @@ const lsTool = Store.lsTool; ...@@ -6,10 +6,9 @@ const lsTool = Store.lsTool;
const completePrefix = endConf.completePrefix; const completePrefix = endConf.completePrefix;
const AmosConfig = endConf.AmosConfig; const AmosConfig = endConf.AmosConfig;
const ConvertorView3dURI = AmosConfig.wsURI.convertorView3dURI;
const baseURI = AmosConfig.wsURI.baseURI; const convertorView3dURI = AmosConfig.wsURI.convertorView3dURI;
const view3dURI = AmosConfig.wsURI.view3dURI; const ruleURI = AmosConfig.wsURI.ruleURI;
const getToken = () => { const getToken = () => {
return lsTool.read(SysConsts.token); return lsTool.read(SysConsts.token);
...@@ -17,13 +16,8 @@ const getToken = () => { ...@@ -17,13 +16,8 @@ const getToken = () => {
export default { export default {
convertorRulews: completePrefix(ConvertorView3dURI, 'rule.ws?token={token}'), rulews: completePrefix(ruleURI, 'rule.ws?token={token}'),
convertorView3dws: completePrefix(ConvertorView3dURI, 'view3d.ws?token={token}'), convertorView3d: completePrefix(convertorView3dURI, '3dViewMessage')
rulews: completePrefix(view3dURI, 'rule.ws?token={token}'),
view3dws: completePrefix(view3dURI, 'view3d.ws?token={token}'),
viewIndexws: completePrefix(baseURI, '3dViewMessage')
}; };
export const completeToken = (url) => { export const completeToken = (url) => {
...@@ -31,7 +25,3 @@ export const completeToken = (url) => { ...@@ -31,7 +25,3 @@ export const completeToken = (url) => {
const result = formatUrl(url, { token }); const result = formatUrl(url, { token });
return result; return result;
}; };
...@@ -13,8 +13,8 @@ const defaultPageable = { ...@@ -13,8 +13,8 @@ const defaultPageable = {
}; };
const defaultHeaders = { const defaultHeaders = {
// appKey: 'CONVERTER_STATION', appKey: 'CONVERTER_STATION',
// product: 'CONVERTER_STATION_WEB', product: 'CONVERTER_STATION_WEB',
channelType: '3dpage' channelType: '3dpage'
}; };
...@@ -36,8 +36,8 @@ const getToken = () => { ...@@ -36,8 +36,8 @@ const getToken = () => {
/** /**
* 删除全局变量requests中的地址 * 删除全局变量requests中的地址
* @param {*} url * @param {*} url
* @param {*} method * @param {*} method
*/ */
const delRequest = (url, method) => { const delRequest = (url, method) => {
if (window.requests && window.requests.length > 0) { if (window.requests && window.requests.length > 0) {
...@@ -70,8 +70,8 @@ const convertDatalist = (dataList = [], key = 'content') => { ...@@ -70,8 +70,8 @@ const convertDatalist = (dataList = [], key = 'content') => {
export function commonGet(url) { export function commonGet(url) {
window.setLoading && window.setLoading(true); window.setLoading && window.setLoading(true);
return amosRequest(url, { return amosRequest(url, {
timeout: 10000000 , timeout: 10000000 ,
method: 'GET', method: 'GET',
headers: compleHeaders(), headers: compleHeaders(),
reject(error){ reject(error){
......
...@@ -2,15 +2,11 @@ import React from 'react'; ...@@ -2,15 +2,11 @@ import React 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 Basic from 'amos-designer/lib/pages/sketchs'; import Basic from 'amos-designer/lib/pages/sketchs';
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 { eventTopics } from './consts';
import ScreenSaverView from './screenSaver/ScreenSaverView'; import ScreenSaverView from './screenSaver/ScreenSaverView';
import View3D from './View3D'; import View3D from './View3D';
import PanoramicLeft from './../view/panoramic/statistical/indexLeft'; import Statistical from './../view/panoramic/statistical';
import PanoramicRight from './../view/panoramic/statistical/indexRight';
// 引入换流站3dview模块主体样式文件 // 引入换流站3dview模块主体样式文件
import './../styles'; import './../styles';
...@@ -45,9 +41,7 @@ class ConvertorView3DRoot extends Basic { ...@@ -45,9 +41,7 @@ class ConvertorView3DRoot extends Basic {
this.pushTimeOutId = null; this.pushTimeOutId = null;
} }
} }
// componentWillReceiveProps = nextProps => {
// this.setState({ alarmStarted: nextProps.alarmStarted });
// }
editModelChange = (status) => { editModelChange = (status) => {
this.setState({ this.setState({
isEdit: status isEdit: status
...@@ -95,32 +89,24 @@ class ConvertorView3DRoot extends Basic { ...@@ -95,32 +89,24 @@ class ConvertorView3DRoot extends Basic {
} }
} }
/** refshExceptAreaData = ()=>{
* 监控视图消息 (view3d ws) this.view3d.initExceptionAreasData && this.view3d.initExceptionAreasData();
*/ }
handleData = (data = {}) => {
console.log('view3d ws data:', data);
const topic = data.topic || eventTopics.base3d_view;
this.props.trigger(topic, data);
};
render() { render() {
const { isEdit } = this.state; const { isEdit } = this.state;
const wsURL = completeToken(SysWsURL.convertorView3dws);
return ( return (
<div> <div>
{ { isEdit ? '' : <Statistical refshExceptAreaData={this.refshExceptAreaData} /> }
isEdit ? '' : <PanoramicLeft />
}
<div className="sys-view-3d"> <div className="sys-view-3d">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <View3D
<View3D onLoadCompleted={this.onLoadCompleted} hiddenScreenSaver={this.hiddenScreenSaver} editModelChange={this.editModelChange}/> ref={node => this.view3d = node}
onLoadCompleted={this.onLoadCompleted}
hiddenScreenSaver={this.hiddenScreenSaver}
editModelChange={this.editModelChange}
/>
{this.getScreenSaver()} {this.getScreenSaver()}
</div> </div>
{
isEdit ? '' : <PanoramicRight />
}
</div> </div>
); );
} }
......
...@@ -79,7 +79,7 @@ class MaskContent extends Component { ...@@ -79,7 +79,7 @@ class MaskContent extends Component {
headerName, headerName,
errorAreaId errorAreaId
} = this.props; } = this.props;
const wsURL = completeToken(SysWsURL.convertorRulews); const wsURL = completeToken(SysWsURL.rulews);
const controlAnimation = { const controlAnimation = {
animateName: 'zoom-comb-left', animateName: 'zoom-comb-left',
visible: !planStarted, visible: !planStarted,
......
...@@ -84,8 +84,7 @@ class View3D extends Component { ...@@ -84,8 +84,7 @@ class View3D extends Component {
markerList: [], markerList: [],
plFatLineCache: [], plFatLineCache: [],
fireEquipmentPosition: [], fireEquipmentPosition: [],
contingencyPlanId:'', contingencyPlanId: '',
markers: { markers: {
patrol: [], patrol: [],
risk: [], risk: [],
...@@ -151,7 +150,7 @@ class View3D extends Component { ...@@ -151,7 +150,7 @@ class View3D extends Component {
this._registerEvents(); this._registerEvents();
this._bindPubSubEvents(); this._bindPubSubEvents();
this._bindRulesPubSubEvents(); this._bindRulesPubSubEvents();
this.getExceptionAreaList(); this.getExceptionAreasList();
} }
genPenId = () => { genPenId = () => {
...@@ -213,10 +212,8 @@ class View3D extends Component { ...@@ -213,10 +212,8 @@ class View3D extends Component {
if (this.timer) { if (this.timer) {
clearTimeout(this.timer); clearTimeout(this.timer);
} }
// this.infoHelper && this.infoHelper.destroy();
} }
// eslint-disable-next-line react/sort-comp
_registerEvents = () => { _registerEvents = () => {
this.r3d.on('dbclick', evt => { this.r3d.on('dbclick', evt => {
if (evt.button !== 0) { if (evt.button !== 0) {
...@@ -268,7 +265,6 @@ class View3D extends Component { ...@@ -268,7 +265,6 @@ class View3D extends Component {
let fireEquipmentPosition = data.contingencyRo.fireEquipmentPosition.split(','); let fireEquipmentPosition = data.contingencyRo.fireEquipmentPosition.split(',');
this.setState({ fireEquipmentPosition }); this.setState({ fireEquipmentPosition });
} }
assembleTroubleView(this, data, this.state.markers); assembleTroubleView(this, data, this.state.markers);
break; break;
case 'base3d.fromws.mapArea_action1-2': //镜头切换(旋转+推进) case 'base3d.fromws.mapArea_action1-2': //镜头切换(旋转+推进)
...@@ -1239,12 +1235,18 @@ class View3D extends Component { ...@@ -1239,12 +1235,18 @@ class View3D extends Component {
} }
} }
getExceptionAreaList = () => { getExceptionAreasList = () => {
exceptionRegionListAction().then(data=>{ exceptionRegionListAction().then(data=>{
this.setState({ exceptionAreas: data }); this.setState({ exceptionAreas: data });
}); });
} }
initExceptionAreasData = ()=>{
this.setState({ startLoadExceptionArea: false },()=>{
this.getExceptionAreasList();
});
}
renderPolygonRegion = (exceptionAreas)=> { renderPolygonRegion = (exceptionAreas)=> {
const regionConf = { const regionConf = {
regionColor: '#76d015', // 区域颜色 regionColor: '#76d015', // 区域颜色
...@@ -1334,7 +1336,7 @@ class View3D extends Component { ...@@ -1334,7 +1336,7 @@ class View3D extends Component {
x: fireEquipmentPosition[0], x: fireEquipmentPosition[0],
y: fireEquipmentPosition[1], y: fireEquipmentPosition[1],
z: fireEquipmentPosition[2] z: fireEquipmentPosition[2]
} };
} else { } else {
firePosition = { x: -90.827, y: 30.4577, z: 1.0839 }; firePosition = { x: -90.827, y: 30.4577, z: 1.0839 };
} }
...@@ -1391,7 +1393,6 @@ class View3D extends Component { ...@@ -1391,7 +1393,6 @@ class View3D extends Component {
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />} {startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />}
</A3DDesigner> </A3DDesigner>
</div> </div>
{/* <div className="editButton" onClick={() => this.editButtonChange()}>编辑模式</div> */}
{ editFlag && { editFlag &&
<div> <div>
{ {
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types';
import EquipStatusList from './EquipStatusList'; import EquipStatusList from './EquipStatusList';
import SafetyExecuteList from './SafetyExecuteList'; import SafetyExecuteList from './SafetyExecuteList';
import SafetyIndex from './SafetyIndex'; import SafetyIndex from './SafetyIndex';
...@@ -35,6 +35,7 @@ export default class Statistical extends Component { ...@@ -35,6 +35,7 @@ export default class Statistical extends Component {
break; break;
case 'error_status': case 'error_status':
console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~'); console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~');
this.props.refshExceptAreaData && this.props.refshExceptAreaData();
break; break;
case 'week_safety_index': case 'week_safety_index':
console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~'); console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~');
...@@ -52,6 +53,7 @@ export default class Statistical extends Component { ...@@ -52,6 +53,7 @@ export default class Statistical extends Component {
console.log('首页刷新~~~~~~~~~~~~~~~~~~~~'); console.log('首页刷新~~~~~~~~~~~~~~~~~~~~');
this.safetyIndex.getSafetyIndex(); this.safetyIndex.getSafetyIndex();
this.safetyExecute.safetyExecuteList(); this.safetyExecute.safetyExecuteList();
this.safetyExecute.onlineDayData();
this.equipStatus.equipStatusList(); this.equipStatus.equipStatusList();
this.safetyIndexWeek.safetyIndexWeekData(); this.safetyIndexWeek.safetyIndexWeekData();
this.statisticsCheck.statisticsCheckData(); this.statisticsCheck.statisticsCheckData();
...@@ -64,7 +66,7 @@ export default class Statistical extends Component { ...@@ -64,7 +66,7 @@ export default class Statistical extends Component {
render() { render() {
const wsURL = completeToken(SysWsURL.viewIndexws); const wsURL = completeToken(SysWsURL.convertorView3d);
return ( return (
<div className="statistical"> <div className="statistical">
<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 />
...@@ -82,3 +84,7 @@ export default class Statistical extends Component { ...@@ -82,3 +84,7 @@ export default class Statistical extends Component {
); );
} }
} }
Statistical.propTypes = {
refshExceptAreaData: PropTypes.func
};
import React, { Component } from 'react';
import EquipStatusList from './EquipStatusList';
import SafetyExecuteList from './SafetyExecuteList';
import SafetyIndex from './SafetyIndex';
import AmosWebSocket from 'amos-websocket';
import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts';
/**
* 全景监控统计
*/
export default class StatisticalLeft extends Component {
handleData = (data = {}) => {
console.log('ws data:', data);
data = JSON.parse(JSON.stringify(data));
console.log(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 'all':
console.log('首页左侧刷新~~~~~~~~~~~~~~~~~~~~');
this.safetyIndex.getSafetyIndex();
this.safetyExecute.safetyExecuteList();
this.equipStatus.equipStatusList();
break;
default:
console.log(refreshType,':类型不支持');
}
}
render() {
const wsURL = completeToken(SysWsURL.viewIndexws);
return (
<div className="statistical-left">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
<SafetyIndex ref={node => this.safetyIndex = node} />
<SafetyExecuteList ref={node => this.safetyExecute = node} />
<EquipStatusList ref={node => this.equipStatus = node} />
</div>
);
}
}
import React, { Component } from 'react';
import SafetyIndexWeek from './SafetyIndexWeek';
import StatisticsCheck from './StatisticsCheck';
import StatisticsDuty from './StatisticsDuty';
import AmosWebSocket from 'amos-websocket';
import SysWsURL, { completeToken } from '../../../consts/wsUrlConsts';
/**
* 全景监控统计
*/
export default class StatisticalRight extends Component {
handleData = (data = {}) => {
console.log('ws data:', data);
data = JSON.parse(JSON.stringify(data));
console.log(data);
let refreshType = data.refreshType;
let content = data.content;
switch (refreshType){
case 'error_status':
console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~');
break;
case 'week_safety_index':
console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~');
this.safetyIndexWeek.safetyIndexWeekData();
break;
case 'today_check_status':
console.log('今日巡检情况刷新~~~~~~~~~~~~~~~~~~~~');
this.statisticsCheck.statisticsCheckData();
break;
case 'today_duty':
this.statisticsDuty.statisticsDutyData();
console.log('今日值班刷新~~~~~~~~~~~~~~~~~~~~');
break;
case 'all':
console.log('首页右侧刷新~~~~~~~~~~~~~~~~~~~~');
this.safetyIndexWeek.safetyIndexWeekData();
this.statisticsCheck.statisticsCheckData();
this.statisticsDuty.statisticsDutyData();
break;
default:
console.log(refreshType,':类型不支持');
}
}
render() {
const wsURL = completeToken(SysWsURL.viewIndexws);
return (
<div className="statistical-right">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
<SafetyIndexWeek ref={node => this.safetyIndexWeek = node} />
<StatisticsCheck ref={node => this.statisticsCheck = node} />
<StatisticsDuty ref={node => this.statisticsDuty = node} />
</div>
);
}
}
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