فهرست منبع

设备接口对接

yangyang 2 سال پیش
والد
کامیت
1070a66297

+ 3 - 3
android/app/build.gradle

@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
 
 android {
-    compileSdkVersion flutter.compileSdkVersion
+    compileSdkVersion 33
     ndkVersion flutter.ndkVersion
 
     compileOptions {
@@ -39,8 +39,8 @@ android {
         applicationId "com.ruankong.deus.deus_app"
         // You can update the following values to match your application needs.
         // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
-        minSdkVersion flutter.minSdkVersion
-        targetSdkVersion flutter.targetSdkVersion
+        minSdkVersion 21
+        targetSdkVersion 33
         versionCode flutterVersionCode.toInteger()
         versionName flutterVersionName
     }

+ 3 - 0
lib/common/utils/ConstantString.dart

@@ -21,6 +21,8 @@ class ConstantString {
 
   static const String loginText = "登录";
 
+  static const String updateText = "修改";
+
   static const String mainText = "首页";
 
   static const String loginNull = "请输入用户名和密码";
@@ -30,6 +32,7 @@ class ConstantString {
   static const String cancel = "取消";
 
   static const String query = "查询";
+
   static const String close_job = "关闭任务";
 
   static const String login_maint = "登记维保";

+ 111 - 29
lib/generated/json/base/json_convert_content.dart

@@ -2,17 +2,21 @@
 // ignore_for_file: camel_case_types
 // ignore_for_file: prefer_single_quotes
 
+import 'package:deus_app/generated/json/drop_menu_item_helper.dart';
+import 'package:deus_app/generated/json/equipment_info_entity_helper.dart';
+import 'package:deus_app/generated/json/equipment_list_entity_helper.dart';
 import 'package:deus_app/generated/json/login_response_entity_helper.dart';
+import 'package:deus_app/generated/json/personal_data_count_entity_helper.dart';
 import 'package:deus_app/generated/json/user_response_entity_helper.dart';
+import 'package:deus_app/model/drop_menu_item.dart';
+import 'package:deus_app/model/equipment_info_entity.dart';
+import 'package:deus_app/model/equipment_list_entity.dart';
 import 'package:deus_app/model/login_response_entity.dart';
-import 'package:deus_app/model/user_response_entity.dart';
-import 'package:deus_app/model/patrol_response_entity.dart';
 // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
+import 'package:deus_app/model/patrol_response_entity.dart';
+import 'package:deus_app/model/personal_data_count_entity.dart';
 import 'package:deus_app/model/user_response_entity.dart';
 
-import '../../../model/patrol_job_detail_response_entity.dart';
-import '../patrol_job_detail_response_entity_helper.dart';
-
 class JsonConvert<T> {
 	T fromJson(Map<String, dynamic> json) {
 		return _getFromJson<T>(runtimeType, this, json);
@@ -38,12 +42,24 @@ class JsonConvert<T> {
 				return loginResponseDataFromJson(data as LoginResponseData, json) as T;
 			case LoginResponseDataUser:
 				return loginResponseDataUserFromJson(data as LoginResponseDataUser, json) as T;
-			case PatrolJobDetailResponseData:
-				return patrolJobDetailResponseDataFromJson(data as PatrolJobDetailResponseData, json) as T;
-			case PatrolJobDetailResponseDataList:
-				return patrolJobDetailResponseDataListFromJson(data as PatrolJobDetailResponseDataList, json) as T;
-			case PatrolJobDetailResponseDataListDeviceList:
-				return patrolJobDetailResponseDataListDeviceListFromJson(data as PatrolJobDetailResponseDataListDeviceList, json) as T;    }
+			case EquipmentListEntity:
+				return equipmentListEntityFromJson(data as EquipmentListEntity, json) as T;
+			case EquipmentListData:
+				return equipmentListDataFromJson(data as EquipmentListData, json) as T;
+			case EquipmentListDataEquipmentVOS:
+				return equipmentListDataEquipmentVOSFromJson(data as EquipmentListDataEquipmentVOS, json) as T;
+			case EquipmentListDataCountDTO:
+				return equipmentListDataCountDTOFromJson(data as EquipmentListDataCountDTO, json) as T;
+			case PersonalDataCountEntity:
+				return personalDataCountEntityFromJson(data as PersonalDataCountEntity, json) as T;
+			case PersonalDataCountData:
+				return personalDataCountDataFromJson(data as PersonalDataCountData, json) as T;
+			case DropMenuItem:
+				return dropMenuItemFromJson(data as DropMenuItem, json) as T;
+			case EquipmentInfoEntity:
+				return equipmentInfoEntityFromJson(data as EquipmentInfoEntity, json) as T;
+			case EquipmentInfoData:
+				return equipmentInfoDataFromJson(data as EquipmentInfoData, json) as T;    }
 		return data as T;
 	}
 
@@ -63,18 +79,45 @@ class JsonConvert<T> {
 				return loginResponseDataToJson(data as LoginResponseData);
 			case LoginResponseDataUser:
 				return loginResponseDataUserToJson(data as LoginResponseDataUser);
-			case PatrolJobDetailResponseData:
-				return patrolJobDetailResponseDataToJson(data as PatrolJobDetailResponseData);
-			case PatrolJobDetailResponseDataList:
-				return patrolJobDetailResponseDataListToJson(data as PatrolJobDetailResponseDataList);
-			case PatrolJobDetailResponseDataListDeviceList:
-				return patrolJobDetailResponseDataListDeviceListToJson(data as PatrolJobDetailResponseDataListDeviceList);
+			case EquipmentListEntity:
+				return equipmentListEntityToJson(data as EquipmentListEntity);
+			case EquipmentListData:
+				return equipmentListDataToJson(data as EquipmentListData);
+			case EquipmentListDataEquipmentVOS:
+				return equipmentListDataEquipmentVOSToJson(data as EquipmentListDataEquipmentVOS);
+			case EquipmentListDataCountDTO:
+				return equipmentListDataCountDTOToJson(data as EquipmentListDataCountDTO);
+			case PersonalDataCountEntity:
+				return personalDataCountEntityToJson(data as PersonalDataCountEntity);
+			case PersonalDataCountData:
+				return personalDataCountDataToJson(data as PersonalDataCountData);
+			case DropMenuItem:
+				return dropMenuItemToJson(data as DropMenuItem);
+			case EquipmentInfoEntity:
+				return equipmentInfoEntityToJson(data as EquipmentInfoEntity);
+			case EquipmentInfoData:
+				return equipmentInfoDataToJson(data as EquipmentInfoData);
 			}
 			return data as T;
 		}
   //Go back to a single instance by type
 	static _fromJsonSingle<M>( json) {
 		String type = M.toString();
+		if(type == (PatrolJobDataResponseEntity).toString()){
+			return PatrolJobDataResponseEntity().fromJson(json);
+		}
+		if(type == (PatrolJobDataVO).toString()){
+			return PatrolJobDataVO().fromJson(json);
+		}
+		if(type == (PatrolJobDetailResponseEntity).toString()){
+			return PatrolJobDetailResponseEntity().fromJson(json);
+		}
+		if(type == (PatrolJobDeviceResponseData).toString()){
+			return PatrolJobDeviceResponseData().fromJson(json);
+		}
+		if(type == (PatrolJobItemResponseData).toString()){
+			return PatrolJobItemResponseData().fromJson(json);
+		}
 		if(type == (UserResponseEntity).toString()){
 			return UserResponseEntity().fromJson(json);
 		}
@@ -96,14 +139,29 @@ class JsonConvert<T> {
 		if(type == (LoginResponseDataUser).toString()){
 			return LoginResponseDataUser().fromJson(json);
 		}
-		if(type == (PatrolJobDetailResponseData).toString()){
-			return PatrolJobDetailResponseData().fromJson(json);
+		if(type == (EquipmentListEntity).toString()){
+			return EquipmentListEntity().fromJson(json);
+		}
+		if(type == (EquipmentListData).toString()){
+			return EquipmentListData().fromJson(json);
+		}
+		if(type == (EquipmentListDataEquipmentVOS).toString()){
+			return EquipmentListDataEquipmentVOS().fromJson(json);
 		}
-		if(type == (PatrolJobDetailResponseDataList).toString()){
-			return PatrolJobDetailResponseDataList().fromJson(json);
+		if(type == (EquipmentListDataCountDTO).toString()){
+			return EquipmentListDataCountDTO().fromJson(json);
 		}
-		if(type == (PatrolJobDetailResponseDataListDeviceList).toString()){
-			return PatrolJobDetailResponseDataListDeviceList().fromJson(json);
+		if(type == (PersonalDataCountEntity).toString()){
+			return PersonalDataCountEntity().fromJson(json);
+		}
+		if(type == (PersonalDataCountData).toString()){
+			return PersonalDataCountData().fromJson(json);
+		}
+		if(type == (EquipmentInfoEntity).toString()){
+			return EquipmentInfoEntity().fromJson(json);
+		}
+		if(type == (EquipmentInfoData).toString()){
+			return EquipmentInfoData().fromJson(json);
 		}
 
 		return null;
@@ -111,6 +169,15 @@ class JsonConvert<T> {
 
   //list is returned by type
 	static M _getListChildType<M>(List data) {
+		if(<PatrolJobDataResponseEntity>[] is M){
+			return data.map<PatrolJobDataResponseEntity>((e) => PatrolJobDataResponseEntity().fromJson(e)).toList() as M;
+		}
+		if(<PatrolJobDataVO>[] is M){
+			return data.map<PatrolJobDataVO>((e) => PatrolJobDataVO().fromJson(e)).toList() as M;
+		}
+		if(<PatrolJobDetailResponseEntity>[] is M){
+			return data.map<PatrolJobDetailResponseEntity>((e) => PatrolJobDetailResponseEntity().fromJson(e)).toList() as M;
+		}
 		if(<UserResponseEntity>[] is M){
 			return data.map<UserResponseEntity>((e) => UserResponseEntity().fromJson(e)).toList() as M;
 		}
@@ -132,14 +199,29 @@ class JsonConvert<T> {
 		if(<LoginResponseDataUser>[] is M){
 			return data.map<LoginResponseDataUser>((e) => LoginResponseDataUser().fromJson(e)).toList() as M;
 		}
-		if(<PatrolJobDetailResponseData>[] is M){
-			return data.map<PatrolJobDetailResponseData>((e) => PatrolJobDetailResponseData().fromJson(e)).toList() as M;
+		if(<EquipmentListEntity>[] is M){
+			return data.map<EquipmentListEntity>((e) => EquipmentListEntity().fromJson(e)).toList() as M;
+		}
+		if(<EquipmentListData>[] is M){
+			return data.map<EquipmentListData>((e) => EquipmentListData().fromJson(e)).toList() as M;
+		}
+		if(<EquipmentListDataEquipmentVOS>[] is M){
+			return data.map<EquipmentListDataEquipmentVOS>((e) => EquipmentListDataEquipmentVOS().fromJson(e)).toList() as M;
+		}
+		if(<EquipmentListDataCountDTO>[] is M){
+			return data.map<EquipmentListDataCountDTO>((e) => EquipmentListDataCountDTO().fromJson(e)).toList() as M;
+		}
+		if(<PersonalDataCountEntity>[] is M){
+			return data.map<PersonalDataCountEntity>((e) => PersonalDataCountEntity().fromJson(e)).toList() as M;
+		}
+		if(<PersonalDataCountData>[] is M){
+			return data.map<PersonalDataCountData>((e) => PersonalDataCountData().fromJson(e)).toList() as M;
 		}
-		if(<PatrolJobDetailResponseDataList>[] is M){
-			return data.map<PatrolJobDetailResponseDataList>((e) => PatrolJobDetailResponseDataList().fromJson(e)).toList() as M;
+		if(<EquipmentInfoEntity>[] is M){
+			return data.map<EquipmentInfoEntity>((e) => EquipmentInfoEntity().fromJson(e)).toList() as M;
 		}
-		if(<PatrolJobDetailResponseDataListDeviceList>[] is M){
-			return data.map<PatrolJobDetailResponseDataListDeviceList>((e) => PatrolJobDetailResponseDataListDeviceList().fromJson(e)).toList() as M;
+		if(<EquipmentInfoData>[] is M){
+			return data.map<EquipmentInfoData>((e) => EquipmentInfoData().fromJson(e)).toList() as M;
 		}
 
 		throw Exception("not found");

+ 18 - 0
lib/generated/json/drop_menu_item_helper.dart

@@ -0,0 +1,18 @@
+import 'package:deus_app/model/drop_menu_item.dart';
+
+dropMenuItemFromJson(DropMenuItem data, Map<String, dynamic> json) {
+	if (json['label'] != null) {
+		data.label = json['label'];
+	}
+	if (json['value'] != null) {
+		data.value = json['value'];
+	}
+	return data;
+}
+
+Map<String, dynamic> dropMenuItemToJson(DropMenuItem entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['label'] = entity.label;
+	data['value'] = entity.value;
+	return data;
+}

+ 203 - 0
lib/generated/json/equipment_info_entity_helper.dart

@@ -0,0 +1,203 @@
+import 'package:deus_app/model/equipment_info_entity.dart';
+
+equipmentInfoEntityFromJson(EquipmentInfoEntity data, Map<String, dynamic> json) {
+	if (json['code'] != null) {
+		data.code = json['code'] is String
+				? int.tryParse(json['code'])
+				: json['code'].toInt();
+	}
+	if (json['data'] != null) {
+		data.data = EquipmentInfoData().fromJson(json['data']);
+	}
+	if (json['msg'] != null) {
+		data.msg = json['msg'].toString();
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentInfoEntityToJson(EquipmentInfoEntity entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['code'] = entity.code;
+	data['data'] = entity.data.toJson();
+	data['msg'] = entity.msg;
+	return data;
+}
+
+equipmentInfoDataFromJson(EquipmentInfoData data, Map<String, dynamic> json) {
+	if (json['id'] != null) {
+		data.id = json['id'] is String
+				? int.tryParse(json['id'])
+				: json['id'].toInt();
+	}
+	if (json['name'] != null) {
+		data.name = json['name'].toString();
+	}
+	if (json['showName'] != null) {
+		data.showName = json['showName'].toString();
+	}else{
+		data.showName=json['name'].toString();
+	}
+	if (json['deviceKey'] != null) {
+		data.deviceKey = json['deviceKey'].toString();
+	}
+	if (json['authType'] != null) {
+		data.authType = json['authType'] is String
+				? int.tryParse(json['authType'])
+				: json['authType'].toInt();
+	}
+	if (json['isEnable'] != null) {
+		data.isEnable = json['isEnable'] is String
+				? int.tryParse(json['isEnable'])
+				: json['isEnable'].toInt();
+	}
+	if (json['isActive'] != null) {
+		data.isActive = json['isActive'] is String
+				? int.tryParse(json['isActive'])
+				: json['isActive'].toInt();
+	}
+	if (json['deviceSecret'] != null) {
+		data.deviceSecret = json['deviceSecret'].toString();
+	}
+	if (json['deviceId'] != null) {
+		data.deviceId = json['deviceId'].toString();
+	}
+	if (json['productName'] != null) {
+		data.productName = json['productName'].toString();
+	}
+	if (json['productKey'] != null) {
+		data.productKey = json['productKey'].toString();
+	}
+	if (json['productId'] != null) {
+		data.productId = json['productId'] is String
+				? int.tryParse(json['productId'])
+				: json['productId'].toInt();
+	}
+	if (json['status'] != null) {
+		data.status = json['status'] is String
+				? int.tryParse(json['status'])
+				: json['status'].toInt();
+	}
+	if (json['nodeType'] != null) {
+		data.nodeType = json['nodeType'] is String
+				? int.tryParse(json['nodeType'])
+				: json['nodeType'].toInt();
+	}
+	if (json['connectionProtocol'] != null) {
+		data.connectionProtocol = json['connectionProtocol'] is String
+				? int.tryParse(json['connectionProtocol'])
+				: json['connectionProtocol'].toInt();
+	}
+	if (json['ip'] != null) {
+		data.ip = json['ip'].toString();
+	}
+	if (json['lastUpdateOn'] != null) {
+		data.lastUpdateOn = json['lastUpdateOn'];
+	}
+	if (json['activationOn'] != null) {
+		data.activationOn = json['activationOn'];
+	}else{
+		data.activationOn ="暂无";
+	}
+	if (json['positionId'] != null) {
+		data.positionId = json['positionId'];
+	}
+	if (json['number'] != null) {
+		data.number = json['number'];
+	}
+	if (json['speedA'] != null) {
+		data.speedA = json['speedA'].toString();
+	}else{
+    data.speedA="暂无";
+  }
+	if (json['speedB'] != null) {
+		data.speedB = json['speedB'].toString();
+	}else{
+    data.speedB="暂无";
+  }
+	if (json['finenessA'] != null) {
+		data.finenessA = json['finenessA'].toString();
+	}else{
+    data.finenessA="暂无";
+  }
+	if (json['finenessB'] != null) {
+		data.finenessB = json['finenessB'].toString();
+	}else{
+    data.finenessB="暂无";
+  }
+	if (json['holeCountA'] != null) {
+		data.holeCountA = json['holeCountA'].toString();
+	}else{
+    data.holeCountA="暂无";
+  }
+	if (json['holeCountB'] != null) {
+		data.holeCountB = json['holeCountB'].toString();
+	}else{
+    data.holeCountB="暂无";
+  }
+	if (json['activePeriod'] != null) {
+		data.activePeriod = json['activePeriod'];
+	}
+	if (json['createdOn'] != null) {
+		data.createdOn = json['createdOn'].toString();
+	}
+  if (json['lastOnlineOn'] != null) {
+    data.lastOnlineOn = json['lastOnlineOn'].toString();
+  }else{
+    data.lastOnlineOn ="未知";
+  }
+	if (json['iotId'] != null) {
+		data.iotId = json['iotId'].toString();
+	}
+	if (json['description'] != null) {
+		data.description = json['description'];
+	}
+	if (json['customerId'] != null) {
+		data.customerId = json['customerId'].toString();
+	}
+	if (json['channelId'] != null) {
+		data.channelId = json['channelId'].toString();
+	}
+	if (json['imei'] != null) {
+		data.imei = json['imei'];
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentInfoDataToJson(EquipmentInfoData entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['id'] = entity.id;
+	data['name'] = entity.name;
+	data['showName'] = entity.showName;
+	data['deviceKey'] = entity.deviceKey;
+	data['authType'] = entity.authType;
+	data['isEnable'] = entity.isEnable;
+	data['isActive'] = entity.isActive;
+	data['deviceSecret'] = entity.deviceSecret;
+	data['deviceId'] = entity.deviceId;
+	data['productName'] = entity.productName;
+	data['productKey'] = entity.productKey;
+	data['productId'] = entity.productId;
+	data['status'] = entity.status;
+	data['nodeType'] = entity.nodeType;
+	data['connectionProtocol'] = entity.connectionProtocol;
+	data['ip'] = entity.ip;
+	data['lastUpdateOn'] = entity.lastUpdateOn;
+	data['activationOn'] = entity.activationOn;
+	data['positionId'] = entity.positionId;
+	data['number'] = entity.number;
+	data['speedA'] = entity.speedA;
+	data['speedB'] = entity.speedB;
+	data['finenessA'] = entity.finenessA;
+	data['finenessB'] = entity.finenessB;
+	data['holeCountA'] = entity.holeCountA;
+	data['holeCountB'] = entity.holeCountB;
+	data['activePeriod'] = entity.activePeriod;
+	data['createdOn'] = entity.createdOn;
+	data['lastOnlineOn'] = entity.lastOnlineOn;
+	data['iotId'] = entity.iotId;
+	data['description'] = entity.description;
+	data['customerId'] = entity.customerId;
+	data['channelId'] = entity.channelId;
+	data['imei'] = entity.imei;
+	return data;
+}

+ 263 - 0
lib/generated/json/equipment_list_entity_helper.dart

@@ -0,0 +1,263 @@
+import 'package:deus_app/model/equipment_list_entity.dart';
+
+equipmentListEntityFromJson(EquipmentListEntity data, Map<String, dynamic> json) {
+	if (json['code'] != null) {
+		data.code = json['code'] is String
+				? int.tryParse(json['code'])
+				: json['code'].toInt();
+	}
+	if (json['data'] != null) {
+		data.data = EquipmentListData().fromJson(json['data']);
+	}
+	if (json['msg'] != null) {
+		data.msg = json['msg'].toString();
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentListEntityToJson(EquipmentListEntity entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['code'] = entity.code;
+	data['data'] = entity.data.toJson();
+	data['msg'] = entity.msg;
+	return data;
+}
+
+equipmentListDataFromJson(EquipmentListData data, Map<String, dynamic> json) {
+	if (json['total'] != null) {
+		data.total = json['total'] is String
+				? int.tryParse(json['total'])
+				: json['total'].toInt();
+	}
+	if (json['index'] != null) {
+		data.index = json['index'] is String
+				? int.tryParse(json['index'])
+				: json['index'].toInt();
+	}
+	if (json['size'] != null) {
+		data.size = json['size'] is String
+				? int.tryParse(json['size'])
+				: json['size'].toInt();
+	}
+	if (json['sortBy'] != null) {
+		data.sortBy = json['sortBy'];
+	}
+	if (json['sort'] != null) {
+		data.sort = json['sort'];
+	}
+	if (json['query'] != null) {
+		data.query = json['query'];
+	}
+	if (json['equipmentVOS'] != null) {
+		data.equipmentVOS = (json['equipmentVOS'] as List).map((v) => EquipmentListDataEquipmentVOS().fromJson(v)).toList();
+	}
+	if (json['countDTO'] != null) {
+		data.countDTO = EquipmentListDataCountDTO().fromJson(json['countDTO']);
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentListDataToJson(EquipmentListData entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['total'] = entity.total;
+	data['index'] = entity.index;
+	data['size'] = entity.size;
+	data['sortBy'] = entity.sortBy;
+	data['sort'] = entity.sort;
+	data['query'] = entity.query;
+	data['equipmentVOS'] =  entity.equipmentVOS.map((v) => v.toJson()).toList();
+	data['countDTO'] = entity.countDTO.toJson();
+	return data;
+}
+
+equipmentListDataEquipmentVOSFromJson(EquipmentListDataEquipmentVOS data, Map<String, dynamic> json) {
+	if (json['id'] != null) {
+		data.id = json['id'] is String
+				? int.tryParse(json['id'])
+				: json['id'].toInt();
+	}
+	if (json['name'] != null) {
+		data.name = json['name'].toString();
+	}
+	if (json['showName'] != null) {
+		data.showName = json['showName'].toString();
+	}else{
+		data.showName =data.name;
+	}
+	if (json['deviceKey'] != null) {
+		data.deviceKey = json['deviceKey'].toString();
+	}
+	if (json['authType'] != null) {
+		data.authType = json['authType'] is String
+				? int.tryParse(json['authType'])
+				: json['authType'].toInt();
+	}
+	if (json['isEnable'] != null) {
+		data.isEnable = json['isEnable'] is String
+				? int.tryParse(json['isEnable'])
+				: json['isEnable'].toInt();
+	}
+	if (json['isActive'] != null) {
+		data.isActive = json['isActive'];
+	}
+	if (json['deviceSecret'] != null) {
+		data.deviceSecret = json['deviceSecret'].toString();
+	}
+	if (json['deviceId'] != null) {
+		data.deviceId = json['deviceId'].toString();
+	}
+	if (json['productName'] != null) {
+		data.productName = json['productName'].toString();
+	}
+	if (json['productKey'] != null) {
+		data.productKey = json['productKey'].toString();
+	}
+	if (json['productId'] != null) {
+		data.productId = json['productId'] is String
+				? int.tryParse(json['productId'])
+				: json['productId'].toInt();
+	}
+	if (json['status'] != null) {
+		data.status = json['status'] is String
+				? int.tryParse(json['status'])
+				: json['status'].toInt();
+	}
+	if (json['nodeType'] != null) {
+		data.nodeType = json['nodeType'] is String
+				? int.tryParse(json['nodeType'])
+				: json['nodeType'].toInt();
+	}
+	if (json['connectionProtocol'] != null) {
+		data.connectionProtocol = json['connectionProtocol'];
+	}
+	if (json['ip'] != null) {
+		data.ip = json['ip'];
+	}
+	if (json['lastUpdateOn'] != null) {
+		data.lastUpdateOn = json['lastUpdateOn'];
+	}
+	if (json['activationOn'] != null) {
+		data.activationOn = json['activationOn'];
+	}
+	if (json['positionId'] != null) {
+		data.positionId = json['positionId'];
+	}
+	if (json['number'] != null) {
+		data.number = json['number'];
+	}
+	if (json['speedA'] != null) {
+		data.speedA = json['speedA'].toString();
+	}
+	if (json['speedB'] != null) {
+		data.speedB = json['speedB'].toString();
+	}
+	if (json['finenessA'] != null) {
+		data.finenessA = json['finenessA'].toString();
+	}
+	if (json['finenessB'] != null) {
+		data.finenessB = json['finenessB'].toString();
+	}
+	if (json['holeCountA'] != null) {
+		data.holeCountA = json['holeCountA'].toString();
+	}
+	if (json['holeCountB'] != null) {
+		data.holeCountB = json['holeCountB'].toString();
+	}
+	if (json['activePeriod'] != null) {
+		data.activePeriod = json['activePeriod'];
+	}
+	if (json['createdOn'] != null) {
+		data.createdOn = json['createdOn'].toString();
+	}
+	if (json['lastOnlineOn'] != null) {
+		data.lastOnlineOn = json['lastOnlineOn'];
+	}
+	if (json['iotId'] != null) {
+		data.iotId = json['iotId'].toString();
+	}
+	if (json['description'] != null) {
+		data.description = json['description'].toString();
+	}
+	if (json['customerId'] != null) {
+		data.customerId = json['customerId'].toString();
+	}
+	if (json['channelId'] != null) {
+		data.channelId = json['channelId'];
+	}
+	if (json['imei'] != null) {
+		data.imei = json['imei'];
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentListDataEquipmentVOSToJson(EquipmentListDataEquipmentVOS entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['id'] = entity.id;
+	data['name'] = entity.name;
+	data['showName'] = entity.showName;
+	data['deviceKey'] = entity.deviceKey;
+	data['authType'] = entity.authType;
+	data['isEnable'] = entity.isEnable;
+	data['isActive'] = entity.isActive;
+	data['deviceSecret'] = entity.deviceSecret;
+	data['deviceId'] = entity.deviceId;
+	data['productName'] = entity.productName;
+	data['productKey'] = entity.productKey;
+	data['productId'] = entity.productId;
+	data['status'] = entity.status;
+	data['nodeType'] = entity.nodeType;
+	data['connectionProtocol'] = entity.connectionProtocol;
+	data['ip'] = entity.ip;
+	data['lastUpdateOn'] = entity.lastUpdateOn;
+	data['activationOn'] = entity.activationOn;
+	data['positionId'] = entity.positionId;
+	data['number'] = entity.number;
+	data['speedA'] = entity.speedA;
+	data['speedB'] = entity.speedB;
+	data['finenessA'] = entity.finenessA;
+	data['finenessB'] = entity.finenessB;
+	data['holeCountA'] = entity.holeCountA;
+	data['holeCountB'] = entity.holeCountB;
+	data['activePeriod'] = entity.activePeriod;
+	data['createdOn'] = entity.createdOn;
+	data['lastOnlineOn'] = entity.lastOnlineOn;
+	data['iotId'] = entity.iotId;
+	data['description'] = entity.description;
+	data['customerId'] = entity.customerId;
+	data['channelId'] = entity.channelId;
+	data['imei'] = entity.imei;
+	return data;
+}
+
+equipmentListDataCountDTOFromJson(EquipmentListDataCountDTO data, Map<String, dynamic> json) {
+	if (json['count'] != null) {
+		data.count = json['count'] is String
+				? int.tryParse(json['count'])
+				: json['count'].toInt();
+	}
+	if (json['active'] != null) {
+		data.active = json['active'] is String
+				? int.tryParse(json['active'])
+				: json['active'].toInt();
+	}
+	if (json['online'] != null) {
+		data.online = json['online'] is String
+				? int.tryParse(json['online'])
+				: json['online'].toInt();
+	}
+	if (json['offline'] != null) {
+		data.offline = json['offline'] is String
+				? int.tryParse(json['offline'])
+				: json['offline'].toInt();
+	}
+	return data;
+}
+
+Map<String, dynamic> equipmentListDataCountDTOToJson(EquipmentListDataCountDTO entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['count'] = entity.count;
+	data['active'] = entity.active;
+	data['online'] = entity.online;
+	data['offline'] = entity.offline;
+	return data;
+}

+ 0 - 213
lib/generated/json/patrol_job_detail_response_entity_helper.dart

@@ -1,213 +0,0 @@
-import 'package:deus_app/model/patrol_job_detail_response_entity.dart';
-
-patrolJobDetailResponseEntityFromJson(PatrolJobDetailResponseEntity data, Map<String, dynamic> json) {
-	if (json['code'] != null) {
-		data.code = json['code'] is String
-				? int.tryParse(json['code'])
-				: json['code'].toInt();
-	}
-	if (json['data'] != null) {
-		data.data = PatrolJobDetailResponseData().fromJson(json['data']);
-	}
-	if (json['msg'] != null) {
-		data.msg = json['msg'].toString();
-	}
-	return data;
-}
-
-Map<String, dynamic> patrolJobDetailResponseEntityToJson(PatrolJobDetailResponseEntity entity) {
-	final Map<String, dynamic> data = new Map<String, dynamic>();
-	data['code'] = entity.code;
-	data['data'] = entity.data.toJson();
-	data['msg'] = entity.msg;
-	return data;
-}
-
-patrolJobDetailResponseDataFromJson(PatrolJobDetailResponseData data, Map<String, dynamic> json) {
-	if (json['id'] != null) {
-		data.id = json['id'] is String
-				? int.tryParse(json['id'])
-				: json['id'].toInt();
-	}
-	if (json['name'] != null) {
-		data.name = json['name'].toString();
-	}
-	if (json['number'] != null) {
-		data.number = json['number'].toString();
-	}
-	if (json['planName'] != null) {
-		data.planName = json['planName'].toString();
-	}
-	if (json['planNumber'] != null) {
-		data.planNumber = json['planNumber'].toString();
-	}
-	if (json['termType'] != null) {
-		data.termType = json['termType'] is String
-				? int.tryParse(json['termType'])
-				: json['termType'].toInt();
-	}
-	if (json['personnelId'] != null) {
-		data.personnelId = json['personnelId'] is String
-				? int.tryParse(json['personnelId'])
-				: json['personnelId'].toInt();
-	}
-	if (json['personnel'] != null) {
-		data.personnel = json['personnel'].toString();
-	}
-	if (json['remarks'] != null) {
-		data.remarks = json['remarks'].toString();
-	}
-	if (json['finishTime'] != null) {
-		data.finishTime = json['finishTime'].toString();
-	}
-	if (json['fileUrls'] != null) {
-		data.fileUrls = (json['fileUrls'] as List).map((v) => v).toList().cast<dynamic>();
-	}
-	if (json['startDate'] != null) {
-		data.startDate = json['startDate'].toString();
-	}
-	if (json['endDate'] != null) {
-		data.endDate = json['endDate'].toString();
-	}
-	if (json['status'] != null) {
-		data.status = json['status'] is String
-				? int.tryParse(json['status'])
-				: json['status'].toInt();
-	}
-	if (json['closeReason'] != null) {
-		data.closeReason = json['closeReason'];
-	}
-	if (json['customerName'] != null) {
-		data.customerName = json['customerName'];
-	}
-	if (json['channelName'] != null) {
-		data.channelName = json['channelName'];
-	}
-	if (json['closeUser'] != null) {
-		data.closeUser = json['closeUser'];
-	}
-	if (json['closeUserName'] != null) {
-		data.closeUserName = json['closeUserName'];
-	}
-	if (json['closeTime'] != null) {
-		data.closeTime = json['closeTime'];
-	}
-	if (json['createTime'] != null) {
-		data.createTime = json['createTime'].toString();
-	}
-	if (json['creator'] != null) {
-		data.creator = json['creator'] is String
-				? int.tryParse(json['creator'])
-				: json['creator'].toInt();
-	}
-	if (json['creatorName'] != null) {
-		data.creatorName = json['creatorName'].toString();
-	}
-	if (json['list'] != null) {
-		data.xList = (json['list'] as List).map((v) => PatrolJobDetailResponseDataList().fromJson(v)).toList();
-	}
-	return data;
-}
-
-Map<String, dynamic> patrolJobDetailResponseDataToJson(PatrolJobDetailResponseData entity) {
-	final Map<String, dynamic> data = new Map<String, dynamic>();
-	data['id'] = entity.id;
-	data['name'] = entity.name;
-	data['number'] = entity.number;
-	data['planName'] = entity.planName;
-	data['planNumber'] = entity.planNumber;
-	data['termType'] = entity.termType;
-	data['personnelId'] = entity.personnelId;
-	data['personnel'] = entity.personnel;
-	data['remarks'] = entity.remarks;
-	data['finishTime'] = entity.finishTime;
-	data['fileUrls'] = entity.fileUrls;
-	data['startDate'] = entity.startDate;
-	data['endDate'] = entity.endDate;
-	data['status'] = entity.status;
-	data['closeReason'] = entity.closeReason;
-	data['customerName'] = entity.customerName;
-	data['channelName'] = entity.channelName;
-	data['closeUser'] = entity.closeUser;
-	data['closeUserName'] = entity.closeUserName;
-	data['closeTime'] = entity.closeTime;
-	data['createTime'] = entity.createTime;
-	data['creator'] = entity.creator;
-	data['creatorName'] = entity.creatorName;
-	data['list'] =  entity.xList.map((v) => v.toJson()).toList();
-	return data;
-}
-
-patrolJobDetailResponseDataListFromJson(PatrolJobDetailResponseDataList data, Map<String, dynamic> json) {
-	if (json['productName'] != null) {
-		data.productName = json['productName'].toString();
-	}
-	if (json['deviceList'] != null) {
-		data.deviceList = (json['deviceList'] as List).map((v) => PatrolJobDetailResponseDataListDeviceList().fromJson(v)).toList();
-	}
-	return data;
-}
-
-Map<String, dynamic> patrolJobDetailResponseDataListToJson(PatrolJobDetailResponseDataList entity) {
-	final Map<String, dynamic> data = new Map<String, dynamic>();
-	data['productName'] = entity.productName;
-	data['deviceList'] =  entity.deviceList.map((v) => v.toJson()).toList();
-	return data;
-}
-
-patrolJobDetailResponseDataListDeviceListFromJson(PatrolJobDetailResponseDataListDeviceList data, Map<String, dynamic> json) {
-	if (json['id'] != null) {
-		data.id = json['id'] is String
-				? int.tryParse(json['id'])
-				: json['id'].toInt();
-	}
-	if (json['equipmentId'] != null) {
-		data.equipmentId = json['equipmentId'] is String
-				? int.tryParse(json['equipmentId'])
-				: json['equipmentId'].toInt();
-	}
-	if (json['name'] != null) {
-		data.name = json['name'].toString();
-	}
-	if (json['showName'] != null) {
-		data.showName = json['showName'].toString();
-	}
-	if (json['deviceKey'] != null) {
-		data.deviceKey = json['deviceKey'].toString();
-	}
-	if (json['productName'] != null) {
-		data.productName = json['productName'].toString();
-	}
-	if (json['itemCompleteTime'] != null) {
-		data.itemCompleteTime = json['itemCompleteTime'].toString();
-	}
-	if (json['itemPerson'] != null) {
-		data.itemPerson = json['itemPerson'].toString();
-	}
-	if (json['patrolJobId'] != null) {
-		data.patrolJobId = json['patrolJobId'] is String
-				? int.tryParse(json['patrolJobId'])
-				: json['patrolJobId'].toInt();
-	}
-	if (json['isComplete'] != null) {
-		data.isComplete = json['isComplete'] is String
-				? int.tryParse(json['isComplete'])
-				: json['isComplete'].toInt();
-	}
-	return data;
-}
-
-Map<String, dynamic> patrolJobDetailResponseDataListDeviceListToJson(PatrolJobDetailResponseDataListDeviceList entity) {
-	final Map<String, dynamic> data = new Map<String, dynamic>();
-	data['id'] = entity.id;
-	data['equipmentId'] = entity.equipmentId;
-	data['name'] = entity.name;
-	data['showName'] = entity.showName;
-	data['deviceKey'] = entity.deviceKey;
-	data['productName'] = entity.productName;
-	data['itemCompleteTime'] = entity.itemCompleteTime;
-	data['itemPerson'] = entity.itemPerson;
-	data['patrolJobId'] = entity.patrolJobId;
-	data['isComplete'] = entity.isComplete;
-	return data;
-}

+ 51 - 0
lib/generated/json/personal_data_count_entity_helper.dart

@@ -0,0 +1,51 @@
+import 'package:deus_app/model/personal_data_count_entity.dart';
+
+personalDataCountEntityFromJson(PersonalDataCountEntity data, Map<String, dynamic> json) {
+	if (json['code'] != null) {
+		data.code = json['code'] is String
+				? int.tryParse(json['code'])
+				: json['code'].toInt();
+	}
+	if (json['msg'] != null) {
+		data.msg = json['msg'].toString();
+	}
+	if (json['data'] != null) {
+		data.data = PersonalDataCountData().fromJson(json['data']);
+	}
+	return data;
+}
+
+Map<String, dynamic> personalDataCountEntityToJson(PersonalDataCountEntity entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['code'] = entity.code;
+	data['msg'] = entity.msg;
+	data['data'] = entity.data.toJson();
+	return data;
+}
+
+personalDataCountDataFromJson(PersonalDataCountData data, Map<String, dynamic> json) {
+	if (json['maintJobCount'] != null) {
+		data.maintJobCount = json['maintJobCount'] is String
+				? int.tryParse(json['maintJobCount'])
+				: json['maintJobCount'].toInt();
+	}
+	if (json['patrolJobCount'] != null) {
+		data.patrolJobCount = json['patrolJobCount'] is String
+				? int.tryParse(json['patrolJobCount'])
+				: json['patrolJobCount'].toInt();
+	}
+	if (json['alarmCount'] != null) {
+		data.alarmCount = json['alarmCount'] is String
+				? int.tryParse(json['alarmCount'])
+				: json['alarmCount'].toInt();
+	}
+	return data;
+}
+
+Map<String, dynamic> personalDataCountDataToJson(PersonalDataCountData entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['maintJobCount'] = entity.maintJobCount;
+	data['patrolJobCount'] = entity.patrolJobCount;
+	data['alarmCount'] = entity.alarmCount;
+	return data;
+}

+ 1 - 1
lib/model/drop_menu_item.dart

@@ -2,6 +2,6 @@ import 'package:deus_app/generated/json/base/json_convert_content.dart';
 
 class DropMenuItem extends JsonConvert<DropMenuItem>{
   late dynamic label;
-  late dynamic value;
+  late int value;
   DropMenuItem(this.label,this.value);
 }

+ 44 - 0
lib/model/equipment_info_entity.dart

@@ -0,0 +1,44 @@
+import 'package:deus_app/generated/json/base/json_convert_content.dart';
+
+class EquipmentInfoEntity with JsonConvert<EquipmentInfoEntity> {
+	late int code;
+	late EquipmentInfoData data;
+	late String msg;
+}
+
+class EquipmentInfoData with JsonConvert<EquipmentInfoData> {
+	late int id;
+	late String name;
+	late String showName;
+	late String deviceKey;
+	late int authType;
+	late int isEnable;
+	late int isActive;
+	late String deviceSecret;
+	late String deviceId;
+	late String productName;
+	late String productKey;
+	late int productId;
+	late int status;
+	late int nodeType;
+	late int connectionProtocol;
+	late String ip;
+	late dynamic lastUpdateOn;
+	late String activationOn;
+	late dynamic positionId;
+	late dynamic number;
+	late String speedA;
+	late String speedB;
+	late String finenessA;
+	late String finenessB;
+	late String holeCountA;
+	late String holeCountB;
+	late dynamic activePeriod;
+	late String createdOn;
+	late String lastOnlineOn;
+	late String iotId;
+	late dynamic description;
+	late String customerId;
+	late String channelId;
+	late dynamic imei;
+}

+ 62 - 0
lib/model/equipment_list_entity.dart

@@ -0,0 +1,62 @@
+import 'package:deus_app/generated/json/base/json_convert_content.dart';
+
+class EquipmentListEntity with JsonConvert<EquipmentListEntity> {
+	late int code;
+	late EquipmentListData data;
+	late String msg;
+}
+
+class EquipmentListData with JsonConvert<EquipmentListData> {
+	late int total;
+	late int index;
+	late int size;
+	late dynamic sortBy;
+	late dynamic sort;
+	late dynamic query;
+	late List<EquipmentListDataEquipmentVOS> equipmentVOS;
+	late EquipmentListDataCountDTO countDTO;
+}
+
+class EquipmentListDataEquipmentVOS with JsonConvert<EquipmentListDataEquipmentVOS> {
+	late int id;
+	late String name;
+	late String showName;
+	late String deviceKey;
+	late int authType;
+	late int isEnable;
+	late dynamic isActive;
+	late String deviceSecret;
+	late String deviceId;
+	late String productName;
+	late String productKey;
+	late int productId;
+	late int status;
+	late int nodeType;
+	late dynamic connectionProtocol;
+	late dynamic ip;
+	late dynamic lastUpdateOn;
+	late dynamic activationOn;
+	late dynamic positionId;
+	late dynamic number;
+	late String speedA;
+	late String speedB;
+	late String finenessA;
+	late String finenessB;
+	late String holeCountA;
+	late String holeCountB;
+	late dynamic activePeriod;
+	late String createdOn;
+	late dynamic lastOnlineOn;
+	late String iotId;
+	late String description;
+	late String customerId;
+	late dynamic channelId;
+	late dynamic imei;
+}
+
+class EquipmentListDataCountDTO with JsonConvert<EquipmentListDataCountDTO> {
+	late int count;
+	late int active;
+	late int online;
+	late int offline;
+}

+ 0 - 54
lib/model/patrol_job_detail_response_entity.dart

@@ -1,54 +0,0 @@
-import 'package:deus_app/generated/json/base/json_convert_content.dart';
-import 'package:deus_app/generated/json/base/json_field.dart';
-
-class PatrolJobDetailResponseEntity with JsonConvert<PatrolJobDetailResponseEntity> {
-	late int code;
-	late PatrolJobDetailResponseData data;
-	late String msg;
-}
-
-class PatrolJobDetailResponseData with JsonConvert<PatrolJobDetailResponseData> {
-	late int id;
-	late String name;
-	late String number;
-	late String planName;
-	late String planNumber;
-	late int termType;
-	late int personnelId;
-	late String personnel;
-	late String remarks;
-	late String finishTime;
-	late List<dynamic> fileUrls;
-	late String startDate;
-	late String endDate;
-	late int status;
-	late dynamic closeReason;
-	late dynamic customerName;
-	late dynamic channelName;
-	late dynamic closeUser;
-	late dynamic closeUserName;
-	late dynamic closeTime;
-	late String createTime;
-	late int creator;
-	late String creatorName;
-	@JSONField(name: "list")
-	late List<PatrolJobDetailResponseDataList> xList;
-}
-
-class PatrolJobDetailResponseDataList with JsonConvert<PatrolJobDetailResponseDataList> {
-	late String productName;
-	late List<PatrolJobDetailResponseDataListDeviceList> deviceList;
-}
-
-class PatrolJobDetailResponseDataListDeviceList with JsonConvert<PatrolJobDetailResponseDataListDeviceList> {
-	late int id;
-	late int equipmentId;
-	late String name;
-	late String showName;
-	late String deviceKey;
-	late String productName;
-	late String itemCompleteTime;
-	late String itemPerson;
-	late int patrolJobId;
-	late int isComplete;
-}

+ 13 - 0
lib/model/personal_data_count_entity.dart

@@ -0,0 +1,13 @@
+import 'package:deus_app/generated/json/base/json_convert_content.dart';
+
+class PersonalDataCountEntity with JsonConvert<PersonalDataCountEntity> {
+	late int code;
+	late String msg;
+	late PersonalDataCountData data;
+}
+
+class PersonalDataCountData with JsonConvert<PersonalDataCountData> {
+	late int maintJobCount;
+	late int patrolJobCount;
+	late int alarmCount;
+}

+ 292 - 0
lib/page/device/device_manage_detail_page.dart

@@ -0,0 +1,292 @@
+import 'package:deus_app/common/style/TitleBar.dart';
+import 'package:deus_app/common/style/gsy_style.dart';
+import 'package:deus_app/common/utils/DioUtil.dart';
+import 'package:deus_app/common/utils/LoadingDialogHelper.dart';
+import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/generated/json/equipment_info_entity_helper.dart';
+import 'package:deus_app/model/equipment_info_entity.dart';
+import 'package:deus_app/page/device/device_manage_update_page.dart';
+import 'package:flutter/material.dart';
+
+class DeviceManageDetailPage extends StatefulWidget {
+  final EquipmentInfoData data;
+
+  const DeviceManageDetailPage({super.key, required this.data});
+
+  @override
+  State createState() {
+    return _DeviceManageDetailPage(data);
+  }
+}
+
+class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
+  EquipmentInfoData data;
+
+  _DeviceManageDetailPage(this.data);
+
+   var _event;
+
+  @override
+  Widget build(BuildContext context) {
+    // TODO: implement build
+    return Scaffold(
+        appBar: TitleBar().backAppbar(context, "设备详情"),
+        backgroundColor: const Color(0xfff2f2f2),
+        body: ListView(children: _Ws()));
+  }
+
+  List<Widget> _Ws() {
+    List<Widget> ws = [];
+    ws.add(_deviceDetail());
+    ws.add(_deviceList());
+    return ws;
+  }
+
+  Widget _deviceDetail() {
+    return Column(children: [
+      Container(
+        decoration: BoxDecoration(color: Colors.white),
+        padding: EdgeInsets.only(bottom: 15, top: 15, left: 12, right: 12),
+        margin: EdgeInsets.only(bottom: 15),
+        child: Column(
+          children: [
+            Row(
+              children: [
+                Container(
+                  // padding: EdgeInsets.fromLTRB(12, 0, 0, 0),
+                  alignment: Alignment.bottomLeft,
+                  child: Text(
+                    data.showName,
+                    style: TextStyle(
+                        fontSize: GSYConstant.middleTextWhiteSize,
+                        fontWeight: FontWeight.bold),
+                  ),
+                ),
+                Container(
+                  margin: EdgeInsets.only(left: 10),
+                  padding: EdgeInsets.fromLTRB(3, 2, 3, 2),
+                  alignment: Alignment.centerLeft,
+                  child: Text(
+                    data.status == 0
+                        ? '在线'
+                        : data.status == 1
+                            ? '离线'
+                            : data.status == 2
+                                ? '未激活'
+                                : '未知',
+                    style: TextStyle(
+                        fontSize: GSYConstant.minTextSize,
+                        color: data.status == 2
+                            ? Colors.red
+                            : data.status == 1
+                                ? Colors.orange
+                                : data.status == 0
+                                    ? Colors.blue
+                                    : Colors.black),
+                  ),
+                  decoration: BoxDecoration(
+                    border: new Border.all(
+                      color: data.status == 2
+                          ? Colors.red
+                          : data.status == 1
+                              ? Colors.orange
+                              : data.status == 0
+                                  ? Colors.blue
+                                  : Colors.black, //边框颜色
+                      width: 1.0, //边框粗细
+                    ),
+                    borderRadius: const BorderRadius.all(
+                        const Radius.circular(3.0)), //边框的弧度
+                  ),
+                )
+              ],
+            ),
+            Container(
+                padding: EdgeInsets.only(top: 15),
+                child: Row(
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    children: [
+                      new Text(
+                        '产品名称:',
+                        style: GSYConstant.smallTextLight,
+                      ),
+                      Container(
+                        child: Text(
+                          data.productName,
+                          style: GSYConstant.smallTextLight,
+                          textAlign: TextAlign.right,
+                        ),
+                      ),
+                    ])),
+            Container(
+                padding: EdgeInsets.only(top: 15),
+                child: Row(
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    children: [
+                      new Text(
+                        '激活时间:',
+                        style: GSYConstant.smallTextLight,
+                      ),
+                      Container(
+                        child: Text(
+                          data.activationOn,
+                          style: GSYConstant.smallTextLight,
+                          textAlign: TextAlign.right,
+                        ),
+                      ),
+                    ])),
+            Container(
+                padding: EdgeInsets.only(top: 15),
+                child: Row(
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    children: [
+                      new Text(
+                        '最后上线时间:',
+                        style: GSYConstant.smallTextLight,
+                      ),
+                      Container(
+                        child: Text(
+                          data.lastOnlineOn,
+                          style: GSYConstant.smallTextLight,
+                          textAlign: TextAlign.right,
+                        ),
+                      ),
+                    ])),
+          ],
+        ),
+      ),
+    ]);
+  }
+
+  Widget _deviceList() {
+    return Column(
+      children: [
+        Container(
+            decoration: BoxDecoration(color: Colors.white),
+            padding: const EdgeInsets.fromLTRB(12, 15, 12, 15),
+            child: Column(
+              children: [
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    const Text("设备参数", style: TextStyle(
+                        fontSize: GSYConstant.middleTextWhiteSize,
+                        fontWeight: FontWeight.bold)),
+                    GestureDetector(
+                      child: const Text("修改参数",
+                          style: TextStyle(
+                              fontSize: GSYConstant.middleTextWhiteSize,
+                              color: Colors.blue),
+                          textAlign: TextAlign.right),
+                      onTap: () {
+                        Navigator.push(
+                            context,
+                            MaterialPageRoute(
+                                builder: (context) => DeviceManageUpdatePage(data:data)));
+                      },
+                    )
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Container(
+                  alignment: Alignment.centerLeft,
+                  child: Text('当前设备已设置的参数如下:', style: GSYConstant.smallTextBold),
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('A侧速度:', style: GSYConstant.smallTextLight),
+                    new Text(data.speedA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('B侧速度:', style: GSYConstant.smallTextLight),
+                    new Text(data.speedB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('A侧纤度:', style: GSYConstant.smallTextLight),
+                    new Text(data.finenessA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('B侧纤度:', style: GSYConstant.smallTextLight),
+                    new Text(data.finenessB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('A侧孔数:', style: GSYConstant.smallTextLight),
+                    new Text(data.holeCountA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                ),
+                SizedBox(
+                  height: 15,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    new Text('B侧孔数:', style: GSYConstant.smallTextLight),
+                    new Text(data.holeCountB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                  ],
+                )
+              ],
+            ))
+      ],
+    );
+  }
+  @override
+  void initState() {
+    super.initState();
+    _event = eventBus.on<Object>().listen((event) {
+      setState(() {
+        equipmentInfo(data.id);
+      });
+    });
+  }
+
+  equipmentInfo(int id) async{
+    LoadingDialogHelper.showLoading(context);
+    var result = await DioUtil().request("equipment/equipmentInfo",method: DioMethod.get,params: {'id':id});
+    EquipmentInfoEntity entity=equipmentInfoEntityFromJson(EquipmentInfoEntity(), result);
+    LoadingDialogHelper.dismissLoading(context);
+    if (entity.code == 0) {
+      setState(() {
+        data=entity.data;
+      });
+    } else {
+      showToast(entity.msg);
+    }
+  }
+
+  @override
+  void dispose() {
+    // TODO: implement dispose
+    super.dispose();
+    _event.cancel();
+  }
+}

+ 163 - 88
lib/page/device/device_manage_page.dart

@@ -1,7 +1,13 @@
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
+import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/generated/json/equipment_info_entity_helper.dart';
+import 'package:deus_app/generated/json/equipment_list_entity_helper.dart';
+import 'package:deus_app/model/equipment_info_entity.dart';
+import 'package:deus_app/model/equipment_list_entity.dart';
+import 'package:deus_app/page/device/device_manage_detail_page.dart';
 import 'package:deus_app/widget/MyDrawer.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
@@ -20,10 +26,16 @@ class DeviceManagePage extends StatefulWidget {
 
 class _DeviceManage extends State<DeviceManagePage> {
   String deviceNum = "0";
+  String _device = '', _username = '';
+  dynamic _satus, _isEnabled;
+
   final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
   RefreshController _refreshController =
       RefreshController(initialRefresh: false);
 
+  List<EquipmentListDataEquipmentVOS> equipmentVOS =
+      <EquipmentListDataEquipmentVOS>[];
+
   void _onRefresh() async {
     // monitor network fetch
     await Future.delayed(Duration(milliseconds: 1000));
@@ -41,6 +53,12 @@ class _DeviceManage extends State<DeviceManagePage> {
   }
 
   @override
+  void initState() {
+    super.initState();
+    equipmentList();
+  }
+
+  @override
   Widget build(BuildContext contexts) {
     return Scaffold(
       key: _scaffoldKey,
@@ -49,8 +67,12 @@ class _DeviceManage extends State<DeviceManagePage> {
       }),
       backgroundColor: const Color(0xfff2f2f2),
       endDrawer: MyDrawer(
-        callback: (index, str) {
-          showToast(str);
+        callback:(String device, String name,dynamic stase,dynamic isEnabled){
+          _device=device;
+          _username=name;
+          _satus=stase;
+          _isEnabled=isEnabled;
+          equipmentList();
         },
       ),
       //抽屉
@@ -71,35 +93,36 @@ class _DeviceManage extends State<DeviceManagePage> {
             ],
           ),
           Expanded(
-              child: SmartRefresher(
-            enablePullDown: true,
-            enablePullUp: true,
-            header: WaterDropHeader(),
-            footer: CustomFooter(
-              builder: (BuildContext context, LoadStatus? mode) {
-                Widget body;
-                if (mode == LoadStatus.idle) {
-                  body = Text("上拉加载");
-                } else if (mode == LoadStatus.loading) {
-                  body = CupertinoActivityIndicator();
-                } else if (mode == LoadStatus.failed) {
-                  body = Text("加载失败!点击重试!");
-                } else if (mode == LoadStatus.canLoading) {
-                  body = Text("松手,加载更多!");
-                } else {
-                  body = Text("没有更多数据了!");
-                }
-                return Container(
-                  height: 55.0,
-                  child: Center(child: body),
-                );
-              },
-            ),
-            controller: _refreshController,
-            onRefresh: _onRefresh,
-            onLoading: _onLoading,
+              child: Container(
+            //     child: SmartRefresher(
+            //   enablePullDown: true,
+            //   enablePullUp: true,
+            //   header: WaterDropHeader(),
+            //   footer: CustomFooter(
+            //     builder: (BuildContext context, LoadStatus? mode) {
+            //       Widget body;
+            //       if (mode == LoadStatus.idle) {
+            //         body = Text("上拉加载");
+            //       } else if (mode == LoadStatus.loading) {
+            //         body = CupertinoActivityIndicator();
+            //       } else if (mode == LoadStatus.failed) {
+            //         body = Text("加载失败!点击重试!");
+            //       } else if (mode == LoadStatus.canLoading) {
+            //         body = Text("松手,加载更多!");
+            //       } else {
+            //         body = Text("没有更多数据了!");
+            //       }
+            //       return Container(
+            //         height: 55.0,
+            //         child: Center(child: body),
+            //       );
+            //     },
+            //   ),
+            //   controller: _refreshController,
+            //   onRefresh: _onRefresh,
+            //   onLoading: _onLoading,
             child: ListView.builder(
-              itemCount: 20,
+              itemCount: equipmentVOS.length,
               itemBuilder: (context, index) {
                 return Container(
                     margin: EdgeInsets.only(top: 12, left: 10, right: 10),
@@ -113,8 +136,8 @@ class _DeviceManage extends State<DeviceManagePage> {
                               children: [
                                 Container(
                                   child: Text(
-                                    '此处展示设备名称',
-                                    style: TextStyle(
+                                    equipmentVOS[index].showName,
+                                    style: const TextStyle(
                                       color: Colors.black,
                                       fontSize: GSYConstant.middleTextWhiteSize,
                                       fontWeight: FontWeight.bold,
@@ -125,16 +148,34 @@ class _DeviceManage extends State<DeviceManagePage> {
                                   padding: EdgeInsets.only(
                                       top: 3, bottom: 3, left: 5, right: 5),
                                   child: Text(
-                                    '运行中',
+                                    equipmentVOS[index].status == 0
+                                        ? '在线'
+                                        : equipmentVOS[index].status == 1
+                                            ? '离线'
+                                            : equipmentVOS[index].status == 2
+                                                ? '未激活'
+                                                        : '未知',
                                     textAlign: TextAlign.right,
                                     style: TextStyle(
-                                      color: Colors.blue,
+                                      color: equipmentVOS[index].status == 0
+                                          ? Colors.blue
+                                          : equipmentVOS[index].status == 1
+                                              ? Colors.orange
+                                              : equipmentVOS[index].status == 2
+                                                  ? Colors.red
+                                                  : Colors.black,
                                       fontSize: GSYConstant.minTextSize,
                                     ),
                                   ),
                                   decoration: BoxDecoration(
                                     border: new Border.all(
-                                      color: Colors.blue, //边框颜色
+                                      color: equipmentVOS[index].status == 0
+                                          ? Colors.blue
+                                          : equipmentVOS[index].status == 1
+                                          ? Colors.orange
+                                          : equipmentVOS[index].status == 2
+                                          ? Colors.red
+                                                  : Colors.black, //边框颜色
                                       width: 1.0, //边框粗细
                                     ),
                                     borderRadius: const BorderRadius.all(
@@ -142,65 +183,65 @@ class _DeviceManage extends State<DeviceManagePage> {
                                   ),
                                 )
                               ]),
-                          SizedBox(
-                            height: 12,
-                          ),
-                          Row(
-                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                              children: [
-                                Container(
-                                  child: Text(
-                                    'devicekey:',
-                                    style: TextStyle(
-                                      color: GSYColors.primaryLightValue,
-                                      fontSize: GSYConstant.middleTextWhiteSize,
-                                    ),
-                                  ),
-                                ),
-                                Container(
-                                  child: Text(
-                                    'devicekey',
-                                    textAlign: TextAlign.right,
-                                    style: TextStyle(
-                                      color: GSYColors.primaryLightValue,
-                                      fontSize: GSYConstant.middleTextWhiteSize,
-                                    ),
-                                  ),
-                                ),
-                              ]),
-                          SizedBox(
-                            height: 10,
-                          ),
-                          Row(
-                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                              children: [
-                                Container(
-                                  child: Text(
-                                    'IMEI:',
-                                    style: TextStyle(
-                                      color: GSYColors.primaryLightValue,
-                                      fontSize: GSYConstant.middleTextWhiteSize,
-                                    ),
-                                  ),
-                                ),
-                                Container(
-                                  child: Text(
-                                    'IMEI',
-                                    textAlign: TextAlign.right,
-                                    style: TextStyle(
-                                      color: GSYColors.primaryLightValue,
-                                      fontSize: GSYConstant.middleTextWhiteSize,
-                                    ),
-                                  ),
-                                ),
-                              ]),
+                          // SizedBox(
+                          //   height: 12,
+                          // ),
+                          // Row(
+                          //     mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                          //     children: [
+                          //       Container(
+                          //         child: Text(
+                          //           'devicekey:',
+                          //           style: TextStyle(
+                          //             color: GSYColors.primaryLightValue,
+                          //             fontSize: GSYConstant.middleTextWhiteSize,
+                          //           ),
+                          //         ),
+                          //       ),
+                          //       Container(
+                          //         child: Text(
+                          //           'devicekey',
+                          //           textAlign: TextAlign.right,
+                          //           style: TextStyle(
+                          //             color: GSYColors.primaryLightValue,
+                          //             fontSize: GSYConstant.middleTextWhiteSize,
+                          //           ),
+                          //         ),
+                          //       ),
+                          //     ]),
+                          // SizedBox(
+                          //   height: 10,
+                          // ),
+                          // Row(
+                          //     mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                          //     children: [
+                          //       Container(
+                          //         child: Text(
+                          //           'IMEI:',
+                          //           style: TextStyle(
+                          //             color: GSYColors.primaryLightValue,
+                          //             fontSize: GSYConstant.middleTextWhiteSize,
+                          //           ),
+                          //         ),
+                          //       ),
+                          //       Container(
+                          //         child: Text(
+                          //           'IMEI',
+                          //           textAlign: TextAlign.right,
+                          //           style: TextStyle(
+                          //             color: GSYColors.primaryLightValue,
+                          //             fontSize: GSYConstant.middleTextWhiteSize,
+                          //           ),
+                          //         ),
+                          //       ),
+                          //     ]),
                           SizedBox(
                             height: 5,
                           ),
                         ],
                       ),
                       onTap: () {
-                        Scaffold.of(context).openEndDrawer();
+                        equipmentInfo(equipmentVOS[index].id);
                       },
                     ));
               },
@@ -210,4 +251,38 @@ class _DeviceManage extends State<DeviceManagePage> {
       ),
     );
   }
+
+  equipmentList() async {
+    // LoadingDialogHelper.showLoading(context);
+    var result = await DioUtil().request("equipment/equipmentList",
+        method: DioMethod.post, data: {'index': 1, 'size': 50,'query':{'status':_satus,'name':_username,'isEnable':_isEnabled,'showName':_device}});
+    EquipmentListEntity entity =
+        equipmentListEntityFromJson(EquipmentListEntity(), result,);
+    // LoadingDialogHelper.dismissLoading(context);
+    if (entity.code == 0) {
+      setState(() {
+        equipmentVOS.clear();
+        equipmentVOS.addAll(entity.data.equipmentVOS);
+      });
+    } else {
+      showToast(entity.msg);
+    }
+  }
+
+
+
+  equipmentInfo(int id) async{
+    var result = await DioUtil().request("equipment/equipmentInfo",method: DioMethod.get,params: {'id':id});
+    EquipmentInfoEntity entity=equipmentInfoEntityFromJson(EquipmentInfoEntity(), result);
+    if (entity.code == 0) {
+      setState(() {
+          Navigator.push(
+              context,
+              MaterialPageRoute(
+                  builder: (context) => DeviceManageDetailPage(data:entity.data)));
+      });
+    } else {
+      showToast(entity.msg);
+    }
+  }
 }

+ 300 - 0
lib/page/device/device_manage_update_page.dart

@@ -0,0 +1,300 @@
+import 'package:deus_app/common/style/TitleBar.dart';
+import 'package:deus_app/common/style/gsy_style.dart';
+import 'package:deus_app/common/utils/ConstantString.dart';
+import 'package:deus_app/common/utils/DioUtil.dart';
+import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/model/equipment_info_entity.dart';
+import 'package:deus_app/widget/gsy_flex_button.dart';
+import 'package:event_bus/event_bus.dart';
+import 'package:flutter/material.dart';
+
+class DeviceManageUpdatePage extends StatefulWidget {
+
+  final EquipmentInfoData data;
+
+  const DeviceManageUpdatePage({super.key, required this.data});
+
+
+  @override
+  State createState() {
+    return _DeviceManageUpdatePage(data);
+  }
+}
+
+//创建EventBus对象
+final EventBus eventBus = EventBus();
+
+class _DeviceManageUpdatePage extends State<DeviceManageUpdatePage>{
+
+  EquipmentInfoData data;
+
+  _DeviceManageUpdatePage(this.data);
+
+  TextEditingController _finenessAController= TextEditingController();
+  TextEditingController _finenessBController= TextEditingController();
+  TextEditingController _holeCountAController= TextEditingController();
+  TextEditingController _holeCountBController= TextEditingController();
+  TextEditingController _speedAController= TextEditingController();
+  TextEditingController _speedBController= TextEditingController();
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: TitleBar().backAppbar(context, "修改参数"),
+      backgroundColor: const Color(0xfff2f2f2),
+      body: SingleChildScrollView (
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children:<Widget> [
+            Padding(
+              padding: const EdgeInsets.only(top: 50.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'A测速度:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      decoration: InputDecoration(
+                        border: OutlineInputBorder(),
+                      ),
+                      controller: _speedAController,
+                      style: TextStyle(fontSize: 14),
+
+                      onChanged: (value) {
+                        setState(() {
+                          data.speedA=value;
+                        });
+                      },
+                    ),
+                  ),
+                  flex: 3,
+                ),
+              ]),
+            ),
+            Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'B侧速度:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      controller: _speedBController,
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        setState(() {
+                          data.speedB=value;
+                        });
+                      },
+                    ),
+                  ),
+                  flex: 3,
+                ),
+              ]),
+            ),
+            Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'A侧纤度:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      controller: _finenessAController,
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        setState(() {
+                          data.finenessA=value;
+                        });
+                      },
+                    ),
+                  ),
+                  flex: 3,
+                ),
+              ]),
+            ),
+            Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'B侧纤度:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  flex: 3,
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      controller: _finenessBController,
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        setState(() {
+                          data.finenessB=value;
+                        });
+                      },
+                    ),
+                  ),
+                ),
+              ]),
+            ),
+            Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'A侧孔数:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  flex: 3,
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      controller: _holeCountAController,
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        setState(() {
+                          data.holeCountA=value;
+                        });
+                      },
+                    ),
+                  ),
+                ),
+              ]),
+            ),
+            Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
+              child: Row(children: [
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    'B侧孔数:',
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.smallTextSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Expanded(
+                  flex: 3,
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      controller: _holeCountBController,
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        setState(() {
+                          data.holeCountB=value;
+                        });
+                      },
+                    ),
+                  ),
+                ),
+              ]),
+            ),
+            SizedBox(
+              height: 30,
+            ),
+            _getButton()
+          ],
+        ),
+      ),
+    );
+  }
+
+  parameter() async {
+    // LoadingDialogHelper.showLoading(context);
+    var result = await DioUtil().request("equipment/parameter",
+        method: DioMethod.post, data: {'id':data.id,'finenessA':data.finenessA,'finenessB':data.finenessB
+    ,'holeCountA':data.holeCountA,'holeCountB':data.holeCountB,'speedA':data.speedA,'speedB':data.speedB});
+    // LoadingDialogHelper.dismissLoading(context);
+    if (result['code']== 0) {
+      setState(() {
+        //发出事件
+        eventBus.fire(Object());
+        Navigator.pop(context);
+      });
+    } else {
+      showToast(result['msg']);
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    _finenessAController=TextEditingController(text: data.finenessA);
+    _finenessBController=TextEditingController(text: data.finenessB);
+    _holeCountAController=TextEditingController(text: data.holeCountA);
+    _holeCountBController=TextEditingController(text: data.holeCountB);
+    _speedAController=TextEditingController(text: data.speedA);
+    _speedBController=TextEditingController(text: data.speedB);
+  }
+
+  Widget _getButton() {
+    return Container(
+      height: 50,
+      width: double.infinity,
+      margin: EdgeInsets.all(10),
+      decoration: BoxDecoration(
+        borderRadius: BorderRadius.circular(4.0),
+      ),
+      child: GSYFlexButton(
+        text: ConstantString.updateText,
+        color: Color(0xFF4875EC),
+        textColor: GSYColors.textWhite,
+        fontSize: 16,
+        onPress: parameter,
+      ),
+    );
+  }
+
+}

