Commit 4bbe8ed4 authored by 单奇雲's avatar 单奇雲

bug

parent 9ce53a10
...@@ -22,7 +22,8 @@ import { ...@@ -22,7 +22,8 @@ import {
tirggerPlanTopic, tirggerPlanTopic,
tirggerTransTopic, tirggerTransTopic,
cacheObjsSave, cacheObjsSave,
flyToSubView flyToSubView,
convertMarkerType
} from './dataProcessor'; } from './dataProcessor';
import { import {
dealTroubleMarkers, dealTroubleMarkers,
...@@ -569,7 +570,7 @@ class View3D extends Component { ...@@ -569,7 +570,7 @@ class View3D extends Component {
treeData.forEach( t => { treeData.forEach( t => {
if (t.isRegion && t.children && t.children.length > 0){ if (t.isRegion && t.children && t.children.length > 0){
this.getPointLoop( { markers }, pointType, t.children); this.getPointLoop( { markers }, pointType, t.children);
} else if (t.position3d && !t.isRegion){ } else if (t.position3d && t.position3d.length > 0 && !t.isRegion){
t.position = t.position3d; t.position = t.position3d;
t.key = `${t.type}-${t.id}`; t.key = `${t.type}-${t.id}`;
t.label = t.name; t.label = t.name;
...@@ -1336,10 +1337,10 @@ class View3D extends Component { ...@@ -1336,10 +1337,10 @@ class View3D extends Component {
changeMarkersData = (position,type,id) => { changeMarkersData = (position,type,id) => {
const me = this; const me = this;
const { markers, selectPoints } = me.state; const { markers, selectPoints } = me.state;
const index = markers[type].findIndex(e=>e.id === id); const index = markers[convertMarkerType(type)].findIndex(e=>e.id === id && e.type === type);
if (index >= 0){ if (index >= 0){
markers[type][index].position = position; markers[convertMarkerType(type)][index].position = position;
markers[type][index].isEdit = true; markers[convertMarkerType(type)][index].isEdit = true;
selectPoints.position = position; selectPoints.position = position;
me.setState({ me.setState({
markers, markers,
......
...@@ -400,7 +400,7 @@ export const flyToSubView = (instance,obj,LENS_LEVEL) =>{ ...@@ -400,7 +400,7 @@ export const flyToSubView = (instance,obj,LENS_LEVEL) =>{
//改变marker坐标 //改变marker坐标
export const changeMarkerPosition = (instance,obj,data) => { export const changeMarkerPosition = (instance,obj,data) => {
const { id, type, position } = data; const { id, type, position } = data;
(instance.markerList[convertType(type)] || []).forEach( mc => { (instance.markerList[convertMarkerType(type)] || []).forEach( mc => {
const extData = mc.getExtData(); const extData = mc.getExtData();
if (extData.id === id && extData.type === type) { if (extData.id === id && extData.type === type) {
mc.baseObjHelper.position = position; mc.baseObjHelper.position = position;
...@@ -408,7 +408,7 @@ export const changeMarkerPosition = (instance,obj,data) => { ...@@ -408,7 +408,7 @@ export const changeMarkerPosition = (instance,obj,data) => {
}); });
}; };
const convertType = (type) => { export const convertMarkerType = (type) => {
const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool'; const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool';
return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ; return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ;
}; };
...@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
planeOptions: { planeOptions: {
width: 20, width: 20,
height: 10, height: 10,
position: [0, 20, 0], position: [0, 10, 0],
doubleSide: true doubleSide: true
}, },
canvasOptions: { canvasOptions: {
......
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