Commit 568c914c authored by suhuiguang's avatar suhuiguang

编辑模式-区域绑定,未编辑的区域,错误显示感叹号

区域异常红柱子在故障模式进入内部后,再退出不显示 消防安全执行异常信息列表,鼠标悬浮增加小手
parent 30496ee8
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
.safetyExecuteList{ .safetyExecuteList{
height: 45%; height: 45%;
margin-left: 37px; margin-left: 37px;
&-open{
cursor: pointer;
}
.up{ .up{
height: 90px; height: 90px;
.left{ .left{
...@@ -97,13 +101,13 @@ ...@@ -97,13 +101,13 @@
padding-top: 15px; padding-top: 15px;
height: 50px; height: 50px;
.icon{ .icon{
float: left; display: inline;
display: inline; cursor: pointer;
img{ img{
padding-left: 20px; padding-left: 20px;
}
} }
}
.arrow{ .arrow{
float: right; float: right;
......
...@@ -58,6 +58,7 @@ class PromptModal extends Component { ...@@ -58,6 +58,7 @@ class PromptModal extends Component {
noDefaultFooter noDefaultFooter
noDefaultHeader noDefaultHeader
destroyContent destroyContent
outterClosable={false}
onCancel={this.cancel} onCancel={this.cancel}
closable={false} closable={false}
/> />
...@@ -70,7 +71,9 @@ PromptModal.propTypes = { ...@@ -70,7 +71,9 @@ PromptModal.propTypes = {
saveAreaData: PropTypes.func, saveAreaData: PropTypes.func,
savePointAndRefreshMarker: PropTypes.func, savePointAndRefreshMarker: PropTypes.func,
handleOutExceptModel: PropTypes.func, handleOutExceptModel: PropTypes.func,
savePointData: PropTypes.func savePointData: PropTypes.func,
savePointDataBack: PropTypes.func,
savePointDataSwitch: PropTypes.func
}; };
export default PromptModal; export default PromptModal;
...@@ -607,9 +607,9 @@ class View3D extends Component { ...@@ -607,9 +607,9 @@ class View3D extends Component {
} }
startDrow = (areaItem) => { startDrow = (areaItem) => {
// this.a3dRef.addPen(m); // this.a3dRef.addPen(m);
this.setState({ isAreaSave: true });
console.log('drow--------'); console.log('drow--------');
this.setState({ this.setState({
isAreaSave: true,
selectArea: areaItem, selectArea: areaItem,
rightHeight: 10, rightHeight: 10,
showRightPanel: true showRightPanel: true
...@@ -617,9 +617,9 @@ class View3D extends Component { ...@@ -617,9 +617,9 @@ class View3D extends Component {
this.drowItem = areaItem; this.drowItem = areaItem;
this.addPen(areaItem.id); this.addPen(areaItem.id);
} }
addPen(areaKey) { addPen(areaKey) {
let params = { 'displayName': '进攻线路', 'thumb': '/a3dres/images/pathline/line-attack.png', 'descr': '', 'objParam': null, 'type': 'pen' }; let params = { 'displayName': '进攻线路', 'thumb': '/a3dres/images/pathline/line-attack.png', 'descr': '', 'objParam': null, 'type': 'pen' };
// console.log(this.state.selectArea)
const penProps = { const penProps = {
key: this.genPenId(), key: this.genPenId(),
color: 0x00ff00, color: 0x00ff00,
...@@ -629,44 +629,34 @@ class View3D extends Component { ...@@ -629,44 +629,34 @@ class View3D extends Component {
this.a3dRef.newPen(penProps); this.a3dRef.newPen(penProps);
this.hasCreatePen = true; this.hasCreatePen = true;
} }
/** 画笔 down 事件响应 */ /** 画笔 down 事件响应 */
handlePenDown = (event) => { handlePenDown = (event) => {
if (!this.isCanBeDraw()){ if (!this.isCanBeDraw()){
return; return;
} }
const me = this; const me = this;
const { routePathData } = me.state;
// 鼠标左键(右键),添加一个点 // 鼠标左键(右键),添加一个点
if (event.button === 0 || event.button === 2) { if (event.button === 0 || event.button === 2) {
me.a3dRef.stopPenDrag(event.clientX, event.clientY, me.penTargets, true); me.a3dRef.stopPenDrag(event.clientX, event.clientY, me.penTargets, true);
// 鼠标右键 绘制完毕
// 鼠标右键 绘制完毕,需要同步处理 reference 数据
if (event.button === 2){ if (event.button === 2){
// 保存 reference 数据 // 保存 reference 数据
const pen = me.a3dRef.currentPen; const pen = me.a3dRef.currentPen;
let penPoints = pen.getFmtPoints(); let penPoints = pen.getFmtPoints();
if (pen._drawing){ if (pen._drawing){
PubSub.publish(EVENTS_CONSTS.SKETCH_REFERENCE_CHANGE, {
type: 'routePath',
key: pen._uuidKey,
eid: pen.userData.eid,
value: {
...pen.userParams,
points: pen.getFmtPoints()
},
position: pen.position
});
me.a3dRef.changeDrawState(PEN_STATE.FINISHED); me.a3dRef.changeDrawState(PEN_STATE.FINISHED);
this.state.routePathData.push({ routePathData.push({
riskSourceId: this.drowItem.id, riskSourceId: this.drowItem.id,
routePath: JSON.stringify({ routePath: JSON.stringify({
routePath: penPoints, routePath: penPoints,
regionHeigth: 10 regionHeigth: 10
}) })
}); });
this.setState({ me.setState({
drawing: false, drawing: false,
routePathData: this.state.routePathData routePathData
}); });
} }
} }
...@@ -1556,11 +1546,13 @@ class View3D extends Component { ...@@ -1556,11 +1546,13 @@ class View3D extends Component {
return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.onRectCreated(e,area,index)} />; return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.onRectCreated(e,area,index)} />;
}); });
} }
handleOutExceptModel=()=>{ handleOutExceptModel=()=>{
this.clearMarkers(); this.clearMarkers();
this.executeOperate({ key: 'fitview' });//恢复正常视角 this.executeOperate({ key: 'fitview' });//恢复正常视角
this.props.editModelChange(false);//显示全景统计 this.props.editModelChange(false);//显示全景统计
this.enableCamera();//恢复相机 this.enableCamera();//恢复相机
this.lensLevel = LENS_LEVEL.ROOT;
this.setState({ this.setState({
treeData: [], treeData: [],
pageType: 'region',//区域 pageType: 'region',//区域
...@@ -1573,13 +1565,15 @@ class View3D extends Component { ...@@ -1573,13 +1565,15 @@ class View3D extends Component {
dragItem: '', dragItem: '',
selectArea: '', selectArea: '',
selectPoints: '', selectPoints: '',
showRightPanel: false showRightPanel: false,
routePathData: [],
isOutterView: true, //恢复marker显示
drawing: false
}); });
this.a3dRef.changeDrawState(PEN_STATE.CLEARED);//清除当前路径
} }
handleExceptModel =(type,areaId)=>{ handleExceptModel =(type,areaId)=>{
let { isPointSave,isAreaSave } = this.state; const { isPointSave,isAreaSave } = this.state;
if (type === 'into_except_model'){//进入耳朵模式 if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计 this.props.editModelChange(true);//隐藏全景统计
this.setState({ this.setState({
...@@ -1591,7 +1585,6 @@ class View3D extends Component { ...@@ -1591,7 +1585,6 @@ class View3D extends Component {
}); });
} else if (type === 'out_except_model'){ } else if (type === 'out_except_model'){
this.stagePilot.positionCtl.clearDrag(); this.stagePilot.positionCtl.clearDrag();
this.initModelDisplay();
if (isAreaSave){ if (isAreaSave){
this.setState({ promptData: this.setState({ promptData:
{ {
...@@ -1618,6 +1611,7 @@ class View3D extends Component { ...@@ -1618,6 +1611,7 @@ class View3D extends Component {
this.handleOutExceptModel(); this.handleOutExceptModel();
} }
} }
this.initModelDisplay();
} }
} }
...@@ -1722,7 +1716,8 @@ class View3D extends Component { ...@@ -1722,7 +1716,8 @@ class View3D extends Component {
treeDataList, treeDataList,
promptData, promptData,
pointType, pointType,
isOutterView isOutterView,
routePathData
} = this.state; } = this.state;
const { dimension, hiddenScreenSaver, editModelChange } = this.props; const { dimension, hiddenScreenSaver, editModelChange } = this.props;
const graphicProps = { const graphicProps = {
...@@ -1835,6 +1830,7 @@ class View3D extends Component { ...@@ -1835,6 +1830,7 @@ class View3D extends Component {
saveAreaData={this.saveAreaData} saveAreaData={this.saveAreaData}
selectItemChange={this.selectItemChange} selectItemChange={this.selectItemChange}
// stopDrowing={this.stopDrowing} // stopDrowing={this.stopDrowing}
routePathData={routePathData}
pageType={pageType} pageType={pageType}
treeDataList={treeDataList} treeDataList={treeDataList}
pointTypeArr={pointTypeArr} pointTypeArr={pointTypeArr}
......
...@@ -96,6 +96,12 @@ class AreaLeftTree extends Component { ...@@ -96,6 +96,12 @@ class AreaLeftTree extends Component {
}); });
this.props.selectItemChange(selectItem); this.props.selectItemChange(selectItem);
} }
checkAreaIsNoSave =(riskSourceId)=>{
const { routePathData = [] } = this.props;
return routePathData.some(e=>e.riskSourceId === riskSourceId);
}
renderTreeNodes = (data) => { renderTreeNodes = (data) => {
let { searchValue } = this.state; let { searchValue } = this.state;
if (data.length > 0) { if (data.length > 0) {
...@@ -142,7 +148,7 @@ class AreaLeftTree extends Component { ...@@ -142,7 +148,7 @@ class AreaLeftTree extends Component {
}} }}
/> />
} }
{item.isBind ? <img src={moduleEditIcon.bindedTip} alt="" /> : item.routePath ? <img src={moduleEditIcon.noSaveTip} alt="" /> : <img src={moduleEditIcon.noSaveTip} alt="" />} {item.isBind ? <img src={moduleEditIcon.bindedTip} alt="" /> : this.checkAreaIsNoSave(item.id) ? <img src={moduleEditIcon.noSaveTip} alt="" /> : <img src={moduleEditIcon.nobindTip} alt="" />}
</span> </span>
</span> </span>
} }
...@@ -158,6 +164,10 @@ class AreaLeftTree extends Component { ...@@ -158,6 +164,10 @@ class AreaLeftTree extends Component {
}); });
} }
}; };
render() { render() {
const { treeData } = this.state; const { treeData } = this.state;
return ( return (
...@@ -203,7 +213,8 @@ AreaLeftTree.propTypes = { ...@@ -203,7 +213,8 @@ AreaLeftTree.propTypes = {
deleteAreaBind: PropTypes.func, deleteAreaBind: PropTypes.func,
pageType: PropTypes.string, pageType: PropTypes.string,
startDrow: PropTypes.func, startDrow: PropTypes.func,
selectItemChange: PropTypes.func selectItemChange: PropTypes.func,
routePathData: PropTypes.array
}; };
export default AreaLeftTree; export default AreaLeftTree;
...@@ -37,6 +37,16 @@ export default class SafetyExecuteList extends Component { ...@@ -37,6 +37,16 @@ export default class SafetyExecuteList extends Component {
}); });
} }
onClickIcon = (e) => {
if (e.type !== 'warn'){
this.setState({
selectKey: e.key
});
this.safetyExecuteList(e.key);
}
}
safetyExecuteList = (type) => { safetyExecuteList = (type) => {
if (!type){ if (!type){
type = this.state.selectKey; type = this.state.selectKey;
...@@ -67,14 +77,6 @@ export default class SafetyExecuteList extends Component { ...@@ -67,14 +77,6 @@ export default class SafetyExecuteList extends Component {
}); });
} }
onClickIcon = (e) => {
if (e.type !== 'warn'){
this.setState({
selectKey: e.key
});
this.safetyExecuteList(e.key);
}
}
renderContent = (datas) => { renderContent = (datas) => {
return ( return (
...@@ -95,7 +97,7 @@ export default class SafetyExecuteList extends Component { ...@@ -95,7 +97,7 @@ export default class SafetyExecuteList extends Component {
datas.map((item, index) => { datas.map((item, index) => {
return ( return (
<div key={item.id} className="icon"> <div key={item.id} className="icon">
{ selectKey === item.key ? <img src={getIcon(item.icon)} onClick={()=>this.onClickIcon(item)} /> : <img src={getIcon(item.unIcon)} onClick={()=>this.onClickIcon(item)} />} { selectKey === item.key ? <img src={getIcon(item.icon)} alt='' onClick={()=>this.onClickIcon(item)} /> : <img src={getIcon(item.unIcon)} alt='' onClick={()=>this.onClickIcon(item)} />}
</div> </div>
); );
}) })
...@@ -112,36 +114,36 @@ export default class SafetyExecuteList extends Component { ...@@ -112,36 +114,36 @@ export default class SafetyExecuteList extends Component {
} }
return ( return (
isVisable ? isVisable ?
(<div className='safetyExecuteList'> <div className='safetyExecuteList'>
<img src={panoramicIcon.unfold} onClick={() => this.unfoldOnClick(false)}></img> <img className='safetyExecuteList-open' alt='' src={panoramicIcon.unfold} onClick={() => this.unfoldOnClick(false)} />
</div>) : </div> :
(<div className="safetyExecuteList"> <div className="safetyExecuteList">
<div className='up'> <div className='up'>
<div className='left'> <div className='left'>
<img src={panoramicIcon.safetyexecute}></img> <img src={panoramicIcon.safetyexecute} alt='' />
</div>
<div className='right'>
<div className='common-title'>
<span>消防安全执行</span>
</div>
<div className='content'>
<span className='date'>{dayNum}</span>
<span className='day'></span>
</div>
</div>
</div> </div>
<div className='right'> <div className='down'>
<div className='common-title'> <div className='title'>
<span>消防安全执行</span> {this.renderIcon(warnTypes)}
<span className='describe'>{selectValue}</span>
<img className='arrow' src={panoramicIcon.arrow_warn} alt='' onClick={() => this.unfoldOnClick(true)} />
<div className='bottom-line' />
</div> </div>
<div className='content'> <div className='content'>
<span className='date'>{dayNum}</span> {this.renderContent(alarmData)}
<span className='day'></span>
</div> </div>
</div> </div>
</div> </div>
<div className='down'>
<div className='title'>
{this.renderIcon(warnTypes)}
<span className='describe'>{selectValue}</span>
<img className='arrow' src={panoramicIcon.arrow_warn} onClick={() => this.unfoldOnClick(true)}></img>
<div className='bottom-line'></div>
</div>
<div className='content'>
{this.renderContent(alarmData)}
</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