Browse Source

设备列表的模块

liukai 7 months ago
parent
commit
b584994305

+ 3 - 1
app/lib/main.dart

@@ -4,6 +4,7 @@ import 'package:cpt_job/router/job_service_impl.dart';
 import 'package:cpt_job/router/page_router.dart';
 import 'package:cpt_labour/router/labour_service_impl.dart';
 import 'package:cpt_labour/router/page_router.dart';
+import 'package:cpt_report/router/page_router.dart';
 import 'package:cpt_report/router/report_service_impl.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
@@ -116,7 +117,8 @@ class MyApp extends StatelessWidget {
           enableLog: true,
           //默认路由与路由表的加载
           initialRoute: RouterPath.SPLASH,
-          getPages: PageRouter.routes + BasicPageRouter.routes + AuthPageRouter.routes + JobPageRouter.routes + LabourPageRouter.routes,
+          getPages: PageRouter.routes + BasicPageRouter.routes + AuthPageRouter.routes + JobPageRouter.routes + LabourPageRouter.routes +
+              ReportPageRouter.routes,
           //对原生导航的兼容;SmartDialog路由配置生命周期处理
           navigatorObservers: [GetXRouterObserver(), FlutterSmartDialog.observer, routeObserver],
           //默认页面动画

+ 23 - 4
packages/cpt_auth/lib/modules/main/main_controller.dart

@@ -4,6 +4,7 @@ import 'package:domain/entity/response/hotel_info_entity.dart';
 import 'package:domain/repository/auth_repository.dart';
 import 'package:get/get.dart';
 import 'package:plugin_basic/constants/app_constant.dart';
+import 'package:plugin_basic/service/app_config_service.dart';
 import 'package:plugin_basic/service/user_service.dart';
 import 'package:plugin_platform/engine/sp/sp_util.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -118,16 +119,29 @@ class MainController extends GetxController {
   void gotoModulePage(HomeModule module) {
     switch (module.key) {
       case 'labReq':
-        ComponentRouterServices.labourService.startLabourRequestPage();
+        if (ConfigService.to.curSelectCountry.value == 1) {
+          ToastEngine.show("进入新加坡的用工请求模块");
+        } else {
+          //越南的用工请求
+          ComponentRouterServices.labourService.startLabourRequestPage();
+        }
         break;
       case 'jobList':
-        ComponentRouterServices.jobService.startJobListPage();
+        if (ConfigService.to.curSelectCountry.value == 1) {
+          ToastEngine.show("进入新加坡的工作列表模块");
+        } else {
+          //越南的工作列表
+          ComponentRouterServices.jobService.startJobListPage();
+        }
         break;
       case 'sign':
         ComponentRouterServices.jobService.startSignInSignOutPage();
         break;
-      case 'devices':
-        ToastEngine.show("进入 Devices 模块");
+      case 'reviseList':
+        ToastEngine.show("进入新加坡的 Revise List 模块");
+        break;
+      case 'device':
+        ComponentRouterServices.reportService.startDeviceListPage();
         break;
       case 'reqReview':
         ToastEngine.show("进入 Labour Request Review 模块");
@@ -136,8 +150,13 @@ class MainController extends GetxController {
         ToastEngine.show("进入 Attendance Review 模块");
         break;
       case 'template':
+        //越南的用工请求
         ToastEngine.show("进入 Default Job Title 模块");
         break;
+      case 'jobTitle':
+        //新加坡的用工请求
+        ToastEngine.show("进入新加坡的 Default Job Title 模块");
+        break;
       case 'report':
         ToastEngine.show("进入 Report 模块");
         break;

+ 120 - 0
packages/cpt_report/lib/modules/device_list/device_list_controller.dart

@@ -0,0 +1,120 @@
+import 'package:domain/entity/response/device_list_entity.dart';
+import 'package:domain/repository/other_repository.dart';
+import 'package:get/get.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
+
+import 'device_list_state.dart';
+
+class DeviceListController extends GetxController with DioCancelableMixin{
+  final OtherRepository _otherRepository = Get.find();
+  final DeviceListState state = DeviceListState();
+
+  var _curPage = 1;
+  var _needShowPlaceholder = true;
+
+  //页面PlaceHolder的展示
+  LoadState loadingState = LoadState.State_Success;
+  String? errorMessage;
+
+  //刷新页面状态
+  void changeLoadingState(LoadState state) {
+    loadingState = state;
+    update();
+  }
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true,
+    controlFinishLoad: true,
+  );
+
+  // Refresh 刷新事件
+  Future onRefresh() async {
+    _curPage = 1;
+    fetchDeviceList();
+  }
+
+  // Refresh 加载事件
+  Future loadMore() async {
+    _curPage++;
+    fetchDeviceList();
+  }
+
+  // 重试请求
+  Future retryRequest() async {
+    _curPage = 1;
+    _needShowPlaceholder = true;
+    fetchDeviceList();
+  }
+
+  /// 获取服务器数据,通知消息列表
+  Future fetchDeviceList() async {
+    if (_needShowPlaceholder) {
+      changeLoadingState(LoadState.State_Loading);
+    }
+
+    // 获取 Applied 列表
+    var listResult = await _otherRepository.fetchDeviceList(
+      curPage: _curPage,
+      cancelToken: cancelToken,
+    );
+
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.rows);
+    } else {
+      errorMessage = listResult.errorMsg;
+      changeLoadingState(LoadState.State_Error);
+    }
+
+    // 最后赋值
+    _needShowPlaceholder = false;
+  }
+
+  // 处理数据与展示的逻辑
+  void handleList(List<DeviceListRows>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_curPage == 1) {
+        //刷新的方式
+        state.datas.clear();
+        state.datas.addAll(list);
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success);
+      } else {
+        //加载更多
+        state.datas.addAll(list);
+        refreshController.finishLoad();
+        update();
+      }
+    } else {
+      if (_curPage == 1) {
+        //展示无数据的布局
+        state.datas.clear();
+        changeLoadingState(LoadState.State_Empty);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
+
+  @override
+  void onReady() {
+    super.onReady();
+    fetchDeviceList();
+
+  }
+
+  @override
+  void onClose() {
+    state.datas.clear();
+    super.onClose();
+  }
+
+}

+ 155 - 0
packages/cpt_report/lib/modules/device_list/device_list_item.dart

@@ -0,0 +1,155 @@
+import 'package:cs_resources/constants/color_constants.dart';
+import 'package:domain/entity/response/device_list_entity.dart';
+import 'package:domain/entity/response/job_list_entity.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:plugin_basic/basic_export.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_button.dart';
+import 'package:widgets/my_text_view.dart';
+
+/**
+ * 设备列表
+ */
+class DeviceListItem extends StatelessWidget {
+  final int index;
+  final DeviceListRows item;
+
+  DeviceListItem({
+    required this.index,
+    required this.item,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.symmetric(vertical: 24, horizontal: 21),
+      margin: EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
+      decoration: BoxDecoration(
+        color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
+        borderRadius: BorderRadius.circular(5), // 设置圆角
+      ),
+      child: Column(
+        mainAxisSize: MainAxisSize.max,
+        crossAxisAlignment: CrossAxisAlignment.start,
+        children: [
+          // 设备Mac
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "Device MAC:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+              //部门
+              MyTextView(
+                item.deviceMac ?? "-",
+                marginLeft: 5,
+                isFontMedium: true,
+                textColor: Colors.white,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ),
+
+          // 设备别名
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "Device Alias:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+              MyTextView(
+                item.deviceAlias ?? "-",
+                marginLeft: 5,
+                isFontRegular: true,
+                textColor: Colors.white,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ).marginOnly(top: 15),
+
+          // 位置
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "Location:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+
+              MyTextView(
+                item.siteTypeShow ?? "",
+                marginLeft: 5,
+                isFontRegular: true,
+                textColor: ColorConstants.white,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ).marginOnly(top: 15),
+
+          // 状态
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "Alive State:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+              //状态
+              MyTextView(
+                item.aliveState == 0 ? "Offline".tr : "Online".tr,
+                marginLeft: 5,
+                isFontRegular: true,
+                textColor:  item.aliveState == 0 ? ColorConstants.textRedFF6262 : ColorConstants.textGreen0AC074,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ).marginOnly(top: 15),
+
+          // 创建时间
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "Created At:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+              //发布状态
+              MyTextView(
+                item.createdAt ?? "-",
+                marginLeft: 5,
+                isFontRegular: true,
+                textColor: Colors.white,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ).marginOnly(top: 15),
+
+        ],
+      ),
+    );
+  }
+}

