Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-convertor-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-convertor-view
Commits
f82468ac
Commit
f82468ac
authored
Apr 27, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.双屏联动,通过postmessage实现-全景监控
parent
63c56696
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
amos.config.js
amos.config.js
+1
-1
index.js
src/view/ue4/index.js
+28
-5
No files found.
amos.config.js
View file @
f82468ac
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
// 管控模型
// 管控模型
mgtCtrlModel
:
'http://172.16.10.91:8080'
,
mgtCtrlModel
:
'http://172.16.10.91:8080'
,
prePlan
:
'http://172.16.10.91:3004'
,
prePlan
:
'http://172.16.10.91:3004'
,
ue4URI
:
'http://172.16.3.69:8089
?token={token}
'
ue4URI
:
'http://172.16.3.69:8089'
},
},
// 系统配置信息 主要是为了区分各子系统
// 系统配置信息 主要是为了区分各子系统
sysConf
:
{
sysConf
:
{
...
...
src/view/ue4/index.js
View file @
f82468ac
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
IFrame
}
from
'amos-framework'
;
import
{
IFrame
}
from
'amos-framework'
;
import
{
Store
}
from
'amos-tool'
;
import
{
Store
}
from
'amos-tool'
;
import
{
CONSTS
}
from
'CONSTS/storageConsts'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
{
getOutterURL
}
from
'../../consts/urlConsts'
;
import
{
getOutterURL
}
from
'../../consts/urlConsts'
;
import
{
tirggerTransTopic
}
from
'./../3dview/dataProcessor'
;
const
lsTool
=
Store
.
lsTool
;
const
lsTool
=
Store
.
lsTool
;
const
ue4URI
=
getOutterURL
(
'ue4URI'
);
/**
/**
* ue4-全景监控
* ue4-全景监控
*/
*/
export
default
class
Ue4RootView
extends
Component
{
class
Ue4RootView
extends
Component
{
componentDidMount
()
{
window
.
addEventListener
(
'message'
,
this
.
messageHandle
);
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'message'
,
this
.
messageHandle
);
}
messageHandle
=
(
event
)
=>
{
console
.
log
(
'双屏联动信息'
,
event
.
origin
,
event
.
data
);
if
(
event
.
origin
===
ue4URI
){
tirggerTransTopic
(
CONSTS
.
forward
,
event
.
data
);
}
}
render
()
{
render
()
{
let
url
=
getOutterURL
(
'ue4URI'
)
;
let
url
=
`
${
ue4URI
}
?token={token}`
;
const
token
=
lsTool
.
read
(
SysConsts
.
token
);
const
token
=
lsTool
.
read
(
SysConsts
.
token
);
url
=
formatUrl
(
url
,
{
token
});
url
=
formatUrl
(
url
,
{
token
});
return
(
return
(
<
IFrame
<
IFrame
url
=
{
url
}
url
=
{
url
}
width
=
'100%'
width
=
'100%'
id
=
"iframe-ue4-view
-root
"
id
=
"iframe-ue4-view"
style
=
{{
height
:
'calc(100% - 40px)'
,
marginTop
:
'40px'
}}
style
=
{{
height
:
'calc(100% - 40px)'
,
marginTop
:
'40px'
}}
display
=
"initial"
display
=
"initial"
position
=
"relative"
position
=
"relative"
...
@@ -29,4 +50,6 @@ export default class Ue4RootView extends Component {
...
@@ -29,4 +50,6 @@ export default class Ue4RootView extends Component {
/>
/>
);
);
}
}
}
}
\ No newline at end of file
export
default
Ue4RootView
;
\ No newline at end of file
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