Commit e2c7e38b authored by suhuiguang's avatar suhuiguang

1.修改编辑模式退出后区域显示bug

2.页面样式
parent e94546a5
......@@ -27,13 +27,15 @@
// border-image:linear-gradient(90deg,rgba(50,217,239,0) 2%,rgba(50,217,239,0.49) 29%,rgba(50,217,239,0.73) 73%,rgba(50,217,239,0) 100%);
}
}
.quipBtn {
width: 169px;
height: 44px;
background: url('/mods/components/3dviewConvertor/assets/convertor/moduleEdit/quip.png') no-repeat 100% 100%;
margin-top: 10px;
margin-left: 70px;
}
.quipBtn {
width: 169px;
height: 44px;
margin-top: 10px;
margin-left: 70px;
cursor: pointer;
background: url('/mods/components/3dviewConvertor/assets/convertor/moduleEdit/quip.png') no-repeat 100% 100%;
}
}
.bottomBox {
position: absolute;
......
......@@ -3,35 +3,41 @@
// height: 100%;
// width: 100%;
.statistical-left {
position: absolute;
height: 100%;
width: 350px;
float: left;
z-index: 1;
color: white;
display: flex;
flex-direction: column;
.statistical-left {
position: absolute;
height: 100%;
width: 350px;
float: left;
z-index: 1;
color: white;
display: flex;
flex-direction: column;
.equipStatusList {
padding-left: 97px;
padding-top: 10px;
flex-grow: 1;
overflow-y: auto;
.title-child{
width: 100%;
height: 55px;
//margin-top: 5px;
}
.title-date{
height: 20px;
font-size: 13px;
}
.title-text{
font-size: 15px;
}
}
.equipStatusList{
padding-left: 97px;
padding-top: 10px;
flex-grow: 1;
overflow-y: auto;
.title-child{
width: 100%;
height: 55px;
//margin-top: 5px;
}
.title-date{
height: 20px;
font-size: 13px;
}
.title-text{
font-size: 15px;
}
}
::-webkit-scrollbar {
/* 隐藏滚轮 */
display: none;
}
.safetyExecuteList{
flex: 2;
......
......@@ -729,56 +729,55 @@ class View3D extends Component {
}
//选中区域变化
selectItemChange = (selectArea) => {
this.state.selectArea = selectArea
this.setState({
selectArea: selectArea,
selectArea,
showRightPanel: true
})
});
}
//选中点变化
selectPointChange = (selectPoints) => {
this.setState({
selectPoints: selectPoints,
selectPoints,
showRightPanel: true
})
});
}
getAreas = (treeData) => {
let { dragItem } = this.state;
// console.log(treeData)
// let areas = [];
if (treeData&&treeData.length>0) {
if (treeData && treeData.length > 0) {
treeData.map((item) => {
if (item.isRegion && item.isBind) {
if (item.children&&item.children.length > 0) {
if (item.children && item.children.length > 0) {
if (dragItem) {
if ( dragItem.parentId && dragItem.parentId == item.id) {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>)
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} else {
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />)
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
}
{this.getAreas(item.children)}
} else {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />)
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
{this.getAreas(item.children)}
}
}else {
} else {
if (dragItem) {
if ( dragItem&&dragItem.parentId && dragItem.parentId == item.id) {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>)
if ( dragItem && dragItem.parentId && dragItem.parentId === item.id) {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} else {
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />)
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
}
} else {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>)
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
}
}
} else {
if (item.children&&item.children.length > 0) {
{this.getAreas(item.children)}
if (item.children && item.children.length > 0) {
this.getAreas(item.children);
}
}
});
......@@ -789,29 +788,28 @@ class View3D extends Component {
this.getAreas(this.state.treeData);
return this.areas;
}
onRegionCreated = (polygonRegion,item) => {
console.log(polygonRegion)
// console.log(polygonRegion.pointInPolygon)
this.polygonRegion[item.id] = polygonRegion;
console.log(this.polygonRegion)
}
//保存区域绑定
saveAreaData = () => {
let { treeData, routePathData, pageType } = this.state;
let routePathParams = [];
console.log(routePathData)
let { routePathData } = this.state;
saveAreaDataAction(routePathData).then(d => {
message.success('保存成功!');
getAreaTreeAction().then(data => {
console.log(data);
this.setState({
treeData:data || []
})
treeData: data || []
});
});
}, eer => {
message.error('保存失败!');
});
}
//保存点绑定
savePointData = () => {
let { markers } = this.state;
......@@ -823,14 +821,12 @@ class View3D extends Component {
pointId: item[i].id,
pointType: item[i].type,
position3d: `${item[i].position.x},${item[i].position.y},${item[i].position.z}`
})
});
}
}
savePointListAction(paramsArr).then(data => {
console.log(data);
})
});
}
// 删除点绑定
deletePointBind = () => {
......@@ -841,28 +837,28 @@ class View3D extends Component {
pointId: selectPoints.id,
pointType: selectPoints.type,
position3d: `${selectPoints.position.x},${selectPoints.position.y},${selectPoints.position.z}`
})
});
savePointListAction(pointParams).then(data => {
console.log(data);
})
});
}
}
//删除区域
deleteAreaBind = () => {
let { selectArea,routePathData } = this.state;
let { selectArea } = this.state;
if (selectArea) {
let areaParams = [];
areaParams.push({
riskSourceId: selectArea.id,
riskSourceId: selectArea.id,
routePath: ''
})
});
saveAreaDataAction(areaParams).then(d => {
message.success('删除成功!');
getAreaTreeAction().then(data => {
console.log(data);
this.setState({
treeData:data || []
})
treeData: data || []
});
});
}, eer => {
message.error('删除失败!');
......@@ -1000,6 +996,7 @@ class View3D extends Component {
this.getPointList();
}
}
simpleTipOk = () => {
this.setState({
simpleTipVisible: false
......@@ -1388,7 +1385,7 @@ class View3D extends Component {
{editFlag && pageType === 'region' ? '' : <PointsPool markers={markers} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} />}
{fireTruckRoute && <FatLine {...lineData.fatLineConf} linePath={JSON.parse(fireTruckRoute)} visible={showFireTruckRoute} />}
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{this.renderAreas()}
{editFlag && this.renderAreas()}
{this.renderPolygonRegion(exceptionAreas)}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />}
</A3DDesigner>
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { utils, Store } from 'amos-tool';
import { utils } from 'amos-tool';
import { Markers } from 'amos-3d/lib/designer';
import { connect3D } from 'amos-3d/lib/designer';
import { BaseObjHelper } from 'base-r3d/lib/factory';
import { safetyIndexIconMapper } from './../../consts/imgStatic';
const lsTool = Store.lsTool;
const getIcon = (exceptionType) => {
return safetyIndexIconMapper[exceptionType];
};
......
......@@ -138,9 +138,9 @@ export default class SafetyIndex extends Component {
</span>
</div>
{
[{ name: '风险值上升',num: safetyIndexData.riskExceptionNum },
{ name: '巡检不合格',num: safetyIndexData.checkExceptionNum },
{ name: '火灾报警',num: safetyIndexData.fireExceptionNum }].map((item,index)=>
[{ name: '风险值异常',num: safetyIndexData.riskExceptionNum },
{ name: '巡检异常',num: safetyIndexData.checkExceptionNum },
{ name: '设备故障',num: safetyIndexData.fireExceptionNum }].map((item,index)=>
<div key={item.name} className="content-item">{item.name} {item.num}</div>
)
}
......
......@@ -2,7 +2,7 @@
* 告警控制
*/
export const warnController = [
{ key: 'fire', icon: 'model_fire', type: 'fire', label: '火灾告警' },
{ key: 'fire', icon: 'model_fire', type: 'fire', label: '设备故障' },
{ key: 'risk', icon: 'model_risk', type: 'risk', label: '风险异常' },
{ key: 'check', icon: 'model_patrol', type: 'check', label: '巡检异常' }
];
......
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