yangyang hace 2 años
padre
commit
8ed82bdbbe

+ 18 - 2
lib/PhotoTool.dart

@@ -17,14 +17,15 @@ class PhotoTool extends StatefulWidget {
   // const PhotoTool({required this.imageCount,required this.lineCount
   //   ,required this.addCall,required this.removeCall});
 
-  const PhotoTool({required this.imageCount,required this.lineCount
+  const PhotoTool({super.key, required this.imageCount,required this.lineCount
     ,required this.addCall,required this.removeCall,required this.focusNode});
   @override
   _PhotoToolState createState() => _PhotoToolState();
 }
 
 class _PhotoToolState extends State<PhotoTool> {
-  List<AssetEntity> _imageFiles = [];
+  static List<AssetEntity> _imageFiles = [];
+  // var _event;
   @override
   Widget build(BuildContext context) {
     return Container(
@@ -174,6 +175,21 @@ class _PhotoToolState extends State<PhotoTool> {
       }
     });
   }
+//   @override
+//   void initState() {
+//     super.initState();
+//     _event = eventBus.on<RefreshPhoto>().listen((event) {
+//       setState(() {
+//         _imageFiles.addAll(event.imageFiles);
+//         _imageFiles.addAll(widget.imageFiles);
+//       });
+//     });
+//   }
+//   @override
+//   void dispose() {
+//     super.dispose();
+//     _event.cancel();
+//   }
 }
 
 typedef _AddCall = void Function(List<AssetEntity> mList);

+ 218 - 0
lib/common/dialog/ViewDialog.dart

@@ -0,0 +1,218 @@
+//图片查看
+import 'package:flutter/material.dart';
+//import 'dart:async';
+
+/*
+ * imgs 格式[{url:'',file:File}]
+ * img 当前点击进入的图片
+ * width 屏幕宽度
+ */
+
+class ViewDialog extends StatefulWidget {
+  ViewDialog({super.key, this.img, this.imgs, this.width});
+  final img;
+  final imgs;
+  final width;
+
+  @override
+  _PageStatus createState() => _PageStatus();
+}
+
+class _PageStatus extends State<ViewDialog> {
+  var image;
+  var w;
+  var index = 1;
+  var _scrollController;
+  var down = 0.0; //触开始的时候的left
+  var half = false; //是否超过一半
+
+  last() {
+    if(1 == index) {
+
+    }else {
+      setState(() {
+        image = widget.imgs[index - 2];
+        index = index - 1;
+      });
+    }
+  }
+
+  next() {
+    if(widget.imgs.length == index) {
+
+    }else {
+      setState(() {
+        image = widget.imgs[index];
+        index = index + 1;
+      });
+    }
+  }
+
+  delete() {
+    Navigator.pop(context);
+  }
+
+  @override
+  void initState() {
+    //页面初始化
+    super.initState();
+    var n = 0;
+    var nn;
+    widget.imgs.forEach((i) {
+      n = n + 1;
+      if(i == widget.img) {
+        nn = n;
+      }
+    });
+    print(nn);
+    if(nn > 1) {
+      print(widget.width);
+      _scrollController = ScrollController(
+          initialScrollOffset: widget.width * (nn - 1)
+      );
+    }else {
+      _scrollController = ScrollController(
+        initialScrollOffset: 0,
+      );
+    }
+    setState(() {
+      image = widget.img;
+      index = nn;
+    });
+  }
+
+  nextPage(w) {
+    setState(() {
+      index = index + 1;
+      _scrollController.animateTo(
+        (index -1) * w,
+        duration: Duration(milliseconds: 200),
+        curve: Curves.easeIn,
+      );
+    });
+  }
+
+  lastPage(w) {
+    setState(() {
+      index = index - 1;
+      _scrollController.animateTo(
+        (index - 1) * w,
+        duration: Duration(milliseconds: 200),
+        curve: Curves.easeIn,
+      );
+    });
+  }
+
+  moveEnd(e,w,l) {
+    var end = e.primaryVelocity;
+    if(end > 10 && index > 1) {
+      lastPage(w);
+    }else if(end < -10 && index < l){
+      nextPage(w);
+    }else if(half == true){
+      if(down > w/2 && index < l) {
+        //右边开始滑动超过一半,则下一张
+        nextPage(w);
+      }else if(down < w/2 && index > 1){
+        lastPage(w);
+      }else {
+        _scrollController.animateTo(
+          (index -1) * w,
+          duration: Duration(milliseconds: 200),
+          curve: Curves.easeIn,
+        );
+      }
+    }else {
+      _scrollController.animateTo(
+        (index -1) * w,
+        duration: Duration(milliseconds: 200),
+        curve: Curves.easeIn,
+      );
+    }
+  }
+
+  imgMove(e,w,l) {
+    //down 为起点
+    var left = e.position.dx;
+    var now = (index -1 ) * w;
+    var move = left - down;//移动距离
+    if(left - down > w/2 || down - left > w/2) {
+      half = true;
+    }else {
+      half = false;
+    }
+    _scrollController.jumpTo(now - move);
+  }
+
+  Widget list(w,l) {
+    List<Widget> array = [];
+    widget.imgs.forEach((i) {
+      array.add(
+        Listener(
+          onPointerMove: (e) {
+            imgMove(e,w,l);
+          },
+          onPointerDown: (e) {
+            down = e.position.dx;
+          },
+          child: GestureDetector(
+            onTap: (){
+              Navigator.pop(context);
+            },
+            onHorizontalDragEnd: (e) {moveEnd(e,w,l);},
+            child: Container(
+              width: w,
+              child:  Image.network(i),
+            ),
+          ),
+        ),
+      );
+    });
+    return ListView(
+      controller: _scrollController,
+      scrollDirection: Axis.horizontal,
+      children: array,
+    );
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    w = MediaQuery.of(context).size.width;
+    var l = widget.imgs.length;
+    return Container(
+      color: Colors.black,
+      child: Stack(
+        children: <Widget>[
+          list(w,l),
+          Positioned(
+            top: 20,
+            child: Container(
+                alignment: Alignment.center,
+                width: w,
+                child: Text('$index/$l',style: TextStyle(
+                  decoration: TextDecoration.none,
+                  color: Colors.white,fontSize: 16,
+                  fontWeight: FontWeight.w400,
+                  shadows: [
+                    Shadow(color: Colors.black, offset: Offset(1, 1)),
+                  ],
+                ))
+            ),
+          ),
+          Positioned(
+            top: 20,
+            right: 20,
+            child: Container(
+              alignment: Alignment.centerLeft,
+              width: 20,
+              child: GestureDetector(
+                onTap: () {delete();},
+                child: Icon(Icons.delete,color: Colors.white),
+              ),
+            ),
+          ),
+        ],
+      ),
+    );
+  }
+}

+ 15 - 0
lib/common/event/RefreshPhoto.dart

@@ -0,0 +1,15 @@
+import 'package:wechat_assets_picker/wechat_assets_picker.dart';
+
+class RefreshPhoto{
+
+  late List<AssetEntity> _imageFiles;
+
+
+  RefreshPhoto(this._imageFiles);
+
+  List<AssetEntity> get imageFiles => _imageFiles;
+
+  set imageFiles(List<AssetEntity> value) {
+    _imageFiles = value;
+  }
+}

+ 2 - 2
lib/common/utils/DioUtil.dart

@@ -113,7 +113,7 @@ class DioUtil {
           onSendProgress: onSendProgress,
           onReceiveProgress: onReceiveProgress);
       EasyLoading.dismiss();
-      if(response.data['code']==403){
+      if(response.data['code']==401){
         // 跳转登录页面并清空栈
         globalNavigatorKey.currentState
             ?.pushNamedAndRemoveUntil(LoginPage.routeName, (route) => false);
@@ -123,7 +123,7 @@ class DioUtil {
     } on DioError catch (e) {
       EasyLoading.dismiss();
       // showToast(e.message);
-      if(e.response?.data['code']==403){
+      if(e.response?.data['code']==401){
         // 跳转登录页面并清空栈
         globalNavigatorKey.currentState
             ?.pushNamedAndRemoveUntil(LoginPage.routeName, (route) => false);

+ 10 - 0
lib/generated/json/base/json_convert_content.dart

@@ -100,6 +100,8 @@ class JsonConvert<T> {
 				return userResponseDataFromJson(data as UserResponseData, json) as T;
 			case UserResponseDataUserMenuList:
 				return userResponseDataUserMenuListFromJson(data as UserResponseDataUserMenuList, json) as T;
+			case UserAppResponseDataUserMenuList:
+				return userAppResponseDataUserMenuListFromJson(data as UserAppResponseDataUserMenuList, json) as T;
 			case UserResponseDataRoleList:
 				return userResponseDataRoleListFromJson(data as UserResponseDataRoleList, json) as T;
 			case MaintItemsListResponseEntity:
@@ -211,6 +213,8 @@ class JsonConvert<T> {
 				return userResponseDataToJson(data as UserResponseData);
 			case UserResponseDataUserMenuList:
 				return userResponseDataUserMenuListToJson(data as UserResponseDataUserMenuList);
+			case UserAppResponseDataUserMenuList:
+				return userAppResponseDataUserMenuListToJson(data as UserAppResponseDataUserMenuList);
 			case UserResponseDataRoleList:
 				return userResponseDataRoleListToJson(data as UserResponseDataRoleList);
 			case MaintItemsListResponseEntity:
@@ -360,6 +364,9 @@ class JsonConvert<T> {
 		if(type == (UserResponseDataUserMenuList).toString()){
 			return UserResponseDataUserMenuList().fromJson(json);
 		}
+		if(type == (UserAppResponseDataUserMenuList).toString()){
+			return UserAppResponseDataUserMenuList().fromJson(json);
+		}
 		if(type == (UserResponseDataRoleList).toString()){
 			return UserResponseDataRoleList().fromJson(json);
 		}
@@ -528,6 +535,9 @@ class JsonConvert<T> {
 		if(<UserResponseDataUserMenuList>[] is M){
 			return data.map<UserResponseDataUserMenuList>((e) => UserResponseDataUserMenuList().fromJson(e)).toList() as M;
 		}
+		if(<UserAppResponseDataUserMenuList>[] is M){
+			return data.map<UserAppResponseDataUserMenuList>((e) => UserAppResponseDataUserMenuList().fromJson(e)).toList() as M;
+		}
 		if(<UserResponseDataRoleList>[] is M){
 			return data.map<UserResponseDataRoleList>((e) => UserResponseDataRoleList().fromJson(e)).toList() as M;
 		}

+ 103 - 0
lib/generated/json/user_response_entity_helper.dart

@@ -69,6 +69,9 @@ userResponseDataFromJson(UserResponseData data, Map<String, dynamic> json) {
 	if (json['userMenuList'] != null) {
 		data.userMenuList = (json['userMenuList'] as List).map((v) => UserResponseDataUserMenuList().fromJson(v)).toList();
 	}
+	if (json['menu4AppList'] != null) {
+		data.menu4AppList = (json['menu4AppList'] as List).map((v) => UserAppResponseDataUserMenuList().fromJson(v)).toList();
+	}
 	if (json['roleIdList'] != null) {
 		data.roleIdList = json['roleIdList'];
 	}
@@ -91,6 +94,7 @@ Map<String, dynamic> userResponseDataToJson(UserResponseData entity) {
 	data['orgName'] = entity.orgName;
 	data['orgId'] = entity.orgId;
 	data['userMenuList'] =  entity.userMenuList.map((v) => v.toJson()).toList();
+	data['menu4AppList'] =  entity.menu4AppList.map((v) => v.toJson()).toList();
 	data['roleIdList'] = entity.roleIdList;
 	data['roleList'] =  entity.roleList.map((v) => v.toJson()).toList();
 	return data;
@@ -170,6 +174,80 @@ userResponseDataUserMenuListFromJson(UserResponseDataUserMenuList data, Map<Stri
 	return data;
 }
 
+userAppResponseDataUserMenuListFromJson(UserAppResponseDataUserMenuList data, Map<String, dynamic> json) {
+	if (json['id'] != null) {
+		data.id = json['id'] is String
+				? int.tryParse(json['id'])
+				: json['id'].toInt();
+	}
+	if (json['pid'] != null) {
+		data.pid = json['pid'] is String
+				? int.tryParse(json['pid'])
+				: json['pid'].toInt();
+	}
+	if (json['subCount'] != null) {
+		data.subCount = json['subCount'] is String
+				? int.tryParse(json['subCount'])
+				: json['subCount'].toInt();
+	}
+	if (json['type'] != null) {
+		data.type = json['type'] is String
+				? int.tryParse(json['type'])
+				: json['type'].toInt();
+	}
+	if (json['title'] != null) {
+		data.title = json['title'].toString();
+	}
+	if (json['name'] != null) {
+		data.name = json['name'].toString();
+	}
+	if (json['component'] != null) {
+		data.component = json['component'].toString();
+	}
+	if (json['sort'] != null) {
+		data.sort = json['sort'] is String
+				? int.tryParse(json['sort'])
+				: json['sort'].toInt();
+	}
+	if (json['icon'] != null) {
+		data.icon = json['icon'].toString();
+	}
+	if (json['iconActive'] != null) {
+		data.iconActive = json['iconActive'].toString();
+	}
+	if (json['path'] != null) {
+		data.path = json['path'].toString();
+	}
+	if (json['isEl'] != null) {
+		data.isEl = json['isEl'];
+	}
+	if (json['isCache'] != null) {
+		data.isCache = json['isCache'];
+	}
+	if (json['isHidden'] != null) {
+		data.isHidden = json['isHidden'];
+	}
+	if (json['isDelete'] != null) {
+		data.isDelete = json['isDelete'];
+	}
+	if (json['permission'] != null) {
+		data.permission = json['permission'].toString();
+	}
+	if (json['creator'] != null) {
+		data.creator = json['creator'].toString();
+	}
+	if (json['createTime'] != null) {
+		data.createTime = json['createTime'].toString();
+	}
+	if (json['subMenu'] != null) {
+		data.subMenu = json['subMenu'];
+	}
+	if (json['pname'] != null) {
+		data.pname = json['pname'];
+	}
+	return data;
+}
+
 Map<String, dynamic> userResponseDataUserMenuListToJson(UserResponseDataUserMenuList entity) {
 	final Map<String, dynamic> data = new Map<String, dynamic>();
 	data['id'] = entity.id;
@@ -195,6 +273,31 @@ Map<String, dynamic> userResponseDataUserMenuListToJson(UserResponseDataUserMenu
 	return data;
 }
 
+Map<String, dynamic> userAppResponseDataUserMenuListToJson(UserAppResponseDataUserMenuList entity) {
+	final Map<String, dynamic> data = new Map<String, dynamic>();
+	data['id'] = entity.id;
+	data['pid'] = entity.pid;
+	data['subCount'] = entity.subCount;
+	data['type'] = entity.type;
+	data['title'] = entity.title;
+	data['name'] = entity.name;
+	data['component'] = entity.component;
+	data['sort'] = entity.sort;
+	data['icon'] = entity.icon;
+	data['iconActive'] = entity.iconActive;
+	data['path'] = entity.path;
+	data['isEl'] = entity.isEl;
+	data['isCache'] = entity.isCache;
+	data['isHidden'] = entity.isHidden;
+	data['isDelete'] = entity.isDelete;
+	data['permission'] = entity.permission;
+	data['creator'] = entity.creator;
+	data['createTime'] = entity.createTime;
+	data['subMenu'] = entity.subMenu;
+	data['pname'] = entity.pname;
+	return data;
+}
+
 userResponseDataRoleListFromJson(UserResponseDataRoleList data, Map<String, dynamic> json) {
 	if (json['id'] != null) {
 		data.id = json['id'] is String

+ 0 - 3
lib/main.dart

@@ -1,5 +1,4 @@
 import 'package:deus_app/page/device/device_manage_page.dart';
-import 'package:deus_app/page/home/home_page.dart';
 import 'package:deus_app/page/login/login_page.dart';
 import 'package:deus_app/page/maint/maint_job_page.dart';
 import 'package:deus_app/page/patrol/patrol_job_edit.dart';
@@ -47,8 +46,6 @@ class MyApp extends StatelessWidget {
         // 对应路由/NavigatorPushNamedPage
         LoginPage.routeName: (BuildContext context) =>
             LoginPage(),
-        HomePage.routeName: (BuildContext context) =>
-            HomePage(),
         PatrolJobPage.routeName: (BuildContext context) =>
             PatrolJobPage(),
         DeviceManagePage.routeName: (BuildContext context) =>

+ 24 - 0
lib/model/user_response_entity.dart

@@ -18,6 +18,7 @@ class UserResponseData with JsonConvert<UserResponseData> {
 	late String orgName;
 	late int orgId;
 	late List<UserResponseDataUserMenuList> userMenuList;
+	late List<UserAppResponseDataUserMenuList> menu4AppList;
 	late dynamic roleIdList;
 	late List<UserResponseDataRoleList> roleList;
 }
@@ -45,6 +46,29 @@ class UserResponseDataUserMenuList with JsonConvert<UserResponseDataUserMenuList
 	late dynamic pname;
 }
 
+class UserAppResponseDataUserMenuList with JsonConvert<UserAppResponseDataUserMenuList> {
+	late int id;
+	late int pid;
+	late int subCount;
+	late int type;
+	late String title;
+	late String name;
+	late String component;
+	late int sort;
+	late String icon;
+	late String iconActive;
+	late String path;
+	late bool isEl;
+	late bool isCache;
+	late bool isHidden;
+	late bool isDelete;
+	late String permission;
+	late String creator;
+	late String createTime;
+	late dynamic subMenu;
+	late dynamic pname;
+}
+
 class UserResponseDataRoleList with JsonConvert<UserResponseDataRoleList> {
 	late int id;
 	late String name;

+ 230 - 188
lib/page/device/device_manage_page.dart

@@ -48,201 +48,240 @@ class _DeviceManage extends State<DeviceManagePage> {
       }),
       backgroundColor: const Color(0xfff2f2f2),
       endDrawer: MyDrawer(
-        callback:(String device, String name,dynamic stase,dynamic isEnabled){
-          _device=device;
-          _username=name;
-          _satus=stase;
-          _isEnabled=isEnabled;
+        callback:
+            (String device, String name, dynamic stase, dynamic isEnabled) {
+          _device = device;
+          _username = name;
+          _satus = stase;
+          _isEnabled = isEnabled;
           equipmentList();
         },
       ),
       //抽屉
-      body: Column(
-        children: [
-          SizedBox(
-            height: 10,
-          ),
-          Row(
-            mainAxisAlignment: MainAxisAlignment.start,
-            children: [
-              SizedBox(
-                width: 15,
-              ),
-              Text(ConstantString.deviceNum,
-                  style: GSYConstant.smallActionLightText),
-              Text(deviceNum, style: GSYConstant.normalTextBigWhiteBold),
-            ],
-          ),
-          Expanded(
-              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: equipmentVOS.length,
-              itemBuilder: (context, index) {
-                return Container(
-                    margin: EdgeInsets.only(top: 12, left: 10, right: 10),
-                    padding: EdgeInsets.only(top: 12, bottom: 10),
-                    color: Colors.white,
-                    child: ListTile(
-                      title: Column(
-                        children: [
-                          Row(
-                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+      body: equipmentVOS.isNotEmpty
+          ? Column(
+              children: [
+                SizedBox(
+                  height: 10,
+                ),
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: [
+                    SizedBox(
+                      width: 15,
+                    ),
+                    Text(ConstantString.deviceNum,
+                        style: GSYConstant.smallActionLightText),
+                    Text(deviceNum, style: GSYConstant.normalTextBigWhiteBold),
+                  ],
+                ),
+                Expanded(
+                    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: equipmentVOS.length,
+                    itemBuilder: (context, index) {
+                      return Container(
+                          margin: EdgeInsets.only(top: 12, left: 10, right: 10),
+                          padding: EdgeInsets.only(top: 12, bottom: 10),
+                          color: Colors.white,
+                          child: ListTile(
+                            title: Column(
                               children: [
-                                Container(
-                                  child: Text(
-                                    equipmentVOS[index].showName,
-                                    style: const TextStyle(
-                                      color: Colors.black,
-                                      fontSize: GSYConstant.middleTextWhiteSize,
-                                      fontWeight: FontWeight.bold,
-                                    ),
-                                  ),
+                                Row(
+                                    mainAxisAlignment:
+                                        MainAxisAlignment.spaceBetween,
+                                    children: [
+                                      Container(
+                                        child: Text(
+                                          equipmentVOS[index].showName,
+                                          style: const TextStyle(
+                                            color: Colors.black,
+                                            fontSize:
+                                                GSYConstant.middleTextWhiteSize,
+                                            fontWeight: FontWeight.bold,
+                                          ),
+                                        ),
+                                      ),
+                                      Container(
+                                        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: 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: 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(
+                                              const Radius.circular(
+                                                  3.0)), //边框的弧度
+                                        ),
+                                      )
+                                    ]),
+                                // 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,
                                 ),
-                                Container(
-                                  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: 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: 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(
-                                        const Radius.circular(3.0)), //边框的弧度
-                                  ),
-                                )
-                              ]),
-                          // 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: () {
-                        equipmentInfo(equipmentVOS[index].id);
-                      },
-                    ));
-              },
-            ),
-          ))
-        ],
-      ),
+                              ],
+                            ),
+                            onTap: () {
+                              equipmentInfo(equipmentVOS[index].id);
+                            },
+                          ));
+                    },
+                  ),
+                ))
+              ],
+            )
+          : Container(
+              alignment: Alignment.center,
+              child: const Text(
+                '暂无数据',
+                textAlign: TextAlign.center,
+                style: TextStyle(
+                  color: GSYColors.primaryLightValue,
+                  fontSize: GSYConstant.middleTextWhiteSize,
+                ),
+              )),
     );
   }
 
   equipmentList() async {
     // LoadingDialogHelper.showLoading(context);
-    var result = await DioUtil().request("equipment/equipmentList",
-        method: DioMethod.post, data: {'index': 1, 'size': 50,'query':{'status':_satus,'name':_device,'isEnable':_isEnabled,'showName':_username}});
-    EquipmentListEntity entity =
-        equipmentListEntityFromJson(EquipmentListEntity(), result,);
+    var result = await DioUtil()
+        .request("equipment/equipmentList", method: DioMethod.post, data: {
+      'index': 1,
+      'size': 50,
+      'query': {
+        'status': _satus,
+        'name': _device,
+        'isEnable': _isEnabled,
+        'showName': _username
+      }
+    });
+    EquipmentListEntity entity = equipmentListEntityFromJson(
+      EquipmentListEntity(),
+      result,
+    );
     // LoadingDialogHelper.dismissLoading(context);
     if (entity.code == 0) {
       setState(() {
-        deviceNum=entity.data.total.toString();
+        deviceNum = entity.data.total.toString();
         equipmentVOS.clear();
         equipmentVOS.addAll(entity.data.equipmentVOS);
       });
@@ -251,15 +290,18 @@ class _DeviceManage extends State<DeviceManagePage> {
     }
   }
 
-  equipmentInfo(int id) async{
-    var result = await DioUtil().request("equipment/equipmentInfo",method: DioMethod.get,params: {'id':id});
-    EquipmentInfoEntity entity=equipmentInfoEntityFromJson(EquipmentInfoEntity(), result);
+  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)));
+        Navigator.push(
+            context,
+            MaterialPageRoute(
+                builder: (context) =>
+                    DeviceManageDetailPage(data: entity.data)));
       });
     } else {
       showToast(entity.msg);

+ 32 - 33
lib/page/home/home_page.dart

@@ -4,18 +4,16 @@ 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:deus_app/page/repair/repair_page.dart';
+import 'package:deus_app/model/user_response_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
-import '../device/device_manage_page.dart';
-import '../maint/maint_job_page.dart';
-
 class HomePage extends StatefulWidget {
   static var routeName = '/HomePage';
 
-  const HomePage({Key? key}) : super(key: key);
+  List<UserAppResponseDataUserMenuList> userResponseEntity;
+
+   HomePage({super.key,required this.userResponseEntity});
 
   @override
   _MineViewPageState createState() => _MineViewPageState();
@@ -26,28 +24,28 @@ class _MineViewPageState extends State<HomePage> {
     {"name": "今日维保任务", "num": 0},
     {"name": "今日巡检任务", "num": 0}
   ];
-  List icons = [
-    {
-      "name": "设备管理",
-      "image": "images/device_manage.png",
-      'jump': DeviceManagePage.routeName
-    },
-    {
-      "name": "维保任务",
-      "image": "images/maintenance.png",
-      'jump': MaintJobPage.routeName
-    },
-    {
-      "name": "巡检任务",
-      "image": "images/patrol_inspect.png",
-      'jump': PatrolJobPage.routeName
-    },
-    {
-      "name": "报修管理",
-      "image": "images/maintenance_manage.png",
-      'jump': RepairPage.routeName
-    },
-  ];
+  // List icons = [
+  //   {
+  //     "name": "设备管理",
+  //     "image": "images/device_manage.png",
+  //     'jump': DeviceManagePage.routeName
+  //   },
+  //   {
+  //     "name": "维保任务",
+  //     "image": "images/maintenance.png",
+  //     'jump': MaintJobPage.routeName
+  //   },
+  //   {
+  //     "name": "巡检任务",
+  //     "image": "images/patrol_inspect.png",
+  //     'jump': PatrolJobPage.routeName
+  //   },
+  //   {
+  //     "name": "报修管理",
+  //     "image": "images/maintenance_manage.png",
+  //     'jump': RepairPage.routeName
+  //   },
+  // ];
 
   int alarmCount = 0;
 
@@ -250,10 +248,10 @@ class _MineViewPageState extends State<HomePage> {
                                   120,
                         ),
                         itemBuilder: (context, index) {
-                          Map item = icons[index];
+                          UserAppResponseDataUserMenuList item = widget.userResponseEntity[index];
                           return GestureDetector(
                             onTap: () =>
-                                Navigator.pushNamed(context, item['jump']),
+                                Navigator.pushNamed(context, item.path),
                             child: Container(
                               padding: EdgeInsets.all(5),
                               decoration: BoxDecoration(
@@ -264,12 +262,12 @@ class _MineViewPageState extends State<HomePage> {
                                 mainAxisAlignment: MainAxisAlignment.center,
                                 children: [
                                   Image.asset(
-                                    item["image"],
+                                    item.icon,
                                     width: 60,
                                     height: 60,
                                   ),
                                   SizedBox(height: 10),
-                                  Text(item["name"].toString(),
+                                  Text(item.title.toString(),
                                       style: TextStyle(
                                           color: Color(0xff000000),
                                           fontSize: 13))
@@ -278,7 +276,7 @@ class _MineViewPageState extends State<HomePage> {
                             ),
                           );
                         },
-                        itemCount: icons.length,
+                        itemCount: widget.userResponseEntity.length,
                       )
                     ],
                   ),
@@ -291,6 +289,7 @@ class _MineViewPageState extends State<HomePage> {
             showToast('再按一次退出');
             return false;
           }
+          SystemNavigator.pop();
           return true;
         });
   }

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

@@ -275,7 +275,6 @@ class _LoginPageState extends State<LoginPage> {
   getInfo() async {
     var result =
         await DioUtil().request('user/current-user', method: DioMethod.post);
-    // LoadingDialogHelper.dismissLoading(context);
     UserResponseEntity entity =
         userResponseEntityFromJson(UserResponseEntity(), result);
     if (entity.code == 0) {
@@ -284,7 +283,7 @@ class _LoginPageState extends State<LoginPage> {
       StoreHelper.putStorage(ConstantString.phone, entity.data.phone);
       Navigator.pushAndRemoveUntil(
           context,
-          MaterialPageRoute(builder: (context) => HomePage()),
+          MaterialPageRoute(builder: (context) => HomePage(userResponseEntity: entity.data.menu4AppList)),
           (route) => false);
     } else {
       showToast(entity.msg);

+ 23 - 11
lib/page/maint/maint_job_detail.dart

@@ -1,4 +1,5 @@
 import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
+import 'package:deus_app/common/dialog/ViewDialog.dart';
 import 'package:deus_app/common/event/RefreshMaintDetail.dart';
 import 'package:deus_app/common/event/RefreshMaintPage.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
@@ -32,7 +33,7 @@ class MaintJobDetail extends StatefulWidget {
 MaintJobDetailData maintJobDetail = MaintJobDetailData();
 List<DeviceList> deviceList = <DeviceList>[];
 List<ItemsList> itemList = <ItemsList>[];
-List<FileUrls> fileUrls = <FileUrls>[];
+List<String> fileUrls = <String>[];
 
 class _MaintJobDetail extends State<MaintJobDetail> {
   var id;
@@ -58,7 +59,9 @@ class _MaintJobDetail extends State<MaintJobDetail> {
       }
       fileUrls.clear();
       if(null!=maintJobDetail.fileUrls){
-        fileUrls.addAll(maintJobDetail.fileUrls!);
+        for (var value in maintJobDetail.fileUrls!) {
+          fileUrls.add(value.url!);
+        }
       }
       if (maintJobDetail.status == 1 || maintJobDetail.status == 3|| maintJobDetail.status == 4) {
         type = true;
@@ -564,15 +567,24 @@ class _MaintJobDetail extends State<MaintJobDetail> {
         initiallyExpanded: false);
   }
 
-  Widget _buildImage(FileUrls imageData) {
-    return Container(
-        margin: EdgeInsets.only(left: 12, bottom: 10),
-        width: MediaQuery.of(context).size.width / 4,
-        height: MediaQuery.of(context).size.width / 4,
-        child: Image.network(
-          imageData.url!,
-          fit: BoxFit.fill,
-        ));
+  Widget _buildImage(String imageData) {
+    return InkWell(
+      child: Container(
+          margin: EdgeInsets.only(left: 12, bottom: 10),
+          width: MediaQuery.of(context).size.width / 4,
+          height: MediaQuery.of(context).size.width / 4,
+          child: Image.network(
+            imageData,
+            fit: BoxFit.fill,
+          )),
+      onTap: () {
+        Navigator.push(
+            context,
+            MaterialPageRoute(
+                builder: (context) =>
+                    ViewDialog(img: imageData,imgs: fileUrls,width: MediaQuery.of(context).size.width,)));
+      },
+    );
   }
 
   closeJob(String msg) async {

+ 3 - 2
lib/page/maint/maint_job_edit.dart

@@ -142,7 +142,7 @@ class _MairintJobEdit extends State<MairintJobEdit> {
           height: 50,
           padding: EdgeInsets.only(left: 12),
           alignment: Alignment.centerLeft,
-          child: Text('巡检图片',
+          child: Text('维保图片',
               style: TextStyle(
                 color: Colors.black,
                 fontSize: GSYConstant.TextSize15,
@@ -155,10 +155,11 @@ class _MairintJobEdit extends State<MairintJobEdit> {
               imageCount: 5,
               lineCount: 5,
               addCall: (List<AssetEntity> _imageFiles) {
+                imageFiles.clear();
                 imageFiles.addAll(_imageFiles);
               },
               removeCall: (int index) {
-                imageFiles.remove(index);
+                imageFiles.removeAt(index);
               },
               focusNode: focusNode),
         )

+ 49 - 38
lib/page/maint/maint_job_page.dart

@@ -116,7 +116,7 @@ class _MaintJobPage extends State<MaintJobPage> {
         ),
         //抽屉
         backgroundColor: const Color(0xfff2f2f2),
-        body: Column(
+        body: maint_job_list.isNotEmpty?Column(
           children: [
             const SizedBox(
               height: 10,
@@ -134,44 +134,55 @@ class _MaintJobPage extends State<MaintJobPage> {
             Expanded(
                 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:Expanded(
-              //     child: Container(
-              child: ListView.builder(
-                itemCount: maint_job_list.length,
-                itemBuilder: (context, index) {
-                  MaintJobVO maintJobVO = maint_job_list[index];
-                  return _maint_job_list(maintJobVO);
-                },
-              ),
-            )))
+                      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:Expanded(
+                      //     child: Container(
+                      child: ListView.builder(
+                        itemCount: maint_job_list.length,
+                        itemBuilder: (context, index) {
+                          MaintJobVO maintJobVO = maint_job_list[index];
+                          return _maint_job_list(maintJobVO);
+                        },
+                      ),
+                    )))
           ],
-        ));
+        ):Container(
+            alignment: Alignment.center,
+            child: const Text(
+              '暂无数据',
+              textAlign: TextAlign.center,
+              style: TextStyle(
+                color: GSYColors.primaryLightValue,
+                fontSize: GSYConstant.middleTextWhiteSize,
+              ),
+            ),
+        )
+    );
   }
 
   Widget _maint_job_list(MaintJobVO maintJobVO) {

+ 43 - 32
lib/page/patrol/patrol_job_detail.dart

@@ -1,3 +1,4 @@
+import 'package:deus_app/common/dialog/ViewDialog.dart';
 import 'package:deus_app/common/event/RefreshPatrol.dart';
 import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
@@ -17,7 +18,6 @@ import '../../model/patrol_job_detail_response_entity.dart';
  * 巡检任务详情页面
  */
 class PatrolJobDetail extends StatefulWidget {
-
   var id;
 
   PatrolJobDetail({super.key, @required this.id});
@@ -32,7 +32,6 @@ class PatrolJobDetail extends StatefulWidget {
 }
 
 class _PatrolJobDetail extends State<PatrolJobDetail> {
-
   var _event;
   var id;
 
@@ -62,7 +61,7 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
         fileUrls.addAll(responseData.fileUrls);
         if (responseData.status == 1 || responseData.status == 4) {
           type = true;
-        }else{
+        } else {
           type = false;
         }
       });
@@ -99,13 +98,12 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
   Widget build(BuildContext context) {
     return Scaffold(
         resizeToAvoidBottomInset: false,
-        appBar: TitleBar()
-            .backAppbar("巡检任务详情"),
+        appBar: TitleBar().backAppbar("巡检任务详情"),
         backgroundColor: const Color(0xfff2f2f2),
         body: Stack(
           children: [
             Container(
-              margin: EdgeInsets.only(bottom: type?60:0),
+              margin: EdgeInsets.only(bottom: type ? 60 : 0),
               child: ListView(
                 children: _Ws(),
               ),
@@ -152,8 +150,8 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
                               Navigator.push(
                                   context,
                                   MaterialPageRoute(
-                                      builder: (context) =>
-                                          PatrolJobList(responseData: responseData)));
+                                      builder: (context) => PatrolJobList(
+                                          responseData: responseData)));
                             }
                           },
                           style: ButtonStyle(
@@ -222,23 +220,26 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
                                       ? '已逾期'
                                       : '未知',
                   style: TextStyle(
-                      fontSize: GSYConstant.minTextSize, color:patrolJobDetailData.status == 0 || patrolJobDetailData.status == 4
-                      ? Colors.red
-                      : patrolJobDetailData.status == 1
-                      ? Colors.orange
-                      : patrolJobDetailData.status == 2
-                      ? Colors.blue
-                      : Colors.black),
+                      fontSize: GSYConstant.minTextSize,
+                      color: patrolJobDetailData.status == 0 ||
+                              patrolJobDetailData.status == 4
+                          ? Colors.red
+                          : patrolJobDetailData.status == 1
+                              ? Colors.orange
+                              : patrolJobDetailData.status == 2
+                                  ? Colors.blue
+                                  : Colors.black),
                 ),
                 decoration: BoxDecoration(
                   border: new Border.all(
-                    color:patrolJobDetailData.status == 0 || patrolJobDetailData.status == 4
-                  ? Colors.red
-                      : patrolJobDetailData.status == 1
-                  ? Colors.orange
-                      : patrolJobDetailData.status == 2
-                    ? Colors.blue
-                    : Colors.black, //边框颜色
+                    color: patrolJobDetailData.status == 0 ||
+                            patrolJobDetailData.status == 4
+                        ? Colors.red
+                        : patrolJobDetailData.status == 1
+                            ? Colors.orange
+                            : patrolJobDetailData.status == 2
+                                ? Colors.blue
+                                : Colors.black, //边框颜色
                     width: 1.0, //边框粗细
                   ),
                   borderRadius: const BorderRadius.all(
@@ -591,7 +592,9 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
           Container(
             width: double.infinity,
             margin: EdgeInsets.only(bottom: 5),
-            padding: fileUrls.isNotEmpty?EdgeInsets.only(right: 12, top: 10):EdgeInsets.only(right: 0, top: 0),
+            padding: fileUrls.isNotEmpty
+                ? EdgeInsets.only(right: 12, top: 10)
+                : EdgeInsets.only(right: 0, top: 0),
             color: Colors.white,
             child: Wrap(children: fileUrls.map((e) => _buildImage(e)).toList()),
             alignment: Alignment.centerLeft,
@@ -600,16 +603,24 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
         initiallyExpanded: false);
   }
 
-
   Widget _buildImage(String imageData) {
-    return Container(
-        margin: EdgeInsets.only(left: 12, bottom: 10),
-        width: MediaQuery.of(context).size.width / 4,
-        height: MediaQuery.of(context).size.width / 4,
-        child: Image.network(
-          imageData!,
-          fit: BoxFit.fill,
-        ));
+    return InkWell(
+      child: Container(
+          margin: EdgeInsets.only(left: 12, bottom: 10),
+          width: MediaQuery.of(context).size.width / 4,
+          height: MediaQuery.of(context).size.width / 4,
+          child: Image.network(
+            imageData!,
+            fit: BoxFit.fill,
+          )),
+      onTap: () {
+        Navigator.push(
+            context,
+            MaterialPageRoute(
+                builder: (context) =>
+                    ViewDialog(img: imageData,imgs: fileUrls,width: MediaQuery.of(context).size.width,)));
+      },
+    );
   }
 
   @override

+ 3 - 2
lib/page/patrol/patrol_job_edit.dart

@@ -153,11 +153,12 @@ class _PatrolJobEdit extends State<PatrolJobEdit> with WidgetsBindingObserver {
               imageCount: 5,
               lineCount: 5,
               addCall: (List<AssetEntity> _imageFiles) {
+                imageFiles.clear();
                 imageFiles.addAll(_imageFiles);
               },
               removeCall: (int index) {
-                imageFiles.remove(index);
-              },focusNode:focusNode),
+                imageFiles.removeAt(index);
+              },focusNode:focusNode,),
         )
       ],
     ));

+ 48 - 37
lib/page/patrol/patrol_job_page.dart

@@ -91,7 +91,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
         }),
         //抽屉
         backgroundColor: const Color(0xfff2f2f2),
-        body: Column(
+        body: patrol_job_list.isNotEmpty?Column(
           children: [
             SizedBox(
               height: 10,
@@ -109,42 +109,53 @@ class _PatrolJobPage extends State<PatrolJobPage> {
             Expanded(
                 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: patrol_job_list.length,
-              itemBuilder: (context, index) {
-                PatrolJobData patrolJobData = patrol_job_list[index];
-                return _patrol_job_list(patrolJobData);
-              },
-                    ),
-            )))
+                      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: patrol_job_list.length,
+                        itemBuilder: (context, index) {
+                          PatrolJobData patrolJobData = patrol_job_list[index];
+                          return _patrol_job_list(patrolJobData);
+                        },
+                      ),
+                    )))
           ],
-        ));
+        ):Container(
+          alignment: Alignment.center,
+          child: const Text(
+            '暂无数据',
+            textAlign: TextAlign.center,
+            style: TextStyle(
+              color: GSYColors.primaryLightValue,
+              fontSize: GSYConstant.middleTextWhiteSize,
+            ),
+          ),
+        )
+    );
   }
 
   Widget _patrol_job_list(PatrolJobData patrolJobData) {
@@ -304,7 +315,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
     // if failed,use refreshFailed()
     if (mounted) {
       setState(() {
-        index = 0;
+        index = 1;
         _load();
       });
     }

+ 2 - 2
lib/page/repair/repair_add_page.dart

@@ -147,16 +147,16 @@ class _RepairAddPage extends State<RepairAddPage> {
             ),
           ),
           Container(
-            // padding: EdgeInsets.only(left: 12,right: 12),
             decoration: BoxDecoration(color: Colors.white),
             child: PhotoTool(
                 imageCount: 5,
                 lineCount: 5,
                 addCall: (List<AssetEntity> _imageFiles) {
+                  imageFiles.clear();
                   imageFiles.addAll(_imageFiles);
                 },
                 removeCall: (int index) {
-                  imageFiles.remove(index);
+                  imageFiles.removeAt(index);
                 },
                 focusNode: focusNode),
           )

