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
9a6170aa
Commit
9a6170aa
authored
May 25, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改进入故障模式字段
parent
6862f8b6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
121 deletions
+88
-121
urlConsts.js
mods/components/3dviewConvertor/consts/urlConsts.js
+1
-1
3dService.js
mods/components/3dviewConvertor/services/3dService.js
+4
-5
ConvertorView3DRoot.js
mods/components/3dviewConvertor/view/ConvertorView3DRoot.js
+0
-1
MaskContent.js
mods/components/3dviewConvertor/view/MaskContent.js
+5
-3
View3D.js
mods/components/3dviewConvertor/view/View3D.js
+72
-106
ExceptionArea.js
...nents/3dviewConvertor/view/exceptionArea/ExceptionArea.js
+1
-2
index.js
mods/components/3dviewConvertor/view/sideControl/index.js
+5
-3
No files found.
mods/components/3dviewConvertor/consts/urlConsts.js
View file @
9a6170aa
...
...
@@ -18,7 +18,7 @@ export const FscSerUrl = {
//*******************************************************************************
// 3D视图
//*******************************************************************************
view3dInitUrl
:
completePrefix
(
view3dURI
,
'api/view3d/init3dViewNode?type={type}'
),
// 初始化三维视图 get
view3dInitUrl
:
completePrefix
(
view3dURI
,
'api/view3d/init3dViewNode?type={type}
&riskSourceId={riskSourceId}
'
),
// 初始化三维视图 get
view3dInitLinkUrl
:
completePrefix
(
view3dURI
,
'view3d/initViewLink'
),
// 初始化三维视图 获取link get
searchRegionListUrl
:
completePrefix
(
patrolURI
,
'api/group/queryDept'
),
//右侧菜单-检索-区域集合
searchViewUrl
:
completePrefix
(
view3dURI
,
'api/view3d/retrieve/all?inputText={inputText}&dataLevel={dataLevel}&orgCode={orgCode}&nodeState={nodeState}&type={type}¤t={page}&pageSize={pageSize}&routeName={routeName}&protectObjName={protectObjName}'
),
// 右侧菜单-检索
...
...
mods/components/3dviewConvertor/services/3dService.js
View file @
9a6170aa
...
...
@@ -25,8 +25,8 @@ export const getObjFromNet = (url, callback) => {
* 获取各个类型的marker
* @param {string} type
*/
export
const
initView3DAction
=
(
type
)
=>
{
const
url
=
formatUrl
(
FscSerUrl
.
view3dInitUrl
,
{
type
});
export
const
initView3DAction
=
(
type
,
riskSourceId
)
=>
{
const
url
=
formatUrl
(
FscSerUrl
.
view3dInitUrl
,
{
type
,
riskSourceId
});
return
commonGet
(
url
);
};
...
...
@@ -166,8 +166,8 @@ export const queryContingencyWater = () => {
/**
* 颗粒/重点设备 模式点查询
* @param {模式} model
* @param {模式} model
*/
export
const
pointModelistAction
=
(
model
)
=>
{
return
commonGet
(
formatUrl
(
FasSerUrl
.
pointModelistUrl
,
{
model
}));
};
\ No newline at end of file
};
mods/components/3dviewConvertor/view/ConvertorView3DRoot.js
View file @
9a6170aa
...
...
@@ -107,7 +107,6 @@ class ConvertorView3DRoot extends Basic {
render
()
{
const
{
isEdit
}
=
this
.
state
;
debugger
const
wsURL
=
completeToken
(
SysWsURL
.
convertorView3dws
);
return
(
<
div
>
...
...
mods/components/3dviewConvertor/view/MaskContent.js
View file @
9a6170aa
...
...
@@ -76,7 +76,8 @@ class MaskContent extends Component {
planQuit
,
sideControlShow
,
isShowActionBar
,
headerName
headerName
,
errorAreaId
}
=
this
.
props
;
const
wsURL
=
completeToken
(
SysWsURL
.
convertorRulews
);
const
controlAnimation
=
{
...
...
@@ -108,7 +109,7 @@ class MaskContent extends Component {
return
(
<
div
className
=
"mask-content"
>
<
AmosWebSocket
ref
=
{
node
=>
this
.
aws
=
node
}
url
=
{
wsURL
}
onMessage
=
{
this
.
handleData
}
reconnect
debug
/>
{
sideControlShow
&&
<
SideControl
multiple
=
{
multiple
}
onItemClick
=
{
onItemClick
}
layerConfig
=
{
layerConfig
}
animationProps
=
{
controlAnimation
}
/>
}
{
sideControlShow
&&
<
SideControl
multiple
=
{
multiple
}
errorAreaId
=
{
errorAreaId
}
onItemClick
=
{
onItemClick
}
layerConfig
=
{
layerConfig
}
animationProps
=
{
controlAnimation
}
/>
}
{
sideControlShow
&&
<
DataPane
animationProps
=
{
datapaneAnim
}
/>
}
<
TopMsg
alarmStart
=
{
alarmStart
}
/
>
{
!
isShowActionBar
&&
<
ModelHeader
headerName
=
{
headerName
}
handleExceptModel
=
{
this
.
handleExceptModel
}
/>
}
...
...
@@ -139,7 +140,8 @@ MaskContent.propTypes = {
isShowActionBar
:
PropTypes
.
bool
,
headerName
:
PropTypes
.
string
,
setHeaderName
:
PropTypes
.
string
,
handleExceptModel
:
PropTypes
.
func
handleExceptModel
:
PropTypes
.
func
,
errorAreaId
:
PropTypes
.
number
};
MaskContent
.
defaultProps
=
{
...
...
mods/components/3dviewConvertor/view/View3D.js
View file @
9a6170aa
...
...
@@ -73,7 +73,6 @@ class View3D extends Component {
super
(
props
);
this
.
state
=
{
objs
:
null
,
totalDelta
:
0
,
// zoom值
asyncModels
:
null
,
startAsyncLoad
:
false
,
showExplain
:
false
,
...
...
@@ -114,7 +113,8 @@ class View3D extends Component {
exceptionAreas
:
[],
//异常区域
startLoadExceptionArea
:
false
,
//是否开始加载区域marker
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
//显示工具栏
isShowActionBar
:
true
,
//显示工具栏
errorAreaId
:
''
//异常区域id
};
getObjFromNet
(
view3dFile
,
(
objs
,
asyncModels
)
=>
{
...
...
@@ -240,11 +240,6 @@ class View3D extends Component {
this
.
lensLevel
=
LENS_LEVEL
.
ROOT
;
}
});
this
.
r3d
.
on
(
'camera_zoom'
,
evt
=>
{
console
.
log
(
'main camera_zoom'
,
evt
);
this
.
onCameraZoomChange
(
evt
.
delta
);
});
};
_bindPubSubEvents
=
()
=>
{
...
...
@@ -432,22 +427,8 @@ class View3D extends Component {
this
.
setState
({
showFireTruckRoute
:
false
});
//1.关闭路线显示
this
.
executeOperate
({
key
:
'fitview'
});
this
.
setState
({
markers
:
{}
});
};
onCameraZoomChange
=
delta
=>
{
let
{
totalDelta
,
markerType
,
showMap
}
=
this
.
state
;
totalDelta
=
totalDelta
+
delta
;
// if (totalDelta < mousewheelCount && showMap) {
if
(
showMap
&&
markerType
!=
"impEquipmentMode"
){
this
.
asyncLoadMarkerData
(
markerType
);
}
// } else if (totalDelta >= mousewheelCount && !showMap) {
// this.loadMarkTypeStatistics(markerType);
// }
this
.
setState
({
totalDelta
});
}
loadMarkTypeStatistics
=
markerType
=>
{
const
{
markers
}
=
this
.
state
;
this
.
setState
({
showMap
:
true
});
...
...
@@ -900,66 +881,62 @@ class View3D extends Component {
*/
changeAreaPoint
=
(
type
)
=>
{
let
{
pointTypeArr
}
=
this
.
state
;
if
(
type
==
'region'
)
{
if
(
type
==
=
'region'
)
{
getAreaTreeAction
().
then
(
data
=>
{
this
.
setState
({
treeData
:
data
||
[],
pageType
:
'region'
,
showRightPanel
:
false
})
})
treeData
:
data
||
[],
pageType
:
'region'
,
showRightPanel
:
false
})
;
})
;
}
else
{
getPointTreeAction
(
pointTypeArr
[
0
].
code
||
''
).
then
(
data
=>
{
getPointTreeAction
(
pointTypeArr
[
0
].
code
||
''
).
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
pointType
:
pointTypeArr
[
0
].
code
||
''
,
treeData
:
data
||
[],
pointType
:
pointTypeArr
[
0
].
code
||
''
,
treeData
:
data
||
[],
pageType
:
'point'
,
showRightPanel
:
false
})
})
})
;
})
;
}
}
pointTypeChange
=
(
pointType
)
=>
{
this
.
state
.
pointType
=
pointType
;
getPointTreeAction
(
pointType
).
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
pointType
:
pointType
,
treeData
:
data
||
[]
})
})
pointType
,
treeData
:
data
||
[]
})
;
})
;
}
dragItemChange
=
(
dragItem
)
=>
{
this
.
state
.
dragItem
=
dragItem
;
let
{
treeData
}
=
this
.
state
;
if
(
dragItem
.
isRegion
)
{
//是区域
}
else
{
if
(
dragItem
.
isBind
)
{
if
(
dragItem
.
isBind
)
{
//已绑定
}
else
{
let
hasRegion
=
false
;
}
}
this
.
setState
({
dragItem
})
})
;
}
drop
=
(
event
)
=>
{
event
.
preventDefault
();
let
{
dragItem
,
markers
}
=
this
.
state
;
console
.
log
(
dragItem
)
if
(
dragItem
)
{
let
{
dragItem
,
markers
}
=
this
.
state
;
console
.
log
(
dragItem
)
;
if
(
dragItem
)
{
if
(
dragItem
.
isBind
)
{
this
.
tipMsg
=
'只能放置未绑定的标记点'
this
.
setState
({
simpleTipVisible
:
true
})
})
;
return
false
;
}
...
...
@@ -967,82 +944,75 @@ class View3D extends Component {
const
objs
=
this
.
a3dRef
.
pickerCoordinate
(
event
.
clientX
,
event
.
clientY
,
null
,
true
);
let
position
;
if
(
objs
.
length
>
0
){
// get point
position
=
objs
[
0
].
point
;
}
// [0,0,0]
const
isInside
=
this
.
polygonRegion
[
dragItem
.
parentId
].
pointInPolygon
([
position
.
x
,
position
.
y
,
position
.
z
])
// console.log(this.polygonRegion)
// console.log(position)
console
.
log
(
isInside
)
console
.
log
(
isInside
);
if
(
dragItem
)
{
if
(
isInside
==
false
)
{
this
.
tipMsg
=
'只能放置在当前区域'
if
(
isInside
==
=
false
)
{
this
.
tipMsg
=
'只能放置在当前区域'
;
this
.
setState
({
simpleTipVisible
:
true
})
})
;
return
false
;
}
let
uid
=
UUID
.
uuidFast
()
let
uid
=
UUID
.
uuidFast
()
;
let
addPointParam
=
{
type
:
dragItem
.
type
,
position
:
position
,
uid
:
uid
,
position
,
uid
,
id
:
dragItem
.
id
,
key
:
`
${
dragItem
.
type
}
-
${
dragItem
.
id
}
`
,
title
:
dragItem
.
name
,
label
:
dragItem
.
name
,
level
:
'1'
,
levelStr
:
'level_2'
,
}
markers
.
riskSource
.
push
(
addPointParam
)
console
.
log
(
markers
)
level
:
'1'
,
levelStr
:
'level_2'
};
markers
.
riskSource
.
push
(
addPointParam
);
console
.
log
(
markers
);
this
.
setState
({
markers
})
})
;
}
}
quitEditMode
=
()
=>
{
this
.
setState
({
editFlag
:
false
})
this
.
props
.
editModelChange
(
false
)
})
;
this
.
props
.
editModelChange
(
false
)
;
}
editButtonClick
=
()
=>
{
let
{
editFlag
}
=
this
.
state
;
if
(
editFlag
==
true
)
{
if
(
editFlag
==
=
true
)
{
return
false
;
}
editFlag
=
true
;
this
.
setState
({
editFlag
})
if
(
editFlag
==
true
)
{
this
.
setState
({
editFlag
})
;
if
(
editFlag
=
==
true
)
{
getAreaTreeAction
().
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
treeData
:
data
||
[]
})
})
getPointTypeAction
().
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
pointTypeArr
:
data
||
[],
pointType
:
data
[
0
]
?
data
[
0
].
code
:
''
})
})
this
.
getPointList
();
this
.
setState
({
treeData
:
data
||
[]
});
});
getPointTypeAction
().
then
(
data
=>
{
console
.
log
(
data
);
this
.
setState
({
pointTypeArr
:
data
||
[],
pointType
:
data
[
0
]
?
data
[
0
].
code
:
''
});
});
this
.
getPointList
();
}
}
simpleTipOk
=
()
=>
{
this
.
setState
({
simpleTipVisible
:
false
})
})
;
}
changeMarkerType
=
(
item
,
isCancel
)
=>
{
const
{
markers
,
totalDelta
}
=
this
.
state
;
const
{
markers
}
=
this
.
state
;
if
(
item
.
isLine
)
{
this
.
setState
({
toggleRoad
:
!
isCancel
...
...
@@ -1050,25 +1020,22 @@ class View3D extends Component {
}
else
{
if
(
isCancel
)
{
markers
[
item
.
type
]
=
[];
// delete this.markerList[item.type];
this
.
setState
({
markers
});
}
else
{
// if (totalDelta < mousewheelCount) {
this
.
asyncLoadMarkerData
(
item
.
type
);
// } else if (totalDelta >= mousewheelCount) {
// this.loadMarkTypeStatistics(item.type);
// }
this
.
asyncLoadMarkerData
(
item
.
type
);
}
}
};
asyncLoadMarkerData
=
markerType
=>
{
asyncLoadMarkerData
=
(
markerType
,
riskSourceId
)
=>
{
const
{
markers
}
=
this
.
state
;
this
.
setState
({
showMap
:
false
});
this
.
clearMarkers
();
initView3DAction
(
markerType
).
then
(
d
=>
{
initView3DAction
(
markerType
,
riskSourceId
).
then
(
d
=>
{
if
(
markerType
===
'fireResource'
)
{
markers
[
'hydrant'
]
=
d
[
'hydrant'
];
markers
[
'pool'
]
=
d
[
'pool'
];
...
...
@@ -1138,7 +1105,6 @@ class View3D extends Component {
};
changeMarkerType
=
(
item
,
isCancel
)
=>
{
const
{
markers
,
totalDelta
}
=
this
.
state
;
if
(
item
.
isLine
)
{
this
.
setState
({
toggleRoad
:
!
isCancel
...
...
@@ -1146,11 +1112,7 @@ class View3D extends Component {
}
else
{
this
.
clearMarkers
();
if
(
!
isCancel
)
{
// if (totalDelta < mousewheelCount) {
this
.
asyncLoadMarkerData
(
item
.
type
);
// } else if (totalDelta >= mousewheelCount) {
// this.loadMarkTypeStatistics(item.type);
// }
this
.
asyncLoadMarkerData
(
item
.
type
,
item
.
riskSourceId
);
}
else
{
this
.
setState
({
markerType
:
null
});
}
...
...
@@ -1160,7 +1122,6 @@ class View3D extends Component {
clearMarkers
=
()
=>
{
const
{
markers
}
=
this
.
state
;
markers
[
'patrol'
]
=
[];
markers
[
'risk'
]
=
[];
markers
[
'data'
]
=
[];
markers
[
'room'
]
=
[];
...
...
@@ -1296,24 +1257,26 @@ class View3D extends Component {
});
}
handleExceptModel
=
(
type
)
=>
{
handleExceptModel
=
(
type
,
areaId
)
=>
{
this
.
clearMarkers
();
if
(
type
===
'into_except_model'
){
//进入耳朵模式
if
(
type
===
'into_except_model'
){
//进入耳朵模式
this
.
props
.
editModelChange
(
true
);
//隐藏全景统计
this
.
setState
({
sideControlShow
:
true
,
//显示耳朵
isShowActionBar
:
false
,
//隐藏工具栏
startLoadExceptionArea
:
false
,
//隐藏marker
headerName
:
'故障点模式'
//设置头名称
headerName
:
'故障点模式'
,
//设置头名称
errorAreaId
:
areaId
});
}
else
if
(
type
===
'out_except_model'
){
}
else
if
(
type
===
'out_except_model'
){
this
.
props
.
editModelChange
(
false
);
//显示全景统计
this
.
setState
({
sideControlShow
:
false
,
//隐藏耳朵
isShowActionBar
:
true
,
//显示工具栏
startLoadExceptionArea
:
true
,
//显示marker,
headerName
:
''
,
//设置头名称
editFlag
:
false
//推出编辑模式
editFlag
:
false
,
//推出编辑模式
errorAreaId
:
''
});
}
}
...
...
@@ -1338,7 +1301,8 @@ class View3D extends Component {
exceptionAreas
,
exceptionMarkers
,
startLoadExceptionArea
,
sideControlShow
,
isShowActionBar
,
headerName
headerName
,
errorAreaId
}
=
this
.
state
;
const
{
dimension
,
hiddenScreenSaver
}
=
this
.
props
;
const
graphicProps
=
{
...
...
@@ -1406,6 +1370,7 @@ class View3D extends Component {
headerName
=
{
headerName
}
setHeaderName
=
{
this
.
setHeaderName
}
onActionItemClick
=
{
this
.
onActionItemClick
}
errorAreaId
=
{
errorAreaId
}
handleExceptModel
=
{
this
.
handleExceptModel
}
/
>
}
...
...
@@ -1492,7 +1457,8 @@ View3D.propTypes = {
hiddenScreenSaver
:
PropTypes
.
func
,
onLoadCompleted
:
PropTypes
.
func
,
alarmStart
:
PropTypes
.
func
,
planStart
:
PropTypes
.
func
planStart
:
PropTypes
.
func
,
editModelChange
:
PropTypes
.
func
};
export
default
View3D
;
mods/components/3dviewConvertor/view/exceptionArea/ExceptionArea.js
View file @
9a6170aa
...
...
@@ -46,8 +46,7 @@ class ExceptionArea extends Component {
onMarkerClick
=
(
marker
)
=>
{
const
{
extData
}
=
marker
;
lsTool
.
write
(
'errorAreaId'
,
extData
.
id
);
this
.
props
.
handleExceptModel
&&
this
.
props
.
handleExceptModel
(
'into_except_model'
);
this
.
props
.
handleExceptModel
&&
this
.
props
.
handleExceptModel
(
'into_except_model'
,
extData
.
id
);
}
setTopCardConf
=
(
obj
,{
safetyIndex
})
=>
{
...
...
mods/components/3dviewConvertor/view/sideControl/index.js
View file @
9a6170aa
...
...
@@ -27,12 +27,13 @@ class SideControl extends Component {
* control 点击,第二次点击则取消
*/
onBizItemClick
=
(
item
,
e
)
=>
{
const
{
errorAreaId
:
riskSourceId
}
=
this
.
props
;
const
alreadyActive
=
this
.
isActive
(
item
.
key
);
const
newKeys
=
this
.
getActiveControl
(
item
.
key
,
alreadyActive
);
this
.
setState
({
activeControl
:
newKeys
});
this
.
props
.
onItemClick
&&
this
.
props
.
onItemClick
(
item
,
alreadyActive
);
this
.
props
.
onItemClick
&&
this
.
props
.
onItemClick
(
{
...
item
,
riskSourceId
}
,
alreadyActive
);
};
getActiveControl
=
(
key
,
alreadyActive
)
=>
{
...
...
@@ -53,7 +54,7 @@ class SideControl extends Component {
};
render
()
{
const
{
layerConfig
,
animationProps
}
=
this
.
props
;
const
{
layerConfig
,
animationProps
}
=
this
.
props
;
let
_bizControls
=
bizControls
;
if
(
filterUser
.
includes
(
loginUserName
))
{
let
target
=
_bizControls
.
find
(
item
=>
item
.
key
===
'fireResource-point'
);
...
...
@@ -80,7 +81,8 @@ SideControl.propTypes = {
onItemClick
:
PropTypes
.
func
,
write
:
PropTypes
.
func
,
toStr
:
PropTypes
.
func
,
animationProps
:
PropTypes
.
object
animationProps
:
PropTypes
.
object
,
errorAreaId
:
PropTypes
.
number
};
export
default
SideControl
;
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