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
99689b60
Commit
99689b60
authored
Jul 18, 2025
by
liuzhaoh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加刷新页面定时
parent
301c1db6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
index.vue
src/views/dustMonitoring/index.vue
+37
-1
No files found.
src/views/dustMonitoring/index.vue
View file @
99689b60
<
template
>
<div
class=
"dust-box"
>
<div
class=
"dust-box"
ref=
"dustBox"
>
<div
class=
"top-box"
>
<el-form
:model=
"form"
...
...
@@ -676,9 +676,12 @@ const resizeFun = () => {
onMounted
(()
=>
{
getDusterNameEnum
();
window
.
addEventListener
(
"resize"
,
resizeFun
);
refeshFun
();
getAllMouseEvent
();
});
onUnmounted
(()
=>
{
window
.
removeEventListener
(
"resize"
,
resizeFun
);
cancelAllMouseEvent
();
chartRemoveEvent
();
});
watch
(
...
...
@@ -714,6 +717,39 @@ const handleStatusDotClick = () => {
},
});
};
// 定时刷新页面数据请求 30分钟一次。
const
refreshData
=
()
=>
{
getHealthIndex
();
getPressure
();
getEnergy
();
getDustDetail
();
getAlarmInfo
();
}
let
refreshTimer
=
null
;
const
refeshFun
=
()
=>
{
if
(
refreshTimer
)
{
clearInterval
(
refreshTimer
);
}
refreshTimer
=
setTimeout
(()
=>
{
refreshData
();
refeshFun
()
},
1000
*
60
*
30
);
}
const
dustBox
=
ref
(
null
);
// 获取鼠标所有事件
const
getAllMouseEvent
=
()
=>
{
dustBox
.
value
.
addEventListener
(
"mousemove"
,
cancelRefreshEvent
)
dustBox
.
value
.
addEventListener
(
"mousedown"
,
cancelRefreshEvent
)
}
const
cancelRefreshEvent
=
()
=>
{
clearTimeout
(
refreshTimer
);
refeshFun
();
}
// 取消鼠标事件
const
cancelAllMouseEvent
=
()
=>
{
dustBox
.
value
.
removeEventListener
(
"mousemove"
,
cancelRefreshEvent
)
dustBox
.
value
.
removeEventListener
(
"mousedown"
,
cancelRefreshEvent
)
}
</
script
>
<
style
lang=
"scss"
scoped
>
$borderColor
:
#3a3f45
;
...
...
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