瀏覽代碼

签到签出的字段与页面修改

liukai 4 月之前
父節點
當前提交
2dc113ab8f

+ 4 - 5
packages/cpt_job/lib/modules/sign_in_sign_out/sign_in_sign_out_controller.dart

@@ -17,7 +17,7 @@ import '../../widget/attendance_sign_in_out.dart';
 import 'sign_in_sign_out_state.dart';
 
 class SignInSignOutController extends GetxController with DioCancelableMixin {
-  final JobRepository jobRepository = Get.find();
+  final JobRepository _jobRepository = Get.find();
   final SignInSignOutState state = SignInSignOutState();
 
   var _needShowPlaceholder = true;
@@ -62,7 +62,7 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
     }
 
     //获取到数据
-    var result = await jobRepository.fetchAttendanceList(
+    var result = await _jobRepository.fetchAttendanceList(
       keyword,
       DateTimeUtils.formatDate(startDate.value, format: "yyyy-MM-dd"),
       DateTimeUtils.formatDate(endDate.value, format: "yyyy-MM-dd"),
@@ -71,7 +71,7 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
 
     //处理数据
     if (result.isSuccess) {
-      handleList(result.data?.list);
+      handleList(result.data?.rows);
       refreshController.finishRefresh(IndicatorResult.success);
     } else {
       errorMessage = result.errorMsg;
@@ -101,9 +101,8 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
   /// 签到签出
   void requestCheckInCheckOut(bool isCheckIn, AttendanceList item, ByteData byteData) async {
     //请求接口
-    final String? token = UserService.to.token;
 
-    var result = await jobRepository.submitCheckInOut(
+    var result = await _jobRepository.submitCheckInOut(
       item.appliedId.toString(),
       byteData,
       isCheckIn: isCheckIn,

+ 63 - 71
packages/cpt_job/lib/modules/sign_in_sign_out/sign_in_sign_out_page.dart

@@ -8,7 +8,6 @@ import 'package:plugin_basic/base/base_stateful_page.dart';
 import 'package:plugin_basic/base/base_state.dart';
 import 'package:plugin_basic/base/mixin_state_lifecycle.dart';
 import 'package:plugin_basic/utils/ext_get_nav.dart';
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:router/path/router_path.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -19,7 +18,6 @@ import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_appbar.dart';
 import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
-import 'package:widgets/my_text_field.dart';
 import 'package:widgets/my_text_view.dart';
 import 'package:widgets/widget_export.dart';
 import 'sign_in_sign_out_controller.dart';
@@ -90,79 +88,73 @@ class _SignInSignOutPageState extends BaseState<SignInSignOutPage, SignInSignOut
 
     return autoCtlGetBuilder(
       builder: (controller) {
-        return Scaffold(
-          extendBodyBehindAppBar: true,
-          appBar: MyAppBar.appSearchBar(
-            context,
-            value: controller.keyword,
-            hintText: 'Name/Mobile'.tr,
-            controller: state.searchController,
-            onSearch: (keyword) {
-              controller.doSearch(keyword);
-            },
-            actions: [
-              MyButton(
-                onPressed: () {
-                  controller.resetFiltering();
-                },
-                text: "Reset".tr,
-                textColor: ColorConstants.white,
-                backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
-                radius: 17.25,
-                minWidth: 60,
-                minHeight: 35,
-              ).marginOnly(right: 15)
-            ],
-          ),
-          body: SafeArea(
-            bottom: true,
-            top: false,
-            child: Container(
-              width: double.infinity,
-              height: double.infinity,
-              padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
-              decoration: const BoxDecoration(
-                gradient: LinearGradient(
-                  colors: [
-                    Color(0xFF091D44),
-                    Color(0xFF245A8A),
-                    Color(0xFF7F7CEC),
+        return SafeArea(
+          bottom: true,
+          top: false,
+          child: Container(
+            width: double.infinity,
+            height: double.infinity,
+            padding: EdgeInsets.only(top: ScreenUtil.getStatusBarH(context)),
+            decoration: const BoxDecoration(
+              gradient: LinearGradient(
+                colors: [
+                  Color(0xFF091D44),
+                  Color(0xFF245A8A),
+                  Color(0xFF7F7CEC),
+                ],
+                begin: Alignment.topCenter,
+                end: Alignment.bottomCenter,
+              ),
+            ),
+            child: Column(
+              children: [
+                //顶部的搜索标题布局
+                MyAppBar.searchTitleBar(
+                  context,
+                  value: controller.keyword,
+                  hintText: 'Name/Mobile'.tr,
+                  controller: state.searchController,
+                  onSearch: (keyword) {
+                    controller.doSearch(keyword);
+                  },
+                  actions: [
+                    MyButton(
+                      onPressed: () {
+                        controller.resetFiltering();
+                      },
+                      text: "Reset".tr,
+                      textColor: ColorConstants.white,
+                      backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
+                      radius: 17.25,
+                      minWidth: 60,
+                      minHeight: 35,
+                    ).marginOnly(right: 15)
                   ],
-                  begin: Alignment.topCenter,
-                  end: Alignment.bottomCenter,
                 ),
-              ),
-              child: Column(
-                children: [
-                  //顶部的搜索标题布局
-                  // _buildSearchTitleBar(),
-
-                  // Container(color: Color(0XFF415B7C), height: 0.5, margin: EdgeInsets.only(top: 12)),
 
-                  _buildFilterDateWidget(),
+                _buildFilterDateWidget(),
 
-                  EasyRefresh(
-                    controller: controller.refreshController,
-                    onRefresh: controller.onRefresh,
-                    child: LoadStateLayout(
-                      state: controller.loadingState,
-                      errorMessage: controller.errorMessage,
-                      errorRetry: () {
-                        controller.retryRequest();
-                      },
-                      successSliverWidget: [
-                        SliverList(
-                            delegate: SliverChildBuilderDelegate(
-                          (context, index) {
-                            return _buildAttendanceItem(controller, index, () {});
-                          },
-                          childCount: controller.datas.length,
-                        ))
-                      ],
-                    ),
-                  ).expanded(),
-                ],
-              ),
+                EasyRefresh(
+                  controller: controller.refreshController,
+                  onRefresh: controller.onRefresh,
+                  child: LoadStateLayout(
+                    state: controller.loadingState,
+                    errorMessage: controller.errorMessage,
+                    errorRetry: () {
+                      controller.retryRequest();
+                    },
+                    successSliverWidget: [
+                      SliverList(
+                          delegate: SliverChildBuilderDelegate(
+                        (context, index) {
+                          return _buildAttendanceItem(controller, index, () {});
+                        },
+                        childCount: controller.datas.length,
+                      ))
+                    ],
+                  ),
+                ).expanded(),
+              ],
             ),
           ),
         );

+ 2 - 5
packages/cs_domain/lib/entity/response/attendance_entity.dart

@@ -5,11 +5,8 @@ export 'package:domain/generated/json/attendance_entity.g.dart';
 
 @JsonSerializable()
 class AttendanceEntity {
-	int? count = 0;
-	int? curPage = 0;
-	int? pageSize = 0;
-	int? countPage = 0;
-	List<AttendanceList>? list = [];
+	int total = 0;
+	List<AttendanceList>? rows = [];
 
 	AttendanceEntity();
 

+ 12 - 33
packages/cs_domain/lib/generated/json/attendance_entity.g.dart

@@ -3,54 +3,33 @@ import 'package:domain/entity/response/attendance_entity.dart';
 
 AttendanceEntity $AttendanceEntityFromJson(Map<String, dynamic> json) {
   final AttendanceEntity attendanceEntity = AttendanceEntity();
-  final int? count = jsonConvert.convert<int>(json['count']);
-  if (count != null) {
-    attendanceEntity.count = count;
+  final int? total = jsonConvert.convert<int>(json['total']);
+  if (total != null) {
+    attendanceEntity.total = total;
   }
-  final int? curPage = jsonConvert.convert<int>(json['curPage']);
-  if (curPage != null) {
-    attendanceEntity.curPage = curPage;
-  }
-  final int? pageSize = jsonConvert.convert<int>(json['pageSize']);
-  if (pageSize != null) {
-    attendanceEntity.pageSize = pageSize;
-  }
-  final int? countPage = jsonConvert.convert<int>(json['countPage']);
-  if (countPage != null) {
-    attendanceEntity.countPage = countPage;
-  }
-  final List<AttendanceList>? list = (json['list'] as List<dynamic>?)?.map(
+  final List<AttendanceList>? rows = (json['rows'] as List<dynamic>?)?.map(
           (e) => jsonConvert.convert<AttendanceList>(e) as AttendanceList).toList();
-  if (list != null) {
-    attendanceEntity.list = list;
+  if (rows != null) {
+    attendanceEntity.rows = rows;
   }
   return attendanceEntity;
 }
 
 Map<String, dynamic> $AttendanceEntityToJson(AttendanceEntity entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
-  data['count'] = entity.count;
-  data['curPage'] = entity.curPage;
-  data['pageSize'] = entity.pageSize;
-  data['countPage'] = entity.countPage;
-  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  data['total'] = entity.total;
+  data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
   return data;
 }
 
 extension AttendanceEntityExtension on AttendanceEntity {
   AttendanceEntity copyWith({
-    int? count,
-    int? curPage,
-    int? pageSize,
-    int? countPage,
-    List<AttendanceList>? list,
+    int? total,
+    List<AttendanceList>? rows,
   }) {
     return AttendanceEntity()
-      ..count = count ?? this.count
-      ..curPage = curPage ?? this.curPage
-      ..pageSize = pageSize ?? this.pageSize
-      ..countPage = countPage ?? this.countPage
-      ..list = list ?? this.list;
+      ..total = total ?? this.total
+      ..rows = rows ?? this.rows;
   }
 }