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
23356c33
Commit
23356c33
authored
Jun 05, 2020
by
张博
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
8d3a5c84
2ec8b905
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
277 additions
and
180 deletions
+277
-180
imgStatic.js
mods/components/3dviewConvertor/consts/imgStatic.js
+8
-4
urlConsts.js
mods/components/3dviewConvertor/consts/urlConsts.js
+1
-0
panoramicService.js
mods/components/3dviewConvertor/services/panoramicService.js
+9
-0
PointsPool.js
mods/components/3dviewConvertor/view/PointsPool.js
+0
-1
View3D.js
mods/components/3dviewConvertor/view/View3D.js
+150
-97
conf.js
mods/components/3dviewConvertor/view/conf.js
+4
-0
ExceptionArea.js
...nents/3dviewConvertor/view/exceptionArea/ExceptionArea.js
+3
-3
PointLeftTree.js
...3dviewConvertor/view/moduleEditComponent/PointLeftTree.js
+7
-6
RightEditRegionPanel.js
...onvertor/view/moduleEditComponent/RightEditRegionPanel.js
+45
-32
EquipStatusList.js
...ewConvertor/view/panoramic/statistical/EquipStatusList.js
+6
-1
marker3DFactory.js
...components/3dviewConvertor/view/points/marker3DFactory.js
+44
-36
No files found.
mods/components/3dviewConvertor/consts/imgStatic.js
View file @
23356c33
...
...
@@ -238,12 +238,17 @@ export const marker3DIoncMapper = {
export
const
safetyIndexIconMapper
=
{
allEror
:
'/mods/components/3dviewConvertor/threeres/markers/exception_all
@2x
.png'
,
allEror
:
'/mods/components/3dviewConvertor/threeres/markers/exception_all.png'
,
faultEror
:
'/mods/components/3dviewConvertor/threeres/markers/exception_fault.png'
,
riskEror
:
'/mods/components/3dviewConvertor/threeres/markers/exception_risk.png'
,
transparent_rpn
:
require
(
'./../threeres/markers/transparent_rpn.png'
)
};
export
const
markerTitleBgMapper
=
{
base
:
require
(
'../assets/convertor/3dview/markers/markerTitle.png'
)
};
\ No newline at end of file
base
:
'/mods/components/3dviewConvertor/assets/convertor/3dview/markers/markerTitle.png'
};
export
const
equipStatusIconMapper
=
{
equip_false
:
'/mods/components/3dviewConvertor/assets/convertor/3dview/markers/pa-0.png'
,
equip_true
:
'/mods/components/3dviewConvertor/assets/convertor/3dview/markers/pa-1.png'
};
mods/components/3dviewConvertor/consts/urlConsts.js
View file @
23356c33
...
...
@@ -62,6 +62,7 @@ export const FscSerUrl = {
statisticsDutyUrl
:
completePrefix
(
convertorURI
,
'api/view3d/statistics/duty'
),
//今日值班统计
onlineDayUrl
:
completePrefix
(
convertorURI
,
'api/view3d/online/date'
),
//消防安全执行天数
exceptionRegionListUrl
:
completePrefix
(
baseURI
,
'api/view3d/region/exception/list'
),
//异常区域查询
listPointsByRegionIdUrl
:
completePrefix
(
baseURI
,
'api/view3d/point/list/{regionId}'
)
//查询区域下点
};
export
const
FasSerUrl
=
{
...
...
mods/components/3dviewConvertor/services/panoramicService.js
View file @
23356c33
...
...
@@ -66,3 +66,12 @@ export const exceptionRegionListAction = ()=>{
return
commonGet
(
FscSerUrl
.
exceptionRegionListUrl
);
};
/**
* 区域下点查询
* @param {number} regionId
*/
export
const
getPointsByRegionIdAction
=
(
regionId
)
=>
{
const
url
=
formatUrl
(
FscSerUrl
.
listPointsByRegionIdUrl
,
{
regionId
});
return
commonGet
(
url
);
};
mods/components/3dviewConvertor/view/PointsPool.js
View file @
23356c33
...
...
@@ -115,7 +115,6 @@ class PointsPool extends Component {
isEditMode
=
{
this
.
props
.
isEditMode
}
addMarker
=
{
this
.
addMarker
}
stagePilot
=
{
this
.
props
.
stagePilot
}
editFlag
=
{
this
.
props
.
editFlag
}
selectPoints
=
{
this
.
props
.
selectPoints
}
/
>
{
/* <PatrolPoint
...
...
mods/components/3dviewConvertor/view/View3D.js
View file @
23356c33
...
...
@@ -2,11 +2,10 @@ import React, { Component } from 'react';
import
PropTypes
from
'prop-types'
;
import
{
utils
,
UUID
,
deepCopy
}
from
'amos-tool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
Connect
as
UIConnect
,
Modal
,
message
,
AmosAlert
,
Toas
t
}
from
'amos-framework'
;
import
{
Connect
as
UIConnect
,
message
,
AmosAler
t
}
from
'amos-framework'
;
import
{
FatLine
}
from
'amos-3d/lib/advanced'
;
import
A3DDesigner
,
{
Connect
,
FireObject
,
DESIGNER_CONSTS
,
PolygonRegion
}
from
'amos-3d/lib/designer'
;
import
WorkerObjContent
from
'amos-3d/lib/worker/WorkerObjContent'
;
import
{
transitionHelper
}
from
'amos-3d/lib/helpers'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
LensJumpFactory
}
from
'base-r3d/lib/factory'
;
import
{
CONSTS
}
from
'../consts/storageConsts'
;
...
...
@@ -39,7 +38,7 @@ import RightEditPointPanel from './moduleEditComponent/RightEditPointPanel';
import
RightEditRegionPanel
from
'./moduleEditComponent/RightEditRegionPanel'
;
import
{
EVENTS_CONSTS
}
from
'../consts/EventConsts'
;
import
ExceptionArea
from
'./exceptionArea/ExceptionArea'
;
import
{
exceptionRegionListAction
}
from
'../services/panoramicService'
;
import
{
exceptionRegionListAction
,
getPointsByRegionIdAction
}
from
'../services/panoramicService'
;
const
AmosConfig
=
endConf
.
AmosConfig
;
...
...
@@ -112,7 +111,7 @@ class View3D extends Component {
routePathData
:
[],
//区域线位置
pageType
:
'region'
,
//编辑类型
pointType
:
''
,
//筛选框点类型
editFlag
:
false
,
//编辑模式
isEditMode
:
false
,
//编辑模式
showRightPanel
:
false
,
//是否显示右侧详情
dragItem
:
''
,
//拖动的节点,
exceptionAreas
:
[],
//异常区域
...
...
@@ -197,7 +196,7 @@ class View3D extends Component {
this
.
setState
(
{
planStarted
:
true
,
editFlag
:
false
isEditMode
:
false
},
()
=>
{
this
.
props
.
trigger
(
eventTopics
.
plan_start
,
{
...
...
@@ -285,8 +284,8 @@ class View3D extends Component {
let
fireEquipmentPosition
=
data
.
contingencyRo
.
fireEquipmentPosition
.
split
(
','
);
this
.
setState
({
fireEquipmentPosition
});
}
assembleTroubleView
(
this
,
data
,
this
.
state
.
markers
);
this
.
handleExceptModel
(
'out_except_model'
);
assembleTroubleView
(
this
,
data
,
this
.
state
.
markers
);
break
;
case
'base3d.fromws.mapArea_action1-2'
:
//镜头切换(旋转+推进)
changeGoodView
(
this
,
data
);
...
...
@@ -500,7 +499,7 @@ class View3D extends Component {
const
me
=
this
;
if
(
!
obj
.
isForceParent
)
{
obj
.
on
(
'click'
,
evt
=>
{
if
(
this
.
state
.
editFlag
==
false
)
{
if
(
this
.
state
.
isEditMode
==
false
)
{
console
.
log
(
'obj click:'
,
evt
);
// this.focusPosition(evt.pickedPosition);
me
.
outlineFactory
.
toggleOutline
(
evt
.
object
);
...
...
@@ -547,11 +546,14 @@ class View3D extends Component {
}
}
};
getPointList
=
()
=>
{
const
{
markers
}
=
this
.
state
getPointList
=
(
pointType
)
=>
{
let
{
markers
}
=
this
.
state
this
.
clearMarkers
();
getPointListAction
().
then
(
data
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
markers
[
data
[
i
].
type
].
push
(
data
[
i
])
if
(
pointType
&&
data
[
i
].
type
==
pointType
){
markers
[
pointType
].
push
(
data
[
i
]);
}
}
this
.
setState
({
markers
})
})
...
...
@@ -849,6 +851,10 @@ class View3D extends Component {
message
.
error
(
'保存失败!'
);
});
}
changeRoutePath
=
(
routePathNode
)
=>
{
this
.
state
.
routePathData
.
push
(
routePathNode
);
}
//保存区域绑定
saveAreaData
=
()
=>
{
let
{
routePathData
}
=
this
.
state
;
...
...
@@ -888,16 +894,20 @@ class View3D extends Component {
});
}
}
savePointListAction
(
paramsArr
).
then
(
data
=>
{
message
.
success
(
'保存成功!'
);
getPointTreeAction
(
pointType
).
then
(
data
=>
{
this
.
setState
({
treeData
:
data
||
[],
pageType
:
'point'
,
showRightPanel
:
false
});
});
})
savePointListAction
(
paramsArr
).
then
(
data
=>
{
getPointTreeAction
(
pointType
).
then
(
data
=>
{
this
.
setState
({
treeData
:
data
||
[],
pageType
:
'point'
,
showRightPanel
:
false
});
}
);
message
.
success
(
'保存成功'
);
},
error
=>
message
.
error
(
'保存失败'
)
);
}
...
...
@@ -931,9 +941,9 @@ class View3D extends Component {
fireDetection
:[]
}
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
newMarkers
[
data
[
i
].
type
].
push
(
data
[
i
])
newMarkers
[
data
[
i
].
type
].
push
(
data
[
i
])
;
}
this
.
setState
(
{
markers
:
newMarkers
})
this
.
setState
(
{
markers
:
newMarkers
});
})
this
.
setState
({
...
...
@@ -945,32 +955,28 @@ class View3D extends Component {
})
}
}
toastWarningInfo
=
(
content
)
=>
{
Toast
.
warning
({
title
:
'警告'
,
content
,
placement
:
'topMiddle'
,
})
}
//删除区域
deleteAreaBind
=
()
=>
{
let
{
selectArea
}
=
this
.
state
;
let
{
selectArea
,
treeData
}
=
this
.
state
;
if
(
selectArea
)
{
let
areaParams
=
[];
areaParams
.
push
({
riskSourceId
:
selectArea
.
id
,
routePath
:
''
});
saveAreaDataAction
(
areaParams
).
then
(
d
=>
{
message
.
success
(
'删除成功!'
);
getAreaTreeAction
().
then
(
data
=>
{
this
.
getAreas
(
data
);
getPointsByRegionIdAction
(
selectArea
.
id
).
then
(
d
=>
{
if
(
d
&&
d
.
length
==
0
){
this
.
state
.
routePathData
.
push
({
riskSourceId
:
selectArea
.
id
,
routePath
:
''
});
var
tree
=
new
Object
();
tree
.
children
=
treeData
;
this
.
removeTreeDataRoutePathByChildId
(
selectArea
.
id
,
tree
);
this
.
getAreas
(
tree
.
children
);
this
.
setState
({
treeData
:
data
||
[]
routePathData
:
this
.
state
.
routePathData
,
treeData
:
tree
.
children
});
}
);
},
eer
=>
{
message
.
error
(
'删除失败!'
);
}
else
{
message
.
danger
(
'请先清除点的绑定再进行删除!'
);
}
});
}
}
...
...
@@ -990,6 +996,29 @@ class View3D extends Component {
}
this
.
setState
({
treeDataList
})
}
removeTreeDataRoutePathByChildId
=
(
areaId
,
obj
)
=>
{
let
oldSize
=
obj
.
children
.
length
;
let
flag
=
false
;
if
(
oldSize
>
0
){
obj
.
children
&&
obj
.
children
.
some
(
t
=>
{
if
(
t
.
id
==
areaId
){
t
.
routePath
=
''
;
t
.
isBind
=
false
;
flag
=
true
}
});
if
(
flag
){
//移除
return
;
}
else
{
obj
.
children
&&
obj
.
children
.
some
(
t
=>
{
this
.
removeTreeDataRoutePathByChildId
(
areaId
,
t
);
});
}
}
else
{
return
;
}
}
/**
* 切换区域和点页面
...
...
@@ -1006,6 +1035,7 @@ class View3D extends Component {
showRightPanel
:
false
});
});
this
.
disabledCamera
();
}
else
{
getPointTreeAction
(
pointTypeArr
[
0
].
code
||
''
).
then
(
data
=>
{
this
.
generateList
(
data
)
...
...
@@ -1016,17 +1046,19 @@ class View3D extends Component {
showRightPanel
:
false
});
});
this
.
enableCamera
();
}
}
pointTypeChange
=
(
pointType
)
=>
{
let
{
isPointSave
}
=
this
.
state
if
(
!
isPointSave
){
this
.
showConfirm
()
let
{
isPointSave
}
=
this
.
state
;
if
(
!
isPointSave
){
this
.
showConfirm
()
;
}
this
.
setState
({
pointType
,
treeData
:[]
treeData
:
[]
});
this
.
getPointList
(
pointType
);
getPointTreeAction
(
pointType
).
then
(
data
=>
{
this
.
setState
({
pointType
,
...
...
@@ -1037,10 +1069,10 @@ class View3D extends Component {
showConfirm
=
()
=>
{
AmosAlert
.
confirm
(
'提示'
,
'有未保存数据,是否保存?'
,
{
callback
:
(
flag
)
=>
{
if
(
flag
){
this
.
savePointData
()
if
(
flag
){
this
.
savePointData
();
}
else
{
this
.
setState
({
isPointSave
:
true
})
this
.
setState
({
isPointSave
:
true
});
}
}
});
...
...
@@ -1063,13 +1095,12 @@ class View3D extends Component {
}
drop
=
(
event
)
=>
{
const
{
dragItem
,
markers
}
=
this
.
state
;
event
.
preventDefault
();
this
.
setState
({
isPointSave
:
false
})
this
.
setState
({
isPointSave
:
false
});
let
{
dragItem
,
markers
}
=
this
.
state
;
if
(
dragItem
)
{
if
(
dragItem
.
isBind
)
{
this
.
toastWarningInfo
(
'只能放置未绑定的标记点'
)
message
.
danger
(
'只能放置未绑定的标记点'
);
return
false
;
}
...
...
@@ -1083,7 +1114,7 @@ class View3D extends Component {
console
.
log
(
isInside
);
if
(
dragItem
)
{
if
(
isInside
===
false
)
{
this
.
toastWarningInfo
(
'只能放置在当前区域'
)
message
.
danger
(
'只能放置在当前区域'
);
return
false
;
}
let
uid
=
UUID
.
uuidFast
();
...
...
@@ -1107,19 +1138,19 @@ class View3D extends Component {
}
quitEditMode
=
()
=>
{
this
.
setState
({
editFlag
:
false
isEditMode
:
false
});
this
.
props
.
editModelChange
(
false
);
}
editButtonClick
=
()
=>
{
let
{
editFlag
}
=
this
.
state
;
if
(
editFlag
===
true
)
{
let
{
isEditMode
}
=
this
.
state
;
if
(
isEditMode
===
true
)
{
return
false
;
}
editFlag
=
true
;
this
.
setState
({
editFlag
});
if
(
editFlag
===
true
)
{
isEditMode
=
true
;
this
.
setState
({
isEditMode
});
if
(
isEditMode
===
true
)
{
getAreaTreeAction
().
then
(
data
=>
{
this
.
generateList
(
data
)
this
.
setState
({
...
...
@@ -1132,8 +1163,8 @@ class View3D extends Component {
pointTypeArr
:
data
||
[],
pointType
:
data
[
0
]
?
data
[
0
].
code
:
''
});
this
.
getPointList
(
data
[
0
].
code
);
});
this
.
getPointList
();
}
}
...
...
@@ -1298,10 +1329,11 @@ class View3D extends Component {
onActionItemClick
=
(
actionType
,
label
,
showLabel
)
=>
{
const
{
pageType
}
=
this
.
state
;
this
.
clearMarkers
();
this
.
props
.
editModelChange
(
false
);
this
.
setState
({
editFlag
:
false
isEditMode
:
false
});
if
(
showLabel
){
//进入各个模式名称设置
this
.
setHeaderName
(
label
);
...
...
@@ -1310,7 +1342,7 @@ class View3D extends Component {
this
.
asyncLoadImpEquipment
(
actionType
);
this
.
props
.
editModelChange
(
true
);
this
.
setState
({
editFlag
:
false
,
isEditMode
:
false
,
isShowActionBar
:
false
,
//隐藏工具栏
startLoadExceptionArea
:
false
,
//隐藏marker
sideControlShow
:
false
//隐藏耳朵
...
...
@@ -1318,6 +1350,10 @@ class View3D extends Component {
}
else
if
(
actionType
===
'editMode'
){
this
.
editButtonClick
();
this
.
props
.
editModelChange
(
true
);
if
(
pageType
===
'region'
){
this
.
disabledCamera
();
}
this
.
setState
({
isShowActionBar
:
false
,
//隐藏工具栏
startLoadExceptionArea
:
false
,
//隐藏marker
...
...
@@ -1326,7 +1362,7 @@ class View3D extends Component {
}
else
{
this
.
props
.
editModelChange
(
false
);
this
.
setState
({
editFlag
:
false
isEditMode
:
false
});
}
}
...
...
@@ -1346,6 +1382,18 @@ class View3D extends Component {
}
disabledCamera
=
()
=>
{
this
.
stagePilot
.
cameraFactory
.
orbitControl
.
maxPolarAngle
=
0
;
//不能旋转
this
.
stagePilot
.
cameraFactory
.
orbitControl
.
minPolarAngle
=
0
;
//不能旋转
this
.
cameraFactory
.
fitView
(
desigerHelperConfig
.
verticalCameraEffect
);
//视角调整为平面视角
}
enableCamera
=
()
=>
{
this
.
stagePilot
.
cameraFactory
.
orbitControl
.
maxPolarAngle
=
desigerConf
.
cameraOptions
.
builtInOrbit
.
maxPolarAngle
;
//恢复正常视角
this
.
stagePilot
.
cameraFactory
.
orbitControl
.
minPolarAngle
=
desigerConf
.
cameraOptions
.
builtInOrbit
.
minPolarAngle
;
//恢复正常视角
this
.
executeOperate
({
key
:
'fitview'
});
//初始视角
}
onRectCreated
=
(
polygonRegion
,
area
,
index
)
=>
{
polygonRegion
.
visible
=
false
;
const
{
regionHeigth
=
10
}
=
area
.
routePath
;
...
...
@@ -1391,7 +1439,7 @@ class View3D extends Component {
}
handleExceptModel
=
(
type
,
areaId
)
=>
{
let
{
isPointSave
}
=
this
.
state
let
{
isPointSave
}
=
this
.
state
;
this
.
clearMarkers
();
if
(
type
===
'into_except_model'
){
//进入耳朵模式
this
.
props
.
editModelChange
(
true
);
//隐藏全景统计
...
...
@@ -1403,47 +1451,52 @@ class View3D extends Component {
errorAreaId
:
areaId
});
}
else
if
(
type
===
'out_except_model'
){
if
(
!
isPointSave
){
if
(
!
isPointSave
){
AmosAlert
.
confirm
(
'提示'
,
'有未保存数据,是否保存?'
,
{
callback
:
(
flag
)
=>
{
if
(
flag
){
this
.
savePointData
()
this
.
props
.
editModelChange
(
false
);
//显示全景统计
this
.
setState
({
treeData
:[],
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
editFlag
:
false
,
//推出编辑模式
errorAreaId
:
''
});
if
(
flag
){
this
.
savePointData
();
this
.
executeOperate
({
key
:
'fitview'
});
//恢复正常视角
this
.
props
.
editModelChange
(
false
);
//显示全景统计
this
.
setState
({
treeData
:
[],
pageType
:
'region'
,
//区域
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
isEditMode
:
false
,
//推出编辑模式
errorAreaId
:
''
});
}
else
{
this
.
props
.
editModelChange
(
false
);
//显示全景统计
this
.
setState
({
isPointSave
:
true
,
treeData
:[],
isPointSave
:
true
,
treeData
:
[],
pageType
:
'region'
,
//区域
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
editFlag
:
false
,
//推出编辑模式
isEditMode
:
false
,
//推出编辑模式
errorAreaId
:
''
});
}
}
});
}
else
{
}
else
{
this
.
props
.
editModelChange
(
false
);
//显示全景统计
this
.
enableCamera
();
//恢复相机
this
.
setState
({
treeData
:[],
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
editFlag
:
false
,
//推出编辑模式
errorAreaId
:
''
});
treeData
:
[],
pageType
:
'region'
,
//区域
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
isEditMode
:
false
,
//推出编辑模式
errorAreaId
:
''
});
}
}
...
...
@@ -1490,7 +1543,7 @@ class View3D extends Component {
planStarted
,
alarmStarted
,
fireEquipmentPosition
,
drawing
,
pageType
,
pointTypeArr
,
editFlag
,
showRightPanel
,
selectPoints
,
selectArea
,
drawing
,
pageType
,
pointTypeArr
,
isEditMode
,
showRightPanel
,
selectPoints
,
selectArea
,
exceptionAreas
,
exceptionMarkers
,
startLoadExceptionArea
,
sideControlShow
,
isShowActionBar
,
...
...
@@ -1583,16 +1636,16 @@ class View3D extends Component {
onCreated
=
{
this
.
onGraphCreated
}
>
{
startAsyncLoad
&&
<
WorkerObjContent
objs
=
{
asyncModels
}
onWorkerMessage
=
{
this
.
onWorkerLoading
}
enableLoading
afterInit
=
{
this
.
onAfterWorkerInit
}
/>
}
{
editFlag
&&
pageType
===
'region'
?
''
:
<
PointsPool
markers
=
{
markers
}
editFlag
=
{
editFlag
}
selectPoints
=
{
selectPoints
}
updateMarker
=
{
this
.
updateMarker
}
planStarted
=
{
alarmStarted
}
stagePilot
=
{
this
.
stagePilot
}
addMarker
=
{
this
.
addMarker
}
/>
}
{
isEditMode
&&
pageType
===
'region'
?
''
:
<
PointsPool
markers
=
{
markers
}
isEditMode
=
{
isEditMode
}
selectPoints
=
{
selectPoints
}
updateMarker
=
{
this
.
updateMarker
}
planStarted
=
{
alarmStarted
}
stagePilot
=
{
this
.
stagePilot
}
positionCtl
=
{
this
.
positionCtl
}
addMarker
=
{
this
.
addMarker
}
/>
}
{
fireTruckRoute
&&
<
FatLine
{...
lineData
.
fatLineConf
}
linePath
=
{
JSON
.
parse
(
fireTruckRoute
)}
visible
=
{
showFireTruckRoute
}
/>
}
<
FlameFire
position
=
{
firePosition
}
width
=
{
10
}
height
=
{
20
}
depth
=
{
8
}
sliceSpacing
=
{
1
}
visible
=
{
planStarted
}
/
>
{
editFlag
&&
this
.
renderAreas
()}
{
isEditMode
&&
this
.
renderAreas
()}
{
this
.
renderPolygonRegion
(
exceptionAreas
)}
{
startLoadExceptionArea
&&
<
ExceptionArea
markers
=
{
exceptionMarkers
}
handleExceptModel
=
{
this
.
handleExceptModel
}
/>
}
<
/A3DDesigner
>
<
/div
>
{
editFlag
&&
{
isEditMode
&&
<
div
>
{
pageType
===
'region'
?
...
...
@@ -1629,7 +1682,7 @@ class View3D extends Component {
<
/div
>
<
div
className
=
'rightBox'
>
{
showRightPanel
&&
pageType
===
'region'
?
<
RightEditRegionPanel
detailData
=
{
selectArea
}
rightHeight
=
{
rightHeight
}
closeRightPanel
=
{()
=>
this
.
setState
({
showRightPanel
:
false
})}
saveRoutePath
=
{
this
.
saveRoutePath
}
/> : '
'
showRightPanel
&&
pageType
===
'region'
?
<
RightEditRegionPanel
detailData
=
{
selectArea
}
rightHeight
=
{
rightHeight
}
closeRightPanel
=
{()
=>
this
.
setState
({
showRightPanel
:
false
})}
changeRoutePath
=
{
this
.
changeRoutePath
}
routePathData
=
{
this
.
state
.
routePathData
}
/> : '
'
}
{
showRightPanel
&&
pageType
===
'point'
?
<
RightEditPointPanel
detailData
=
{
selectPoints
}
positionxyz
=
{
positionxyz
}
closeRightPanel
=
{()
=>
this
.
setState
({
showRightPanel
:
false
})}
/> : '
'
...
...
mods/components/3dviewConvertor/view/conf.js
View file @
23356c33
...
...
@@ -362,6 +362,10 @@ export const desigerHelperConfig = {
},
objAnchor
:
{
position
:
[
0
,
5
,
0
]
},
verticalCameraEffect
:
{
position
:
[
2.3815615940156256
,
419.57425506421896
,
11.965199740306224
],
target
:
[
2.408441971875859
,
1.3271790975878637
,
3.918674823963386
]
}
};
...
...
mods/components/3dviewConvertor/view/exceptionArea/ExceptionArea.js
View file @
23356c33
...
...
@@ -52,9 +52,9 @@ class ExceptionArea extends Component {
obj
.
baseObjHelper
.
titleConfig
=
{
// 顶牌平面参数
planeOptions
:
{
width
:
4
0
,
height
:
4
0
,
position
:
[
0
,
4
,
0
],
width
:
2
0
,
height
:
2
0
,
position
:
[
0
,
2
,
0
],
doubleSide
:
true
},
canvasOptions
:
{
...
...
mods/components/3dviewConvertor/view/moduleEditComponent/PointLeftTree.js
View file @
23356c33
...
...
@@ -62,14 +62,14 @@ class PointLeftTree extends Component {
this
.
setState
({
treeData
,
treeDataList
,
pointTypeArr
,
pointType
:
pointTypeArr
[
0
]?
pointTypeArr
[
0
].
code
:
''
//
pointTypeArr,
//
pointType: pointTypeArr[0]?pointTypeArr[0].code:''
})
}
onSelectChange
=
(
value
,
item
)
=>
{
console
.
log
(
value
,
item
);
this
.
s
tate
.
pointType
=
value
;
this
.
s
etState
({
pointType
:
value
})
this
.
props
.
pointTypeChange
(
value
);
}
onSearchChange
=
e
=>
{
...
...
@@ -190,14 +190,15 @@ class PointLeftTree extends Component {
<
div
className
=
"leftTree"
>
<
div
className
=
'leftContainer'
>
<
div
className
=
'topForm'
>
{(
pointType
!=
''
)
&&
<
Select
onChange
=
{
this
.
onSelectChange
}
defaultValue
=
{
pointType
}
className
=
'leftSelect'
>
{(
pointType
!=
''
)
&&
<
Select
onChange
=
{
this
.
onSelectChange
}
defaultValue
=
{
pointType
}
value
=
{
pointType
}
className
=
'leftSelect'
>
{
pointTypeArr
.
map
(
item
=>
{
return
(
<
Option
value
=
{
item
.
code
}
>
{
item
.
name
}
<
/Option>
)
})
}
<
/Select>
}
<
/Select
>
}
<
Search
className
=
'leftSearch'
icon
=
"search"
onChange
=
{
this
.
onSearchChange
}
onIconClick
=
{
this
.
onSearchChange
}
/
>
<
/div
>
...
...
mods/components/3dviewConvertor/view/moduleEditComponent/RightEditRegionPanel.js
View file @
23356c33
...
...
@@ -15,43 +15,50 @@ const RadioGroup = Radio.Group;
class
RightEditRegionPanel
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
form
:
{
}
,
rules
:
{},
treeDetailData
:[]
form
:
{
},
rules
:
{},
treeDetailData
:[]
,
detailData
:
{},
heightInput
:
0
};
}
componentDidMount
()
{
console
.
log
(
JSON
.
stringify
(
this
.
props
.
detailData
))
// getAreaTreeDetailAction().then(data => {
// console.log(data);
// this.setState({
// treeDetailData:data || []
// })
// this.props.getAreaData(data || [])
// })
console
.
log
(
JSON
.
stringify
(
this
.
props
.
detailData
))
const
{
detailData
,
routePathData
}
=
this
.
props
;
this
.
mergeDetailData
(
detailData
,
routePathData
);
}
componentWillUnmount
()
{
}
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
nextProps
)
let
{
treeData
,
pointTypeArr
}
=
nextProps
;
// this.setState({
console
.
log
(
nextProps
)
// if(this.props.detailData != nextProps.detailData || this.props.routePathData != nextProps.routePathData){
let
{
detailData
,
routePathData
}
=
nextProps
;
this
.
mergeDetailData
(
detailData
,
routePathData
);
// }
}
// })
mergeDetailData
=
(
detailData
,
routePathData
)
=>
{
let
{
heightInput
}
=
this
.
state
;
const
{
rightHeight
}
=
this
.
props
;
routePathData
&&
routePathData
.
forEach
(
r
=>
{
if
(
r
.
riskSourceId
===
detailData
.
id
){
detailData
.
routePath
=
r
.
routePath
;
}
});
heightInput
=
detailData
&&
detailData
.
routePath
&&
detailData
.
routePath
!=
''
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
||
rightHeight
;
this
.
setState
({
detailData
,
heightInput
});
}
onChange
=
(
key
,
e
)
=>
{
const
value
=
e
.
target
.
value
;
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
[
key
]:
value
});
this
.
setState
({
form
:
newForm
form
:
newForm
,
heightInput
:
value
});
}
onRadioChange
=
(
value
)
=>
{
...
...
@@ -67,15 +74,9 @@ class RightEditRegionPanel extends Component {
});
}
handleSubmit
=
(
e
)
=>
{
// e.preventDefault();
const
{
detailData
}
=
this
.
props
const
{
detailData
}
=
this
.
state
;
this
.
form
.
validate
((
valid
,
dataValues
,
errors
)
=>
{
console
.
log
(
'返回内容:'
,
dataValues
,
valid
,
errors
);
if
(
valid
)
{
...
...
@@ -83,10 +84,19 @@ class RightEditRegionPanel extends Component {
let
routePathData
=
[
{
riskSourceId
:
detailData
.
id
,
routePath
:
JSON
.
stringify
({
routePath
:
detailData
.
routePath
,
routePath
:
JSON
.
parse
(
detailData
.
routePath
)
.
routePath
,
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
})}]
this
.
props
.
saveRoutePath
(
routePathData
)
// this.props.saveRoutePath(routePathData)
let
routePathDataNode
=
{
riskSourceId
:
detailData
.
id
,
routePath
:
JSON
.
stringify
({
routePath
:
JSON
.
parse
(
detailData
.
routePath
).
routePath
,
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
})
}
this
.
props
.
changeRoutePath
(
routePathDataNode
);
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
...
...
@@ -95,8 +105,8 @@ class RightEditRegionPanel extends Component {
}
render
()
{
let
{
rules
,
form
,
pointTypeArr
,
pointType
,
}
=
this
.
state
;
let
{
pageType
,
detailData
,
rightHeight
}
=
this
.
props
;
let
{
rules
,
form
,
pointTypeArr
,
pointType
,
detailData
,
heightInput
}
=
this
.
state
;
let
{
pageType
,
rightHeight
}
=
this
.
props
;
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
28
},
...
...
@@ -174,7 +184,10 @@ class RightEditRegionPanel extends Component {
</div> */
}
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"高"
field
=
"positionZ"
{...
formItemLayout
}
>
<
Input
placeholder
=
{
rightHeight
}
onChange
=
{(
e
)
=>
this
.
onChange
(
'positionZ'
,
e
)}
/
>
<
Input
placeholder
=
{
detailData
.
routePath
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
||
rightHeight
}
value
=
{
heightInput
}
onChange
=
{(
e
)
=>
this
.
onChange
(
'positionZ'
,
e
)}
/
>
{
/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */
}
<
/FormItem
>
<
/div
>
...
...
mods/components/3dviewConvertor/view/panoramic/statistical/EquipStatusList.js
View file @
23356c33
import
React
,
{
Component
}
from
'react'
;
import
{
equipStatusListAction
}
from
'./../../../services/panoramicService'
;
import
{
equipStatusIconMapper
}
from
'./../../../consts/imgStatic'
;
const
getIcon
=
(
status
)
=>
{
return
equipStatusIconMapper
[
`equip_
${
status
}
`
];
};
/**
* 设备状态消息
*/
...
...
@@ -32,7 +37,7 @@ export default class EquipStatusList extends Component {
return
(
<
div
key
=
{
item
.
id
}
className
=
"title-child"
>
<
div
className
=
"title-date"
>
{
item
.
changeDate
}
<
/div
>
<
div
className
=
"title-text"
>
{
item
.
label
}
<
/div
>
<
div
className
=
"title-text"
>
{
item
.
label
}
&
nbsp
;
&
nbsp
;
<
img
src
=
{
getIcon
(
item
.
status
)}
alt
=
""
/>
<
/div
>
<
/div
>
);
})
...
...
mods/components/3dviewConvertor/view/points/marker3DFactory.js
View file @
23356c33
...
...
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import
{
utils
}
from
'amos-tool'
;
import
{
Markers
}
from
'amos-3d/lib/designer'
;
import
{
BaseObjHelper
}
from
'base-r3d/lib/factory'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
{
CONSTS
}
from
'./../../consts/storageConsts'
;
import
PointDialog
from
'./PointDialog'
;
import
{
tirggerPlanTopic
}
from
'./../dataProcessor'
;
...
...
@@ -17,29 +18,6 @@ const getIcon = (markerType, level) => {
return
marker3DIoncMapper
[
`
${
markerType
}
`
]
};
const
buildMarkerOptions
=
(
markers
,
markerType
,
defaultParams
=
{})
=>
{
if
(
!
utils
.
isEmpty
(
markers
)){
markers
.
forEach
(
m
=>
{
const
url
=
getIcon
(
markerType
,
m
.
level
);
let
position
;
if
(
!
utils
.
isArray
(
m
.
position
)){
position
=
Object
.
values
(
m
.
position
);
}
for
(
let
k
of
Object
.
keys
(
defaultParams
))
{
m
[
k
]
=
defaultParams
[
k
];
}
m
.
key
=
m
.
key
||
m
.
id
;
m
.
url
=
url
;
m
.
position
=
utils
.
isArray
(
m
.
position
)
?
m
.
position
:
position
;
m
.
size
=
10
;
m
.
name
=
m
.
name
?
m
.
name
:
m
.
label
;
m
.
label
=
null
;
// m.label = createMarkerLabel(m.name);
});
}
return
markers
;
};
const
createMarkerLabel
=
(
text
)
=>
{
const
div
=
document
.
createElement
(
'div'
);
div
.
style
.
position
=
'absolute'
;
...
...
@@ -100,7 +78,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
}
componentWillReceiveProps
=
nextProps
=>
{
if
(
nextProps
.
editFlag
){
if
(
nextProps
.
isEditMode
){
this
.
markersCache
.
eachValue
(
obj
=>
{
this
.
setTopCardConf
(
obj
,
obj
.
extData
);
if
(
nextProps
.
selectPoints
.
type
==
obj
.
extData
.
type
&&
nextProps
.
selectPoints
.
id
==
obj
.
extData
.
id
){
...
...
@@ -130,9 +108,6 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
onMarkerClick
=
(
marker
,
e
)
=>
{
const
{
isClick
}
=
this
.
state
;
if
(
this
.
props
.
editFlag
){
return
false
}
if
(
this
.
props
.
isEditMode
)
{
return
false
}
...
...
@@ -159,14 +134,13 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
}
}
markerCreated
=
({
markersCache
})
=>
{
let
{
editFlag
,
selectKey
,
stagePilot
}
=
this
.
props
let
{
isEditMode
,
selectKey
}
=
this
.
props
this
.
markersCache
=
markersCache
;
this
.
stagePilot
=
stagePilot
;
this
.
stagePilot
=
this
.
props
.
stagePilot
;
this
.
outlineHelper
=
this
.
stagePilot
?
this
.
stagePilot
.
outlineHelper
:
undefined
;
markersCache
.
eachValue
(
obj
=>
{
this
.
setTopCardConf
(
obj
,
obj
.
extData
);
if
(
obj
.
extData
.
type
===
"riskSource"
&&
markerType
!=
'impEquipmentMode'
&&
!
editFlag
){
if
(
obj
.
extData
.
type
===
"riskSource"
&&
markerType
!=
'impEquipmentMode'
&&
!
isEditMode
){
this
.
setTwinkleConf
(
obj
);
}
});
...
...
@@ -192,17 +166,17 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
obj
.
baseObjHelper
.
titleConfig
=
{
// 顶牌平面参数
planeOptions
:
{
width
:
3
0
,
height
:
15
,
width
:
4
0
,
height
:
20
,
position
:
[
0
,
20
,
0
],
doubleSide
:
true
},
canvasOptions
:
{
font
:
'
34
px Microsoft YaHei'
,
font
:
'
28
px Microsoft YaHei'
,
fillStyle
:
'white'
,
textBaseline
:
'middle'
,
textAlign
:
'center'
,
textX
:
128
,
textX
:
128
},
imgWidth
:
256
,
imgHeight
:
128
,
...
...
@@ -217,12 +191,46 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
obj
.
baseObjHelper
.
title
=
cardTitle
;
}
buildMarkerOptions
=
(
markers
,
markerType
,
defaultParams
=
{})
=>
{
const
{
isEditMode
}
=
this
.
props
;
if
(
!
utils
.
isEmpty
(
markers
)){
markers
.
forEach
(
m
=>
{
const
url
=
getIcon
(
markerType
,
m
.
level
);
let
position
;
if
(
!
utils
.
isArray
(
m
.
position
)){
position
=
Object
.
values
(
m
.
position
);
}
for
(
let
k
of
Object
.
keys
(
defaultParams
))
{
if
((
markerType
===
'riskSource'
||
markerType
===
'patrol'
)
&&
k
!=
'useModel'
&&
!
isEditMode
){
m
[
k
]
=
formatUrl
(
defaultParams
[
k
],
{
url
:
`
${
markerType
}
-
${
m
.
level
}
`
});
}
else
if
((
markerType
===
'riskSource'
||
markerType
===
'patrol'
)
&&
k
!=
'useModel'
&&
isEditMode
){
if
(
markerType
===
'riskSource'
){
m
[
k
]
=
formatUrl
(
defaultParams
[
k
],
{
url
:
`
${
markerType
}
-4`
});
}
else
{
m
[
k
]
=
formatUrl
(
defaultParams
[
k
],
{
url
:
`
${
markerType
}
-1`
});
}
}
else
{
m
[
k
]
=
defaultParams
[
k
];
}
}
m
.
key
=
m
.
key
||
m
.
id
;
m
.
url
=
url
;
m
.
position
=
utils
.
isArray
(
m
.
position
)
?
m
.
position
:
position
;
m
.
size
=
10
;
m
.
name
=
m
.
name
?
m
.
name
:
m
.
label
;
m
.
label
=
null
;
// m.label = createMarkerLabel(m.name);
});
}
return
markers
;
};
render
()
{
const
{
markers
,
...
rest
}
=
this
.
props
;
const
{
planStarted
}
=
this
.
state
;
let
dialogStyle
=
{
zIndex
:
1000
};
const
result
=
buildMarkerOptions
(
markers
,
markerType
,
markerParams
);
const
result
=
this
.
buildMarkerOptions
(
markers
,
markerType
,
markerParams
);
return
(
<
WrappedComponent
>
<
Markers
...
...
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