+ 29 - 4
lib/page/home/home_page.dart

@@ -1,6 +1,9 @@
 import 'package:deus_app/common/local/StoreHelper.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
+import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/generated/json/personal_data_count_entity_helper.dart';
+import 'package:deus_app/model/personal_data_count_entity.dart';
 import 'package:deus_app/page/patrol/patrol_job_page.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
@@ -19,8 +22,8 @@ class HomePage extends StatefulWidget {
 
 class _MineViewPageState extends State<HomePage> {
   List items = [
-    {"name": "今日维保任务", "num": 1},
-    {"name": "今日巡检任务", "num": 2}
+    {"name": "今日维保任务", "num": 0},
+    {"name": "今日巡检任务", "num": 0}
   ];
   List icons = [
     {
@@ -41,9 +44,29 @@ class _MineViewPageState extends State<HomePage> {
     {"name": "保修管理", "image": "images/maintenance_manage.png", 'jump': ''},
   ];
 
+  int alarmCount = 0;
+
   @override
   void initState() {
     super.initState();
+    fetchAlbum();
+  }
+
+  fetchAlbum() async {
+    var result =
+        await DioUtil().request("personalData/count", method: DioMethod.post);
+    PersonalDataCountEntity entity =
+        personalDataCountEntityFromJson(PersonalDataCountEntity(), result);
+    if (entity.code == 0) {
+      setState(() {
+        items.clear();
+        items.add({"name": "今日维保任务", "num": entity.data.maintJobCount});
+        items.add({"name": "今日巡检任务", "num": entity.data.patrolJobCount});
+        alarmCount = entity.data.alarmCount;
+      });
+    } else {
+      showToast(entity.msg);
+    }
   }
 
   void registerHandler() {}
@@ -141,9 +164,11 @@ class _MineViewPageState extends State<HomePage> {
                       height: 40,
                       alignment: Alignment.center,
                       decoration: BoxDecoration(
-                          color: Color(0xff74b900),
+                          color:
+                              alarmCount > 0 ? Colors.red : Color(0xff74b900),
                           borderRadius: BorderRadius.circular(10)),
-                      child: Text("当前设备运行正常",
+                      child: Text(
+                          alarmCount > 0 ? '今日告警数量:$alarmCount' : "当前设备运行正常",
                           style: TextStyle(
                               color: Color(0xffffffff), fontSize: 15))),
                   SizedBox(

+ 1 - 1
lib/page/login/login_page.dart

@@ -37,7 +37,7 @@ class _LoginPageState extends State<LoginPage> {
   //TextEditingController可以使用 text 属性指定初始值
   final TextEditingController _usernameController = TextEditingController();
   final TextEditingController _passwordController = TextEditingController();
-  String _username = '17659896868', _password = '123456';
+  String _username = '13182861111', _password = '123456';
 
   @override
   Widget build(BuildContext context) {

+ 94 - 98
lib/widget/MyDrawer.dart

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
 class MyDrawer extends StatefulWidget {
   final _CallBack callback;
 
-  const MyDrawer({super.key,required this.callback});
+  const MyDrawer({super.key, required this.callback});
 
   @override
   State createState() {
@@ -14,15 +14,19 @@ class MyDrawer extends StatefulWidget {
   }
 }
 
-DropMenuItem boy = DropMenuItem('男', 1);
-DropMenuItem girl = DropMenuItem('女', 2);
-DropMenuItem sexSelect = DropMenuItem('男', 1);
-List<DropMenuItem> sexMenuItems = [boy, girl];
+DropMenuItem on = DropMenuItem('在线', 0);
+DropMenuItem off = DropMenuItem('离线', 1);
+DropMenuItem not = DropMenuItem('未激活', 2);
+List<DropMenuItem> sexMenuItems = [on, off, not];
 
-typedef _CallBack = void Function(int selectIndex, String selectStr);
+DropMenuItem enable = DropMenuItem('启用', 1);
+DropMenuItem disable = DropMenuItem('禁用', 0);
+List<DropMenuItem> sexMenuItems2 = [enable, disable];
+String? key,key2;
 
-class _myDrawer extends State<MyDrawer> {
+typedef _CallBack = void Function(String device, String name,dynamic stase,dynamic isEnabled);
 
+class _myDrawer extends State<MyDrawer> {
   @override
   Widget build(BuildContext context) {
     return Drawer(
@@ -34,7 +38,7 @@ class _myDrawer extends State<MyDrawer> {
           crossAxisAlignment: CrossAxisAlignment.start,
           children: <Widget>[
             Padding(
-              padding: const EdgeInsets.only(top: 50.0, left: 10, right: 10),
+              padding: const EdgeInsets.only(top: 65.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
                   flex: 2,
@@ -56,7 +60,9 @@ class _myDrawer extends State<MyDrawer> {
                       ),
                       style: TextStyle(fontSize: 14),
                       onChanged: (value) {
-                        _device = value;
+                        setState(() {
+                          _device = value;
+                        });
                       },
                     ),
                   ),
@@ -85,93 +91,13 @@ class _myDrawer extends State<MyDrawer> {
                       decoration: InputDecoration(border: OutlineInputBorder()),
                       style: TextStyle(fontSize: 14),
                       onChanged: (value) {
-                        _username = value;
-                      },
-                    ),
-                  ),
-                  flex: 7,
-                ),
-              ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
-              child: Row(children: [
-                Expanded(
-                  flex: 2,
-                  child: Text(
-                    'devicekey',
-                    style: TextStyle(
-                      color: Colors.black,
-                      fontSize: GSYConstant.minTextSize,
-                      fontWeight: FontWeight.bold,
-                    ),
-                  ),
-                ),
-                Expanded(
-                  child: Container(
-                    height: 40,
-                    child: TextField(
-                      decoration: InputDecoration(border: OutlineInputBorder()),
-                      style: TextStyle(fontSize: 14),
-                      onChanged: (value) {
-                        _deviceKey = value;
-                      },
-                    ),
-                  ),
-                  flex: 7,
-                ),
-              ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
-              child: Row(children: [
-                Expanded(
-                  flex: 2,
-                  child: Text(
-                    '产品名称',
-                    style: TextStyle(
-                      color: Colors.black,
-                      fontSize: GSYConstant.minTextSize,
-                      fontWeight: FontWeight.bold,
-                    ),
-                  ),
-                ),
-                Expanded(
-                  flex: 7,
-                  child: Container(
-                    height: 40,
-                    child: TextField(
-                      decoration: InputDecoration(border: OutlineInputBorder()),
-                      style: TextStyle(fontSize: 14),
-                      onChanged: (value) {
                         setState(() {
-                          _product = value;
+                          _username = value;
                         });
                       },
                     ),
                   ),
-                ),
-              ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
-              child: Row(children: [
-                Expanded(
-                  flex: 2,
-                  child: Text(
-                    '设备类型',
-                    style: TextStyle(
-                      color: Colors.black,
-                      fontSize: GSYConstant.minTextSize,
-                      fontWeight: FontWeight.bold,
-                    ),
-                  ),
-                ),
-                Expanded(
                   flex: 7,
-                  child: Container(
-                    child: dropDownButtonsColumn(sexMenuItems, '性别', sexSelect),
-                  ),
                 ),
               ]),
             ),
@@ -192,7 +118,8 @@ class _myDrawer extends State<MyDrawer> {
                 Expanded(
                   flex: 7,
                   child: Container(
-                    child: dropDownButtonsColumn(sexMenuItems, '性别', sexSelect),
+                    child:
+                        dropDownButtonsColumn(sexMenuItems, '请选择设备状态'),
                   ),
                 ),
               ]),
@@ -214,7 +141,8 @@ class _myDrawer extends State<MyDrawer> {
                 Expanded(
                   flex: 7,
                   child: Container(
-                    child: dropDownButtonsColumn(sexMenuItems, '性别', sexSelect),
+                    child: dropDownButtons(
+                        sexMenuItems2, '请选择启用状态'),
                   ),
                 ),
               ]),
@@ -247,7 +175,7 @@ class _myDrawer extends State<MyDrawer> {
                 TextButton(
                   onPressed: () {
                     if (widget.callback != null) {
-                      widget.callback(0,"aaa");
+                      widget.callback(_device,_username,satus,isEnabled);
                     }
                   },
                   child: Text(ConstantString.query),
@@ -278,10 +206,12 @@ class _myDrawer extends State<MyDrawer> {
     );
   }
 
-  static const SEX = ['男', '女', '保密'];
-  String _device = '', _username = '', _deviceKey = '', _product = '';
+  String _device = '', _username = '';
 
-  Widget dropDownButtonsColumn(List<DropMenuItem> list, String hint, DropMenuItem select) {
+  dynamic satus = null, isEnabled =null;
+
+  Widget dropDownButtonsColumn(
+      List<DropMenuItem> list, String hint) {
     return Container(
       height: 40,
       //gives the height of the dropdown button
@@ -323,11 +253,77 @@ class _myDrawer extends State<MyDrawer> {
               ),
               // setting hint
               onChanged: (String? value) {
+                  key = value;
                 setState(() {
-                  sexSelect.label = value!; // saving the selected value
+                  list.forEach((element) {
+                    if(value==element.label){
+                      satus= element.value; // saving the selected value
+                    }
+                  });
+                });
+              },
+              value: key,
+              // value: sexMenuItems.label, // displaying the selected value
+            ),
+          )),
+    );
+  }
+
+
+  Widget dropDownButtons(
+      List<DropMenuItem> list, String hint) {
+    return Container(
+      height: 40,
+      //gives the height of the dropdown button
+      width: MediaQuery.of(context).size.width,
+      //gives the width of the dropdown button
+      decoration: BoxDecoration(
+        border: new Border.all(
+          color: Colors.grey, //边框颜色
+          width: 1.0, //边框粗细
+        ),
+        borderRadius:
+        const BorderRadius.all(const Radius.circular(4.0)), //边框的弧度
+      ),
+      // padding: const EdgeInsets.symmetric(horizontal: 13), //you can include padding to control the menu items
+      child: Theme(
+          data: Theme.of(context).copyWith(
+            // canvasColor: Colors.white, // background color for the dropdown items
+              buttonTheme: ButtonTheme.of(context).copyWith(
+                alignedDropdown:
+                true, //If false (the default), then the dropdown's menu will be wider than its button.
+              )),
+          child: DropdownButtonHideUnderline(
+            // to hide the default underline of the dropdown button
+            child: DropdownButton<String>(
+              iconEnabledColor: Color(0xFF595959),
+              // icon color of the dropdown button
+              items: list.map((dropMenuItem) {
+                return DropdownMenuItem<String>(
+                  value: dropMenuItem.label,
+                  child: Text(
+                    dropMenuItem.label,
+                    style: TextStyle(fontSize: 15),
+                  ),
+                );
+              }).toList(),
+              hint: Text(
+                hint,
+                style: TextStyle(fontSize: 15),
+              ),
+              // setting hint
+              onChanged: (String? value) {
+                  key2=value;
+                setState(() {
+                  list.forEach((element) {
+                    if(value==element.label){
+                      isEnabled= element.value; // saving the selected value
+                    }
+                  });
                 });
               },
-              value: sexSelect.label, // displaying the selected value
+              value: key2,
+              // value: sexMenuItems.label, // displaying the selected value
             ),
           )),
     );

+ 3 - 0
pubspec.yaml

@@ -60,6 +60,9 @@ dev_dependencies:
   dio: ^4.0.4
   synchronized: ^3.0.1 #用于同步处理数据存储
   pull_to_refresh: ^2.0.0
+  wechat_assets_picker: ^8.0.0
+  flutter_staggered_grid_view: ^0.4.1
+  event_bus: ^2.0.0
 # For information on the generic Dart part of this file, see the
 # following page: https://dart.dev/tools/pub/pubspec