Commit b9b7506e authored by suhuiguang's avatar suhuiguang

1.修改

parent 16ff3558
......@@ -59,16 +59,6 @@ class PointsPool extends Component {
onMarkersCreated = (type, { markersCache }) => {
this.markerList[type] = markersCache;
let stagePilot = this.props.stagePilot;
debugger;
// if(markersCache&&stagePilot) {
// // console.log(this.markerList)
// console.log(markersCache)
// // console.log(this.props)
// markersCache.eachValue(item => {
// item.node._userData = { ...item.extData };
// stagePilot.positionCtl.objects.push(item.node); })
// }
(markersCache || []).forEach(mc => {
const extData = mc.getExtData();
if (extData.hasOwnProperty('visible')){
......
......@@ -780,18 +780,22 @@ class View3D extends Component {
}
//选中点变化
selectPointChange = (selectPoints) => {
if(selectPoints.isRegion){
this.setState({selectArea:selectPoints})
}else{
this.dragItemChange(selectPoints)
const { markers, pointType } = this.state;
if (selectPoints.isRegion){
this.setState({ selectArea: selectPoints });
} else {
this.dragItemChange(selectPoints);
markers[pointType].map(e => {
if (e.id === selectPoints.id){
selectPoints.position = e.position;
}
});
this.setState({
selectArea:'',
selectArea: '',
selectPoints,
showRightPanel: true,
selectPoints
showRightPanel: true
});
}
}
getAreas = (treeData) => {
......@@ -1259,29 +1263,22 @@ class View3D extends Component {
});
};
/**
* 更新 markers data
* 批量更新
* @params {Object} markersData {markerType<String>: markers<Array>}
*/
changeMarkersData = markersData => {
if (!utils.isEmpty(markersData)) {
const { markers } = this.state;
const newMarkers = Object.assign({}, markers, markersData);
this.setState({
markers: newMarkers
changeMarkersData = (position,type,id) => {
const me = this;
const { markers, selectPoints } = me.state;
const index = markers[type].findIndex(e=>e.id === id);
if (index >= 0){
markers[type][index].position = position;
markers[type][index].isEdit = true;
selectPoints.position = position;
me.setState({
markers,
selectPoints
});
}
};
createInfowindow = text => {
const div = document.createElement('div');
div.style.position = 'absolute';
div.className = 'three-ui-infowindow';
div.innerText = text;
return div;
};
afterRender = () => {
// this.infoHelper && this.infoHelper.update();
};
......@@ -1546,19 +1543,19 @@ class View3D extends Component {
const { markers } = me.state;
const isInside = me.polygonRegion && extData.parentId && me.polygonRegion[extData.parentId].pointInPolygon([position.x,position.y,position.z]);
// if (isInside){
markers[extData.type].forEach(e => {
if (e.id === extData.id){
e.position = position;
e.isEdit = true;
}
});
extData.position = position;
this.setState({
markers,
positionxyz: position,
showRightPanel: true,
selectPoints: extData
});
markers[extData.type].forEach(e => {
if (e.id === extData.id){
e.position = position;
e.isEdit = true;
}
});
extData.position = position;
this.setState({
markers,
positionxyz: position,
showRightPanel: true,
selectPoints: extData
});
// } else {
// message.error('不能放置非所在区域');
// }
......@@ -1670,7 +1667,7 @@ class View3D extends Component {
>
{startAsyncLoad && <WorkerObjContent objs={asyncModels} onWorkerMessage={this.onWorkerLoading} enableLoading afterInit={this.onAfterWorkerInit} />}
{isEditMode && pageType === 'region' ? '' :
<PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker}/>}
<PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker} ref={node => this.pointsPool = node} />}
{fireTruckRoute && <FatLine {...lineData.fatLineConf} linePath={JSON.parse(fireTruckRoute)} visible={showFireTruckRoute} />}
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()}
......
......@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
}
}
markerCreated = ({ markersCache }) => {
let {isEditMode,selectKey} =this.props
let { isEditMode,selectKey } =this.props;
this.markersCache = markersCache;
this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
......
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