Commit 93ea6fa5 authored by 张宏's avatar 张宏

123

parent 28c64984
......@@ -69,7 +69,7 @@ class AlertBasicInfoBO extends Equatable {
alertCount: json['alertCount'] as int? ?? 0,
alertTime: json['alertTime'] as String? ?? '',
alertIcon: json['alertIcon'] as String? ?? '',
alertDeviceId: json['alertDeviceId'] as String? ?? '',
alertDeviceId: json['alertDeviceId']?.toString() ?? '',
);
}
......
......@@ -28,7 +28,7 @@ class DeviceBasicInfoBO {
final int deviceId;
final String deviceName;
final String deviceCode;
final String roomName;
final String deviceLocation;
final String deviceTypeIcon;
final String onlineStatus;
......@@ -36,7 +36,7 @@ class DeviceBasicInfoBO {
required this.deviceId,
required this.deviceName,
required this.deviceCode,
required this.roomName,
required this.deviceLocation,
required this.deviceTypeIcon,
required this.onlineStatus,
});
......@@ -46,7 +46,7 @@ class DeviceBasicInfoBO {
deviceId: json['deviceId'] as int? ?? 0,
deviceName: json['deviceName'] as String? ?? '',
deviceCode: json['deviceCode'] as String? ?? '',
roomName: json['roomName'] as String? ?? '',
deviceLocation: json['deviceLocation'] as String? ?? '',
deviceTypeIcon: json['deviceTypeIcon'] as String? ?? '',
onlineStatus: json['onlineStatus'] as String? ?? '',
);
......
......@@ -46,7 +46,8 @@ class DeviceCubit extends Cubit<DeviceState> {
return DeviceInfo(
deviceName: basic.deviceName,
deviceId: basic.deviceCode,
location: basic.roomName,
// location: basic.roomName,
location: basic.deviceLocation,
status: status,
voltage: params.voltage,
current: params.current,
......
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/repositories/alert_detail_repository.dart';
import 'package:smart_hotel_app/services/alert_detail_service.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart';
class TemperatureBlock extends StatelessWidget {
final int alertId;
......@@ -340,6 +342,7 @@ class TemperatureBlock extends StatelessWidget {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('操作成功')),
);
context.read<HomeIndexCubit>().reloadDashboard();
}
} catch (e) {
if (context.mounted) {
......
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/repositories/alert_detail_repository.dart';
import 'package:smart_hotel_app/routes/app_router.gr.dart';
import 'package:smart_hotel_app/services/alert_detail_service.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart';
class VoltageOperateBlock extends StatelessWidget {
final int alertId;
......@@ -279,6 +281,7 @@ class VoltageOperateBlock extends StatelessWidget {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('操作成功')),
);
context.read<HomeIndexCubit>().reloadDashboard();
}
} catch (e) {
if (context.mounted) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment