Commit 23356c33 authored by 张博's avatar 张博

解决冲突

parents 8d3a5c84 2ec8b905
...@@ -238,12 +238,17 @@ export const marker3DIoncMapper = { ...@@ -238,12 +238,17 @@ export const marker3DIoncMapper = {
export const safetyIndexIconMapper = { export const safetyIndexIconMapper = {
allEror: '/mods/components/3dviewConvertor/threeres/markers/exception_all@2x.png', allEror: '/mods/components/3dviewConvertor/threeres/markers/exception_all.png',
faultEror: '/mods/components/3dviewConvertor/threeres/markers/exception_fault.png', faultEror: '/mods/components/3dviewConvertor/threeres/markers/exception_fault.png',
riskEror: '/mods/components/3dviewConvertor/threeres/markers/exception_risk.png', riskEror: '/mods/components/3dviewConvertor/threeres/markers/exception_risk.png',
transparent_rpn: require('./../threeres/markers/transparent_rpn.png') transparent_rpn: require('./../threeres/markers/transparent_rpn.png')
}; };
export const markerTitleBgMapper = { export const markerTitleBgMapper = {
base: require('../assets/convertor/3dview/markers/markerTitle.png') base: '/mods/components/3dviewConvertor/assets/convertor/3dview/markers/markerTitle.png'
}; };
\ No newline at end of file
export const equipStatusIconMapper = {
equip_false: '/mods/components/3dviewConvertor/assets/convertor/3dview/markers/pa-0.png',
equip_true: '/mods/components/3dviewConvertor/assets/convertor/3dview/markers/pa-1.png'
};
...@@ -62,6 +62,7 @@ export const FscSerUrl = { ...@@ -62,6 +62,7 @@ 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}') //查询区域下点
}; };
export const FasSerUrl = { export const FasSerUrl = {
......
...@@ -66,3 +66,12 @@ export const exceptionRegionListAction = ()=>{ ...@@ -66,3 +66,12 @@ export const exceptionRegionListAction = ()=>{
return commonGet(FscSerUrl.exceptionRegionListUrl); return commonGet(FscSerUrl.exceptionRegionListUrl);
}; };
/**
* 区域下点查询
* @param {number} regionId
*/
export const getPointsByRegionIdAction = (regionId) =>{
const url = formatUrl(FscSerUrl.listPointsByRegionIdUrl, { regionId });
return commonGet(url);
};
...@@ -115,7 +115,6 @@ class PointsPool extends Component { ...@@ -115,7 +115,6 @@ class PointsPool extends Component {
isEditMode={this.props.isEditMode} isEditMode={this.props.isEditMode}
addMarker={this.addMarker} addMarker={this.addMarker}
stagePilot={this.props.stagePilot} stagePilot={this.props.stagePilot}
editFlag={this.props.editFlag}
selectPoints={this.props.selectPoints} selectPoints={this.props.selectPoints}
/> />
{/* <PatrolPoint {/* <PatrolPoint
......
...@@ -2,11 +2,10 @@ import React, { Component } from 'react'; ...@@ -2,11 +2,10 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { utils,UUID, deepCopy } from 'amos-tool'; import { utils,UUID, deepCopy } from 'amos-tool';
import { PubSub } from 'ray-eventpool'; import { PubSub } from 'ray-eventpool';
import { Connect as UIConnect, Modal,message,AmosAlert, Toast } from 'amos-framework'; import { Connect as UIConnect, message, AmosAlert } from 'amos-framework';
import { FatLine } from 'amos-3d/lib/advanced'; import { FatLine } from 'amos-3d/lib/advanced';
import A3DDesigner, { Connect, FireObject,DESIGNER_CONSTS,PolygonRegion } from 'amos-3d/lib/designer'; import A3DDesigner, { Connect, FireObject,DESIGNER_CONSTS,PolygonRegion } from 'amos-3d/lib/designer';
import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent'; import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent';
import { transitionHelper } from 'amos-3d/lib/helpers';
import * as endConf from 'amos-processor/lib/config/endconf'; import * as endConf from 'amos-processor/lib/config/endconf';
import { LensJumpFactory } from 'base-r3d/lib/factory'; import { LensJumpFactory } from 'base-r3d/lib/factory';
import { CONSTS } from '../consts/storageConsts'; import { CONSTS } from '../consts/storageConsts';
...@@ -39,7 +38,7 @@ import RightEditPointPanel from './moduleEditComponent/RightEditPointPanel'; ...@@ -39,7 +38,7 @@ import RightEditPointPanel from './moduleEditComponent/RightEditPointPanel';
import RightEditRegionPanel from './moduleEditComponent/RightEditRegionPanel'; import RightEditRegionPanel from './moduleEditComponent/RightEditRegionPanel';
import { EVENTS_CONSTS } from '../consts/EventConsts'; import { EVENTS_CONSTS } from '../consts/EventConsts';
import ExceptionArea from './exceptionArea/ExceptionArea'; import ExceptionArea from './exceptionArea/ExceptionArea';
import { exceptionRegionListAction } from '../services/panoramicService'; import { exceptionRegionListAction,getPointsByRegionIdAction } from '../services/panoramicService';
const AmosConfig = endConf.AmosConfig; const AmosConfig = endConf.AmosConfig;
...@@ -112,7 +111,7 @@ class View3D extends Component { ...@@ -112,7 +111,7 @@ class View3D extends Component {
routePathData: [], //区域线位置 routePathData: [], //区域线位置
pageType: 'region', //编辑类型 pageType: 'region', //编辑类型
pointType: '', //筛选框点类型 pointType: '', //筛选框点类型
editFlag: false,//编辑模式 isEditMode: false,//编辑模式
showRightPanel: false, //是否显示右侧详情 showRightPanel: false, //是否显示右侧详情
dragItem: '', //拖动的节点, dragItem: '', //拖动的节点,
exceptionAreas: [], //异常区域 exceptionAreas: [], //异常区域
...@@ -197,7 +196,7 @@ class View3D extends Component { ...@@ -197,7 +196,7 @@ class View3D extends Component {
this.setState( this.setState(
{ {
planStarted: true, planStarted: true,
editFlag: false isEditMode: false
}, },
() => { () => {
this.props.trigger(eventTopics.plan_start, { this.props.trigger(eventTopics.plan_start, {
...@@ -285,8 +284,8 @@ class View3D extends Component { ...@@ -285,8 +284,8 @@ 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);
this.handleExceptModel('out_except_model'); this.handleExceptModel('out_except_model');
assembleTroubleView(this, data, this.state.markers);
break; break;
case 'base3d.fromws.mapArea_action1-2': //镜头切换(旋转+推进) case 'base3d.fromws.mapArea_action1-2': //镜头切换(旋转+推进)
changeGoodView(this, data); changeGoodView(this, data);
...@@ -500,7 +499,7 @@ class View3D extends Component { ...@@ -500,7 +499,7 @@ class View3D extends Component {
const me = this; const me = this;
if (!obj.isForceParent) { if (!obj.isForceParent) {
obj.on('click', evt => { obj.on('click', evt => {
if (this.state.editFlag == false) { if (this.state.isEditMode == false) {
console.log('obj click:', evt); console.log('obj click:', evt);
// this.focusPosition(evt.pickedPosition); // this.focusPosition(evt.pickedPosition);
me.outlineFactory.toggleOutline(evt.object); me.outlineFactory.toggleOutline(evt.object);
...@@ -547,11 +546,14 @@ class View3D extends Component { ...@@ -547,11 +546,14 @@ class View3D extends Component {
} }
} }
}; };
getPointList = () => { getPointList = (pointType) => {
const { markers} = this.state let { markers } = this.state
this.clearMarkers();
getPointListAction().then(data => { getPointListAction().then(data => {
for (let i = 0; i < data.length;i++){ for (let i = 0; i < data.length;i++){
markers[data[i].type].push(data[i]) if(pointType && data[i].type == pointType){
markers[pointType].push(data[i]);
}
} }
this.setState({markers}) this.setState({markers})
}) })
...@@ -849,6 +851,10 @@ class View3D extends Component { ...@@ -849,6 +851,10 @@ class View3D extends Component {
message.error('保存失败!'); message.error('保存失败!');
}); });
} }
changeRoutePath = ( routePathNode ) => {
this.state.routePathData.push(routePathNode);
}
//保存区域绑定 //保存区域绑定
saveAreaData = () => { saveAreaData = () => {
let { routePathData } = this.state; let { routePathData } = this.state;
...@@ -888,16 +894,20 @@ class View3D extends Component { ...@@ -888,16 +894,20 @@ class View3D extends Component {
}); });
} }
} }
savePointListAction(paramsArr).then(data => { savePointListAction(paramsArr).then(
message.success('保存成功!'); data => {
getPointTreeAction(pointType).then(data => { getPointTreeAction(pointType).then(
this.setState({ data => {
treeData: data || [], this.setState({
pageType: 'point', treeData: data || [],
showRightPanel: false pageType: 'point',
}); showRightPanel: false
}); });
}) }
);
message.success('保存成功');
},error => message.error('保存失败')
);
} }
...@@ -931,9 +941,9 @@ class View3D extends Component { ...@@ -931,9 +941,9 @@ class View3D extends Component {
fireDetection:[] fireDetection:[]
} }
for (let i = 0; i < data.length;i++){ for (let i = 0; i < data.length;i++){
newMarkers[data[i].type].push(data[i]) newMarkers[data[i].type].push(data[i]);
} }
this.setState({markers:newMarkers}) this.setState( {markers: newMarkers });
}) })
this.setState({ this.setState({
...@@ -945,32 +955,28 @@ class View3D extends Component { ...@@ -945,32 +955,28 @@ class View3D extends Component {
}) })
} }
} }
toastWarningInfo =(content)=>{
Toast.warning({
title:'警告',
content,
placement:'topMiddle',
})
}
//删除区域 //删除区域
deleteAreaBind = () => { deleteAreaBind = () => {
let { selectArea } = this.state; let { selectArea,treeData } = this.state;
if (selectArea) { if (selectArea) {
let areaParams = []; getPointsByRegionIdAction(selectArea.id).then(d => {
areaParams.push({ if (d && d.length == 0){
riskSourceId: selectArea.id, this.state.routePathData.push({
routePath: '' riskSourceId: selectArea.id,
}); routePath: ''
saveAreaDataAction(areaParams).then(d => { });
message.success('删除成功!'); var tree = new Object();
getAreaTreeAction().then(data => { tree.children = treeData;
this.getAreas(data); this.removeTreeDataRoutePathByChildId(selectArea.id,tree);
this.getAreas(tree.children);
this.setState({ this.setState({
treeData: data || [] routePathData: this.state.routePathData,
treeData: tree.children
}); });
}); } else {
}, eer => { message.danger('请先清除点的绑定再进行删除!');
message.error('删除失败!'); }
}); });
} }
} }
...@@ -990,6 +996,29 @@ class View3D extends Component { ...@@ -990,6 +996,29 @@ class View3D extends Component {
} }
this.setState({treeDataList}) this.setState({treeDataList})
} }
removeTreeDataRoutePathByChildId = ( areaId, obj ) => {
let oldSize = obj.children.length;
let flag = false;
if(oldSize > 0){
obj.children && obj.children.some( t => {
if(t.id == areaId){
t.routePath = '';
t.isBind = false;
flag = true
}
});
if(flag){//移除
return;
}else{
obj.children && obj.children.some(t => {
this.removeTreeDataRoutePathByChildId( areaId, t );
});
}
}else{
return;
}
}
/** /**
* 切换区域和点页面 * 切换区域和点页面
...@@ -1006,6 +1035,7 @@ class View3D extends Component { ...@@ -1006,6 +1035,7 @@ class View3D extends Component {
showRightPanel: false showRightPanel: false
}); });
}); });
this.disabledCamera();
} else { } else {
getPointTreeAction(pointTypeArr[0].code || '').then(data => { getPointTreeAction(pointTypeArr[0].code || '').then(data => {
this.generateList(data) this.generateList(data)
...@@ -1016,17 +1046,19 @@ class View3D extends Component { ...@@ -1016,17 +1046,19 @@ class View3D extends Component {
showRightPanel: false showRightPanel: false
}); });
}); });
this.enableCamera();
} }
} }
pointTypeChange = (pointType) => { pointTypeChange = (pointType) => {
let {isPointSave} =this.state let { isPointSave } = this.state;
if(!isPointSave){ if (!isPointSave){
this.showConfirm() this.showConfirm();
} }
this.setState({ this.setState({
pointType, pointType,
treeData:[] treeData: []
}); });
this.getPointList(pointType);
getPointTreeAction(pointType).then(data => { getPointTreeAction(pointType).then(data => {
this.setState({ this.setState({
pointType, pointType,
...@@ -1037,10 +1069,10 @@ class View3D extends Component { ...@@ -1037,10 +1069,10 @@ class View3D extends Component {
showConfirm = () => { showConfirm = () => {
AmosAlert.confirm('提示', '有未保存数据,是否保存?', { AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
callback: (flag) => { callback: (flag) => {
if(flag){ if (flag){
this.savePointData() this.savePointData();
} else { } else {
this.setState({isPointSave:true}) this.setState({ isPointSave: true });
} }
} }
}); });
...@@ -1063,13 +1095,12 @@ class View3D extends Component { ...@@ -1063,13 +1095,12 @@ class View3D extends Component {
} }
drop = (event) => { drop = (event) => {
const { dragItem,markers} = this.state;
event.preventDefault(); event.preventDefault();
this.setState({isPointSave:false}) this.setState({ isPointSave: false });
let { dragItem,markers } = this.state;
if (dragItem) { if (dragItem) {
if (dragItem.isBind) { if (dragItem.isBind) {
this.toastWarningInfo('只能放置未绑定的标记点') message.danger('只能放置未绑定的标记点');
return false; return false;
} }
...@@ -1083,7 +1114,7 @@ class View3D extends Component { ...@@ -1083,7 +1114,7 @@ class View3D extends Component {
console.log(isInside); console.log(isInside);
if (dragItem) { if (dragItem) {
if (isInside === false) { if (isInside === false) {
this.toastWarningInfo('只能放置在当前区域') message.danger('只能放置在当前区域');
return false; return false;
} }
let uid = UUID.uuidFast(); let uid = UUID.uuidFast();
...@@ -1107,19 +1138,19 @@ class View3D extends Component { ...@@ -1107,19 +1138,19 @@ class View3D extends Component {
} }
quitEditMode = () => { quitEditMode = () => {
this.setState({ this.setState({
editFlag: false isEditMode: false
}); });
this.props.editModelChange(false); this.props.editModelChange(false);
} }
editButtonClick = () => { editButtonClick = () => {
let { editFlag } = this.state; let { isEditMode } = this.state;
if (editFlag === true) { if (isEditMode === true) {
return false; return false;
} }
editFlag = true; isEditMode = true;
this.setState({ editFlag }); this.setState({ isEditMode });
if (editFlag === true) { if (isEditMode === true) {
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
this.generateList(data) this.generateList(data)
this.setState({ this.setState({
...@@ -1132,8 +1163,8 @@ class View3D extends Component { ...@@ -1132,8 +1163,8 @@ class View3D extends Component {
pointTypeArr: data || [], pointTypeArr: data || [],
pointType: data[0] ? data[0].code : '' pointType: data[0] ? data[0].code : ''
}); });
this.getPointList(data[0].code);
}); });
this.getPointList();
} }
} }
...@@ -1298,10 +1329,11 @@ class View3D extends Component { ...@@ -1298,10 +1329,11 @@ class View3D extends Component {
onActionItemClick = (actionType, label, showLabel) => { onActionItemClick = (actionType, label, showLabel) => {
const { pageType } = this.state;
this.clearMarkers(); this.clearMarkers();
this.props.editModelChange(false); this.props.editModelChange(false);
this.setState({ this.setState({
editFlag: false isEditMode: false
}); });
if (showLabel){//进入各个模式名称设置 if (showLabel){//进入各个模式名称设置
this.setHeaderName(label); this.setHeaderName(label);
...@@ -1310,7 +1342,7 @@ class View3D extends Component { ...@@ -1310,7 +1342,7 @@ class View3D extends Component {
this.asyncLoadImpEquipment(actionType); this.asyncLoadImpEquipment(actionType);
this.props.editModelChange(true); this.props.editModelChange(true);
this.setState({ this.setState({
editFlag: false, isEditMode: false,
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
startLoadExceptionArea: false,//隐藏marker startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵 sideControlShow: false //隐藏耳朵
...@@ -1318,6 +1350,10 @@ class View3D extends Component { ...@@ -1318,6 +1350,10 @@ class View3D extends Component {
} else if (actionType === 'editMode'){ } else if (actionType === 'editMode'){
this.editButtonClick(); this.editButtonClick();
this.props.editModelChange(true); this.props.editModelChange(true);
if (pageType === 'region'){
this.disabledCamera();
}
this.setState({ this.setState({
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
startLoadExceptionArea: false,//隐藏marker startLoadExceptionArea: false,//隐藏marker
...@@ -1326,7 +1362,7 @@ class View3D extends Component { ...@@ -1326,7 +1362,7 @@ class View3D extends Component {
} else { } else {
this.props.editModelChange(false); this.props.editModelChange(false);
this.setState({ this.setState({
editFlag: false isEditMode: false
}); });
} }
} }
...@@ -1346,6 +1382,18 @@ class View3D extends Component { ...@@ -1346,6 +1382,18 @@ class View3D extends Component {
} }
disabledCamera =()=>{
this.stagePilot.cameraFactory.orbitControl.maxPolarAngle = 0;//不能旋转
this.stagePilot.cameraFactory.orbitControl.minPolarAngle = 0;//不能旋转
this.cameraFactory.fitView(desigerHelperConfig.verticalCameraEffect);//视角调整为平面视角
}
enableCamera =()=>{
this.stagePilot.cameraFactory.orbitControl.maxPolarAngle = desigerConf.cameraOptions.builtInOrbit.maxPolarAngle;//恢复正常视角
this.stagePilot.cameraFactory.orbitControl.minPolarAngle = desigerConf.cameraOptions.builtInOrbit.minPolarAngle;//恢复正常视角
this.executeOperate({ key: 'fitview' });//初始视角
}
onRectCreated = (polygonRegion,area,index) => { onRectCreated = (polygonRegion,area,index) => {
polygonRegion.visible = false; polygonRegion.visible = false;
const { regionHeigth = 10 } = area.routePath; const { regionHeigth = 10 } = area.routePath;
...@@ -1391,7 +1439,7 @@ class View3D extends Component { ...@@ -1391,7 +1439,7 @@ class View3D extends Component {
} }
handleExceptModel =(type,areaId)=>{ handleExceptModel =(type,areaId)=>{
let {isPointSave}=this.state let { isPointSave } = this.state;
this.clearMarkers(); this.clearMarkers();
if (type === 'into_except_model'){//进入耳朵模式 if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计 this.props.editModelChange(true);//隐藏全景统计
...@@ -1403,47 +1451,52 @@ class View3D extends Component { ...@@ -1403,47 +1451,52 @@ class View3D extends Component {
errorAreaId: areaId errorAreaId: areaId
}); });
} else if (type === 'out_except_model'){ } else if (type === 'out_except_model'){
if(!isPointSave){ if (!isPointSave){
AmosAlert.confirm('提示', '有未保存数据,是否保存?', { AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
callback: (flag) => { callback: (flag) => {
if(flag){ if (flag){
this.savePointData() this.savePointData();
this.props.editModelChange(false);//显示全景统计 this.executeOperate({ key: 'fitview' });//恢复正常视角
this.setState({ this.props.editModelChange(false);//显示全景统计
treeData:[], this.setState({
sideControlShow: false, //隐藏耳朵 treeData: [],
isShowActionBar: true, //显示工具栏 pageType: 'region',//区域
startLoadExceptionArea: true, //显示marker, sideControlShow: false, //隐藏耳朵
headerName: '', //设置头名称 isShowActionBar: true, //显示工具栏
editFlag: false, //推出编辑模式 startLoadExceptionArea: true, //显示marker,
errorAreaId: '' headerName: '', //设置头名称
}); isEditMode: false, //推出编辑模式
errorAreaId: ''
});
} else { } else {
this.props.editModelChange(false);//显示全景统计 this.props.editModelChange(false);//显示全景统计
this.setState({ this.setState({
isPointSave:true, isPointSave: true,
treeData:[], treeData: [],
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵 sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏 isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker, startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称 headerName: '', //设置头名称
editFlag: false, //推出编辑模式 isEditMode: false, //推出编辑模式
errorAreaId: '' errorAreaId: ''
}); });
} }
} }
}); });
}else{ } else {
this.props.editModelChange(false);//显示全景统计 this.props.editModelChange(false);//显示全景统计
this.enableCamera();//恢复相机
this.setState({ this.setState({
treeData:[], treeData: [],
sideControlShow: false, //隐藏耳朵 pageType: 'region',//区域
isShowActionBar: true, //显示工具栏 sideControlShow: false, //隐藏耳朵
startLoadExceptionArea: true, //显示marker, isShowActionBar: true, //显示工具栏
headerName: '', //设置头名称 startLoadExceptionArea: true, //显示marker,
editFlag: false, //推出编辑模式 headerName: '', //设置头名称
errorAreaId: '' isEditMode: false, //推出编辑模式
}); errorAreaId: ''
});
} }
} }
...@@ -1490,7 +1543,7 @@ class View3D extends Component { ...@@ -1490,7 +1543,7 @@ class View3D extends Component {
planStarted, planStarted,
alarmStarted, alarmStarted,
fireEquipmentPosition, fireEquipmentPosition,
drawing, pageType, pointTypeArr, editFlag, showRightPanel, selectPoints, selectArea, drawing, pageType, pointTypeArr, isEditMode, showRightPanel, selectPoints, selectArea,
exceptionAreas, exceptionMarkers,startLoadExceptionArea, exceptionAreas, exceptionMarkers,startLoadExceptionArea,
sideControlShow, sideControlShow,
isShowActionBar, isShowActionBar,
...@@ -1583,16 +1636,16 @@ class View3D extends Component { ...@@ -1583,16 +1636,16 @@ class View3D extends Component {
onCreated={this.onGraphCreated} onCreated={this.onGraphCreated}
> >
{startAsyncLoad && <WorkerObjContent objs={asyncModels} onWorkerMessage={this.onWorkerLoading} enableLoading afterInit={this.onAfterWorkerInit} />} {startAsyncLoad && <WorkerObjContent objs={asyncModels} onWorkerMessage={this.onWorkerLoading} enableLoading afterInit={this.onAfterWorkerInit} />}
{editFlag && pageType === 'region' ? '' : {isEditMode && pageType === 'region' ? '' :
<PointsPool markers={markers} editFlag={editFlag} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} addMarker={this.addMarker}/>} <PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker}/>}
{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} />
{editFlag && this.renderAreas()} {isEditMode && this.renderAreas()}
{this.renderPolygonRegion(exceptionAreas)} {this.renderPolygonRegion(exceptionAreas)}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />} {startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />}
</A3DDesigner> </A3DDesigner>
</div> </div>
{ editFlag && { isEditMode &&
<div> <div>
{ {
pageType === 'region' ? pageType === 'region' ?
...@@ -1629,7 +1682,7 @@ class View3D extends Component { ...@@ -1629,7 +1682,7 @@ class View3D extends Component {
</div> </div>
<div className='rightBox'> <div className='rightBox'>
{ {
showRightPanel && pageType === 'region' ? <RightEditRegionPanel detailData={selectArea} rightHeight={rightHeight} closeRightPanel={()=>this.setState({showRightPanel:false})} saveRoutePath={this.saveRoutePath}/> : '' showRightPanel && pageType === 'region' ? <RightEditRegionPanel detailData={selectArea} rightHeight={rightHeight} closeRightPanel={()=>this.setState({showRightPanel:false})} changeRoutePath={this.changeRoutePath} routePathData={this.state.routePathData}/> : ''
} }
{ {
showRightPanel && pageType === 'point' ? <RightEditPointPanel detailData={selectPoints} positionxyz={positionxyz} closeRightPanel={()=>this.setState({showRightPanel:false})}/> : '' showRightPanel && pageType === 'point' ? <RightEditPointPanel detailData={selectPoints} positionxyz={positionxyz} closeRightPanel={()=>this.setState({showRightPanel:false})}/> : ''
......
...@@ -362,6 +362,10 @@ export const desigerHelperConfig = { ...@@ -362,6 +362,10 @@ export const desigerHelperConfig = {
}, },
objAnchor: { objAnchor: {
position: [0, 5, 0] position: [0, 5, 0]
},
verticalCameraEffect: {
position: [2.3815615940156256, 419.57425506421896, 11.965199740306224],
target: [2.408441971875859, 1.3271790975878637, 3.918674823963386]
} }
}; };
......
...@@ -52,9 +52,9 @@ class ExceptionArea extends Component { ...@@ -52,9 +52,9 @@ class ExceptionArea extends Component {
obj.baseObjHelper.titleConfig = { obj.baseObjHelper.titleConfig = {
// 顶牌平面参数 // 顶牌平面参数
planeOptions: { planeOptions: {
width: 40, width: 20,
height: 40, height: 20,
position: [0,4,0], position: [0,2,0],
doubleSide: true doubleSide: true
}, },
canvasOptions: { canvasOptions: {
......
...@@ -62,14 +62,14 @@ class PointLeftTree extends Component { ...@@ -62,14 +62,14 @@ class PointLeftTree extends Component {
this.setState({ this.setState({
treeData, treeData,
treeDataList, treeDataList,
pointTypeArr, //pointTypeArr,
pointType: pointTypeArr[0]?pointTypeArr[0].code:'' //pointType: pointTypeArr[0]?pointTypeArr[0].code:''
}) })
} }
onSelectChange = (value, item) =>{ onSelectChange = (value, item) =>{
console.log(value, item); console.log(value, item);
this.state.pointType = value; this.setState({pointType:value})
this.props.pointTypeChange(value); this.props.pointTypeChange(value);
} }
onSearchChange = e => { onSearchChange = e => {
...@@ -190,14 +190,15 @@ class PointLeftTree extends Component { ...@@ -190,14 +190,15 @@ class PointLeftTree extends Component {
<div className="leftTree"> <div className="leftTree">
<div className='leftContainer'> <div className='leftContainer'>
<div className='topForm'> <div className='topForm'>
{(pointType!='') && {(pointType!='') &&
<Select onChange={this.onSelectChange} defaultValue={pointType} className='leftSelect'> <Select onChange={this.onSelectChange} defaultValue={pointType} value={pointType} className='leftSelect'>
{ {
pointTypeArr.map(item => { pointTypeArr.map(item => {
return (<Option value={item.code} >{item.name}</Option>) return (<Option value={item.code} >{item.name}</Option>)
}) })
} }
</Select>} </Select>
}
<Search className='leftSearch' icon="search" onChange={this.onSearchChange} onIconClick={this.onSearchChange} /> <Search className='leftSearch' icon="search" onChange={this.onSearchChange} onIconClick={this.onSearchChange} />
</div> </div>
......
...@@ -15,43 +15,50 @@ const RadioGroup = Radio.Group; ...@@ -15,43 +15,50 @@ const RadioGroup = Radio.Group;
class RightEditRegionPanel extends Component { class RightEditRegionPanel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
form: { form: {},
rules: {},
}, treeDetailData:[],
rules:{}, detailData: {},
treeDetailData:[] heightInput: 0
}; };
} }
componentDidMount() { componentDidMount() {
console.log(JSON.stringify(this.props.detailData)) console.log(JSON.stringify(this.props.detailData))
// getAreaTreeDetailAction().then(data => { const { detailData,routePathData } = this.props;
// console.log(data); this.mergeDetailData(detailData,routePathData);
// this.setState({
// treeDetailData:data || []
// })
// this.props.getAreaData(data || [])
// })
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(nextProps) console.log(nextProps)
let {treeData,pointTypeArr} = nextProps; // if(this.props.detailData != nextProps.detailData || this.props.routePathData != nextProps.routePathData){
// this.setState({ let { detailData,routePathData } = nextProps;
this.mergeDetailData(detailData,routePathData);
// }
}
// }) mergeDetailData = (detailData,routePathData) => {
let { heightInput } = this.state;
const { rightHeight } = this.props;
routePathData && routePathData.forEach(r => {
if(r.riskSourceId === detailData.id){
detailData.routePath = r.routePath;
}
});
heightInput = detailData && detailData.routePath && detailData.routePath != '' && JSON.parse(detailData.routePath).regionHeigth || rightHeight;
this.setState({ detailData, heightInput });
} }
onChange = (key, e) => { onChange = (key, e) => {
const value = e.target.value; const value = e.target.value;
const newForm = Object.assign({}, this.state.form, { [key]: value }); const newForm = Object.assign({}, this.state.form, { [key]: value });
this.setState({ this.setState({
form: newForm form: newForm,
heightInput: value
}); });
} }
onRadioChange = (value) => { onRadioChange = (value) => {
...@@ -67,15 +74,9 @@ class RightEditRegionPanel extends Component { ...@@ -67,15 +74,9 @@ class RightEditRegionPanel extends Component {
}); });
} }
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
const {detailData} = this.props const {detailData} = this.state;
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
console.log('返回内容:', dataValues, valid, errors); console.log('返回内容:', dataValues, valid, errors);
if (valid) { if (valid) {
...@@ -83,10 +84,19 @@ class RightEditRegionPanel extends Component { ...@@ -83,10 +84,19 @@ class RightEditRegionPanel extends Component {
let routePathData=[ { let routePathData=[ {
riskSourceId: detailData.id, riskSourceId: detailData.id,
routePath: JSON.stringify({ routePath: JSON.stringify({
routePath:detailData.routePath, routePath:JSON.parse(detailData.routePath).routePath,
regionHeigth:parseFloat(dataValues.positionZ) regionHeigth:parseFloat(dataValues.positionZ)
})}] })}]
this.props.saveRoutePath(routePathData)
// this.props.saveRoutePath(routePathData)
let routePathDataNode={
riskSourceId: detailData.id,
routePath: JSON.stringify({
routePath:JSON.parse(detailData.routePath).routePath,
regionHeigth:parseFloat(dataValues.positionZ)
})
}
this.props.changeRoutePath(routePathDataNode);
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
...@@ -95,8 +105,8 @@ class RightEditRegionPanel extends Component { ...@@ -95,8 +105,8 @@ class RightEditRegionPanel extends Component {
} }
render() { render() {
let { rules, form,pointTypeArr,pointType, } = this.state; let { rules, form,pointTypeArr,pointType,detailData,heightInput } = this.state;
let { pageType,detailData,rightHeight } = this.props; let { pageType,rightHeight } = this.props;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 28 }, xs: { span: 28 },
...@@ -174,7 +184,10 @@ class RightEditRegionPanel extends Component { ...@@ -174,7 +184,10 @@ class RightEditRegionPanel extends Component {
</div> */} </div> */}
<div className='positionItem'> <div className='positionItem'>
<FormItem label="高" field="positionZ" {...formItemLayout}> <FormItem label="高" field="positionZ" {...formItemLayout}>
<Input placeholder={rightHeight} onChange={(e) => this.onChange('positionZ', e)}/> <Input
placeholder={detailData.routePath && JSON.parse(detailData.routePath).regionHeigth || rightHeight}
value={heightInput}
onChange={(e) => this.onChange('positionZ', e)}/>
{/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */} {/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */}
</FormItem> </FormItem>
</div> </div>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { equipStatusListAction } from './../../../services/panoramicService'; import { equipStatusListAction } from './../../../services/panoramicService';
import { equipStatusIconMapper } from './../../../consts/imgStatic';
const getIcon = (status)=>{
return equipStatusIconMapper[`equip_${status}`];
};
/** /**
* 设备状态消息 * 设备状态消息
*/ */
...@@ -32,7 +37,7 @@ export default class EquipStatusList extends Component { ...@@ -32,7 +37,7 @@ export default class EquipStatusList extends Component {
return ( return (
<div key={item.id} className="title-child"> <div key={item.id} className="title-child">
<div className="title-date" >{item.changeDate}</div> <div className="title-date" >{item.changeDate}</div>
<div className="title-text" >{item.label}</div> <div className="title-text" >{item.label}&nbsp;&nbsp;<img src={getIcon(item.status)} alt="" /></div>
</div> </div>
); );
}) })
......
...@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; ...@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { utils } from 'amos-tool'; import { utils } from 'amos-tool';
import { Markers } from 'amos-3d/lib/designer'; import { Markers } from 'amos-3d/lib/designer';
import { BaseObjHelper } from 'base-r3d/lib/factory'; import { BaseObjHelper } from 'base-r3d/lib/factory';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { CONSTS } from './../../consts/storageConsts'; import { CONSTS } from './../../consts/storageConsts';
import PointDialog from './PointDialog'; import PointDialog from './PointDialog';
import { tirggerPlanTopic } from './../dataProcessor'; import { tirggerPlanTopic } from './../dataProcessor';
...@@ -17,29 +18,6 @@ const getIcon = (markerType, level) => { ...@@ -17,29 +18,6 @@ const getIcon = (markerType, level) => {
return marker3DIoncMapper[`${markerType}`] return marker3DIoncMapper[`${markerType}`]
}; };
const buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
if (!utils.isEmpty(markers)){
markers.forEach(m => {
const url = getIcon(markerType, m.level);
let position;
if (!utils.isArray(m.position)){
position = Object.values(m.position);
}
for (let k of Object.keys(defaultParams)) {
m[k] = defaultParams[k];
}
m.key = m.key || m.id;
m.url = url;
m.position = utils.isArray(m.position) ? m.position : position;
m.size = 10;
m.name = m.name ? m.name : m.label;
m.label = null;
// m.label = createMarkerLabel(m.name);
});
}
return markers;
};
const createMarkerLabel = (text) => { const createMarkerLabel = (text) => {
const div = document.createElement('div'); const div = document.createElement('div');
div.style.position = 'absolute'; div.style.position = 'absolute';
...@@ -100,7 +78,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -100,7 +78,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
} }
componentWillReceiveProps = nextProps => { componentWillReceiveProps = nextProps => {
if(nextProps.editFlag){ if(nextProps.isEditMode){
this.markersCache.eachValue(obj=>{ this.markersCache.eachValue(obj=>{
this.setTopCardConf(obj, obj.extData); this.setTopCardConf(obj, obj.extData);
if(nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id ==obj.extData.id ){ if(nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id ==obj.extData.id ){
...@@ -130,9 +108,6 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -130,9 +108,6 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
onMarkerClick = (marker, e) => { onMarkerClick = (marker, e) => {
const { isClick } = this.state; const { isClick } = this.state;
if(this.props.editFlag){
return false
}
if (this.props.isEditMode) { if (this.props.isEditMode) {
return false return false
} }
...@@ -159,14 +134,13 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -159,14 +134,13 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
} }
} }
markerCreated = ({ markersCache }) => { markerCreated = ({ markersCache }) => {
let {editFlag,selectKey,stagePilot} =this.props let {isEditMode,selectKey} =this.props
this.markersCache = markersCache; this.markersCache = markersCache;
this.stagePilot =stagePilot; this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined; this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
markersCache.eachValue(obj=>{ markersCache.eachValue(obj=>{
this.setTopCardConf(obj, obj.extData); this.setTopCardConf(obj, obj.extData);
if(obj.extData.type === "riskSource" && markerType != 'impEquipmentMode' && !editFlag){ if(obj.extData.type === "riskSource" && markerType != 'impEquipmentMode' && !isEditMode){
this.setTwinkleConf(obj); this.setTwinkleConf(obj);
} }
}); });
...@@ -192,17 +166,17 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -192,17 +166,17 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
obj.baseObjHelper.titleConfig = { obj.baseObjHelper.titleConfig = {
// 顶牌平面参数 // 顶牌平面参数
planeOptions: { planeOptions: {
width: 30, width: 40,
height: 15, height: 20,
position: [0,20,0], position: [0,20,0],
doubleSide: true doubleSide: true
}, },
canvasOptions: { canvasOptions: {
font: '34px Microsoft YaHei', font: '28px Microsoft YaHei',
fillStyle: 'white', fillStyle: 'white',
textBaseline: 'middle', textBaseline: 'middle',
textAlign: 'center', textAlign: 'center',
textX: 128, textX: 128
}, },
imgWidth: 256, imgWidth: 256,
imgHeight: 128, imgHeight: 128,
...@@ -217,12 +191,46 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -217,12 +191,46 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
obj.baseObjHelper.title = cardTitle; obj.baseObjHelper.title = cardTitle;
} }
buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
const { isEditMode } = this.props;
if (!utils.isEmpty(markers)){
markers.forEach(m => {
const url = getIcon(markerType, m.level);
let position;
if (!utils.isArray(m.position)){
position = Object.values(m.position);
}
for (let k of Object.keys(defaultParams)) {
if((markerType === 'riskSource' || markerType === 'patrol' ) && k != 'useModel' && !isEditMode){
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-${m.level}` });
}else if((markerType === 'riskSource' || markerType === 'patrol' ) && k != 'useModel' && isEditMode){
if(markerType === 'riskSource'){
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-4` });
}else{
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-1` });
}
}else{
m[k] = defaultParams[k];
}
}
m.key = m.key || m.id;
m.url = url;
m.position = utils.isArray(m.position) ? m.position : position;
m.size = 10;
m.name = m.name ? m.name : m.label;
m.label = null;
// m.label = createMarkerLabel(m.name);
});
}
return markers;
};
render() { render() {
const { markers, ...rest } = this.props; const { markers, ...rest } = this.props;
const { planStarted } = this.state; const { planStarted } = this.state;
let dialogStyle = { zIndex: 1000 }; let dialogStyle = { zIndex: 1000 };
const result = buildMarkerOptions(markers, markerType, markerParams); const result = this.buildMarkerOptions(markers, markerType, markerParams);
return ( return (
<WrappedComponent> <WrappedComponent>
<Markers <Markers
......
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