+ 21 - 11
lib/page/repair/repair_detail.dart

@@ -1,4 +1,5 @@
 import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
+import 'package:deus_app/common/dialog/ViewDialog.dart';
 import 'package:deus_app/common/event/RefreshRepairDetail.dart';
 import 'package:deus_app/common/event/RefreshRepairPage.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
@@ -207,7 +208,7 @@ class _RepairDetail extends State<RepairDetail> {
         padding: repairResUrls.isNotEmpty?EdgeInsets.only(right: 12, top: 10):EdgeInsets.only(right: 0, top: 0),
         color: Colors.white,
         child: Wrap(
-            children: repairResUrls.map((e) => _buildImage(e)).toList()),
+            children: repairResUrls.map((e) => _buildImage(e,1)).toList()),
         alignment: Alignment.centerLeft,
       )
     ]);
@@ -296,7 +297,7 @@ class _RepairDetail extends State<RepairDetail> {
               // padding: fileUrls.isNotEmpty?EdgeInsets.only(right: 12, top: 10):EdgeInsets.only(right: 0, top: 0),
               color: Colors.white,
               child: Wrap(
-                  children: repairImgUrls.map((e) => _buildImage(e)).toList()),
+                  children: repairImgUrls.map((e) => _buildImage(e,0)).toList()),
               alignment: Alignment.centerLeft,
             )
           ],
