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
8aa27333
Commit
8aa27333
authored
Jun 12, 2020
by
张博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
0ac02935
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
113 additions
and
68 deletions
+113
-68
pointsDetails.scss
mods/components/3dviewConvertor/styles/pointsDetails.scss
+16
-0
PointsPool.js
mods/components/3dviewConvertor/view/PointsPool.js
+28
-23
PromptModal.js
mods/components/3dviewConvertor/view/PromptModal.js
+12
-1
View3D.js
mods/components/3dviewConvertor/view/View3D.js
+5
-2
dataProcessor.js
mods/components/3dviewConvertor/view/dataProcessor.js
+2
-2
PointLeftTree.js
...3dviewConvertor/view/moduleEditComponent/PointLeftTree.js
+3
-3
marker3DFactory.js
...components/3dviewConvertor/view/points/marker3DFactory.js
+47
-37
No files found.
mods/components/3dviewConvertor/styles/pointsDetails.scss
View file @
8aa27333
...
...
@@ -154,6 +154,22 @@
}
}
.point-dialog-modal
{
::-webkit-scrollbar
{
/* 血槽宽度 */
width
:
5px
;
height
:
5px
;
background-color
:
rgba
(
10
,
53
,
62
,
1
);
border-radius
:
5px
;
}
::-webkit-scrollbar-thumb
{
/* 拖动条 */
border-radius
:
5px
;
background-color
:
rgba
(
255
,
255
,
255
,
0
.4
);
}
::-webkit-scrollbar-track
{
/* 背景槽 */
background-color
:
rgba
(
17
,
44
,
88
,
0
.2
);
}
width
:
100%
;
height
:
100%
;
.amos-modal-container
{
...
...
mods/components/3dviewConvertor/view/PointsPool.js
View file @
8aa27333
...
...
@@ -4,7 +4,7 @@ import { Connect } from 'amos-framework';
import
{
Store
}
from
'amos-tool'
;
import
{
connect3D
}
from
'amos-3d/lib/designer'
;
import
{
RiskPoint
,
PatrolPoint
,
PersonPoint3D
,
MonitorPoint
,
ProbePoint
,
FireResourcePoint
,
EquipmentPoint
,
FireCar3D
,
FirePoint
,
WorkerMen3D
,
PointStatistics
,
ImpEquipmentMode
}
from
'./points'
;
FireResourcePoint
,
EquipmentPoint
,
FireCar3D
,
FirePoint
,
PointStatistics
,
ImpEquipmentMode
}
from
'./points'
;
import
{
eventTopics
,
isPointEvent
,
isLevelFilter
}
from
'./consts'
;
import
{
parseMarkers
,
parseLevelFilter
}
from
'./dataProcessor'
;
...
...
@@ -31,26 +31,26 @@ class PointsPool extends Component {
this
.
markerList
=
{};
}
//
componentDidMount() {
//
this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
//
if (isPointEvent(topic)){
//
parseMarkers(this, topic, data);
//
} else if (isLevelFilter(topic)) {
//
parseLevelFilter(this, topic, data);
//
}
//
});
//
this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
//
parseMarkers(this, topic, data);
//
});
//
// this.props.subscribe(eventTopics.view3d_init, (topic, data) => {
//
// const fireTruckMarkerCache = this.markerList['fireCar'];
//
// if (fireTruckMarkerCache) {
//
// for (let fireTruck of fireTruckMarkerCache.getValues()) {
//
// fireTruck.stopMove();
//
// }
//
// }
//
// });
//
}
componentDidMount
()
{
this
.
props
.
subscribe
(
eventTopics
.
base3d_view
,
(
topic
,
data
)
=>
{
if
(
isPointEvent
(
topic
)){
parseMarkers
(
this
,
topic
,
data
);
}
else
if
(
isLevelFilter
(
topic
))
{
parseLevelFilter
(
this
,
topic
,
data
);
}
});
this
.
props
.
subscribe
(
'base3d.fromws1.showFireTruckRoute'
,
(
topic
,
data
)
=>
{
parseMarkers
(
this
,
topic
,
data
);
});
// this.props.subscribe(eventTopics.view3d_init, (topic, data) => {
// const fireTruckMarkerCache = this.markerList['fireCar'];
// if (fireTruckMarkerCache) {
// for (let fireTruck of fireTruckMarkerCache.getValues()) {
// fireTruck.stopMove();
// }
// }
// });
}
onMarkersCreated
=
(
type
,
{
markersCache
})
=>
{
...
...
@@ -84,7 +84,7 @@ class PointsPool extends Component {
this
.
props
.
updateMarker
(
data
);
}
addMarker
=
(
data
)
=>
{
this
.
props
.
addMarker
(
data
)
this
.
props
.
addMarker
(
data
)
;
}
render
()
{
const
{
markers
,
...
rest
}
=
this
.
props
;
...
...
@@ -241,7 +241,12 @@ class PointsPool extends Component {
PointsPool
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
updateMarker
:
PropTypes
.
func
,
markers
:
PropTypes
.
object
markers
:
PropTypes
.
object
,
isEditMode
:
PropTypes
.
bool
,
selectPoints
:
PropTypes
.
object
,
stagePilot
:
PropTypes
.
object
,
addMarker
:
PropTypes
.
func
};
export
default
PointsPool
;
mods/components/3dviewConvertor/view/PromptModal.js
View file @
8aa27333
import
React
,
{
Component
}
from
'react'
;
import
{
Modal
}
from
'amos-framework'
;
import
PropTypes
from
'prop-types'
;
class
PromptModal
extends
Component
{
constructor
(
props
)
{
...
...
@@ -14,7 +15,7 @@ class PromptModal extends Component {
}
};
saveData
=
()
=>
{
const
{
isback
,
type
,
pointType
,
pointParams
}
=
this
.
props
.
promptData
;
const
{
isback
,
type
,
pointType
,
pointParams
,
isSwitch
}
=
this
.
props
.
promptData
;
this
.
props
.
closePromptModal
();
if
(
type
===
'region'
)
{
...
...
@@ -22,6 +23,8 @@ class PromptModal extends Component {
}
else
{
if
(
isback
){
this
.
props
.
savePointData
();
}
else
if
(
isSwitch
)
{
this
.
props
.
savePointData
();
}
else
{
this
.
props
.
savePointAndRefreshMarker
(
pointType
,
pointParams
);
}
...
...
@@ -61,5 +64,13 @@ class PromptModal extends Component {
);
}
}
PromptModal
.
propTypes
=
{
promptData
:
PropTypes
.
object
,
closePromptModal
:
PropTypes
.
func
,
saveAreaData
:
PropTypes
.
func
,
savePointAndRefreshMarker
:
PropTypes
.
func
,
handleOutExceptModel
:
PropTypes
.
func
,
savePointData
:
PropTypes
.
func
};
export
default
PromptModal
;
mods/components/3dviewConvertor/view/View3D.js
View file @
8aa27333
...
...
@@ -1179,7 +1179,9 @@ class View3D extends Component {
promptContent
:
`有未保存数据,是否保存?`
,
type
:
'point'
,
btnType
:
'isOk'
,
isback
:
false
isback
:
false
,
isSwitch
:
true
}
});
...
...
@@ -1557,10 +1559,11 @@ class View3D extends Component {
selectPoints
:
''
,
showRightPanel
:
false
});
this
.
clearMarkers
();
}
handleExceptModel
=
(
type
,
areaId
)
=>
{
let
{
isPointSave
,
isAreaSave
}
=
this
.
state
;
this
.
clearMarkers
();
if
(
type
===
'into_except_model'
){
//进入耳朵模式
this
.
props
.
editModelChange
(
true
);
//隐藏全景统计
this
.
setState
({
...
...
mods/components/3dviewConvertor/view/dataProcessor.js
View file @
8aa27333
...
...
@@ -250,9 +250,9 @@ export const parseLevelFilter = (instance, topic, data) => {
const
extData
=
mc
.
getExtData
();
if
(
extData
.
levelStr
===
pointLevel
){
if
(
visible
)
{
mc
.
show
()
;
mc
.
visible
=
true
;
}
else
{
mc
.
hide
()
;
mc
.
visible
=
false
;
}
}
});
...
...
mods/components/3dviewConvertor/view/moduleEditComponent/PointLeftTree.js
View file @
8aa27333
...
...
@@ -63,7 +63,7 @@ class PointLeftTree extends Component {
onSelectChange
=
(
value
,
item
)
=>
{
console
.
log
(
value
,
item
);
this
.
setState
({
pointType
:
value
});
this
.
setState
({
pointType
:
value
,
searchValue
:
''
});
this
.
props
.
pointTypeChange
(
value
);
}
onSearchChange
=
(
e
,
v
)
=>
{
...
...
@@ -180,7 +180,7 @@ class PointLeftTree extends Component {
}
render
()
{
let
{
treeData
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
treeData
,
pointTypeArr
,
pointType
,
searchValue
}
=
this
.
state
;
return
(
<
div
className
=
"leftTree"
>
<
div
className
=
'leftContainer'
>
...
...
@@ -196,7 +196,7 @@ class PointLeftTree extends Component {
<
/Select
>
}
<
Search
className
=
'leftSearch'
icon
=
"search"
onChange
=
{
this
.
onSearchChange
}
onIconClick
=
{
this
.
onSearchChange
}
/
>
<
Search
className
=
'leftSearch'
icon
=
"search"
value
=
{
searchValue
}
onChange
=
{
this
.
onSearchChange
}
onIconClick
=
{
this
.
onSearchChange
}
/
>
<
/div
>
<
div
className
=
'treeBox'
>
<
Tree
...
...
mods/components/3dviewConvertor/view/points/marker3DFactory.js
View file @
8aa27333
...
...
@@ -81,18 +81,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
componentWillMount
=
()
=>
{
this
.
setState
({
planStarted
:
this
.
props
.
planStarted
});
};
componentDidMount
()
{
this
.
props
.
subscribe
(
eventTopics
.
base3d_view
,
(
topic
,
data
)
=>
{
if
(
isPointEvent
(
topic
)){
parseMarkers
(
this
,
topic
,
data
);
}
else
if
(
isLevelFilter
(
topic
))
{
parseLevelFilter
(
this
,
topic
,
data
);
}
});
this
.
props
.
subscribe
(
'base3d.fromws1.showFireTruckRoute'
,
(
topic
,
data
)
=>
{
parseMarkers
(
this
,
topic
,
data
);
});
}
//
componentDidMount() {
//
this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
//
if (isPointEvent(topic)){
//
parseMarkers(this, topic, data);
//
} else if (isLevelFilter(topic)) {
//
parseLevelFilter(this, topic, data);
//
}
//
});
//
this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
//
parseMarkers(this, topic, data);
//
});
//
}
componentWillReceiveProps
=
nextProps
=>
{
if
(
nextProps
.
isEditMode
)
{
this
.
markersCache
.
eachValue
(
obj
=>
{
...
...
@@ -145,31 +145,9 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
that
.
setState
({
isClick
:
true
});
// 将isClick设置为true
},
1000
);
};
markerDragend
=
(
marker
,
evt
)
=>
{
if
(
marker
)
{
console
.
log
(
marker
.
position
);
console
.
log
(
marker
.
extData
);
this
.
props
.
addMarker
(
marker
);
}
};
markerCreated
=
({
markersCache
})
=>
{
let
{
isEditMode
,
selectKey
}
=
this
.
props
;
this
.
markersCache
=
markersCache
;
this
.
stagePilot
=
this
.
props
.
stagePilot
;
this
.
outlineHelper
=
this
.
stagePilot
?
this
.
stagePilot
.
outlineHelper
:
undefined
;
markersCache
.
eachValue
(
obj
=>
{
if
(
isEditMode
){
this
.
setTopCardConf
(
obj
,
obj
.
extData
);
}
if
(
obj
.
extData
.
type
===
'riskSource'
&&
markerType
!==
'impEquipmentMode'
&&
!
isEditMode
){
this
.
setTwinkleConf
(
obj
);
}
});
}
setTwinkleConf
=
(
obj
)
=>
{
const
{
twinkle
,
frequency
}
=
obj
.
extData
;
let
pulsePeriod
=
(
twinkle
&&
frequency
!==
0
?
1
/
frequency
:
null
)
;
let
pulsePeriod
=
twinkle
&&
frequency
!==
0
?
1
/
frequency
:
null
;
let
color
=
twinkle
&&
frequency
!==
0
?
'#FF0000'
:
null
;
if
(
!
obj
.
baseObjHelper
.
outlineHelper
){
obj
.
baseObjHelper
.
setOutlineHelper
(
this
.
outlineHelper
);
...
...
@@ -211,7 +189,31 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
// }
obj
.
baseObjHelper
.
title
=
cardTitle
;
};
markerDragend
=
(
marker
,
evt
)
=>
{
if
(
marker
)
{
console
.
log
(
marker
.
position
);
console
.
log
(
marker
.
extData
);
this
.
props
.
addMarker
(
marker
);
}
};
markerCreated
=
(
data
)
=>
{
let
{
isEditMode
}
=
this
.
props
;
let
{
markersCache
}
=
data
;
if
(
markersCache
.
cacheMap
.
size
>
0
)
{
this
.
props
.
onCreated
(
data
);
}
this
.
markersCache
=
markersCache
;
this
.
stagePilot
=
this
.
props
.
stagePilot
;
this
.
outlineHelper
=
this
.
stagePilot
?
this
.
stagePilot
.
outlineHelper
:
undefined
;
markersCache
.
eachValue
(
obj
=>
{
if
(
isEditMode
){
this
.
setTopCardConf
(
obj
,
obj
.
extData
);
}
if
(
obj
.
extData
.
type
===
'riskSource'
&&
markerType
!==
'impEquipmentMode'
&&
!
isEditMode
){
this
.
setTwinkleConf
(
obj
);
}
});
}
buildMarkerOptions
=
(
markers
,
markerType
,
defaultParams
=
{})
=>
{
console
.
log
(
markers
);
const
{
isEditMode
}
=
this
.
props
;
...
...
@@ -263,6 +265,14 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
);
}
}
MarkerPoints
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
updateMarker
:
PropTypes
.
func
,
markers
:
PropTypes
.
object
,
isEditMode
:
PropTypes
.
bool
,
selectPoints
:
PropTypes
.
object
,
stagePilot
:
PropTypes
.
object
,
addMarker
:
PropTypes
.
func
};
return
MarkerPoints
;
}
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