Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DC-TOM
Project
Project
Details
Activity
Releases
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
刘照晖
DC-TOM
Commits
ab87a76b
Commit
ab87a76b
authored
Jun 04, 2025
by
Cai Wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(*): 补充跳转逻辑
parent
c1670329
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
index.vue
src/views/intermediate/index.vue
+25
-1
No files found.
src/views/intermediate/index.vue
View file @
ab87a76b
<
template
>
<div
class=
"intermediate-page"
>
<iframe
ref=
"iframeRef"
class=
"iframe-box"
src=
"https://screen.bmetech.com/steelmakingScreen/#/ecoDashboard"
frameborder=
"0"
...
...
@@ -21,6 +22,7 @@ import { ref, onMounted, computed, onUnmounted } from "vue";
const
router
=
useRouter
();
const
windowHeight
=
ref
(
window
.
innerHeight
);
const
windowWidth
=
ref
(
window
.
innerWidth
);
const
iframeRef
=
ref
(
null
);
// 设计稿尺寸
const
DESIGN_WIDTH
=
1920
;
...
...
@@ -53,14 +55,36 @@ const updateWindowSize = () => {
windowWidth
.
value
=
window
.
innerWidth
;
};
// 处理iframe消息
const
handleMessage
=
(
event
)
=>
{
// 确保消息来源是我们的iframe
if
(
iframeRef
.
value
&&
event
.
source
===
iframeRef
.
value
.
contentWindow
)
{
try
{
// 如果消息是字符串,尝试解析JSON
const
data
=
typeof
event
.
data
===
'string'
?
JSON
.
parse
(
event
.
data
)
:
event
.
data
;
// 根据消息类型处理
if
(
data
.
type
===
'navigation'
&&
data
.
target
===
'dashboard'
)
{
handleBack
();
}
}
catch
(
error
)
{
console
.
error
(
'Error processing iframe message:'
,
error
);
}
}
};
onMounted
(()
=>
{
window
.
addEventListener
(
"resize"
,
updateWindowSize
);
// 添加消息监听器
window
.
addEventListener
(
'message'
,
handleMessage
);
});
onUnmounted
(()
=>
{
window
.
removeEventListener
(
"resize"
,
updateWindowSize
);
// 移除消息监听器
window
.
removeEventListener
(
'message'
,
handleMessage
);
});
const
handleBack
=
()
=>
{
router
.
push
(
"/dashboard"
);
};
...
...
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