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
95fd4c45
Commit
95fd4c45
authored
Jun 05, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
冲突
parents
6c1be8a6
02e22f30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
44 deletions
+35
-44
View3D.js
mods/components/3dviewConvertor/view/View3D.js
+34
-43
marker3DFactory.js
...components/3dviewConvertor/view/points/marker3DFactory.js
+1
-1
No files found.
mods/components/3dviewConvertor/view/View3D.js
View file @
95fd4c45
...
...
@@ -483,7 +483,7 @@ class View3D extends Component {
onAllDone
=
objGroup
=>
{
this
.
sceneFactory
.
level
.
change
(
objGroup
);
this
.
cameraFactory
.
fitView
(
desigerHelperConfig
.
cameraEffect
);
this
.
stagePilot
.
rendererFactory
.
setupUModelSahdow
();
//接受阴影
this
.
setState
({
startAsyncLoad
:
true
});
...
...
@@ -493,6 +493,8 @@ class View3D extends Component {
onAfterWorkerInit
=
workerObjGroup
=>
{
// 处理跳跃
this
.
lensJumpFactory
.
process
(
workerObjGroup
);
// 子线程模型加上阴影
workerObjGroup
.
toggleShadow
(
true
);
};
onComplete
=
obj
=>
{
...
...
@@ -893,20 +895,14 @@ class View3D extends Component {
savePointData
=
()
=>
{
let
{
markers
,
pointType
,
isPointSave
}
=
this
.
state
;
this
.
setState
({
isPointSave
:
true
});
console
.
log
(
markers
);
let
paramsArr
=
[];
for
(
let
key
in
markers
){
let
item
=
markers
[
key
];
for
(
let
i
=
0
;
i
<
item
.
length
;
i
++
)
{
if
(
item
[
i
].
isChange
){
paramsArr
.
push
({
pointId
:
item
[
i
].
id
,
pointType
:
item
[
i
].
type
,
position3d
:
`
${
item
[
i
].
position
[
0
]}
,
${
item
[
i
].
position
[
1
]}
,
${
item
[
i
].
position
[
2
]}
`
});
}
}
}
paramsArr
=
markers
[
pointType
].
filter
(
e
=>
e
.
isEdit
).
map
(
item
=>
{
return
{
pointId
:
item
.
id
,
pointType
:
item
.
type
,
position3d
:
item
.
position
.
length
>
1
?
`
${
item
.
position
[
0
]}
,
${
item
.
position
[
1
]}
,
${
item
.
position
[
2
]}
`
:
null
};
});
savePointListAction
(
paramsArr
).
then
(
data
=>
{
getPointTreeAction
(
pointType
).
then
(
...
...
@@ -1143,8 +1139,8 @@ class View3D extends Component {
title
:
dragItem
.
name
,
label
:
dragItem
.
name
,
level
:
dragItem
.
level
,
levelStr
:
dragItem
.
levelStr
,
isChange
:
true
isEdit
:
true
,
levelStr
:
dragItem
.
levelStr
};
let
selectPoints
=
{
...
...
@@ -1538,35 +1534,30 @@ class View3D extends Component {
// 非法元素
return
object
;
}
addMarker
=
({
extData
,
position
})
=>
{
let
{
markers
}
=
this
.
state
;
for
(
let
i
=
0
;
i
<
markers
[
extData
.
type
].
length
;
i
++
)
{
const
marker
=
markers
[
extData
.
type
][
i
];
if
(
marker
.
id
===
extData
.
id
){
marker
.
position
=
position
;
marker
.
isChange
=
true
;
break
;
}
};
// let paramsArr = [{
// pointId: extData.id,
// pointType: extData.type,
// position3d: `${position[0]},${position[1]},${position[2]}`
// }];
// console.log(paramsArr)
let
selectPoints
=
{
id
:
extData
.
id
,
type
:
extData
.
type
,
position3d
:
position
}
this
.
setState
({
selectPoints
,
markers
,
showRightPanel
:
true
});
// savePointListAction(paramsArr).then(data => {
// })
// this.setState({positionxyz: position})
addMarker
=
({
extData
,
position
})
=>
{
const
me
=
this
;
const
{
markers
}
=
me
;
const
isInside
=
me
.
polygonRegion
&&
extData
.
parentId
&&
me
.
polygonRegion
[
extData
.
parentId
].
pointInPolygon
([
position
.
x
,
position
.
y
,
position
.
z
]);
if
(
isInside
){
markers
[
extData
.
type
].
forEach
(
e
=>
{
if
(
e
.
id
===
extData
.
id
){
e
.
position
=
`
${
position
[
0
]}
,
${
position
[
1
]}
,
${
position
[
2
]}
`
;
e
.
isEdit
=
true
;
}
});
extData
.
position
=
position
;
this
.
setState
({
markers
,
positionxyz
:
position
,
showRightPanel
:
true
,
selectPoints
:
extData
});
}
else
{
message
.
error
(
'不能放置非所在区域'
);
}
}
render
()
{
const
{
objs
,
...
...
mods/components/3dviewConvertor/view/points/marker3DFactory.js
View file @
95fd4c45
...
...
@@ -80,7 +80,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
componentWillReceiveProps
=
nextProps
=>
{
if
(
nextProps
.
isEditMode
){
this
.
markersCache
.
eachValue
(
obj
=>
{
//
this.setTopCardConf(obj, obj.extData);
this
.
setTopCardConf
(
obj
,
obj
.
extData
);
if
(
nextProps
.
selectPoints
.
type
==
obj
.
extData
.
type
&&
nextProps
.
selectPoints
.
id
==
obj
.
extData
.
id
){
this
.
setTwinkleConf
(
obj
);
}
...
...
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