+ 98 - 0
packages/cpt_report/lib/modules/device_list/device_list_page.dart

@@ -0,0 +1,98 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
+
+import 'device_list_controller.dart';
+
+import 'package:plugin_basic/base/base_state.dart';
+import 'package:plugin_basic/base/base_stateful_page.dart';
+import 'package:plugin_basic/utils/ext_get_nav.dart';
+import 'package:router/path/router_path.dart';
+import 'package:shared/utils/screen_util.dart';
+import 'package:widgets/my_appbar.dart';
+
+import 'device_list_item.dart';
+import 'device_list_state.dart';
+
+class DeviceListPage extends BaseStatefulPage<DeviceListController> {
+  DeviceListPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance() {
+    return Get.start(RouterPath.DEVICE_LIST);
+  }
+
+  @override
+  DeviceListController createRawController() {
+    return DeviceListController();
+  }
+
+  @override
+  State<DeviceListPage> createState() => _DeviceListState();
+}
+
+class _DeviceListState extends BaseState<DeviceListPage, DeviceListController> {
+  late DeviceListState state;
+
+  @override
+  void initState() {
+    super.initState();
+    state = controller.state;
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return autoCtlGetBuilder(builder: (controller) {
+      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.titleBar(context, "Device List".tr),
+
+              //底部的列表
+              EasyRefresh(
+                controller: controller.refreshController,
+                onRefresh: controller.onRefresh,
+                onLoad: controller.loadMore,
+                child: LoadStateLayout(
+                  state: controller.loadingState,
+                  errorMessage: controller.errorMessage,
+                  errorRetry: () {
+                    controller.retryRequest();
+                  },
+                  successSliverWidget: [
+                    SliverList(
+                        delegate: SliverChildBuilderDelegate(
+                      (context, index) {
+                        return DeviceListItem(index: index, item: state.datas[index]);
+                      },
+                      childCount: state.datas.length,
+                    ))
+                  ],
+                ),
+              ).marginOnly(top: 5).expanded(),
+            ],
+          ),
+        ),
+      );
+    });
+  }
+}