@@ -305,15 +306,24 @@ class _RepairDetail extends State<RepairDetail> {
     ]);
   }
 
-  Widget _buildImage(String imageData) {
-    return Container(
-        margin: EdgeInsets.only(left: 12, bottom: 10),
-        width: MediaQuery.of(context).size.width / 4,
-        height: MediaQuery.of(context).size.width / 4,
-        child: Image.network(
-          imageData,
-          fit: BoxFit.fill,
-        ));
+  Widget _buildImage(String imageData,int i) {
+    return InkWell(
+      child: Container(
+          margin: EdgeInsets.only(left: 12, bottom: 10),
+          width: MediaQuery.of(context).size.width / 4,
+          height: MediaQuery.of(context).size.width / 4,
+          child: Image.network(
+            imageData,
+            fit: BoxFit.fill,
+          )),
+      onTap: () {
+        Navigator.push(
+            context,
+            MaterialPageRoute(
+                builder: (context) =>
+                    ViewDialog(img: imageData,imgs: i==0?repairImgUrls:repairResUrls,width: MediaQuery.of(context).size.width,)));
+      },
+    );
   }
 
   Widget _patrolJobDetail(RepairDetailResponseData patrolJobDetailData) {

+ 2 - 2
lib/page/repair/repair_job_edit.dart

@@ -123,12 +123,12 @@ class _RepairJobEdit extends State<RepairJobEdit> {
               )),
             ),
             Container(
-              // padding: EdgeInsets.only(left: 12,right: 12),
               decoration: BoxDecoration(color: Colors.white),
               child: PhotoTool(imageCount: 5, lineCount: 5, addCall: (List<AssetEntity> _imageFiles){
+                imageFiles.clear();
                 imageFiles.addAll(_imageFiles);
               }, removeCall:(int index){
-                imageFiles.remove(index);
+                imageFiles.removeAt(index);
               },  focusNode: focusNode),
             )
           ],

