Commit 619ddce8 authored by suhuiguang's avatar suhuiguang

1.王珂动态预案调整为mqtt

parent ddd1d79e
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// websocket 地址 // websocket 地址
wsURI: { wsURI: {
baseURI: 'ws://172.16.11.40:10600/', baseURI: 'ws://172.16.11.40:10600/',
ruleURI: 'ws://172.16.3.77:8083/' ruleURI: 'ws://172.16.10.85:8083/mqtt'
}, },
// 外部链接地址 // 外部链接地址
outterURI: { outterURI: {
......
...@@ -62,7 +62,10 @@ export const FscSerUrl = { ...@@ -62,7 +62,10 @@ export const FscSerUrl = {
statisticsDutyUrl: completePrefix(convertorURI, 'api/view3d/statistics/duty'), //今日值班统计 statisticsDutyUrl: completePrefix(convertorURI, 'api/view3d/statistics/duty'), //今日值班统计
onlineDayUrl: completePrefix(convertorURI, 'api/view3d/online/date'),//消防安全执行天数 onlineDayUrl: completePrefix(convertorURI, 'api/view3d/online/date'),//消防安全执行天数
exceptionRegionListUrl: completePrefix(baseURI, 'api/view3d/region/exception/list'),//异常区域查询 exceptionRegionListUrl: completePrefix(baseURI, 'api/view3d/region/exception/list'),//异常区域查询
listPointsByRegionIdUrl: completePrefix(baseURI, 'api/view3d/point/list/{regionId}') //查询区域下点 listPointsByRegionIdUrl: completePrefix(baseURI, 'api/view3d/point/list/{regionId}'), //查询区域下点
// completePrefix(FscSerUrl.planCloseUrl,`${rUrl}?batchNo=${content.batchNo}&stepCode=${content.stepCode}&=${content.code}&confirm=${confirm}&stepState=${content.stepState}`);
// 关闭预案
planCloseUrl: completePrefix(baseURI, 'api/timeline/fire/exit/?batchNo={batchNo}&stepCode={stepCode}&buttonCode={buttonCode}&confirm={confirm}&stepState={stepState}')
}; };
export const FasSerUrl = { export const FasSerUrl = {
......
...@@ -17,6 +17,7 @@ const getToken = () => { ...@@ -17,6 +17,7 @@ const getToken = () => {
export default { export default {
rulews: completePrefix(ruleURI, 'rule.ws?token={token}'), rulews: completePrefix(ruleURI, 'rule.ws?token={token}'),
mqttUrl: ruleURI,
convertorView3d: completePrefix(convertorView3dURI, '3dViewMessage') convertorView3d: completePrefix(convertorView3dURI, '3dViewMessage')
}; };
......
...@@ -25,3 +25,11 @@ export const ruleAction = (content,confirm) => { ...@@ -25,3 +25,11 @@ export const ruleAction = (content,confirm) => {
export const ruleRePlayAction = (batchNo) => { export const ruleRePlayAction = (batchNo) => {
return commonGet(formatUrl(FscSerUrl.ruleRePlayUrl,{ batchNo })); return commonGet(formatUrl(FscSerUrl.ruleRePlayUrl,{ batchNo }));
}; };
/**
* 关闭预案
*/
export const planCloseAction = (batchNo, stepCode, buttonCode, confirm, stepState) => {
return commonPut(formatUrl(FscSerUrl.planCloseUrl, { batchNo, stepCode, buttonCode, confirm, stepState }));
};
...@@ -2,8 +2,10 @@ import React, { Component } from 'react'; ...@@ -2,8 +2,10 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Connect } from 'amos-framework'; import { Connect } from 'amos-framework';
import AmosWebSocket from 'amos-websocket'; import AmosWebSocket from 'amos-websocket';
import { MQTTProvider } from 'amos-mqtt';
import SysWsURL, { completeToken } from './../consts/wsUrlConsts'; import SysWsURL, { completeToken } from './../consts/wsUrlConsts';
import SideControl from './sideControl'; import SideControl from './sideControl';
import MessageEvent from './MessageEvent';
import globalMsg from './pagefactory/msgFactory'; import globalMsg from './pagefactory/msgFactory';
import { eventTopics, rulesDataFactory } from './consts'; import { eventTopics, rulesDataFactory } from './consts';
import LayerPool from './LayerPool'; import LayerPool from './LayerPool';
...@@ -96,10 +98,12 @@ class MaskContent extends Component { ...@@ -96,10 +98,12 @@ class MaskContent extends Component {
isPermissionControl, isPermissionControl,
bizPerActionBars, bizPerActionBars,
isInitModel, isInitModel,
isPanoramic isPanoramic,
hiddenScreenSaver,
trigger
} = this.props; } = this.props;
alarmStarted && this.props.editModelChange(true); alarmStarted && this.props.editModelChange(true);
const wsURL = completeToken(SysWsURL.rulews); const wsURL = SysWsURL.mqttUrl;
const controlAnimation = { const controlAnimation = {
animateName: 'zoom-comb-left', animateName: 'zoom-comb-left',
visible: !planStarted, visible: !planStarted,
...@@ -118,9 +122,15 @@ class MaskContent extends Component { ...@@ -118,9 +122,15 @@ class MaskContent extends Component {
transitionAppear: true transitionAppear: true
} }
}; };
const messageEvent ={
hiddenScreenSaver,
trigger
}
return ( return (
<div className="mask-content"> <div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <MQTTProvider url={wsURL}>
<MessageEvent {...messageEvent} />
</MQTTProvider>
{ !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} activeAction={activeAction} />} { !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} activeAction={activeAction} />}
{ !alarmStarted && isShowActionBar && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={this.changeSearchPaneVisible} />} { !alarmStarted && isShowActionBar && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={this.changeSearchPaneVisible} />}
<TopMsg alarmStart={alarmStart} /> <TopMsg alarmStart={alarmStart} />
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import _amosTool, { fastDeepEqual } from 'amos-tool';
import globalMsg from './pagefactory/msgFactory';
import { eventTopics, rulesDataFactory } from './consts';
import { withSubscribeMQTT } from 'amos-mqtt';
let oldData;
/**
* 订阅主题
*/
@withSubscribeMQTT({
topic: '/Amos-autosys/yinan/plan'
})
/**
* 消息组件
*
* @class MessageEvent
* @extends {Basic}
*/
class MessageEvent extends Component {
constructor(props) {
super(props);
this.state = {};
}
/**
* 获取订阅信息并修改
* @param {*} nextProps
*/
componentWillReceiveProps({data}) {
if (data) {
const { msgType, msgContext } = data;
const context = this.props.data ? this.props.data.msgContext : null;
const { hiddenScreenSaver, trigger } = this.props;
if (!fastDeepEqual(msgContext, context)) {
// 去掉全局消息 待规则调整后进行调试
// if (msgType === eventTopics.global_msg) {
// hiddenScreenSaver();
// globalMsg(msgContext);
// return;
// }
trigger(`${eventTopics.MQTT}.${msgType}`, data);
}
}
}
render() {
return (
<div />
);
}
}
MessageEvent.propTypes = {
data: PropTypes.array,
hiddenScreenSaver: PropTypes.func,
trigger: PropTypes.func
};
export default MessageEvent;
...@@ -36,6 +36,8 @@ export const pointTopicMapping = { ...@@ -36,6 +36,8 @@ export const pointTopicMapping = {
}; };
export const eventTopics = { export const eventTopics = {
// mqtt 消息前缀
MQTT: 'MQTT',
// 双屏通信主题 // 双屏通信主题
transtopic: 'transtopic', transtopic: 'transtopic',
......
...@@ -33,12 +33,13 @@ class AssistCard extends Component{ ...@@ -33,12 +33,13 @@ class AssistCard extends Component{
render() { render() {
const { display, data } = this.state; const { display, data } = this.state;
let titleStyle = `detailCardTitle-${data.icon}`; let cls = pointIcon[data.icon] ? data.icon : 'zhuyi';
let titleStyle = `detailCardTitle-${cls}`;
return ( return (
<div className="detailCard"> <div className="detailCard">
<div className={titleStyle}> <div className={titleStyle}>
<Row className="cardRow"> <Row className="cardRow">
<Col span={24} className="cardCol"><img src={pointIcon[data.icon]} className="precontrol-assist-card-img" /><span title={data.title || ''} className="cardTitleName">{data.title || ''}</span></Col> <Col span={24} className="cardCol"><img src={pointIcon[data.icon] || pointIcon['zhuyi']} className="precontrol-assist-card-img" /><span title={data.title || ''} className="cardTitleName">{data.title || ''}</span></Col>
</Row> </Row>
</div> </div>
<div className={display ? "detailAssistCardContxt" : "detailAssistCardContxt-notDisplay"}> <div className={display ? "detailAssistCardContxt" : "detailAssistCardContxt-notDisplay"}>
......
...@@ -116,7 +116,7 @@ class MonitorView extends Component { ...@@ -116,7 +116,7 @@ class MonitorView extends Component {
} }
MonitorView.propTypes = { MonitorView.propTypes = {
planStart: PropTypes.bool, // planStart: PropTypes.bool,
// fireResourceData: PropTypes.object // fireResourceData: PropTypes.object
}; };
......
...@@ -11,38 +11,36 @@ class StepView extends Component { ...@@ -11,38 +11,36 @@ class StepView extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
stepName: '', step: [],
nextStepName: '',
display: 'none' display: 'none'
}; };
} }
componentDidMount() { componentDidMount() {
this.props.subscribe(eventTopics.stepArea_view, (topic, content) => { this.props.subscribe(eventTopics.stepArea_view, (topic, content) => {
const { data } = content; const { preStep, step } = content;
const { stepName, nextStepName } = data; this.setState({ preStep, step, display: '' });
this.setState({ stepName, nextStepName, display: '' });
}); });
} }
render() { render() {
let { stepName, nextStepName, display } = this.state; let { display, step } = this.state;
let planEnd = stepName && !nextStepName; let planEnd = step.length > 1 ? false : true;
return ( return (
<div className="precontrol-step-view" style={{ display }} > <div className="precontrol-step-view" style={{ display }} >
{ !planEnd ? { !planEnd ?
( (
<div style={{ height: '100%' }}> <div style={{ height: '100%' }}>
<Item /> <Item />
<Item className="previous-step" dot={<img src={require('./../../../assets/convertor/3dview/prePlan/buzhouqu-dangqianbu.png')} alt="" />}><p>{stepName}</p></Item> <Item className="previous-step" dot={<img src={require('./../../../assets/convertor/3dview/prePlan/buzhouqu-dangqianbu.png')} alt="" />}><p>{ step[0] && step[0].stepName}</p></Item>
<Item className="next-step" dot={<img src={require('./../../../assets/convertor/3dview/prePlan/buzhouqu-xiayibu.png')} alt="" />} >{nextStepName}</Item> <Item className="next-step" dot={<img src={require('./../../../assets/convertor/3dview/prePlan/buzhouqu-xiayibu.png')} alt="" />} >{step[1] && step[1].stepName}</Item>
</div> </div>
) )
: :
( (
<div style={{ height: '100%' }}> <div style={{ height: '100%' }}>
<Item /> <Item />
<Item className="previous-step" dot={<img src={require('../../../assets/convertor/3dview/prePlan/buzhouqu-dangqianbu.png')} alt="" />}><p>{stepName}</p></Item> <Item className="previous-step" dot={<img src={require('../../../assets/convertor/3dview/prePlan/buzhouqu-dangqianbu.png')} alt="" />}><p>{ step[0] && step[0].stepName}</p></Item>
</div> </div>
) )
} }
......
...@@ -4,7 +4,7 @@ import { Connect, Modal } from 'amos-framework'; ...@@ -4,7 +4,7 @@ import { Connect, Modal } from 'amos-framework';
import { CONSTS } from './../../../consts/storageConsts'; import { CONSTS } from './../../../consts/storageConsts';
import { eventTopics } from '../../consts'; import { eventTopics } from '../../consts';
import { tirggerTransTopic } from '../../dataProcessor'; import { tirggerTransTopic } from '../../dataProcessor';
import { ruleAction } from './../../../services/ruleService'; import { planCloseAction } from './../../../services/ruleService';
const eventConnect = Connect.eventConnect; const eventConnect = Connect.eventConnect;
const closeImgPath = require('./../../../assets/convertor/3dview/prePlan/dingbu-tuichu.png'); const closeImgPath = require('./../../../assets/convertor/3dview/prePlan/dingbu-tuichu.png');
...@@ -25,9 +25,9 @@ class TopView extends Component { ...@@ -25,9 +25,9 @@ class TopView extends Component {
componentDidMount() { componentDidMount() {
this.props.subscribe(eventTopics.top_ae_msg, (topic, data) => { this.props.subscribe(eventTopics.top_ae_msg, (topic, data) => {
const { content, batchNo, contingencyPlanId } = data; const { content, batchNo } = data;
this.props.planStart(data); this.props.planStart(data);
this.setState( { content, showContent: 'block', batchNo, contingencyPlanId } ); this.setState( { content, showContent: 'block', batchNo } );
let { planStart } = this.props; let { planStart } = this.props;
this.prepareChangeTimeText(planStart); this.prepareChangeTimeText(planStart);
}); });
...@@ -50,13 +50,14 @@ class TopView extends Component { ...@@ -50,13 +50,14 @@ class TopView extends Component {
// 执行删除逻辑 // 执行删除逻辑
tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false } }); tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false } });
_this.props.planQuit(); _this.props.planQuit();
let content = { batchNo: _this.state.batchNo, // let content = { batchNo: _this.state.batchNo,
stepCode: 0, // stepCode: 0,
code: 'FIRE_CANCEL', // code: 'FIRE_CANCEL',
requestUrl: '/api/timeline/fire', // requestUrl: '/api/timeline/fire',
contingencyPlanId: _this.state.contingencyPlanId, // contingencyPlanId: _this.state.contingencyPlanId,
stepState: 'B' }; // stepState: 'B' };
ruleAction(content, 'CONFIRM').then(e=>{ const { batchNo } = _this.state;
planCloseAction(batchNo, 0, 'FIRE_CANCEL', 'CONFIRM', 'B').then(e=>{
}); });
}, },
onCancel() {} onCancel() {}
......
...@@ -209,7 +209,7 @@ class MonitorView extends Component { ...@@ -209,7 +209,7 @@ class MonitorView extends Component {
} }
MonitorView.propTypes = { MonitorView.propTypes = {
planStart: PropTypes.bool, // planStarted: PropTypes.bool,
fireResourceData: PropTypes.object fireResourceData: PropTypes.object
}; };
......
...@@ -10,7 +10,7 @@ class EmptyPage extends Component { ...@@ -10,7 +10,7 @@ class EmptyPage extends Component {
onOpenButtonList =()=>{ onOpenButtonList =()=>{
const { openStepCxt,batchNo } = this.props; const { openStepCxt,batchNo } = this.props;
batchNo && openStepCxt(batchNo); openStepCxt();
} }
render() { render() {
......
...@@ -46,10 +46,10 @@ class OperateButton extends Component { ...@@ -46,10 +46,10 @@ class OperateButton extends Component {
registerTimer =()=> { registerTimer =()=> {
this.timer && clearTimeout(this.timer); this.timer && clearTimeout(this.timer);
const { message = {} } = this.props; const { message = {} } = this.props;
let json = message.buttonJson ? JSON.parse(message.buttonJson) : {}; let json = message.button ? JSON.parse(message.button) : {};
let button = json.operate[0] || []; let button = json.operate[0] || [];
button.batchNo = message.batchNo; button.batchNo = message.batchNo;
button.contingencyPlanId = message.contingencyPlanId; button.contingencyPlanId = message.caseId;
button.stepCode = json.stepCode; button.stepCode = json.stepCode;
let delayedArry = button.delayed || []; let delayedArry = button.delayed || [];
if (delayedArry.includes(count)) { if (delayedArry.includes(count)) {
...@@ -63,10 +63,10 @@ class OperateButton extends Component { ...@@ -63,10 +63,10 @@ class OperateButton extends Component {
autoClick = () => { autoClick = () => {
const { message = {} } = this.props; const { message = {} } = this.props;
let json = message.buttonJson ? JSON.parse(message.buttonJson) : {}; let json = message.button ? JSON.parse(message.button) : {};
let button = json.operate[0] || []; let button = json.operate[0] || [];
button.batchNo = message.batchNo; button.batchNo = message.batchNo;
button.contingencyPlanId = message.contingencyPlanId; button.contingencyPlanId = message.caseId;
button.stepCode = json.stepCode; button.stepCode = json.stepCode;
this.props.onAutoClick(button, 'CANCEL_' + button.hide); this.props.onAutoClick(button, 'CANCEL_' + button.hide);
} }
...@@ -77,11 +77,11 @@ class OperateButton extends Component { ...@@ -77,11 +77,11 @@ class OperateButton extends Component {
} }
renderBtn =(message) =>{ renderBtn =(message) =>{
let json = message.buttonJson ? JSON.parse(message.buttonJson) : {}; let json = message.button ? JSON.parse(message.button) : {};
let btnList = json.operate || []; let btnList = json.operate || [];
if (btnList && btnList.length === 1) { if (btnList && btnList.length === 1) {
btnList[0].batchNo = message.batchNo; btnList[0].batchNo = message.batchNo;
btnList[0].contingencyPlanId = message.contingencyPlanId; btnList[0].contingencyPlanId = message.caseId;
btnList[0].stepCode = json.stepCode; btnList[0].stepCode = json.stepCode;
return (<Button return (<Button
className="operate-button-button" className="operate-button-button"
...@@ -94,7 +94,7 @@ class OperateButton extends Component { ...@@ -94,7 +94,7 @@ class OperateButton extends Component {
} else if (btnList && btnList.length === 2) { } else if (btnList && btnList.length === 2) {
return (btnList || []).map(btn =>{ return (btnList || []).map(btn =>{
btn.batchNo = message.batchNo; btn.batchNo = message.batchNo;
btn.contingencyPlanId = message.contingencyPlanId; btn.contingencyPlanId = message.caseId;
btn.stepCode = json.stepCode; btn.stepCode = json.stepCode;
return <Button return <Button
className="operate-button-button" className="operate-button-button"
...@@ -110,8 +110,8 @@ class OperateButton extends Component { ...@@ -110,8 +110,8 @@ class OperateButton extends Component {
render() { render() {
const { message = {} } = this.props; const { message = {} } = this.props;
let display = message.hiddPlanButton ? 'none' : '' ; let display = message.hiddPlanButton ? 'none' : '' ;
let url = opeateIcon[message.icon]; let url = opeateIcon[message.icon] || opeateIcon['jiaohuqu-zhihuiquan'];
let json = message.buttonJson ? JSON.parse(message.buttonJson) : {}; let json = message.button ? JSON.parse(message.button) : {};
let btnJsonArry = json.operate || []; let btnJsonArry = json.operate || [];
return ( return (
<div className={display ? 'operate-button-display-root' : 'operate-button-root'} onClick={this.onOpenButtonList} style={{ display }} > <div className={display ? 'operate-button-display-root' : 'operate-button-root'} onClick={this.onOpenButtonList} style={{ display }} >
...@@ -120,7 +120,7 @@ class OperateButton extends Component { ...@@ -120,7 +120,7 @@ class OperateButton extends Component {
<div className='operate-button-content'> <div className='operate-button-content'>
<div className="button-name"> <div className="button-name">
{message.actionName} {message.actionName}
{btnJsonArry.length > 0 && btnJsonArry[0].hide ? <TimerTool ref={timer =>this[message.contingencyPlanId] = timer} autoClick={() => this.hiddenButtonRoot(message)} delayed={btnJsonArry[0].hide} /> : ''} {btnJsonArry.length > 0 && btnJsonArry[0].hide ? <TimerTool ref={timer =>this[message.caseId] = timer} autoClick={() => this.hiddenButtonRoot(message)} delayed={btnJsonArry[0].hide} /> : ''}
</div> </div>
<div className="button-desc">{message.tips}</div> <div className="button-desc">{message.tips}</div>
</div> </div>
......
...@@ -15,6 +15,7 @@ const eventConnect = Connect.eventConnect; ...@@ -15,6 +15,7 @@ const eventConnect = Connect.eventConnect;
const recordType = 'OPERATE'; const recordType = 'OPERATE';
const confirmState = 'CONFIRM'; const confirmState = 'CONFIRM';
let batchNo;
/** /**
* *
...@@ -43,6 +44,10 @@ class ReservePlan extends Component { ...@@ -43,6 +44,10 @@ class ReservePlan extends Component {
} }
componentWillUnmount () {
batchNo = null;
}
componentDidMount(){ componentDidMount(){
this.props.subscribe(eventTopics.optionArea_view, (topic, data) => {//按钮接收 this.props.subscribe(eventTopics.optionArea_view, (topic, data) => {//按钮接收
this.readyOptionAreaData(data); this.readyOptionAreaData(data);
...@@ -90,7 +95,7 @@ class ReservePlan extends Component { ...@@ -90,7 +95,7 @@ class ReservePlan extends Component {
}); });
} }
getPlanExeRecord =(batchNo)=>{ getPlanExeRecord =()=>{
batchNo && this.refshTimeLine(batchNo); batchNo && this.refshTimeLine(batchNo);
} }
...@@ -100,10 +105,10 @@ class ReservePlan extends Component { ...@@ -100,10 +105,10 @@ class ReservePlan extends Component {
if (cxtArry.length === 0 ) { if (cxtArry.length === 0 ) {
cxtArry.push(data); cxtArry.push(data);
} else { } else {
const index = cxtArry.findIndex(item=>item.contingencyPlanId === data.contingencyPlanId); const index = cxtArry.findIndex(item=>item.caseId === data.contingencyPlanId);
if (index < 0 ) { if (index < 0 ) {
newArry = cxtArry.map(item=>{ newArry = cxtArry.map(item=>{
if ((JSON.parse(item.buttonJson) || {}).stepCode !== (JSON.parse(data.buttonJson) || {}).stepCode) { if ((JSON.parse(item.button) || {}).stepCode !== (JSON.parse(data.button) || {}).stepCode) {
item.hiddPlanButton = true; item.hiddPlanButton = true;
} }
return item; return item;
...@@ -139,14 +144,14 @@ class ReservePlan extends Component { ...@@ -139,14 +144,14 @@ class ReservePlan extends Component {
this.setState({ expanded: false }); this.setState({ expanded: false });
} }
openStepCxt =(batchNo)=>{ openStepCxt =()=>{
this.getPlanExeRecord(batchNo);//查询数据 this.getPlanExeRecord();//查询数据
} }
hiddPlanRoot =(content)=>{ hiddPlanRoot =(content)=>{
const { cxtArry } = this.state; const { cxtArry } = this.state;
cxtArry.map(cxt => { cxtArry.map(cxt => {
if (cxt.contingencyPlanId === content.contingencyPlanId ) { if (cxt.caseId === content.contingencyPlanId ) {
cxt.hiddPlanButton = true; cxt.hiddPlanButton = true;
} }
return cxt; return cxt;
...@@ -154,9 +159,9 @@ class ReservePlan extends Component { ...@@ -154,9 +159,9 @@ class ReservePlan extends Component {
let exixtButtonArry = cxtArry.filter(item=>!item.hiddPlanButton); let exixtButtonArry = cxtArry.filter(item=>!item.hiddPlanButton);
let lastStep = []; let lastStep = [];
if (exixtButtonArry.length === 0) { if (exixtButtonArry.length === 0) {
lastStep = cxtArry.filter(item=>parseInt((JSON.parse(item.buttonJson) || {}).stepCode) === parseInt((JSON.parse(content.buttonJson) || {}).stepCode) - 1 && (JSON.parse(item.buttonJson) || {}).operate[0].hide);//上一步挂起的按钮 lastStep = cxtArry.filter(item=>parseInt((JSON.parse(item.button) || {}).stepCode) === parseInt((JSON.parse(content.button) || {}).stepCode) - 1 && (JSON.parse(item.button) || {}).operate[0].hide);//上一步挂起的按钮
lastStep.length > 0 && cxtArry.forEach(item=>{ lastStep.length > 0 && cxtArry.forEach(item=>{
if (parseInt((JSON.parse(item.buttonJson) || {}).stepCode) === parseInt((JSON.parse(content.buttonJson) || {}).stepCode) - 1 && (JSON.parse(item.buttonJson) || {}).operate[0].hide){ if (parseInt((JSON.parse(item.button) || {}).stepCode) === parseInt((JSON.parse(content.button) || {}).stepCode) - 1 && (JSON.parse(item.button) || {}).operate[0].hide){
item.hiddPlanButton = false; item.hiddPlanButton = false;
} }
}); });
...@@ -168,19 +173,19 @@ class ReservePlan extends Component { ...@@ -168,19 +173,19 @@ class ReservePlan extends Component {
dealCxtArryAfterClick =(content)=>{ dealCxtArryAfterClick =(content)=>{
const { cxtArry } = this.state; const { cxtArry } = this.state;
const index = cxtArry.findIndex(item=>item.contingencyPlanId === content.contingencyPlanId); const index = cxtArry.findIndex(item=>item.caseId === content.contingencyPlanId);
index > -1 ? cxtArry.splice(index,1) : '';//删除点击过的数据 index > -1 ? cxtArry.splice(index,1) : '';//删除点击过的数据
let exixtButtonArry = cxtArry.filter(item=>!item.hiddPlanButton); let exixtButtonArry = cxtArry.filter(item=>!item.hiddPlanButton);
let lastStep = []; let lastStep = [];
if (parseInt(content.stepCode) === 9) { if (parseInt(content.stepCode) === 14) {
this.setState({ cxtArry,isShowOver: false, display: 'none' }); this.setState({ cxtArry,isShowOver: false, display: 'none' });
} else { } else {
if (cxtArry.length > 0 && exixtButtonArry.length > 0) { if (cxtArry.length > 0 && exixtButtonArry.length > 0) {
this.setState({ cxtArry,isShowOver: false }); this.setState({ cxtArry,isShowOver: false });
} else if (cxtArry.length > 0 && exixtButtonArry.length === 0) { } else if (cxtArry.length > 0 && exixtButtonArry.length === 0) {
lastStep = cxtArry.filter(item=>parseInt((JSON.parse(item.buttonJson) || {}).stepCode) === parseInt(content.stepCode) - 1 && (JSON.parse(item.buttonJson) || {}).operate[0].hide);//上一步挂起的按钮 lastStep = cxtArry.filter(item=>parseInt((JSON.parse(item.button) || {}).stepCode) === parseInt(content.stepCode) - 1 && (JSON.parse(item.button) || {}).operate[0].hide);//上一步挂起的按钮
lastStep.length > 0 && cxtArry.forEach(item=>{ lastStep.length > 0 && cxtArry.forEach(item=>{
if (parseInt((JSON.parse(item.buttonJson) || {}).stepCode) === parseInt(content.stepCode) - 1 && (JSON.parse(item.buttonJson) || {}).operate[0].hide){ if (parseInt((JSON.parse(item.button) || {}).stepCode) === parseInt(content.stepCode) - 1 && (JSON.parse(item.button) || {}).operate[0].hide){
item.hiddPlanButton = false; item.hiddPlanButton = false;
} }
}); });
...@@ -193,7 +198,8 @@ class ReservePlan extends Component { ...@@ -193,7 +198,8 @@ class ReservePlan extends Component {
renderInteractiveZone =(cxtArry)=>{ renderInteractiveZone =(cxtArry)=>{
return cxtArry.map(e=>{ return cxtArry.map(e=>{
return <OperateButton message={e} key={e.contingencyPlanId} hiddPlanRoot={this.hiddPlanRoot} onButtonClick={this.onButtonClick} onAutoClick={this.onAutoClick} openStepCxt={()=>this.openStepCxt(e.batchNo)} />; batchNo = e.batchNo;
return <OperateButton message={e} key={e.caseId} hiddPlanRoot={this.hiddPlanRoot} onButtonClick={this.onButtonClick} onAutoClick={this.onAutoClick} openStepCxt={()=>this.openStepCxt(e.batchNo)} />;
}); });
} }
......
...@@ -6,7 +6,7 @@ import { desigerHelperConfig } from './conf'; ...@@ -6,7 +6,7 @@ import { desigerHelperConfig } from './conf';
const typeEum = { picture1: '电源负荷图',picture2: '电缆沟封堵图',picture3: '消防车进站行车路线图',picture4: '消防取水图' }; const typeEum = { picture1: '电源负荷图',picture2: '电缆沟封堵图',picture3: '消防车进站行车路线图',picture4: '消防取水图' };
const parseTroubleMarkers = (instance,content,markers)=> {//处理设备报警:切换图层到探测器、显示报警的探测器(闪烁-报警,不闪烁-报警解除) const parseTroubleMarkers = (instance,content,markers)=> {//处理设备报警:切换图层到探测器、显示报警的探测器(闪烁-报警,不闪烁-报警解除)
const { type, fireEquipmentId: id, equipmentName: title } = content.contingencyRo;//数据结构待定 const { type, fireEquipmentId: id, equipmentName: title } = content;//数据结构待定
const markersArr = markers[type] || []; const markersArr = markers[type] || [];
if (markersArr.length > 0){ if (markersArr.length > 0){
let needUpdate = false; let needUpdate = false;
...@@ -38,14 +38,14 @@ const parseTroubleMarkers = (instance,content,markers)=> {//处ç†è®¾å¤‡æŠ¥è­¦ï¼ ...@@ -38,14 +38,14 @@ const parseTroubleMarkers = (instance,content,markers)=> {//处ç†è®¾å¤‡æŠ¥è­¦ï¼
}; };
export const assembleTroubleView = (instance, content, markers)=>{//跳转最佳视角,冒泡显示重点设备名称 export const assembleTroubleView = (instance, content, markers)=>{//跳转最佳视角,冒泡显示重点设备名称
if (void 0 === content || void 0 === content.contingencyRo || void 0 === content.contingencyRo.fireEquipmentPosition) { if (void 0 === content || void 0 === content || void 0 === content.fireEquipmentPosition) {
return; return;
} }
let equipCameraObj = new Object(); let equipCameraObj = new Object();
equipCameraObj.position = content.contingencyRo.fireEquipmentPosition.split(','); equipCameraObj.position = content.fireEquipmentPosition.split(',');
// instance.cameraFactory.flyTo(equipCameraObj); // instance.cameraFactory.flyTo(equipCameraObj);
instance.focusPosition(content.contingencyRo.fireEquipmentPosition.split(',')); instance.focusPosition(content.fireEquipmentPosition.split(','));
const { fireEquipmentId, type = 'monitorEquipment', equipmentId, equipmentName } = content.contingencyRo;//数据结构待定 const { fireEquipmentId, type = 'monitorEquipment', equipmentId, equipmentName } = content;//数据结构待定
const markersArr = markers[type] || []; const markersArr = markers[type] || [];
if (markersArr.length > 0){ if (markersArr.length > 0){
let needUpdate = false; let needUpdate = false;
...@@ -77,7 +77,7 @@ export const executorRecord = (instance,content)=>{//å³ä¾§æŒ‰ç…§æ—¶é—´å€’噿˜ ...@@ -77,7 +77,7 @@ export const executorRecord = (instance,content)=>{//å³ä¾§æŒ‰ç…§æ—¶é—´å€’噿˜
}; };
const dealEquipReleteCameraOpen = (instance,content,markers)=>{//3d显示重点设备配套的摄像头图标及编号 const dealEquipReleteCameraOpen = (instance,content,markers)=>{//3d显示重点设备配套的摄像头图标及编号
const { type,cameraIds } = content.contingencyRo;//数据结构待定 const { type,cameraIds } = content;//数据结构待定
let arry = cameraIds ? cameraIds.split(',') : [];//摄像头数组 let arry = cameraIds ? cameraIds.split(',') : [];//摄像头数组
const oldMarkers = instance.state.markers; const oldMarkers = instance.state.markers;
const { monitorEquipment = [] } = oldMarkers || {}; const { monitorEquipment = [] } = oldMarkers || {};
...@@ -282,7 +282,7 @@ export const dealTroubleMarkers = (instance, content) => { ...@@ -282,7 +282,7 @@ export const dealTroubleMarkers = (instance, content) => {
let markers = {}; let markers = {};
const type = 'monitorEquipment'; const type = 'monitorEquipment';
hiddenFireTruckRoute(instance); hiddenFireTruckRoute(instance);
content.contingencyRo.type = type; content.type = type;
initView3DAction(type,'',false).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers[type] = d;
parseTroubleMarkers(instance,content,markers); parseTroubleMarkers(instance,content,markers);
...@@ -349,7 +349,7 @@ export const flickerTroubleMarkers = (instance, content) => { ...@@ -349,7 +349,7 @@ export const flickerTroubleMarkers = (instance, content) => {
export const equipReleteCameraOpen = (instance, content) => { export const equipReleteCameraOpen = (instance, content) => {
let markers = {}; let markers = {};
let type = 'video'; let type = 'video';
content.contingencyRo.type = type; content.type = type;
initView3DAction(type,'',false).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers[type] = d;
dealEquipReleteCameraOpen(instance,content,markers); dealEquipReleteCameraOpen(instance,content,markers);
...@@ -357,13 +357,13 @@ export const equipReleteCameraOpen = (instance, content) => { ...@@ -357,13 +357,13 @@ export const equipReleteCameraOpen = (instance, content) => {
}; };
export const changeGoodView = (instance, content)=>{ export const changeGoodView = (instance, content)=>{
if (void 0 === content || void 0 === content.contingencyRo) { if (void 0 === content || void 0 === content) {
return; return;
} }
const equipCameraEffect = {}; const equipCameraEffect = {};
const defaultPosition = '44.23,395.41,296.57'; const defaultPosition = '44.23,395.41,296.57';
const defaultRotation = '-0.93,-0.01,-0.01'; const defaultRotation = '-0.93,-0.01,-0.01';
equipCameraEffect.position = (content.contingencyRo.fireEquipmentPosition || defaultPosition).split(','); equipCameraEffect.position = (content.fireEquipmentPosition || defaultPosition).split(',');
// equipCameraEffect.rotation = (content.contingencyRo.rotation || defaultRotation).split(','); // equipCameraEffect.rotation = (content.contingencyRo.rotation || defaultRotation).split(',');
equipCameraEffect.duration = 5000; equipCameraEffect.duration = 5000;
instance.cameraFactory.flyTo(equipCameraEffect); instance.cameraFactory.flyTo(equipCameraEffect);
...@@ -411,7 +411,7 @@ const parseFireTruckMarkers = (instance, content, markers) => {// 3Dç•Œé¢æ¶ˆé˜² ...@@ -411,7 +411,7 @@ const parseFireTruckMarkers = (instance, content, markers) => {// 3Dç•Œé¢æ¶ˆé˜²
}; };
const parseMatchFireEquipMarkers = (instance, content, markers) => {// 3D界面显示着火重点设备配套的消防设施 const parseMatchFireEquipMarkers = (instance, content, markers) => {// 3D界面显示着火重点设备配套的消防设施
const { equipmentId } = content.contingencyRo;//数据结构待定 const { equipmentId } = content;//数据结构待定
getMatchEquipmentListAction([], equipmentId, -1, -1).then(data => { getMatchEquipmentListAction([], equipmentId, -1, -1).then(data => {
let matchEquipIds = []; let matchEquipIds = [];
data.content.map(item => matchEquipIds.push(item.id)); data.content.map(item => matchEquipIds.push(item.id));
......
...@@ -42,7 +42,7 @@ class TopMsg extends Component { ...@@ -42,7 +42,7 @@ class TopMsg extends Component {
<div className="precontrol-top-view" style={{ display: this.state.showContent }}> <div className="precontrol-top-view" style={{ display: this.state.showContent }}>
<div className="top-view-2"> <div className="top-view-2">
<div className="text-content-alarm"> <div className="text-content-alarm">
{this.state.content} {this.state.content.content}
</div> </div>
</div> </div>
</div> </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