+ 7 - 0
packages/cpt_report/lib/modules/device_list/device_list_state.dart

@@ -0,0 +1,7 @@
+import 'package:domain/entity/response/device_list_entity.dart';
+
+class DeviceListState {
+
+  List<DeviceListRows> datas = []; //列表数据
+
+}

+ 6 - 1
packages/cpt_report/lib/router/page_router.dart

@@ -1,5 +1,5 @@
 
-import 'package:flutter/material.dart';
+import 'package:cpt_report/modules/device_list/device_list_page.dart';
 import 'package:get/get.dart';
 import 'package:router/path/router_path.dart';
 
@@ -7,6 +7,11 @@ class ReportPageRouter {
 
   static final routes = [
 
+    //设备列表
+    GetPage(
+      name: RouterPath.DEVICE_LIST,
+      page: () => DeviceListPage(),
+    ),
 
   ];
 }

+ 12 - 2
packages/cpt_report/lib/router/report_service_impl.dart

@@ -1,3 +1,4 @@
+import 'package:cpt_report/modules/device_list/device_list_page.dart';
 import 'package:plugin_basic/basic_export.dart';
 import 'package:router/componentRouter/report_service.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -8,13 +9,22 @@ class ReportServiceImpl extends GetxService implements ReportService {
   void onInit() {
     super.onInit();
     //初始化资源
-    Log.d("ProfileServiceImpl 初始化资源");
   }
 
   @override
   void onClose() {
     super.onClose();
     //销毁资源
-    Log.d("ProfileServiceImpl 销毁资源");
+
+  }
+
+  @override
+  void startDeviceListPage() {
+    DeviceListPage.startInstance();
+  }
+
+  @override
+  void startReportMainPage() {
+
   }
 }

+ 6 - 0
packages/cs_domain/lib/constants/api_constants.dart

@@ -117,4 +117,10 @@ class ApiConstants {
 
   // 用户签到签出
   static const apiSignInOut = "/index.php/api/v1/hotel/sign/clock";
+
+// =========================== 报表与其他 ↓=========================================
+
+  // 设备列表
+  static const apiDeviceList = "/index.php/api/v1/hotel/device/table";
+
 }

+ 55 - 0
packages/cs_domain/lib/entity/response/device_list_entity.dart