+ 16 - 18
lib/page/repair/repair_page.dart

@@ -106,22 +106,9 @@ class _RepairPage extends State<RepairPage> {
         }),
         //抽屉
         backgroundColor: const Color(0xfff2f2f2),
-        body: Stack(
+        body: patrol_job_list.isNotEmpty?Stack(
           children: [
             Column(children: [
-              SizedBox(
-                height: 10,
-              ),
-              Row(
-                mainAxisAlignment: MainAxisAlignment.start,
-                children: [
-                  SizedBox(
-                    width: 15,
-                  ),
-                  Text(ConstantString.repairJobTitle,
-                      style: GSYConstant.smallActionLightText),
-                ],
-              ),
               Expanded(
                   child: Container(
                       margin: EdgeInsets.only(bottom: 50),
@@ -156,7 +143,7 @@ class _RepairPage extends State<RepairPage> {
                           itemCount: patrol_job_list.length,
                           itemBuilder: (context, index) {
                             RepairBillListResponseDataList patrolJobData =
-                                patrol_job_list[index];
+                            patrol_job_list[index];
                             return _patrol_job_list(patrolJobData);
                           },
                         ),
@@ -180,11 +167,11 @@ class _RepairPage extends State<RepairPage> {
                   },
                   style: ButtonStyle(
                     backgroundColor:
-                        MaterialStateProperty.all<Color>(Color(0xFF4875EC)),
+                    MaterialStateProperty.all<Color>(Color(0xFF4875EC)),
                     shape: MaterialStateProperty.all(BeveledRectangleBorder(
                         borderRadius: BorderRadius.circular(0))),
                     foregroundColor:
-                        MaterialStateProperty.all<Color>(Colors.white),
+                    MaterialStateProperty.all<Color>(Colors.white),
                     // padding: MaterialStateProperty.all(EdgeInsets.zero)
                   ),
                   child: const Text(ConstantString.newRepair),
@@ -192,7 +179,18 @@ class _RepairPage extends State<RepairPage> {
               ),
             )
           ],
-        ));
+        ): Container(
+          alignment: Alignment.center,
+          child: const Text(
+            '暂无数据',
+            textAlign: TextAlign.center,
+            style: TextStyle(
+              color: GSYColors.primaryLightValue,
+              fontSize: GSYConstant.middleTextWhiteSize,
+            ),
+          ),
+        )
+    );
   }
 
   Widget _patrol_job_list(RepairBillListResponseDataList patrolJobData) {