|
@@ -510,7 +510,7 @@ class LabourSGRepository extends GetxService {
|
|
|
}
|
|
|
|
|
|
/// 用工请求的首页数据
|
|
|
- Future<HttpResult<LabourRequestSGEntity>> fetchLabourRequestMain(
|
|
|
+ Future<HttpResult<LabourRequestSGCountList?>> fetchLabourRequestMain(
|
|
|
String? date, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
@@ -526,15 +526,33 @@ class LabourSGRepository extends GetxService {
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
|
- //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ // //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ // if (result.isSuccess) {
|
|
|
+ // //重新赋值data或list
|
|
|
+ // final json = result.getDataJson();
|
|
|
+ // var data = LabourRequestSGEntity.fromJson(json!);
|
|
|
+ // //重新赋值data或list
|
|
|
+ // return result.convert<LabourRequestSGEntity>(data: data);
|
|
|
+ // }
|
|
|
+ // return result.convert();
|
|
|
+
|
|
|
if (result.isSuccess) {
|
|
|
- //重新赋值data或list
|
|
|
- final json = result.getDataJson();
|
|
|
- var data = LabourRequestSGEntity.fromJson(json!);
|
|
|
- //重新赋值data或list
|
|
|
- return result.convert<LabourRequestSGEntity>(data: data);
|
|
|
+ var jsonList = result.getListJson();
|
|
|
+
|
|
|
+ var list = jsonList?.map((e) {
|
|
|
+ if (e is Map<String, dynamic>) {
|
|
|
+ return LabourRequestSGCountList.fromJson(e);
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }).toList();
|
|
|
+
|
|
|
+ return result.convert<LabourRequestSGCountList?>(list: list);
|
|
|
}
|
|
|
- return result.convert();
|
|
|
+
|
|
|
+ return result.convert<LabourRequestSGCountList>();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// 添加用工请求的选项数据
|