@@ -0,0 +1,55 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/device_list_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/device_list_entity.g.dart';
+
+@JsonSerializable()
+class DeviceListEntity {
+	int total = 0;
+	List<DeviceListRows> rows = [];
+
+	DeviceListEntity();
+
+	factory DeviceListEntity.fromJson(Map<String, dynamic> json) => $DeviceListEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $DeviceListEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class DeviceListRows {
+	int id = 0;
+	@JSONField(name: "device_key")
+	String? deviceKey = null;
+	@JSONField(name: "device_mac")
+	String? deviceMac = null;
+	@JSONField(name: "device_alias")
+	String? deviceAlias;
+	@JSONField(name: "site_type")
+	int siteType = 0;
+	@JSONField(name: "origin_type")
+	int originType = 0;
+	@JSONField(name: "alive_state")
+	int aliveState = 0;
+	@JSONField(name: "last_online")
+	String? lastOnline = null;
+	@JSONField(name: "site_type_show")
+	String? siteTypeShow = null;
+	@JSONField(name: "created_at")
+	String? createdAt = null;
+
+	DeviceListRows();
+
+	factory DeviceListRows.fromJson(Map<String, dynamic> json) => $DeviceListRowsFromJson(json);
+
+	Map<String, dynamic> toJson() => $DeviceListRowsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 9 - 0
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -6,6 +6,7 @@
 import 'package:flutter/material.dart' show debugPrint;
 import 'package:domain/entity/response/attendance_entity.dart';
 import 'package:domain/entity/response/check_success_entity.dart';
+import 'package:domain/entity/response/device_list_entity.dart';
 import 'package:domain/entity/response/hotel_info_entity.dart';
 import 'package:domain/entity/response/id_name_entity.dart';
 import 'package:domain/entity/response/job_list_add_staff_entity.dart';
@@ -162,6 +163,12 @@ class JsonConvert {
     if (<CheckSuccessEntity>[] is M) {
       return data.map<CheckSuccessEntity>((Map<String, dynamic> e) => CheckSuccessEntity.fromJson(e)).toList() as M;
     }
+    if (<DeviceListEntity>[] is M) {
+      return data.map<DeviceListEntity>((Map<String, dynamic> e) => DeviceListEntity.fromJson(e)).toList() as M;
+    }
+    if (<DeviceListRows>[] is M) {
+      return data.map<DeviceListRows>((Map<String, dynamic> e) => DeviceListRows.fromJson(e)).toList() as M;
+    }
     if (<HotelInfoEntity>[] is M) {
       return data.map<HotelInfoEntity>((Map<String, dynamic> e) => HotelInfoEntity.fromJson(e)).toList() as M;
     }
@@ -326,6 +333,8 @@ class JsonConvertClassCollection {
     (AttendanceEntity).toString(): AttendanceEntity.fromJson,
     (AttendanceList).toString(): AttendanceList.fromJson,
     (CheckSuccessEntity).toString(): CheckSuccessEntity.fromJson,
+    (DeviceListEntity).toString(): DeviceListEntity.fromJson,
+    (DeviceListRows).toString(): DeviceListRows.fromJson,
     (HotelInfoEntity).toString(): HotelInfoEntity.fromJson,
     (HotelInfoMenus).toString(): HotelInfoMenus.fromJson,
     (HotelInfoMenusChildren).toString(): HotelInfoMenusChildren.fromJson,

+ 121 - 0
packages/cs_domain/lib/generated/json/device_list_entity.g.dart

@@ -0,0 +1,121 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/response/device_list_entity.dart';
+
+DeviceListEntity $DeviceListEntityFromJson(Map<String, dynamic> json) {
+  final DeviceListEntity deviceListEntity = DeviceListEntity();
+  final int? total = jsonConvert.convert<int>(json['total']);
+  if (total != null) {
+    deviceListEntity.total = total;
+  }
+  final List<DeviceListRows>? rows = (json['rows'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<DeviceListRows>(e) as DeviceListRows).toList();
+  if (rows != null) {
+    deviceListEntity.rows = rows;
+  }
+  return deviceListEntity;
+}
+
+Map<String, dynamic> $DeviceListEntityToJson(DeviceListEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['total'] = entity.total;
+  data['rows'] = entity.rows.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension DeviceListEntityExtension on DeviceListEntity {
+  DeviceListEntity copyWith({
+    int? total,
+    List<DeviceListRows>? rows,
+  }) {
+    return DeviceListEntity()
+      ..total = total ?? this.total
+      ..rows = rows ?? this.rows;
+  }
+}
+
+DeviceListRows $DeviceListRowsFromJson(Map<String, dynamic> json) {
+  final DeviceListRows deviceListRows = DeviceListRows();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    deviceListRows.id = id;
+  }
+  final String? deviceKey = jsonConvert.convert<String>(json['device_key']);
+  if (deviceKey != null) {
+    deviceListRows.deviceKey = deviceKey;
+  }
+  final String? deviceMac = jsonConvert.convert<String>(json['device_mac']);
+  if (deviceMac != null) {
+    deviceListRows.deviceMac = deviceMac;
+  }
+  final String? deviceAlias = jsonConvert.convert<String>(json['device_alias']);
+  if (deviceAlias != null) {
+    deviceListRows.deviceAlias = deviceAlias;
+  }
+  final int? siteType = jsonConvert.convert<int>(json['site_type']);
+  if (siteType != null) {
+    deviceListRows.siteType = siteType;
+  }
+  final int? originType = jsonConvert.convert<int>(json['origin_type']);
+  if (originType != null) {
+    deviceListRows.originType = originType;
+  }
+  final int? aliveState = jsonConvert.convert<int>(json['alive_state']);
+  if (aliveState != null) {
+    deviceListRows.aliveState = aliveState;
+  }
+  final String? lastOnline = jsonConvert.convert<String>(json['last_online']);
+  if (lastOnline != null) {
+    deviceListRows.lastOnline = lastOnline;
+  }
+  final String? siteTypeShow = jsonConvert.convert<String>(json['site_type_show']);
+  if (siteTypeShow != null) {
+    deviceListRows.siteTypeShow = siteTypeShow;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    deviceListRows.createdAt = createdAt;
+  }
+  return deviceListRows;
+}
+
+Map<String, dynamic> $DeviceListRowsToJson(DeviceListRows entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['device_key'] = entity.deviceKey;
+  data['device_mac'] = entity.deviceMac;
+  data['device_alias'] = entity.deviceAlias;
+  data['site_type'] = entity.siteType;
+  data['origin_type'] = entity.originType;
+  data['alive_state'] = entity.aliveState;
+  data['last_online'] = entity.lastOnline;
+  data['site_type_show'] = entity.siteTypeShow;
+  data['created_at'] = entity.createdAt;
+  return data;
+}
+
+extension DeviceListRowsExtension on DeviceListRows {
+  DeviceListRows copyWith({
+    int? id,
+    String? deviceKey,
+    String? deviceMac,
+    String? deviceAlias,
+    int? siteType,
+    int? originType,
+    int? aliveState,
+    String? lastOnline,
+    String? siteTypeShow,
+    String? createdAt,
+  }) {
+    return DeviceListRows()
+      ..id = id ?? this.id
+      ..deviceKey = deviceKey ?? this.deviceKey
+      ..deviceMac = deviceMac ?? this.deviceMac
+      ..deviceAlias = deviceAlias ?? this.deviceAlias
+      ..siteType = siteType ?? this.siteType
+      ..originType = originType ?? this.originType
+      ..aliveState = aliveState ?? this.aliveState
+      ..lastOnline = lastOnline ?? this.lastOnline
+      ..siteTypeShow = siteTypeShow ?? this.siteTypeShow
+      ..createdAt = createdAt ?? this.createdAt;
+  }
+}

+ 46 - 0
packages/cs_domain/lib/repository/other_repository.dart

@@ -0,0 +1,46 @@
+
+import 'package:domain/entity/response/device_list_entity.dart';
+import 'package:get/get.dart';
+import 'package:plugin_platform/dio_export.dart';
+import 'package:plugin_platform/http/http_provider.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:shared/utils/util.dart';
+
+import '../constants/api_constants.dart';
+
+
+/// 报表与其他的相关数据
+class OtherRepository extends GetxService {
+  HttpProvider httpProvider;
+
+  OtherRepository({required this.httpProvider});
+
+  // 雇主的设备列表
+  Future<HttpResult<DeviceListEntity>> fetchDeviceList({
+        required int curPage,
+        CancelToken? cancelToken,
+      }) async {
+    //参数
+    Map<String, String> params = {};
+    params["cur_page"] = curPage.toString();
+    params["page_size"] = "10";
+
+    final result = await httpProvider.requestNetResult(
+      ApiConstants.apiDeviceList,
+      params: params,
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = DeviceListEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<DeviceListEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 2 - 0
packages/cs_initializer/lib/global_services_injection.dart

@@ -2,6 +2,7 @@ import 'package:domain/constants/api_constants.dart';
 import 'package:domain/repository/auth_repository.dart';
 import 'package:domain/repository/job_repository.dart';
 import 'package:domain/repository/labour_repository.dart';
+import 'package:domain/repository/other_repository.dart';
 import 'package:plugin_basic/basic_export.dart';
 import 'package:plugin_basic/dio_interceptors/interceptor_auth_dio.dart';
 import 'package:plugin_basic/dio_interceptors/interceptor_status_code_dio.dart';
@@ -32,6 +33,7 @@ class GlobalServicesInjection {
     //其他的数据仓库注入
     Get.lazyPut(() => JobRepository(httpProvider: Get.find()));
     Get.lazyPut(() => LabourRepository(httpProvider: Get.find()));
+    Get.lazyPut(() => OtherRepository(httpProvider: Get.find()));
 
     // 用户信息服务(用户信息相关业务类)
     Get.put(UserService(Get.find()));

+ 7 - 0
packages/cs_resources/lib/local/language/en_US.dart

@@ -144,6 +144,13 @@ const Map<String, String> en_US = {
   'Next': 'Next',
   'Singapore': 'Singapore',
   'Revise List': 'Revise List',
+  'Device List': 'Device List',
+  'Device MAC:': 'Device MAC:',
+  'Device Alias:': 'Device Alias:',
+  'Location:': 'Location:',
+  'Alive State:': 'Alive State:',
+  'Offline': 'Offline',
+  'Online': 'Online',
 
   //插件的国际化
   'Pull to refresh': 'Pull to refresh',

+ 7 - 0
packages/cs_resources/lib/local/language/vi_VN.dart

@@ -144,6 +144,13 @@ const Map<String, String> vi_VN = {
   'Next': 'Tiếp theo',
   'Singapore': 'Singapore',
   'Revise List': 'Danh sách sửa đổi',
+  'Device List': 'Danh sách thiết bị',
+  'Device MAC:': 'Thiết bị Địa chỉ Mac:',
+  'Device Alias:': 'Bí danh thiết bị:',
+  'Location:': 'Địa điểm:',
+  'Alive State:': 'Tình trạng trực tuyến:',
+  'Offline': 'Ngoại tuyến',
+  'Online': 'Trực tuyến',
 
   //插件的国际化
   "Pull to refresh": "Kéo để làm mới",

+ 7 - 0
packages/cs_resources/lib/local/language/zh_CN.dart

@@ -144,6 +144,13 @@ const Map<String, String> zh_CN = {
   'Next': '下一步',
   'Singapore': '新加坡',
   'Revise List': '修改列表',
+  'Device List': '设备列表',
+  'Device MAC:': '设备Mac地址:',
+  'Device Alias:': '设备别名:',
+  'Location:': '位置:',
+  'Alive State:': '在线状态:',
+  'Offline': '离线',
+  'Online': '在线',
 
   //插件的国际化
   'Pull to refresh': '下拉刷新',

+ 4 - 0
packages/cs_router/lib/componentRouter/report_service.dart

@@ -3,4 +3,8 @@
  */
 abstract class ReportService {
 
+  void startDeviceListPage();
+
+  void startReportMainPage();
+
 }

+ 5 - 1
packages/cs_router/lib/path/router_path.dart

@@ -26,13 +26,17 @@ class RouterPath {
   static const JOB_APPLIED_STAFF_DETAIL = '/job/applied/staff/detail';  //工作中员工的详细信息
   static const JOB_APPLIED_STAFF_REVIEWS = '/job/applied/staff/reviews';  //工作中员工的被评价列表
 
-
   //用工请求
   static const JOB_LABOUR_REQUEST_LIST = '/labour/list'; //用工请求列表
   static const JOB_LABOUR_REQUEST_ADD = '/labour/add'; //用工请求添加
   static const JOB_LABOUR_REQUEST_Detail = '/labour/detail'; //用工请求详情
   static const JOB_LABOUR_REQUEST_WORKFLOW = '/labour/workflow'; //用工请求修改状态的工作流
 
+  //其他模块和报表模块
+  static const DEVICE_LIST = '/device/list'; //雇主绑定的设备列表
+
+
+
   //全局其他
   static const PREVIEW_IMAGE = '/preview/image'; //预览图片
   static const GLOBAL_WEB = '/global/web'; //全局公用的Web页面