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
74a45541
Commit
74a45541
authored
May 30, 2025
by
Cai Wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(*): 优化布袋监测
parent
4424540c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
79 deletions
+80
-79
bag-monitoring.vue
src/views/dustMonitoring/bag-monitoring.vue
+80
-79
No files found.
src/views/dustMonitoring/bag-monitoring.vue
View file @
74a45541
...
...
@@ -70,7 +70,8 @@
<div
class=
"time-controls"
>
<div
class=
"time-desc"
>
<span
class=
"icon"
></span>
当前实时信号:
{{
currentData
.
compartNo
}}
仓 /
{{
currentData
.
row
}}
排
</div>
当前实时信号:
{{
currentData
.
compartNo
}}
仓 /
{{
currentData
.
row
}}
排
</div>
<div>
<el-button
@
click=
"navigateBackward"
>
<el-icon><ArrowLeftBold
/>
向前
</el-icon>
...
...
@@ -84,7 +85,6 @@
<el-button
@
click=
"reset"
>
重置
</el-button>
</div>
</div>
<table>
...
...
@@ -99,14 +99,20 @@
<tbody>
<tr>
<td>
峰值
{{
currentData
.
row
}}
排_R
</td>
<td
v-for=
"(value, index) in tableData"
:key=
"'r' + index"
:class=
"
{ 'online-style': value.compartNo === currentData.compartNo }">
{{
value
.
peakValueR
||
"-"
}}
<td
v-for=
"(value, index) in tableData"
:key=
"'r' + index"
:class=
"
{
'online-style': value.compartNo === currentData.compartNo,
}"
>
{{
value
.
peakValueR
}}
</td>
</tr>
<tr>
<td>
峰值_H
</td>
<td
v-for=
"(value, index) in tableData"
:key=
"'h' + index"
>
{{
value
.
peakValueH
||
"-"
}}
{{
value
.
peakValueH
}}
</td>
</tr>
<tr>
...
...
@@ -122,13 +128,13 @@
<tr>
<td>
反吹中
</td>
<td
v-for=
"(value, index) in tableData"
:key=
"'b' + index"
>
{{
value
.
blowBack
||
"-"
}}
{{
value
.
blowBack
}}
</td>
</tr>
<tr>
<td>
谷值
</td>
<td
v-for=
"(value, index) in tableData"
:key=
"'v' + index"
>
{{
value
.
valleyValue
||
"-"
}}
{{
value
.
valleyValue
}}
</td>
</tr>
</tbody>
...
...
@@ -245,7 +251,7 @@ const initChartData = () => {
dusterNo
:
dusterNo
.
value
,
deviceNo
:
selectedDevice
.
value
,
startTime
:
startTime
,
endTime
:
endTime
,
//
endTime: endTime,
})
.
then
((
res
)
=>
{
// 将data中的date和realData数据添加到chartData中,要求大数据量下速度快
...
...
@@ -295,7 +301,7 @@ const updateFunction = () => {
if
(
!
dusterNo
.
value
||
!
selectedDevice
.
value
)
return
;
// 从API获取实时数据
if
(
showRealtimeDeviceStatus
)
{
getMonitorRealtime
({
dusterNo
:
dusterNo
.
value
,
deviceNo
:
selectedDevice
.
value
,
...
...
@@ -314,8 +320,8 @@ const updateFunction = () => {
.
catch
((
err
)
=>
{
console
.
error
(
"获取实时数据失败:"
,
err
);
});
}
if
(
showRealtimeDeviceStatus
)
{
// 结束时间往后推一秒
let
endTime
=
moment
(
new
Date
(
currentTime
.
value
))
.
add
(
1
,
"seconds"
)
...
...
@@ -342,18 +348,10 @@ const updateFunction = () => {
updateChart
();
}
});
};
// 停止实时更新
const
stopRealTimeUpdates
=
()
=>
{
if
(
updateTimer
)
{
clearInterval
(
updateTimer
);
updateTimer
=
null
;
}
showRealtimeDeviceStatus
=
false
;
};
// 向前导航(查看更早的数据)
const
navigateBackward
=
()
=>
{
// 不完全关闭轮询,只禁用实时设备状态获取
...
...
@@ -376,6 +374,7 @@ const navigateBackward = () => {
const
endTime
=
new
Date
(
lastTimePoint
.
getTime
()
-
intervalMs
);
lastTimePoint
=
endTime
;
// 重新生成数据
generateHistoricalData
(
endTime
,
interval
);
};
...
...
@@ -399,18 +398,18 @@ const navigateForward = () => {
}
// 计算新的时间范围
cons
t
endTime
=
new
Date
(
lastTimePoint
.
getTime
()
+
intervalMs
);
le
t
endTime
=
new
Date
(
lastTimePoint
.
getTime
()
+
intervalMs
);
// 如果新的结束时间超过当前时间,则切换回实时模式
//
//
如果新的结束时间超过当前时间,则切换回实时模式
const
now
=
moment
();
if
(
endTime
>
now
)
{
lastTimePoint
=
n
ull
;
showRealtimeDeviceStatus
=
true
;
return
;
}
lastTimePoint
=
n
ew
Date
(
now
)
;
endTime
=
new
Date
(
now
)
;
// // showRealtimeDeviceStatus = true
;
// return;
}
else
{
lastTimePoint
=
endTime
;
}
// 重新生成数据
generateHistoricalData
(
endTime
,
interval
);
};
...
...
@@ -435,7 +434,10 @@ const reset = () => {
// 开启实时更新(重置用)
const
startRealTimeUpdate
=
()
=>
{
// 确保之前的定时器已清除
stopRealTimeUpdates
();
if
(
updateTimer
)
{
clearInterval
(
updateTimer
);
updateTimer
=
null
;
}
// 启动定时更新
updateTimer
=
setInterval
(()
=>
{
updateFunction
();
...
...
@@ -518,7 +520,6 @@ watch(dusterNo, (newVal) => {
});
onMounted
(()
=>
{
console
.
log
(
"dusterNo"
,
route
);
if
(
dusterNo
.
value
)
{
getDeviceList
();
}
...
...
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