Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-station-module-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-station-module-view
Commits
ce1afdb0
Commit
ce1afdb0
authored
Jun 04, 2020
by
张博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改拖拽左边点,保存
parent
8609b37e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
54 deletions
+56
-54
amos.config.js
amos.config.js
+3
-3
PointsPool.js
mods/components/3dviewConvertor/view/PointsPool.js
+34
-1
View3D.js
mods/components/3dviewConvertor/view/View3D.js
+15
-41
marker3DFactory.js
...components/3dviewConvertor/view/points/marker3DFactory.js
+4
-9
No files found.
amos.config.js
View file @
ce1afdb0
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
objModelURI
:
'/a3dres'
,
objModelURI
:
'/a3dres'
,
// 根url
// 根url
// baseURI: 'http://172.16.11.30:9008/',
// baseURI: 'http://172.16.11.30:9008/',
baseURI
:
'http://172.16.3.
63
:8083/'
,
baseURI
:
'http://172.16.3.
122
:8083/'
,
// convertorURI: 'http://172.16.3.122:8083/',
// convertorURI: 'http://172.16.3.122:8083/',
convertorURI
:
'http://172.16.3.
63
:8083/'
,
convertorURI
:
'http://172.16.3.
122
:8083/'
,
patrolURI
:
'http://172.16.3.
63
:8082/'
,
patrolURI
:
'http://172.16.3.
122
:8082/'
,
rulesConfigURI
:
'http://172.16.10.91:8080/'
,
rulesConfigURI
:
'http://172.16.10.91:8080/'
,
// plugin URI
// plugin URI
pluginURI
:
'http://172.16.11.40:8099/'
,
pluginURI
:
'http://172.16.11.40:8099/'
,
...
...
mods/components/3dviewConvertor/view/PointsPool.js
View file @
ce1afdb0
...
@@ -58,7 +58,40 @@ class PointsPool extends Component {
...
@@ -58,7 +58,40 @@ class PointsPool extends Component {
}
}
onMarkersCreated
=
(
type
,
{
markersCache
})
=>
{
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'
)){
let
visible
=
extData
.
visible
;
if
(
visible
)
{
if
(
extData
.
type
===
'fireCar'
)
{
mc
.
visible
=
visible
;
mc
.
object2DPipe
.
pipeNode
.
visible
=
false
;
mc
.
object2DPipe
.
pipeNode
.
elementVisible
=
false
;
}
else
{
mc
.
show
();
}
}
else
{
if
(
extData
.
type
===
'fireCar'
)
{
mc
.
visible
=
visible
;
mc
.
object2DPipe
.
pipeNode
.
visible
=
false
;
mc
.
object2DPipe
.
pipeNode
.
elementVisible
=
false
;
}
else
{
mc
.
hide
();
}
}
}
});
}
}
updateMarkers
=
(
data
)
=>
{
updateMarkers
=
(
data
)
=>
{
...
...
mods/components/3dviewConvertor/view/View3D.js
View file @
ce1afdb0
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
utils
,
UUID
}
from
'amos-tool'
;
import
{
utils
,
UUID
,
deepCopy
}
from
'amos-tool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
Connect
as
UIConnect
,
Modal
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
{
Connect
as
UIConnect
,
Modal
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
{
FatLine
}
from
'amos-3d/lib/advanced'
;
import
{
FatLine
}
from
'amos-3d/lib/advanced'
;
...
@@ -9,9 +9,9 @@ import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent';
...
@@ -9,9 +9,9 @@ import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent';
import
{
transitionHelper
}
from
'amos-3d/lib/helpers'
;
import
{
transitionHelper
}
from
'amos-3d/lib/helpers'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
LensJumpFactory
}
from
'base-r3d/lib/factory'
;
import
{
LensJumpFactory
}
from
'base-r3d/lib/factory'
;
import
{
CONSTS
}
from
'.
/.
./consts/storageConsts'
;
import
{
CONSTS
}
from
'../consts/storageConsts'
;
import
MaskContent
from
'./MaskContent'
;
import
MaskContent
from
'./MaskContent'
;
import
{
getObjFromNet
,
initView3DAction
,
query3DStatistics
,
pointModelistAction
}
from
'.
/.
./services/3dService'
;
import
{
getObjFromNet
,
initView3DAction
,
query3DStatistics
,
pointModelistAction
}
from
'../services/3dService'
;
import
{
desigerConf
,
desigerHelperConfig
}
from
'./conf'
;
import
{
desigerConf
,
desigerHelperConfig
}
from
'./conf'
;
import
PointsPool
from
'./PointsPool'
;
import
PointsPool
from
'./PointsPool'
;
import
{
eventTopics
,
isControllerEvent
,
isManualOperate
}
from
'./consts'
;
import
{
eventTopics
,
isControllerEvent
,
isManualOperate
}
from
'./consts'
;
...
@@ -32,14 +32,14 @@ import {
...
@@ -32,14 +32,14 @@ import {
flickerTroubleMarkers
flickerTroubleMarkers
}
from
'./ruleActionView'
;
}
from
'./ruleActionView'
;
import
{
lineData
}
from
'./datas'
;
import
{
lineData
}
from
'./datas'
;
import
{
getAreaTreeAction
,
getPointTypeAction
,
getPointTreeAction
,
getPointListAction
,
saveAreaDataAction
,
savePointListAction
}
from
'.
/.
./services/moduleEditServices'
;
import
{
getAreaTreeAction
,
getPointTypeAction
,
getPointTreeAction
,
getPointListAction
,
saveAreaDataAction
,
savePointListAction
}
from
'../services/moduleEditServices'
;
import
AreaLeftTree
from
'./moduleEditComponent/AreaLeftTree'
;
import
AreaLeftTree
from
'./moduleEditComponent/AreaLeftTree'
;
import
PointLeftTree
from
'./moduleEditComponent/PointLeftTree'
;
import
PointLeftTree
from
'./moduleEditComponent/PointLeftTree'
;
import
RightEditPointPanel
from
'./moduleEditComponent/RightEditPointPanel'
;
import
RightEditPointPanel
from
'./moduleEditComponent/RightEditPointPanel'
;
import
RightEditRegionPanel
from
'./moduleEditComponent/RightEditRegionPanel'
;
import
RightEditRegionPanel
from
'./moduleEditComponent/RightEditRegionPanel'
;
import
{
EVENTS_CONSTS
}
from
'.
/.
./consts/EventConsts'
;
import
{
EVENTS_CONSTS
}
from
'../consts/EventConsts'
;
import
ExceptionArea
from
'./exceptionArea/ExceptionArea'
;
import
ExceptionArea
from
'./exceptionArea/ExceptionArea'
;
import
{
exceptionRegionListAction
}
from
'.
/.
./services/panoramicService'
;
import
{
exceptionRegionListAction
}
from
'../services/panoramicService'
;
const
AmosConfig
=
endConf
.
AmosConfig
;
const
AmosConfig
=
endConf
.
AmosConfig
;
...
@@ -875,9 +875,9 @@ class View3D extends Component {
...
@@ -875,9 +875,9 @@ class View3D extends Component {
//保存点绑定
//保存点绑定
savePointData
=
()
=>
{
savePointData
=
()
=>
{
let
{
markers
,
pointTypeArr
,
pointType
,
isPointSave
}
=
this
.
state
;
let
{
markers
,
pointType
,
isPointSave
}
=
this
.
state
;
this
.
setState
({
isPointSave
:
true
})
this
.
setState
({
isPointSave
:
true
});
console
.
log
(
markers
)
console
.
log
(
markers
)
;
let
paramsArr
=
[];
let
paramsArr
=
[];
for
(
let
key
in
markers
){
for
(
let
key
in
markers
){
let
item
=
markers
[
key
];
let
item
=
markers
[
key
];
...
@@ -885,7 +885,7 @@ class View3D extends Component {
...
@@ -885,7 +885,7 @@ class View3D extends Component {
paramsArr
.
push
({
paramsArr
.
push
({
pointId
:
item
[
i
].
id
,
pointId
:
item
[
i
].
id
,
pointType
:
item
[
i
].
type
,
pointType
:
item
[
i
].
type
,
position3d
:
`
${
item
[
i
].
position
.
x
}
,
${
item
[
i
].
position
.
y
}
,
${
item
[
i
].
position
.
z
}
`
position3d
:
`
${
item
[
i
].
position
[
0
]}
,
${
item
[
i
].
position
[
1
]}
,
${
item
[
i
].
position
[
2
]
}
`
});
});
}
}
}
}
...
@@ -1081,9 +1081,8 @@ class View3D extends Component {
...
@@ -1081,9 +1081,8 @@ class View3D extends Component {
levelStr
:
dragItem
.
levelStr
,
levelStr
:
dragItem
.
levelStr
,
};
};
markers
[
`
${
type
}
`
].
push
(
addPointParam
);
markers
[
`
${
type
}
`
].
push
(
addPointParam
);
console
.
log
(
markers
)
this
.
setState
({
this
.
setState
({
markers
markers
:
deepCopy
(
markers
)
});
});
}
}
}
}
...
@@ -1354,10 +1353,7 @@ class View3D extends Component {
...
@@ -1354,10 +1353,7 @@ class View3D extends Component {
getExceptionAreasList
=
()
=>
{
getExceptionAreasList
=
()
=>
{
exceptionRegionListAction
().
then
(
data
=>
{
exceptionRegionListAction
().
then
(
data
=>
{
const
exceptionAreas
=
data
.
filter
(
e
=>
{
this
.
setState
({
exceptionAreas
:
data
});
return
e
.
routePath
&&
e
.
routePath
.
routePath
&&
e
.
routePath
.
routePath
.
length
>
0
;
});
this
.
setState
({
exceptionAreas
});
});
});
}
}
...
@@ -1375,7 +1371,7 @@ class View3D extends Component {
...
@@ -1375,7 +1371,7 @@ class View3D extends Component {
};
};
return
exceptionAreas
.
map
((
area
,
index
)
=>
{
return
exceptionAreas
.
map
((
area
,
index
)
=>
{
const
{
routePath
:
points
=
[]
}
=
area
.
routePath
;
const
{
routePath
:
points
=
[]
}
=
area
.
routePath
;
return
<
PolygonRegion
key
=
{
area
.
id
}
{...
regionConf
}
points
=
{
points
}
onCreated
=
{
e
=>
this
.
onRectCreated
(
e
,
area
,
index
)}
/>
;
return
points
.
length
>
0
&&
<
PolygonRegion
key
=
{
area
.
id
}
{...
regionConf
}
points
=
{
points
}
onCreated
=
{
e
=>
this
.
onRectCreated
(
e
,
area
,
index
)}
/>
;
});
});
}
}
...
@@ -1441,10 +1437,7 @@ class View3D extends Component {
...
@@ -1441,10 +1437,7 @@ class View3D extends Component {
setHeaderName
=
(
name
)
=>
{
setHeaderName
=
(
name
)
=>
{
this
.
setState
({
headerName
:
name
});
this
.
setState
({
headerName
:
name
});
}
}
markerCreated
=
(
markersCache
)
=>
{
this
.
markersCache
=
markersCache
;
};
prevProcessTarget
=
(
object
)
=>
{
prevProcessTarget
=
(
object
)
=>
{
// 处理 target 元素,只有标识了 isMarkerRoot 的 Object3D 才是真实的 marker root 元素, 同时为其注入了 `extData`
// 处理 target 元素,只有标识了 isMarkerRoot 的 Object3D 才是真实的 marker root 元素, 同时为其注入了 `extData`
const
target
=
object
.
getBusinessNode
(
obj
=>
obj
.
isMarkerRoot
);
const
target
=
object
.
getBusinessNode
(
obj
=>
obj
.
isMarkerRoot
);
...
@@ -1456,34 +1449,15 @@ class View3D extends Component {
...
@@ -1456,34 +1449,15 @@ class View3D extends Component {
}
}
addMarker
=
({
extData
,
position
})
=>
{
addMarker
=
({
extData
,
position
})
=>
{
const
{
markers
}
=
this
.
state
const
{
markers
}
=
this
.
state
// let type =extData.type
// let arr =markers[`${extData.type}`].filter(item =>item.id == extData.id)
// let arrLasting =markers[`${extData.type}`].filter(item =>item.id != extData.id)
// let addPointParam = {
// type: arr[0].type,
// position:position,
// uid:arr[0].uid,
// id: arr[0].id,
// key: arr[0].key,
// title: arr[0].name,
// label: arr[0].name,
// level: arr[0].level,
// levelStr: arr[0].levelStr,
// };
// let pointParam =arrLasting.push(addPointParam)
// //markers[`${extData.type}`].push(pointParam)
let
paramsArr
=
[{
let
paramsArr
=
[{
pointId
:
extData
.
id
,
pointId
:
extData
.
id
,
pointType
:
extData
.
type
,
pointType
:
extData
.
type
,
position3d
:
`
${
position
[
0
]}
,
${
position
[
1
]}
,
${
position
[
2
]}
`
position3d
:
`
${
position
[
0
]}
,
${
position
[
1
]}
,
${
position
[
2
]}
`
}];
}];
console
.
log
(
paramsArr
)
console
.
log
(
paramsArr
)
savePointListAction
(
paramsArr
).
then
(
data
=>
{
savePointListAction
(
paramsArr
).
then
(
data
=>
{
})
})
//this.setState({positionxyz:
position})
this
.
setState
({
positionxyz
:
position
})
}
}
render
()
{
render
()
{
const
{
const
{
...
@@ -1590,7 +1564,7 @@ class View3D extends Component {
...
@@ -1590,7 +1564,7 @@ class View3D extends Component {
>
>
{
startAsyncLoad
&&
<
WorkerObjContent
objs
=
{
asyncModels
}
onWorkerMessage
=
{
this
.
onWorkerLoading
}
enableLoading
afterInit
=
{
this
.
onAfterWorkerInit
}
/>
}
{
startAsyncLoad
&&
<
WorkerObjContent
objs
=
{
asyncModels
}
onWorkerMessage
=
{
this
.
onWorkerLoading
}
enableLoading
afterInit
=
{
this
.
onAfterWorkerInit
}
/>
}
{
editFlag
&&
pageType
===
'region'
?
''
:
{
editFlag
&&
pageType
===
'region'
?
''
:
<
PointsPool
markers
=
{
markers
}
editFlag
=
{
editFlag
}
selectPoints
=
{
selectPoints
}
updateMarker
=
{
this
.
updateMarker
}
planStarted
=
{
alarmStarted
}
stagePilot
=
{
this
.
stagePilot
}
positionCtl
=
{
this
.
positionCtl
}
addMarker
=
{
this
.
addMarker
}
/>
}
<
PointsPool
markers
=
{
markers
}
editFlag
=
{
editFlag
}
selectPoints
=
{
selectPoints
}
updateMarker
=
{
this
.
updateMarker
}
planStarted
=
{
alarmStarted
}
addMarker
=
{
this
.
addMarker
}
/>
}
{
fireTruckRoute
&&
<
FatLine
{...
lineData
.
fatLineConf
}
linePath
=
{
JSON
.
parse
(
fireTruckRoute
)}
visible
=
{
showFireTruckRoute
}
/>
}
{
fireTruckRoute
&&
<
FatLine
{...
lineData
.
fatLineConf
}
linePath
=
{
JSON
.
parse
(
fireTruckRoute
)}
visible
=
{
showFireTruckRoute
}
/>
}
<
FlameFire
position
=
{
firePosition
}
width
=
{
10
}
height
=
{
20
}
depth
=
{
8
}
sliceSpacing
=
{
1
}
visible
=
{
planStarted
}
/
>
<
FlameFire
position
=
{
firePosition
}
width
=
{
10
}
height
=
{
20
}
depth
=
{
8
}
sliceSpacing
=
{
1
}
visible
=
{
planStarted
}
/
>
{
editFlag
&&
this
.
renderAreas
()}
{
editFlag
&&
this
.
renderAreas
()}
...
...
mods/components/3dviewConvertor/view/points/marker3DFactory.js
View file @
ce1afdb0
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
utils
,
deepCopy
}
from
'amos-tool'
;
import
{
utils
}
from
'amos-tool'
;
import
{
Markers
}
from
'amos-3d/lib/designer'
;
import
{
Markers
}
from
'amos-3d/lib/designer'
;
import
{
BaseObjHelper
}
from
'base-r3d/lib/factory'
;
import
{
BaseObjHelper
}
from
'base-r3d/lib/factory'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
{
CONSTS
}
from
'./../../consts/storageConsts'
;
import
{
CONSTS
}
from
'./../../consts/storageConsts'
;
import
PointDialog
from
'./PointDialog'
;
import
PointDialog
from
'./PointDialog'
;
import
{
tirggerPlanTopic
}
from
'./../dataProcessor'
;
import
{
tirggerPlanTopic
}
from
'./../dataProcessor'
;
...
@@ -27,11 +26,7 @@ const buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
...
@@ -27,11 +26,7 @@ const buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
position
=
Object
.
values
(
m
.
position
);
position
=
Object
.
values
(
m
.
position
);
}
}
for
(
let
k
of
Object
.
keys
(
defaultParams
))
{
for
(
let
k
of
Object
.
keys
(
defaultParams
))
{
if
((
markerType
===
'riskSource'
||
markerType
===
'patrol'
)
&&
k
!=
'useModel'
){
m
[
k
]
=
defaultParams
[
k
];
m
[
k
]
=
formatUrl
(
defaultParams
[
k
],
{
url
:
`
${
markerType
}
-
${
m
.
level
}
`
});
}
else
{
m
[
k
]
=
defaultParams
[
k
];
}
}
}
m
.
key
=
m
.
key
||
m
.
id
;
m
.
key
=
m
.
key
||
m
.
id
;
m
.
url
=
url
;
m
.
url
=
url
;
...
@@ -165,7 +160,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
...
@@ -165,7 +160,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
if
(
marker
){
if
(
marker
){
console
.
log
(
marker
.
position
);
console
.
log
(
marker
.
position
);
console
.
log
(
marker
.
extData
);
console
.
log
(
marker
.
extData
);
this
.
props
.
addMarker
(
marker
)
this
.
props
.
addMarker
(
marker
)
;
}
}
}
}
markerCreated
=
({
markersCache
})
=>
{
markerCreated
=
({
markersCache
})
=>
{
...
@@ -239,7 +234,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
...
@@ -239,7 +234,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
<
Markers
<
Markers
{...
rest
}
{...
rest
}
draggable
draggable
markers
=
{
deepCopy
(
result
)
}
markers
=
{
result
}
//events={this.markerEvents}
//events={this.markerEvents}
events
=
{
events
}
events
=
{
events
}
onCreated
=
{
this
.
markerCreated
}
onCreated
=
{
this
.
markerCreated
}
...
...
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