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
e798efd1
Commit
e798efd1
authored
May 20, 2020
by
baoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xiugai
parent
19396154
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
29 deletions
+80
-29
ModuleEdit.js
src/view/3dview/ModuleEdit.js
+49
-14
PointsPoolEditPage.js
src/view/3dview/PointsPoolEditPage.js
+13
-13
AreaLeftTree.js
src/view/3dview/moduleEditComponent/AreaLeftTree.js
+1
-1
marker3DFactory.js
src/view/3dview/moduleEditPoints/marker3DFactory.js
+17
-1
No files found.
src/view/3dview/ModuleEdit.js
View file @
e798efd1
...
...
@@ -364,7 +364,11 @@ class ModuleEdit extends Component {
me
.
a3dRef
.
changeDrawState
(
PEN_STATE
.
FINISHED
);
this
.
state
.
routePathData
.
push
({
riskSourceId
:
this
.
drowItem
.
id
,
routePath
:
JSON
.
stringify
(
penPoints
)
routePath
:
JSON
.
stringify
({
routePath
:
penPoints
,
regionHeigth
:
1
}),
})
this
.
setState
({
drawing
:
false
,
...
...
@@ -528,25 +532,25 @@ class ModuleEdit extends Component {
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
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
)}}
/>
)
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
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
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
noDrop
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
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
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
routePath
}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
{
this
.
getAreas
(
item
.
children
)}
}
}
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
)}}
/>
)
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
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
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
noDrop
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
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
)}}
/>
)
this
.
areas
.
push
(
<
PolygonRegion
{...
this
.
areaStyles
.
normal
}
points
=
{
JSON
.
parse
(
item
.
routePath
)
.
routePath
}
onCreated
=
{(
e
)
=>
{
this
.
onRegionCreated
(
e
,
item
)}}
/>
)
}
}
...
...
@@ -622,8 +626,28 @@ class ModuleEdit extends Component {
console
.
log
(
data
);
})
}
}
//删除区域
deleteAreaBind
=
()
=>
{
let
{
selectArea
,
routePathData
}
=
this
.
state
;
if
(
selectArea
)
{
let
areaParams
=
[];
areaParams
.
push
({
riskSourceId
:
selectArea
.
id
,
routePath
:
''
})
saveAreaDataAction
(
areaParams
).
then
(
d
=>
{
message
.
success
(
'删除成功!'
);
getAreaTreeAction
().
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
treeData
:
data
||
[]
})
});
},
eer
=>
{
message
.
error
(
'删除失败!'
);
});
}
}
...
...
@@ -704,10 +728,8 @@ class ModuleEdit extends Component {
}
// [0,0,0]
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(this.polygonRegion)
// console.log(position)
console
.
log
(
isInside
)
if
(
dragItem
)
{
if
(
isInside
==
false
)
{
...
...
@@ -781,7 +803,15 @@ class ModuleEdit extends Component {
sketchOptions
});
};
prevProcessTarget
=
(
object
)
=>
{
// 处理 target 元素,只有标识了 isMarkerRoot 的 Object3D 才是真实的 marker root 元素, 同时为其注入了 `extData`
const
target
=
object
.
getBusinessNode
(
obj
=>
obj
.
isMarkerRoot
);
if
(
target
){
return
target
;
}
// 非法元素
return
object
;
}
render
()
{
const
{
fireEquipmentPosition
,
drawing
,
objs
,
markers
,
pageType
,
pointType
,
pointTypeArr
,
editFlag
,
showRightPanel
,
selectPoints
,
selectArea
}
=
this
.
state
;
...
...
@@ -814,6 +844,9 @@ class ModuleEdit extends Component {
onCreated
:
this
.
handlePenEditorCreated
,
onPointsChange
:
this
.
handlePenPointsChange
};
const
positionCtlProps
=
{
prevProcessTarget
:
this
.
prevProcessTarget
}
return
(
<
div
className
=
'ModuleEditPage'
>
...
...
@@ -835,6 +868,7 @@ class ModuleEdit extends Component {
nativeProps
=
{
this
.
nativeProps
}
penProps
=
{
penProps
}
enablePositionCtl
positionCtlProps
=
{
positionCtlProps
}
>
<
PointsPoolEditPage
markers
=
{
markers
}
updateMarker
=
{
this
.
updateMarker
}
stagePilot
=
{
this
.
stagePilot
}
/
>
{
this
.
renderAreas
()}
...
...
@@ -856,6 +890,7 @@ class ModuleEdit extends Component {
pointTypeArr
=
{
pointTypeArr
}
pointTypeChange
=
{
this
.
pointTypeChange
}
dragItemChange
=
{
this
.
dragItemChange
}
deleteAreaBind
=
{
this
.
deleteAreaBind
}
/>
:
<
PointLeftTree
treeData
=
{
this
.
state
.
treeData
}
...
...
src/view/3dview/PointsPoolEditPage.js
View file @
e798efd1
...
...
@@ -113,70 +113,70 @@ class PointsPoolEditPage extends Component {
<
RiskPoint
{...
rest
}
markers
=
{
markers
.
riskSource
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'riskSource'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('riskSource', val)}
/
>
<
PatrolPoint
{...
rest
}
markers
=
{
markers
.
patrol
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'risk'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('risk', val)}
/
>
<
PersonPoint3D
{...
rest
}
markers
=
{
markers
.
person
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'person'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('person', val)}
/
>
<
EquipmentPoint
{...
rest
}
markers
=
{
markers
.
impEquipment
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'impEquipment'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('impEquipment', val)}
/
>
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
pool
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'pool'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('pool', val)}
/
>
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
hydrant
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'hydrant'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('hydrant', val)}
/
>
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
fireEquipment
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'fireEquipment'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('fireEquipment', val)}
/
>
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
fireChamber
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'fireChamber'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('fireChamber', val)}
/
>
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
fireFoamRoom
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'fireFoamRoom'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('fireFoamRoom', val)}
/
>
{
!
hideDetector
?
<
FireResourcePoint
{...
rest
}
markers
=
{
markers
.
fireDetection
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'fireDetection'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('fireDetection', val)}
/
>
:
''
}
<
ProbePoint
{...
rest
}
markers
=
{
markers
.
monitorEquipment
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'monitorEquipment'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('monitorEquipment', val)}
/
>
<
MonitorPoint
{...
rest
}
markers
=
{
markers
.
video
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'video'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('video', val)}
/
>
<
FirePoint
{...
rest
}
markers
=
{
markers
.
fire
}
onCreated
=
{(
val
)
=>
this
.
onMarkersCreated
(
'fire'
,
val
)}
//
onCreated={(val) => this.onMarkersCreated('fire', val)}
/
>
{
/*<FireResourcePoint
{...rest}
...
...
src/view/3dview/moduleEditComponent/AreaLeftTree.js
View file @
e798efd1
...
...
@@ -218,7 +218,7 @@ class AreaLeftTree extends Component {
<
Button
className
=
'deleteBtn'
onClick
=
{()
=>
{
// this.props.save
()
this
.
props
.
deleteAreaBind
()
}}
><
/Button
>
<
/div
>
<
/div
>
...
...
src/view/3dview/moduleEditPoints/marker3DFactory.js
View file @
e798efd1
...
...
@@ -89,6 +89,16 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
},
3000
);
tirggerPlanTopic
(
CONSTS
.
plan_detail
,
{
type
:
marker
.
extData
.
type
,
data
:
marker
.
extData
});
}
markerDragend
=
(
marker
,
evt
)
=>
{
console
.
log
(
'hhhhhhhhhhhhhhhhhhhhhhhhhhhh'
);
if
(
marker
){
console
.
log
(
marker
.
position
);
console
.
log
(
marker
.
extData
);
}
}
markerCreated
=
({
markersCache
})
=>
{
this
.
markersCache
=
markersCache
;
}
render
()
{
const
{
markers
,
...
rest
}
=
this
.
props
;
...
...
@@ -96,12 +106,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
let
dialogStyle
=
{
zIndex
:
1000
};
// console.log('zzzzzzzzzzzzzzzz')
const
result
=
buildMarkerOptions
(
markers
,
markerType
,
markerParams
);
const
events
=
{
dragend
:
this
.
markerDragend
,
// dragging: this.markerDragging
}
return
(
<
WrappedComponent
>
<
Markers
{...
rest
}
markers
=
{
deepCopy
(
result
)}
events
=
{
this
.
markerEvents
}
events
=
{
this
.
events
}
draggable
onCreated
=
{
this
.
markerCreated
}
/
>
{
!
planStarted
&&
<
PointDialog
style
=
{
dialogStyle
}
ref
=
{
node
=>
this
.
pdRef
=
node
}
/>
}
<
/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