Commit e2c7e38b authored by suhuiguang's avatar suhuiguang

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

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