Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-convertor-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
amos-convertor-view
Commits
b6b6ce08
Commit
b6b6ce08
authored
May 20, 2020
by
baoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiugai
parent
3f9e7d2b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
25 deletions
+111
-25
ModuleEdit.js
src/view/3dview/ModuleEdit.js
+96
-21
PointsPoolEditPage.js
src/view/3dview/PointsPoolEditPage.js
+7
-3
PointLeftTree.js
src/view/3dview/moduleEditComponent/PointLeftTree.js
+0
-1
marker3DFactory.js
src/view/3dview/moduleEditPoints/marker3DFactory.js
+8
-0
No files found.
src/view/3dview/ModuleEdit.js
View file @
b6b6ce08
...
...
@@ -85,14 +85,28 @@ class ModuleEdit extends Component {
},
editFlag
:
false
,
//编辑模式
showRightPanel
:
false
,
//是否显示右侧详情
simpleTipVisible
:
false
//简单提示
simpleTipVisible
:
false
,
//简单提示
dragItem
:
''
//拖动的节点
};
this
.
nativeProps
=
{
onMouseDown
:
this
.
onMouseDown
,
onMouseMove
:
this
.
onMouseMove
};
this
.
drowItem
=
''
;
this
.
areas
=
[]
this
.
areas
=
[],
this
.
areaStyles
=
{
normal
:{
regionColor
:
'#02B00F'
,
// 区域颜色
lineColor
:
'#00FF70'
,
// 边框颜色
regionOpacity
:
0.3
},
noDrop
:{
regionColor
:
'#969696'
,
// 区域颜色
lineColor
:
'#878787'
,
// 边框颜色
regionOpacity
:
0.4
}
},
getObjFromNet
(
view3dFile
,
(
objs
,
asyncModels
)
=>
{
this
.
setState
({
...
...
@@ -155,20 +169,20 @@ class ModuleEdit extends Component {
// eslint-disable-next-line react/sort-comp
_registerEvents
=
()
=>
{
this
.
r3d
.
on
(
'
db
click'
,
evt
=>
{
this
.
r3d
.
on
(
'click'
,
evt
=>
{
if
(
evt
.
button
!==
0
)
{
return
;
}
const
object
=
evt
.
object
;
if
(
object
)
{
this
.
cameraFactory
.
flyTo
({
position
:
object
.
position
.
toArray
(),
duration
:
6000
});
//
this.cameraFactory.flyTo({
//
position: object.position.toArray(),
//
duration: 6000
//
});
}
});
this
.
r3d
.
on
(
'
key
down'
,
evt
=>
{
this
.
r3d
.
on
(
'
mouse
down'
,
evt
=>
{
// 返回上级
if
(
this
.
lensLevel
===
LENS_LEVEL
.
SUB
&&
evt
.
code
===
'Backspace'
)
{
this
.
lensJumpFactory
.
jumpRoot
(
obj
=>
{
...
...
@@ -194,14 +208,19 @@ class ModuleEdit extends Component {
}
this
.
setState
({
totalDelta
});
}
pointParamsChange
=
(
object
,
modeType
)
=>
{
console
.
log
(
"zzzzzzzzzzzzzz"
,
object
,
modeType
)
}
onGraphCreated
=
({
cameraFactory
,
sceneFactory
,
outlineFactory
,
r3d
,
stagePilot
})
=>
{
this
.
cameraFactory
=
cameraFactory
;
this
.
sceneFactory
=
sceneFactory
;
this
.
outlineFactory
=
outlineFactory
;
this
.
r3d
=
r3d
;
this
.
polygonRegion
=
{};
this
.
stagePilot
=
stagePilot
;
this
.
positionCtl
=
stagePilot
.
positionCtl
;
this
.
positionCtl
.
addListener
(
'changeDone'
,
this
.
pointParamsChange
)
console
.
log
(
this
)
// 重新设置 outline 风格
this
.
outlineFactory
.
outlineConfig
=
{
visibleEdgeColor
:
'#f8a303'
,
...
...
@@ -500,17 +519,38 @@ class ModuleEdit extends Component {
}
getAreas
=
(
treeData
)
=>
{
// let { treeData
} = this.state;
let
{
dragItem
}
=
this
.
state
;
// console.log(treeData)
// let areas = [];
if
(
treeData
&&
treeData
.
length
>
0
)
{
treeData
.
map
((
item
)
=>
{
if
(
item
.
isRegion
&&
item
.
isBind
)
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{
this
.
onRegionCreated
}
/>
)
if
(
dragItem
)
{
if
(
dragItem
.
parentId
&&
dragItem
.
parentId
==
item
.
id
)
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
else
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
noDrop
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
{
this
.
getAreas
(
item
.
children
)}
}
else
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
{
this
.
getAreas
(
item
.
children
)}
}
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{
this
.
onRegionCreated
}
/>
)
}
else
{
if
(
dragItem
)
{
if
(
dragItem
&&
dragItem
.
parentId
&&
dragItem
.
parentId
==
item
.
id
)
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
else
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
noDrop
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
}
else
{
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
}
}
else
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
{
this
.
getAreas
(
item
.
children
)}
...
...
@@ -522,15 +562,14 @@ class ModuleEdit extends Component {
renderAreas
=
()
=>
{
this
.
areas
=
[];
this
.
getAreas
(
this
.
state
.
treeData
);
//
console.log(this.areas)
console
.
log
(
this
.
areas
)
return
this
.
areas
;
}
onRegionCreated
=
(
polygonRegion
,
item
)
=>
{
onRegionCreated
=
(
polygonRegion
,
item
)
=>
{
console
.
log
(
polygonRegion
)
console
.
log
(
item
)
// console.log(polygonRegion.pointInPolygon)
this
.
polygonRegion
=
polygonRegion
;
// console.log(e
)
this
.
polygonRegion
[
item
.
id
]
=
polygonRegion
;
console
.
log
(
this
.
polygonRegion
)
}
//保存区域绑定
saveAreaData
=
()
=>
{
...
...
@@ -626,6 +665,18 @@ class ModuleEdit extends Component {
dragItemChange
=
(
dragItem
)
=>
{
this
.
state
.
dragItem
=
dragItem
;
let
{
treeData
}
=
this
.
state
;
if
(
dragItem
.
isRegion
)
{
//是区域
}
else
{
if
(
dragItem
.
isBind
)
{
//已绑定
}
else
{
let
hasRegion
=
false
;
}
}
this
.
setState
({
dragItem
})
...
...
@@ -652,13 +703,21 @@ class ModuleEdit extends Component {
position
=
objs
[
0
].
point
;
}
// [0,0,0]
const
isInside
=
this
.
polygonRegion
.
pointInPolygon
([
position
.
x
,
position
.
y
,
position
.
z
])
const
isInside
=
this
.
polygonRegion
[
dragItem
.
parentId
]
.
pointInPolygon
([
position
.
x
,
position
.
y
,
position
.
z
])
console
.
log
(
this
.
polygonRegion
)
console
.
log
(
objs
)
console
.
log
(
position
)
console
.
log
(
position
.
x
)
console
.
log
(
isInside
)
if
(
dragItem
)
{
if
(
isInside
==
false
)
{
this
.
tipMsg
=
'只能放置在当前区域'
this
.
setState
({
simpleTipVisible
:
true
})
return
false
;
}
let
uid
=
UUID
.
uuidFast
()
let
addPointParam
=
{
type
:
dragItem
.
type
,
...
...
@@ -707,12 +766,27 @@ class ModuleEdit extends Component {
})
}
/** 拖拽元素外观(位置、缩放、旋转角度)改变 */
onTransformChange
=
(
object
,
modeType
)
=>
{
modeType
===
'translate'
&&
(
modeType
=
'position'
);
modeType
===
'rotate'
&&
(
modeType
=
'rotation'
);
const
basicAttr
=
(
object
.
userData
||
{}).
basicAttr
;
basicAttr
[
modeType
]
=
peelXYZFromObj
(
object
,
modeType
);
const
sketchOptions
=
{
key
:
'basicAttr'
,
value
:
basicAttr
};
this
.
props
.
trigger
(
EVENTS_CONSTS
.
SKETCH_PARAMS_CHANGE
,
{
sketchId
:
(
object
.
userData
||
{}).
eid
,
sketchOptions
});
};
render
()
{
const
{
fireEquipmentPosition
,
drawing
,
objs
,
markers
,
pageType
,
pointType
,
pointTypeArr
,
editFlag
,
showRightPanel
,
selectPoints
,
selectArea
}
=
this
.
state
;
console
.
log
(
this
.
state
)
console
.
log
(
this
.
props
)
console
.
log
(
this
)
const
{
dimension
}
=
this
.
props
;
const
graphicProps
=
{
...
dimension
,
...
...
@@ -753,6 +827,7 @@ class ModuleEdit extends Component {
enableModelParser
disabledEdit
defaultLoading
=
{
false
}
onTransformChange
=
{
this
.
onTransformChange
}
ref
=
{
node
=>
(
this
.
a3dRef
=
node
)}
baseObjs
=
{
objs
}
drawing
=
{
drawing
}
...
...
@@ -824,7 +899,7 @@ class ModuleEdit extends Component {
noDefaultHeader
// onCancel={this.simpleTipCancel}
onOk
=
{
this
.
simpleTipOk
}
content
=
{
<
div
>
内容区域
...
<
/div>
}
content
=
{
<
div
>
{
this
.
tipMsg
}
<
/div>
}
/>
<
/div
>
...
...
src/view/3dview/PointsPoolEditPage.js
View file @
b6b6ce08
...
...
@@ -59,18 +59,22 @@ class PointsPoolEditPage extends Component {
// });
}
onMarkersCreated
=
(
type
,
{
markersCache
})
=>
{
this
.
markerList
[
type
]
=
markersCache
;
let
stagePilot
=
this
.
props
.
stagePilot
;
if
(
markersCache
&&
stagePilot
)
{
console
.
log
(
this
.
markerList
)
//
console.log(this.markerList)
console
.
log
(
markersCache
)
console
.
log
(
this
.
props
)
markersCache
.
eachValue
(
item
=>
stagePilot
.
positionCtl
.
objects
.
push
(
item
.
node
)
)
// 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
();
// console.log('lllllllllllllllll',mc)
if
(
extData
.
hasOwnProperty
(
'visible'
)){
let
visible
=
extData
.
visible
;
if
(
visible
)
{
...
...
src/view/3dview/moduleEditComponent/PointLeftTree.js
View file @
b6b6ce08
...
...
@@ -123,7 +123,6 @@ class PointLeftTree extends Component {
key
=
{
item
.
id
}
dataRef
=
{
item
}
onDragStart
=
{()
=>
{
console
.
log
(
11
)
this
.
props
.
dragItemChange
(
item
)
}}
>
{
this
.
renderTreeNodes
(
item
.
children
)}
...
...
src/view/3dview/moduleEditPoints/marker3DFactory.js
View file @
b6b6ce08
...
...
@@ -48,14 +48,20 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
this
.
markerEvents
=
{
click
:
this
.
onMarkerClick
,
mouseover
:
(
marker
)
=>
{
console
.
log
(
marker
)
marker
.
object2DPipe
.
pipeNode
.
visible
=
true
;
marker
.
object2DPipe
.
pipeNode
.
elementVisible
=
true
;
},
mouseout
:
(
marker
)
=>
{
marker
.
object2DPipe
.
pipeNode
.
visible
=
false
;
marker
.
object2DPipe
.
pipeNode
.
elementVisible
=
false
;
},
mouseup
:
(
evt
)
=>
{
console
.
log
(
'------------------up'
)
console
.
log
(
evt
)
}
};
this
.
state
=
{
isClick
:
true
};
...
...
@@ -71,6 +77,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
onMarkerClick
=
(
marker
,
e
)
=>
{
const
{
isClick
}
=
this
.
state
;
console
.
log
(
"---click"
,
marker
)
if
(
isClick
)
{
this
.
setState
({
isClick
:
false
});
//将isClick 变成false,将不会执行处理事件
this
.
pdRef
&&
this
.
pdRef
.
onOpenClick
(
marker
);
...
...
@@ -87,6 +94,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
const
{
markers
,
...
rest
}
=
this
.
props
;
const
{
planStarted
}
=
this
.
state
;
let
dialogStyle
=
{
zIndex
:
1000
};
// console.log('zzzzzzzzzzzzzzzz')
const
result
=
buildMarkerOptions
(
markers
,
markerType
,
markerParams
);
return
(
<
WrappedComponent
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment