Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
laki_icu_app
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
张宏
laki_icu_app
Commits
be1b16cd
Commit
be1b16cd
authored
Jun 27, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
333333333
parent
96e4c909
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
monitoring_index_cubit.dart
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
+7
-18
No files found.
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
View file @
be1b16cd
...
...
@@ -925,19 +925,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
alarmId:
alarm
.
alarmId
,
);
// 按告警标题去重:相同标题 → 原地覆盖;不同标题 → 插入头部
final
existingIndex
=
state
.
cameraAlerts
.
indexWhere
((
a
)
=>
a
.
title
==
title
);
if
(
existingIndex
>=
0
)
{
// 已存在相同标题 → 原地替换
final
updatedAlerts
=
List
<
AlertInfoBO
>.
from
(
state
.
cameraAlerts
);
updatedAlerts
[
existingIndex
]
=
alert
;
emit
(
state
.
copyWith
(
cameraAlerts:
updatedAlerts
));
}
else
{
// 不存在 → 插入头部
emit
(
state
.
copyWith
(
cameraAlerts:
[
alert
,
...
state
.
cameraAlerts
],
));
}
// 摄像头告警只保留最新一条,新消息直接覆盖
emit
(
state
.
copyWith
(
cameraAlerts:
[
alert
]));
}
/// 处理 MQTT pet/bind 宠物绑定消息
...
...
@@ -1024,7 +1013,7 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
// 温度设定值 (MQTT ×10,如 260 → 26.0℃)
case
'temperatureSetting'
:
final
temp
=
(
value
/
10
).
toStringAsFixed
(
1
);
bloc
.
setCabinTempSetValue
(
temp
);
bloc
.
setCabinTempSetValue
(
temp
.
toString
()
);
break
;
// 湿度设定值
...
...
@@ -1066,13 +1055,13 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
);
break
;
//
照明
灯:0=关 / 1=开
case
'
floodLight
'
:
//
检查
灯:0=关 / 1=开
case
'
inspectionLamp
'
:
bloc
.
setIlluminationLightSwitch
(
value
==
1
);
break
;
//
泛光
灯/检查灯:0=关 / 1=开
case
'
inspectionLamp
'
:
//
照明
灯/检查灯:0=关 / 1=开
case
'
floodLight
'
:
bloc
.
setCheckLightSwitch
(
value
==
1
);
break
;
...
...
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