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
b11b9191
Commit
b11b9191
authored
May 15, 2020
by
baoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiugai
parent
e80b8525
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
25 deletions
+64
-25
ModuleEdit.js
src/view/3dview/ModuleEdit.js
+45
-14
PointsPoolEditPage.js
src/view/3dview/PointsPoolEditPage.js
+8
-0
index.js
src/view/3dview/moduleEditPoints/index.js
+9
-9
marker3DFactory.js
src/view/3dview/moduleEditPoints/marker3DFactory.js
+2
-2
No files found.
src/view/3dview/ModuleEdit.js
View file @
b11b9191
...
@@ -84,7 +84,8 @@ class ModuleEdit extends Component {
...
@@ -84,7 +84,8 @@ class ModuleEdit extends Component {
fireEquipment
:
[]
fireEquipment
:
[]
},
},
editFlag
:
false
,
//编辑模式
editFlag
:
false
,
//编辑模式
showRightPanel
:
false
//是否显示右侧详情
showRightPanel
:
false
,
//是否显示右侧详情
simpleTipVisible
:
false
//简单提示
};
};
this
.
nativeProps
=
{
this
.
nativeProps
=
{
onMouseDown
:
this
.
onMouseDown
,
onMouseDown
:
this
.
onMouseDown
,
...
@@ -194,11 +195,12 @@ class ModuleEdit extends Component {
...
@@ -194,11 +195,12 @@ class ModuleEdit extends Component {
this
.
setState
({
totalDelta
});
this
.
setState
({
totalDelta
});
}
}
onGraphCreated
=
({
cameraFactory
,
sceneFactory
,
outlineFactory
,
r3d
})
=>
{
onGraphCreated
=
({
cameraFactory
,
sceneFactory
,
outlineFactory
,
r3d
,
stagePilot
})
=>
{
this
.
cameraFactory
=
cameraFactory
;
this
.
cameraFactory
=
cameraFactory
;
this
.
sceneFactory
=
sceneFactory
;
this
.
sceneFactory
=
sceneFactory
;
this
.
outlineFactory
=
outlineFactory
;
this
.
outlineFactory
=
outlineFactory
;
this
.
r3d
=
r3d
;
this
.
r3d
=
r3d
;
this
.
stagePilot
=
stagePilot
;
// 重新设置 outline 风格
// 重新设置 outline 风格
this
.
outlineFactory
.
outlineConfig
=
{
this
.
outlineFactory
.
outlineConfig
=
{
...
@@ -212,6 +214,7 @@ class ModuleEdit extends Component {
...
@@ -212,6 +214,7 @@ class ModuleEdit extends Component {
sceneFactory
,
sceneFactory
,
cameraEffect
:
desigerHelperConfig
.
cameraEffect
cameraEffect
:
desigerHelperConfig
.
cameraEffect
});
});
};
};
onAllDone
=
objGroup
=>
{
onAllDone
=
objGroup
=>
{
...
@@ -504,10 +507,10 @@ class ModuleEdit extends Component {
...
@@ -504,10 +507,10 @@ class ModuleEdit extends Component {
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
)
{
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
/>
)
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{
this
.
onRegionCreated
}
/>
)
{
this
.
getAreas
(
item
.
children
)}
{
this
.
getAreas
(
item
.
children
)}
}
}
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
/>
)
this
.
areas
.
push
(
<
PolygonRegion
points
=
{
JSON
.
parse
(
item
.
routePath
)}
onCreated
=
{
this
.
onRegionCreated
}
/>
)
}
else
{
}
else
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
{
this
.
getAreas
(
item
.
children
)}
{
this
.
getAreas
(
item
.
children
)}
...
@@ -522,6 +525,13 @@ class ModuleEdit extends Component {
...
@@ -522,6 +525,13 @@ class ModuleEdit extends Component {
// console.log(this.areas)
// console.log(this.areas)
return
this
.
areas
;
return
this
.
areas
;
}
}
onRegionCreated
=
(
polygonRegion
,
item
)
=>
{
console
.
log
(
polygonRegion
)
console
.
log
(
item
)
// console.log(polygonRegion.pointInPolygon)
this
.
polygonRegion
=
polygonRegion
;
// console.log(e)
}
//保存区域绑定
//保存区域绑定
saveAreaData
=
()
=>
{
saveAreaData
=
()
=>
{
let
{
treeData
,
routePathData
,
pageType
}
=
this
.
state
;
let
{
treeData
,
routePathData
,
pageType
}
=
this
.
state
;
...
@@ -624,7 +634,17 @@ class ModuleEdit extends Component {
...
@@ -624,7 +634,17 @@ class ModuleEdit extends Component {
drop
=
(
event
)
=>
{
drop
=
(
event
)
=>
{
event
.
preventDefault
();
event
.
preventDefault
();
let
{
dragItem
,
markers
}
=
this
.
state
;
let
{
dragItem
,
markers
}
=
this
.
state
;
console
.
log
(
event
.
clientX
)
console
.
log
(
dragItem
)
if
(
dragItem
)
{
if
(
dragItem
.
isBind
)
{
this
.
tipMsg
=
'只能放置未绑定的标记点'
this
.
setState
({
simpleTipVisible
:
true
})
return
false
;
}
}
const
objs
=
this
.
a3dRef
.
pickerCoordinate
(
event
.
clientX
,
event
.
clientY
,
null
,
true
);
const
objs
=
this
.
a3dRef
.
pickerCoordinate
(
event
.
clientX
,
event
.
clientY
,
null
,
true
);
let
position
;
let
position
;
if
(
objs
.
length
>
0
){
if
(
objs
.
length
>
0
){
...
@@ -632,11 +652,12 @@ class ModuleEdit extends Component {
...
@@ -632,11 +652,12 @@ class ModuleEdit extends Component {
position
=
objs
[
0
].
point
;
position
=
objs
[
0
].
point
;
}
}
// [0,0,0]
// [0,0,0]
// const isInside = me.polygonRegion.pointInPolygon(p
)
const
isInside
=
this
.
polygonRegion
.
pointInPolygon
([
position
.
x
,
position
.
y
,
position
.
z
]
)
console
.
log
(
this
.
polygonRegion
)
console
.
log
(
this
.
polygonRegion
)
console
.
log
(
objs
)
console
.
log
(
objs
)
console
.
log
(
position
)
console
.
log
(
position
)
console
.
log
(
position
.
x
)
console
.
log
(
position
.
x
)
console
.
log
(
isInside
)
if
(
dragItem
)
{
if
(
dragItem
)
{
let
uid
=
UUID
.
uuidFast
()
let
uid
=
UUID
.
uuidFast
()
let
addPointParam
=
{
let
addPointParam
=
{
...
@@ -680,11 +701,18 @@ class ModuleEdit extends Component {
...
@@ -680,11 +701,18 @@ class ModuleEdit extends Component {
this
.
getPointList
();
this
.
getPointList
();
}
}
}
}
simpleTipOk
=
()
=>
{
this
.
setState
({
simpleTipVisible
:
false
})
}
render
()
{
render
()
{
const
{
fireEquipmentPosition
,
drawing
,
objs
,
markers
,
pageType
,
pointType
,
pointTypeArr
,
editFlag
,
showRightPanel
,
selectPoints
,
selectArea
}
=
this
.
state
;
const
{
fireEquipmentPosition
,
drawing
,
objs
,
markers
,
pageType
,
pointType
,
pointTypeArr
,
editFlag
,
showRightPanel
,
selectPoints
,
selectArea
}
=
this
.
state
;
console
.
log
(
this
.
state
)
console
.
log
(
this
.
state
)
console
.
log
(
this
.
props
)
console
.
log
(
this
.
props
)
console
.
log
(
this
)
const
{
dimension
}
=
this
.
props
;
const
{
dimension
}
=
this
.
props
;
const
graphicProps
=
{
const
graphicProps
=
{
...
dimension
,
...
dimension
,
...
@@ -695,11 +723,6 @@ class ModuleEdit extends Component {
...
@@ -695,11 +723,6 @@ class ModuleEdit extends Component {
onCreated
:
this
.
onGraphCreated
,
onCreated
:
this
.
onGraphCreated
,
afterRender
:
this
.
afterRender
afterRender
:
this
.
afterRender
};
};
// const modelContentProps = {
// onAllDone: this.onAllDone,
// onComplete: this.onComplete
// };
let
firePosition
=
null
;
let
firePosition
=
null
;
if
(
fireEquipmentPosition
&&
fireEquipmentPosition
.
length
>
0
)
{
if
(
fireEquipmentPosition
&&
fireEquipmentPosition
.
length
>
0
)
{
firePosition
=
{
firePosition
=
{
...
@@ -736,10 +759,9 @@ class ModuleEdit extends Component {
...
@@ -736,10 +759,9 @@ class ModuleEdit extends Component {
enablePen
enablePen
nativeProps
=
{
this
.
nativeProps
}
nativeProps
=
{
this
.
nativeProps
}
penProps
=
{
penProps
}
penProps
=
{
penProps
}
enablePositionCtl
>
>
<
PointsPoolEditPage
markers
=
{
markers
}
updateMarker
=
{
this
.
updateMarker
}
/
>
<
PointsPoolEditPage
markers
=
{
markers
}
updateMarker
=
{
this
.
updateMarker
}
stagePilot
=
{
this
.
stagePilot
}
/
>
{
this
.
renderAreas
()}
{
this
.
renderAreas
()}
<
/A3DDesigner>
<
/A3DDesigner>
<
/div
>
<
/div
>
...
@@ -795,6 +817,15 @@ class ModuleEdit extends Component {
...
@@ -795,6 +817,15 @@ class ModuleEdit extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
}
}
<
Modal
className
=
'moduleEditMadel simpleTip'
header
=
"基本模态框"
visible
=
{
this
.
state
.
simpleTipVisible
}
noDefaultHeader
// onCancel={this.simpleTipCancel}
onOk
=
{
this
.
simpleTipOk
}
content
=
{
<
div
>
内容区域
...
<
/div>
}
/>
<
/div
>
<
/div
>
);
);
...
...
src/view/3dview/PointsPoolEditPage.js
View file @
b11b9191
...
@@ -61,6 +61,14 @@ class PointsPoolEditPage extends Component {
...
@@ -61,6 +61,14 @@ class PointsPoolEditPage extends Component {
onMarkersCreated
=
(
type
,
{
markersCache
})
=>
{
onMarkersCreated
=
(
type
,
{
markersCache
})
=>
{
this
.
markerList
[
type
]
=
markersCache
;
this
.
markerList
[
type
]
=
markersCache
;
let
stagePilot
=
this
.
props
.
stagePilot
;
if
(
markersCache
&&
stagePilot
)
{
console
.
log
(
this
.
markerList
)
console
.
log
(
markersCache
)
console
.
log
(
this
.
props
)
markersCache
.
eachValue
(
item
=>
stagePilot
.
positionCtl
.
objects
.
push
(
item
.
node
)
)
}
(
markersCache
||
[]).
forEach
(
mc
=>
{
(
markersCache
||
[]).
forEach
(
mc
=>
{
const
extData
=
mc
.
getExtData
();
const
extData
=
mc
.
getExtData
();
if
(
extData
.
hasOwnProperty
(
'visible'
)){
if
(
extData
.
hasOwnProperty
(
'visible'
)){
...
...
src/view/3dview/moduleEditPoints/index.js
View file @
b11b9191
...
@@ -16,7 +16,7 @@ class BasicPoint extends Component {
...
@@ -16,7 +16,7 @@ class BasicPoint extends Component {
/**
/**
* 风险
* 风险
*/
*/
export
const
RiskPoint
=
markerFactory
(
BasicPoint
,
export
const
RiskPoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'riskSource'
markerType
:
'riskSource'
}
}
...
@@ -25,7 +25,7 @@ export const RiskPoint = markerFactory(BasicPoint,
...
@@ -25,7 +25,7 @@ export const RiskPoint = markerFactory(BasicPoint,
/**
/**
* 巡检
* 巡检
*/
*/
export
const
PatrolPoint
=
markerFactory
(
BasicPoint
,
export
const
PatrolPoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'risk'
markerType
:
'risk'
}
}
...
@@ -34,7 +34,7 @@ export const PatrolPoint = markerFactory(BasicPoint,
...
@@ -34,7 +34,7 @@ export const PatrolPoint = markerFactory(BasicPoint,
/**
/**
* 人员
* 人员
*/
*/
export
const
PersonPoint
=
markerFactory
(
BasicPoint
,
export
const
PersonPoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'person'
markerType
:
'person'
}
}
...
@@ -43,7 +43,7 @@ export const PersonPoint = markerFactory(BasicPoint,
...
@@ -43,7 +43,7 @@ export const PersonPoint = markerFactory(BasicPoint,
/**
/**
* 监控
* 监控
*/
*/
export
const
MonitorPoint
=
markerFactory
(
BasicPoint
,
export
const
MonitorPoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'video'
markerType
:
'video'
}
}
...
@@ -52,7 +52,7 @@ export const MonitorPoint = markerFactory(BasicPoint,
...
@@ -52,7 +52,7 @@ export const MonitorPoint = markerFactory(BasicPoint,
/**
/**
* 探测点
* 探测点
*/
*/
export
const
ProbePoint
=
markerFactory
(
BasicPoint
,
export
const
ProbePoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'monitorEquipment'
markerType
:
'monitorEquipment'
}
}
...
@@ -61,13 +61,13 @@ export const ProbePoint = markerFactory(BasicPoint,
...
@@ -61,13 +61,13 @@ export const ProbePoint = markerFactory(BasicPoint,
/**
/**
* 消防资源
* 消防资源
*/
*/
export
const
FireResourcePoint
=
markerFactory
(
BasicPoint
,
export
const
FireResourcePoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'fireResource'
markerType
:
'fireResource'
}
}
);
);
export
const
EquipmentPoint
=
markerFactory
(
BasicPoint
,
export
const
EquipmentPoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'impEquipment'
markerType
:
'impEquipment'
}
}
...
@@ -114,14 +114,14 @@ export const WorkerMen3D = marker3DFactory(BasicPoint,
...
@@ -114,14 +114,14 @@ export const WorkerMen3D = marker3DFactory(BasicPoint,
/**
/**
* 人员 3D
* 人员 3D
*/
*/
export
const
FirePoint
=
markerFactory
(
BasicPoint
,
export
const
FirePoint
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'fire'
markerType
:
'fire'
}
}
);
);
export
const
PointStatistics
=
markerFactory
(
BasicPoint
,
export
const
PointStatistics
=
marker
3D
Factory
(
BasicPoint
,
{
{
markerType
:
'statistics'
markerType
:
'statistics'
}
}
...
...
src/view/3dview/moduleEditPoints/marker3DFactory.js
View file @
b11b9191
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
utils
}
from
'amos-tool'
;
import
{
utils
,
deepCopy
}
from
'amos-tool'
;
import
{
Markers
}
from
'amos-3d/lib/designer'
;
import
{
Markers
}
from
'amos-3d/lib/designer'
;
import
{
CONSTS
}
from
'CONSTS/storageConsts'
;
import
{
CONSTS
}
from
'CONSTS/storageConsts'
;
import
PointDialog
from
'./PointDialog'
;
import
PointDialog
from
'./PointDialog'
;
...
@@ -92,7 +92,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
...
@@ -92,7 +92,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
<
WrappedComponent
>
<
WrappedComponent
>
<
Markers
<
Markers
{...
rest
}
{...
rest
}
markers
=
{
result
}
markers
=
{
deepCopy
(
result
)
}
events
=
{
this
.
markerEvents
}
events
=
{
this
.
markerEvents
}
/
>
/
>
{
!
planStarted
&&
<
PointDialog
style
=
{
dialogStyle
}
ref
=
{
node
=>
this
.
pdRef
=
node
}
/>
}
{
!
planStarted
&&
<
PointDialog
style
=
{
dialogStyle
}
ref
=
{
node
=>
this
.
pdRef
=
node
}
/>
}
...
...
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