Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart_hotel_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
张宏
smart_hotel_app
Commits
8e8f1b15
Commit
8e8f1b15
authored
Jun 10, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
5e6cf1be
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
+51
-9
alert_detail_bo.dart
lib/models/bo/alert_detail_bo.dart
+25
-5
device_control_bo.dart
lib/models/bo/device_control_bo.dart
+23
-2
abnormal_detail_view.dart
lib/views/home/abnormal/abnormal_detail_view.dart
+2
-1
abnormal_state.dart
lib/views/home/abnormal/cubit/abnormal_state.dart
+1
-1
No files found.
lib/models/bo/alert_detail_bo.dart
View file @
8e8f1b15
...
...
@@ -43,7 +43,7 @@ class AlertBasicInfoBO extends Equatable {
final
int
alertCount
;
final
String
alertTime
;
final
String
alertIcon
;
final
int
alertDeviceId
;
final
String
alertDeviceId
;
const
AlertBasicInfoBO
({
required
this
.
alertId
,
...
...
@@ -64,12 +64,12 @@ class AlertBasicInfoBO extends Equatable {
alertTitle:
json
[
'alertTitle'
]
as
String
?
??
''
,
alertLevel:
json
[
'alertLevel'
]
as
String
?
??
''
,
alertLevelText:
json
[
'alertLevelText'
]
as
String
?
??
''
,
alertStatus:
json
[
'alertStatus'
]
as
String
?
??
''
,
alertStatus:
json
[
'alertStatus'
]
?.
toString
()
??
''
,
alertDeviceLocation:
json
[
'alertDeviceLocation'
]
as
String
?
??
''
,
alertCount:
json
[
'alertCount'
]
as
int
?
??
0
,
alertTime:
json
[
'alertTime'
]
as
String
?
??
''
,
alertIcon:
json
[
'alertIcon'
]
as
String
?
??
''
,
alertDeviceId:
json
[
'alertDeviceId'
]
as
int
?
??
0
,
alertDeviceId:
json
[
'alertDeviceId'
]
as
String
?
??
''
,
);
}
...
...
@@ -139,10 +139,30 @@ class DataPointBO extends Equatable {
});
factory
DataPointBO
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
final
rawValue
=
json
[
'value'
];
final
double
value
;
if
(
rawValue
is
num
)
{
value
=
rawValue
.
toDouble
();
}
else
if
(
rawValue
is
String
)
{
value
=
double
.
tryParse
(
rawValue
)
??
0
;
}
else
{
value
=
0
;
}
final
rawRecordId
=
json
[
'recordId'
];
final
int
recordId
;
if
(
rawRecordId
is
int
)
{
recordId
=
rawRecordId
;
}
else
if
(
rawRecordId
is
String
)
{
recordId
=
int
.
tryParse
(
rawRecordId
)
??
0
;
}
else
{
recordId
=
0
;
}
return
DataPointBO
(
time:
json
[
'time'
]
as
String
?
??
''
,
value:
(
json
[
'value'
]
as
num
?)?.
toDouble
()
??
0
,
recordId:
json
[
'recordId'
]
as
int
?
??
0
,
value:
value
,
recordId:
recordId
,
);
}
...
...
lib/models/bo/device_control_bo.dart
View file @
8e8f1b15
...
...
@@ -118,10 +118,30 @@ class DeviceDataPointBO {
});
factory
DeviceDataPointBO
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
final
rawPower
=
json
[
'power'
];
final
double
power
;
if
(
rawPower
is
num
)
{
power
=
rawPower
.
toDouble
();
}
else
if
(
rawPower
is
String
)
{
power
=
double
.
tryParse
(
rawPower
)
??
0
;
}
else
{
power
=
0
;
}
final
rawTemperature
=
json
[
'temperature'
];
final
double
temperature
;
if
(
rawTemperature
is
num
)
{
temperature
=
rawTemperature
.
toDouble
();
}
else
if
(
rawTemperature
is
String
)
{
temperature
=
double
.
tryParse
(
rawTemperature
)
??
0
;
}
else
{
temperature
=
0
;
}
return
DeviceDataPointBO
(
time:
json
[
'time'
]
as
String
?
??
''
,
power:
(
json
[
'power'
]
as
num
?)?.
toDouble
()
??
0
,
temperature:
(
json
[
'temperature'
]
as
num
?)?.
toDouble
()
??
0
,
power:
power
,
temperature:
temperature
,
);
}
}
\ No newline at end of file
lib/views/home/abnormal/abnormal_detail_view.dart
View file @
8e8f1b15
...
...
@@ -136,7 +136,8 @@ class AbnormalDetailView extends StatelessWidget {
),
child:
TextButton
(
onPressed:
()
{
final
deviceId
=
cubit
.
state
.
alarmInfo
?.
alertDeviceId
??
0
;
final
deviceIdStr
=
cubit
.
state
.
alarmInfo
?.
alertDeviceId
??
''
;
final
deviceId
=
int
.
tryParse
(
deviceIdStr
)
??
0
;
context
.
pushRoute
(
DeviceDetailRoute
(
deviceId:
deviceId
));
},
child:
Row
(
...
...
lib/views/home/abnormal/cubit/abnormal_state.dart
View file @
8e8f1b15
...
...
@@ -15,7 +15,7 @@ class AlarmInfo {
final
String
linkAction
;
final
String
date
;
final
List
<
FlSpot
>
temperatureSpots
;
final
int
alertDeviceId
;
final
String
alertDeviceId
;
const
AlarmInfo
({
required
this
.
alarmType
,
...
...
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