Procházet zdrojové kódy

在线表单的几种状态的列表

liukai před 3 měsíci
rodič
revize
e285811fb4
38 změnil soubory, kde provedl 923 přidání a 469 odebrání
  1. 1 1
      packages/cpt_form/lib/modules/form/apply/form_apply_screen.dart
  2. 3 2
      packages/cpt_form/lib/modules/form/apply/form_apply_state.dart
  3. 28 61
      packages/cpt_form/lib/modules/form/apply/form_apply_view_model.dart
  4. 7 6
      packages/cpt_form/lib/modules/form/apply/item_form_apply.dart
  5. 1 1
      packages/cpt_form/lib/modules/form/approve/form_approve_screen.dart
  6. 3 2
      packages/cpt_form/lib/modules/form/approve/form_approve_state.dart
  7. 44 67
      packages/cpt_form/lib/modules/form/approve/form_approve_view_model.dart
  8. 12 8
      packages/cpt_form/lib/modules/form/approve/item_form_approve.dart
  9. 8 8
      packages/cpt_form/lib/modules/form/form_page.dart
  10. 1 1
      packages/cpt_form/lib/modules/form/not_approve/form_not_approve_screen.dart
  11. 3 2
      packages/cpt_form/lib/modules/form/not_approve/form_not_approve_state.dart
  12. 48 70
      packages/cpt_form/lib/modules/form/not_approve/form_not_approve_view_model.dart
  13. 13 6
      packages/cpt_form/lib/modules/form/not_approve/item_form_not_approve.dart
  14. 1 1
      packages/cpt_form/lib/modules/form/submit/form_submit_screen.dart
  15. 3 2
      packages/cpt_form/lib/modules/form/submit/form_submit_state.dart
  16. 48 70
      packages/cpt_form/lib/modules/form/submit/form_submit_view_model.dart
  17. 12 5
      packages/cpt_form/lib/modules/form/submit/item_form_submit.dart
  18. 14 0
      packages/cs_domain/lib/constants/api_constants.dart
  19. 26 0
      packages/cs_domain/lib/entity/form_list_entity.dart
  20. 75 0
      packages/cs_domain/lib/entity/form_submitted_entity.dart
  21. 27 0
      packages/cs_domain/lib/entity/form_submitted_page_entity.dart
  22. 56 66
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  23. 61 0
      packages/cs_domain/lib/generated/json/form_list_entity.g.dart
  24. 167 0
      packages/cs_domain/lib/generated/json/form_submitted_entity.g.dart
  25. 57 0
      packages/cs_domain/lib/generated/json/form_submitted_page_entity.g.dart
  26. 2 4
      packages/cs_domain/lib/generated/json/newsfeed_comment_publish_entity.g.dart
  27. 9 19
      packages/cs_domain/lib/generated/json/newsfeed_following_entity.g.dart
  28. 5 11
      packages/cs_domain/lib/generated/json/newsfeed_foryou_entity.g.dart
  29. 5 10
      packages/cs_domain/lib/generated/json/newsfeed_news_entity.g.dart
  30. 2 4
      packages/cs_domain/lib/generated/json/property_news_entity.g.dart
  31. 4 9
      packages/cs_domain/lib/generated/json/property_sale_rent_entity.g.dart
  32. 15 33
      packages/cs_domain/lib/generated/json/user_me_entity.g.dart
  33. 135 0
      packages/cs_domain/lib/repository/form_repository.dart
  34. 27 0
      packages/cs_domain/lib/repository/form_repository.g.dart
  35. binární
      packages/cs_resources/assets/form/apply_icon.webp
  36. binární
      packages/cs_resources/assets/form/approved_icon.webp
  37. binární
      packages/cs_resources/assets/form/not_approved_icon.webp
  38. binární
      packages/cs_resources/assets/form/submit_icon.webp

+ 1 - 1
packages/cpt_form/lib/modules/form/apply/form_apply_screen.dart

@@ -43,7 +43,7 @@ class FormApplyScreen extends HookConsumerWidget {
               (context, index) {
                 return FormApplyItem(index: index, item: state.datas[index]).onTap(() {
                   //进入申请的协议页面
-                  FormTermsPage.startInstance(formType: state.datas[index]);
+                  FormTermsPage.startInstance(formType: state.datas[index].typeId!);
                 });
               },
               childCount: state.datas.length,

+ 3 - 2
packages/cpt_form/lib/modules/form/apply/form_apply_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/form_list_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class FormApplyState {
@@ -6,7 +7,7 @@ class FormApplyState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<String> datas; //页面列表数据
+  List<FormListEntity> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -20,7 +21,7 @@ class FormApplyState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<String>? datas,
+    List<FormListEntity>? datas,
   }) {
     return FormApplyState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 28 - 61
packages/cpt_form/lib/modules/form/apply/form_apply_view_model.dart

@@ -1,3 +1,6 @@
+import 'package:domain/entity/form_list_entity.dart';
+import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -8,7 +11,8 @@ import 'form_apply_state.dart';
 part 'form_apply_view_model.g.dart';
 
 @riverpod
-class FormApplyViewModel extends _$FormApplyViewModel {
+class FormApplyViewModel extends _$FormApplyViewModel with DioCancelableMixin {
+  late final FormRepository _formRepository;
   var _needShowPlaceholder = true; //是否展示LoadingView
 
   // Refresh 控制器
@@ -19,7 +23,10 @@ class FormApplyViewModel extends _$FormApplyViewModel {
 
   @override
   FormApplyState build() {
-    return FormApplyState(datas: []);
+    _formRepository = ref.read(formRepositoryProvider);
+    final state = FormApplyState(datas: []);
+    registerCancellation();
+    return state;
   }
 
   //刷新页面状态
@@ -45,71 +52,31 @@ class FormApplyViewModel extends _$FormApplyViewModel {
     }
 
     // 获取 Applied 列表
-    // var listResult = await _jobRepository.fetchJobAppliedList(
-    //   state.jobId,
-    //   state.selectedStatusId,
-    //   state.keyword,
-    //   curPage: _curPage,
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // // 处理数据
-    // if (listResult.isSuccess) {
-    //   handleList(listResult.data?.rows);
-    // } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    // }
+    var result = await _formRepository.fetchFormApplyList(
+      cancelToken: cancelToken,
+    );
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-
-    final List<String> list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
-
-    if (list.isNotEmpty) {
-      //刷新的方式
-      state = state.copyWith(datas: list);
-      refreshController.finishRefresh();
-
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // 处理数据
+    if (result.isSuccess) {
+      handleList(result.list);
     } else {
-      //加载更多
-      state = state.copyWith(datas: []);
-      changeLoadingState(LoadState.State_Empty, null);
+      changeLoadingState(LoadState.State_Error, result.errorMsg);
     }
 
     // 最后赋值
     _needShowPlaceholder = false;
   }
 
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? 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);
-//     }
-//   }
-// }
+  // 处理数据与展示的逻辑
+  void handleList(List<FormListEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据
+      state = state.copyWith(datas: list, loadingState: LoadState.State_Success);
+    } else {
+      //展示无数据的布局
+      state = state.copyWith(datas: [], loadingState: LoadState.State_Empty, errorMessage: null);
+    }
+
+    refreshController.finishRefresh();
+  }
 }

+ 7 - 6
packages/cpt_form/lib/modules/form/apply/item_form_apply.dart

@@ -1,6 +1,7 @@
 import 'package:cpt_form/modules/form/form_types.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/form_list_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_load_image.dart';
@@ -9,7 +10,7 @@ import 'package:widgets/my_text_view.dart';
 ///  设施的Active的Item
 class FormApplyItem extends StatelessWidget {
   final int index;
-  final String item;
+  final FormListEntity item;
 
   const FormApplyItem({
     required this.index,
@@ -31,14 +32,14 @@ class FormApplyItem extends StatelessWidget {
         mainAxisSize: MainAxisSize.max,
         crossAxisAlignment: CrossAxisAlignment.center,
         children: [
-          MyLoadImage(
-            FormTypes.iconMap[item]?['icon_path'],
-              width: FormTypes.iconMap[item]?['width'],
-              height: FormTypes.iconMap[item]?['height'],
+          MyAssetImage(
+            FormTypes.iconMap[item.typeId]?['icon_path'],
+              width: FormTypes.iconMap[item.typeId]?['width'],
+              height: FormTypes.iconMap[item.typeId]?['height'],
           ),
 
           MyTextView(
-            FormTypes.iconMap[item]?['name'],
+            FormTypes.iconMap[item.typeId]?['name'],
             marginLeft: 17,
             fontSize: 15,
             textColor: context.appColors.textBlack,

+ 1 - 1
packages/cpt_form/lib/modules/form/approve/form_approve_screen.dart

@@ -47,7 +47,7 @@ class FormApproveScreen extends HookConsumerWidget {
               (context, index) {
                 return FormApproveItem(index: index, item: state.datas[index]).onTap((){
                   //去详情页面
-                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index]);
+                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index].estateOnlineForm?.type?.id ?? "");
                 });
               },
               childCount: state.datas.length,

+ 3 - 2
packages/cpt_form/lib/modules/form/approve/form_approve_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class FormApproveState {
@@ -6,7 +7,7 @@ class FormApproveState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<String> datas; //页面列表数据
+  List<FormSubmittedEntity> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -20,7 +21,7 @@ class FormApproveState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<String>? datas,
+    List<FormSubmittedEntity>? datas,
   }) {
     return FormApproveState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 44 - 67
packages/cpt_form/lib/modules/form/approve/form_approve_view_model.dart

@@ -1,3 +1,6 @@
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -8,7 +11,8 @@ import 'form_approve_state.dart';
 part 'form_approve_view_model.g.dart';
 
 @riverpod
-class FormApproveViewModel extends _$FormApproveViewModel {
+class FormApproveViewModel extends _$FormApproveViewModel with DioCancelableMixin{
+  late final FormRepository _formRepository;
   var _curPage = 1; //请求参数当前的页面
   var _needShowPlaceholder = true; //是否展示LoadingView
 
@@ -20,7 +24,9 @@ class FormApproveViewModel extends _$FormApproveViewModel {
 
   @override
   FormApproveState build() {
+    _formRepository = ref.read(formRepositoryProvider);
     final state = FormApproveState(datas: []);
+    registerCancellation();
     return state;
   }
 
@@ -48,78 +54,49 @@ class FormApproveViewModel extends _$FormApproveViewModel {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    // 获取 Applied 列表
-    // var listResult = await _jobRepository.fetchJobAppliedList(
-    //   state.jobId,
-    //   state.selectedStatusId,
-    //   state.keyword,
-    //   curPage: _curPage,
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // // 处理数据
-    // if (listResult.isSuccess) {
-    //   handleList(listResult.data?.rows);
-    // } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    // }
+    // 获取列表
+    var listResult = await _formRepository.fetchFormApproveList(
+      curPage: _curPage,
+      cancelToken: cancelToken,
+    );
 
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-
-    final List<String> list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
-
-    if (_curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(datas: list);
-      refreshController.finishRefresh();
-
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
     } else {
-      //加载更多
-      final allList = state.datas;
-      allList.addAll(list);
-      state.datas.addAll(list);
-
-      refreshController.finishLoad();
-
-      state = state.copyWith(datas: allList);
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
     }
 
     // 最后赋值
     _needShowPlaceholder = false;
   }
 
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? 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);
-//     }
-//   }
-// }
+  // 处理数据与展示的逻辑
+  void handleList(List<FormSubmittedEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_curPage == 1) {
+        //刷新的方式
+        state = state.copyWith(datas: list);
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        state.datas.addAll(List<FormSubmittedEntity>.from(state.datas)..addAll(list));
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_curPage == 1) {
+        //展示无数据的布局
+        state = state.copyWith(datas: []);
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
 }

+ 12 - 8
packages/cpt_form/lib/modules/form/approve/item_form_approve.dart

@@ -1,15 +1,17 @@
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
+import '../form_types.dart';
 
 class FormApproveItem extends StatelessWidget {
   final int index;
-  final String item;
+  final FormSubmittedEntity item;
 
   const FormApproveItem({
     required this.index,
@@ -32,12 +34,16 @@ class FormApproveItem extends StatelessWidget {
           Row(
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
-              const MyAssetImage(Assets.formAccessCard, width: 38.5, height: 31),
+              MyAssetImage(
+                FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['icon_path'],
+                width: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['width'],
+                height: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['height'],
+              ),
               Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   MyTextView(
-                    "Access Card -Owner",
+                    FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['name'],
                     fontSize: 16,
                     maxLines: 2,
                     textColor: context.appColors.textBlack,
@@ -46,7 +52,7 @@ class FormApproveItem extends StatelessWidget {
 
                   //预订人
                   MyTextView(
-                    S.current.booked_by_someone("Wu Bing Bing"),
+                    S.current.booked_by_someone(item.account?.name ?? ""),
                     fontSize: 14,
                     marginTop: 2,
                     textColor: context.appColors.textBlack,
@@ -69,21 +75,19 @@ class FormApproveItem extends StatelessWidget {
             ],
           ),
           MyTextView(
-            S.current.send_on_sometime("04 Feb 2024 at 04:00 PM"),
+            S.current.send_on_sometime(item.sentOn ?? ""),
             fontSize: 14,
             marginTop: 10,
             textColor: context.appColors.textBlack,
             isFontRegular: true,
           ),
-
           MyTextView(
-            S.current.approved_on_sometime("04 Feb 2024 at 04:00 PM"),
+            S.current.approved_on_sometime(item.approvedOn ?? ""),
             fontSize: 14,
             marginTop: 5,
             textColor: context.appColors.textBlack,
             isFontRegular: true,
           ),
-
         ],
       ),
     );

+ 8 - 8
packages/cpt_form/lib/modules/form/form_page.dart

@@ -58,8 +58,8 @@ class FormPage extends HookConsumerWidget {
                     _buildCategory(
                       context,
                       Assets.formApplyIcon,
-                      48.5,
-                      47,
+                      38,
+                      44,
                       S.current.apply,
                       tabsRouter.activeIndex == 0,
                     ).onTap(
@@ -70,8 +70,8 @@ class FormPage extends HookConsumerWidget {
                     _buildCategory(
                       context,
                       Assets.formSubmitIcon,
-                      44,
-                      47,
+                      38.5,
+                      39,
                       S.current.form_submit_title,
                       tabsRouter.activeIndex == 1,
                     ).onTap(
@@ -82,8 +82,8 @@ class FormPage extends HookConsumerWidget {
                     _buildCategory(
                       context,
                       Assets.formApprovedIcon,
-                      40,
-                      47,
+                      39,
+                      39,
                       S.current.approved,
                       tabsRouter.activeIndex == 2,
                     ).onTap(
@@ -94,8 +94,8 @@ class FormPage extends HookConsumerWidget {
                     _buildCategory(
                       context,
                       Assets.formNotApprovedIcon,
-                      42,
-                      46.5,
+                      38.5,
+                      39.5,
                       S.current.not_approved,
                       tabsRouter.activeIndex == 3,
                     ).onTap(

+ 1 - 1
packages/cpt_form/lib/modules/form/not_approve/form_not_approve_screen.dart

@@ -43,7 +43,7 @@ class FormNotApproveScreen extends HookConsumerWidget {
               (context, index) {
                 return FormNotApproveItem(index: index, item: state.datas[index]).onTap(() {
                   //去详情页面
-                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index]);
+                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index].estateOnlineForm?.type?.id ?? "");
                 });
               },
               childCount: state.datas.length,

+ 3 - 2
packages/cpt_form/lib/modules/form/not_approve/form_not_approve_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class FormNotApproveState {
@@ -6,7 +7,7 @@ class FormNotApproveState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<String> datas; //页面列表数据
+  List<FormSubmittedEntity> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -20,7 +21,7 @@ class FormNotApproveState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<String>? datas,
+    List<FormSubmittedEntity>? datas,
   }) {
     return FormNotApproveState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 48 - 70
packages/cpt_form/lib/modules/form/not_approve/form_not_approve_view_model.dart

@@ -1,3 +1,6 @@
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -8,19 +11,23 @@ import 'form_not_approve_state.dart';
 part 'form_not_approve_view_model.g.dart';
 
 @riverpod
-class FormNotApproveViewModel extends _$FormNotApproveViewModel {
+class FormNotApproveViewModel extends _$FormNotApproveViewModel with DioCancelableMixin {
+  late final FormRepository _formRepository;
   var _curPage = 1; //请求参数当前的页面
   var _needShowPlaceholder = true; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   @override
   FormNotApproveState build() {
-    return FormNotApproveState(datas: []);
+    _formRepository = ref.read(formRepositoryProvider);
+    final state = FormNotApproveState(datas: []);
+    registerCancellation();
+    return state;
   }
 
   //刷新页面状态
@@ -53,78 +60,49 @@ class FormNotApproveViewModel extends _$FormNotApproveViewModel {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    // 获取 Applied 列表
-    // var listResult = await _jobRepository.fetchJobAppliedList(
-    //   state.jobId,
-    //   state.selectedStatusId,
-    //   state.keyword,
-    //   curPage: _curPage,
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // // 处理数据
-    // if (listResult.isSuccess) {
-    //   handleList(listResult.data?.rows);
-    // } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    // }
+    // 获取列表
+    var listResult = await _formRepository.fetchFormRejectList(
+      curPage: _curPage,
+      cancelToken: cancelToken,
+    );
 
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-
-    final List<String> list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
-
-    if (_curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(datas: list);
-      refreshController.finishRefresh();
-
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
     } else {
-      //加载更多
-      final allList = state.datas;
-      allList.addAll(list);
-      state.datas.addAll(list);
-
-      refreshController.finishLoad();
-
-      state = state.copyWith(datas: allList);
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
     }
 
     // 最后赋值
     _needShowPlaceholder = false;
   }
 
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? 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);
-//     }
-//   }
-// }
+  // 处理数据与展示的逻辑
+  void handleList(List<FormSubmittedEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_curPage == 1) {
+        //刷新的方式
+        state = state.copyWith(datas: list);
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        state.datas.addAll(List<FormSubmittedEntity>.from(state.datas)..addAll(list));
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_curPage == 1) {
+        //展示无数据的布局
+        state = state.copyWith(datas: []);
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
 }

+ 13 - 6
packages/cpt_form/lib/modules/form/not_approve/item_form_not_approve.dart

@@ -1,15 +1,18 @@
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
+import '../form_types.dart';
+
 
 class FormNotApproveItem extends StatelessWidget {
   final int index;
-  final String item;
+  final FormSubmittedEntity item;
 
   const FormNotApproveItem({
     required this.index,
@@ -32,12 +35,16 @@ class FormNotApproveItem extends StatelessWidget {
           Row(
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
-              const MyAssetImage(Assets.formAccessCard, width: 38.5, height: 31),
+              MyAssetImage(
+                FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['icon_path'],
+                width: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['width'],
+                height: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['height'],
+              ),
               Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   MyTextView(
-                    "Access Card -Owner",
+                    FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['name'],
                     fontSize: 16,
                     maxLines: 2,
                     textColor: context.appColors.textBlack,
@@ -46,7 +53,7 @@ class FormNotApproveItem extends StatelessWidget {
 
                   //预订人
                   MyTextView(
-                    S.current.booked_by_someone("Wu Bing Bing"),
+                    S.current.booked_by_someone(item.account?.name ?? ""),
                     fontSize: 14,
                     marginTop: 2,
                     textColor: context.appColors.textBlack,
@@ -69,7 +76,7 @@ class FormNotApproveItem extends StatelessWidget {
             ],
           ),
           MyTextView(
-            S.current.send_on_sometime("04 Feb 2024 at 04:00 PM"),
+            S.current.send_on_sometime(item.sentOn ?? ""),
             fontSize: 14,
             marginTop: 10,
             textColor: context.appColors.textBlack,
@@ -77,7 +84,7 @@ class FormNotApproveItem extends StatelessWidget {
           ),
 
           MyTextView(
-            S.current.not_approved_on_sometime("04 Feb 2024 at 04:00 PM"),
+            S.current.not_approved_on_sometime(item.rejectedOn ?? ""),
             fontSize: 14,
             marginTop: 5,
             textColor: context.appColors.textBlack,

+ 1 - 1
packages/cpt_form/lib/modules/form/submit/form_submit_screen.dart

@@ -44,7 +44,7 @@ class FormSubmitScreen extends HookConsumerWidget {
               (context, index) {
                 return FormSubmitItem(index: index, item: state.datas[index]).onTap(() {
                   //去详情页面
-                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index]);
+                  FormDetailPage.startInstance(context: context, applyId: "123", type: state.datas[index].estateOnlineForm?.type?.id ?? "");
                 });
               },
               childCount: state.datas.length,

+ 3 - 2
packages/cpt_form/lib/modules/form/submit/form_submit_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class FormSubmitState {
@@ -6,7 +7,7 @@ class FormSubmitState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<String> datas; //页面列表数据
+  List<FormSubmittedEntity> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -20,7 +21,7 @@ class FormSubmitState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<String>? datas,
+    List<FormSubmittedEntity>? datas,
   }) {
     return FormSubmitState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 48 - 70
packages/cpt_form/lib/modules/form/submit/form_submit_view_model.dart

@@ -1,3 +1,6 @@
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -8,19 +11,23 @@ import 'form_submit_state.dart';
 part 'form_submit_view_model.g.dart';
 
 @riverpod
-class FormSubmitViewModel extends _$FormSubmitViewModel {
+class FormSubmitViewModel extends _$FormSubmitViewModel with DioCancelableMixin{
+  late final FormRepository _formRepository;
   var _curPage = 1; //请求参数当前的页面
   var _needShowPlaceholder = true; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   @override
   FormSubmitState build() {
-    return FormSubmitState(datas: []);
+    _formRepository = ref.read(formRepositoryProvider);
+    final state = FormSubmitState(datas: []);
+    registerCancellation();
+    return state;
   }
 
   //刷新页面状态
@@ -53,78 +60,49 @@ class FormSubmitViewModel extends _$FormSubmitViewModel {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    // 获取 Applied 列表
-    // var listResult = await _jobRepository.fetchJobAppliedList(
-    //   state.jobId,
-    //   state.selectedStatusId,
-    //   state.keyword,
-    //   curPage: _curPage,
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // // 处理数据
-    // if (listResult.isSuccess) {
-    //   handleList(listResult.data?.rows);
-    // } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    // }
+    // 获取列表
+    var listResult = await _formRepository.fetchFormSubmitList(
+      curPage: _curPage,
+      cancelToken: cancelToken,
+    );
 
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-
-    final List<String> list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
-
-    if (_curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(datas: list);
-      refreshController.finishRefresh();
-
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
     } else {
-      //加载更多
-      final allList = state.datas;
-      allList.addAll(list);
-      state.datas.addAll(list);
-
-      refreshController.finishLoad();
-
-      state = state.copyWith(datas: allList);
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
     }
 
     // 最后赋值
     _needShowPlaceholder = false;
   }
 
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? 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);
-//     }
-//   }
-// }
+  // 处理数据与展示的逻辑
+  void handleList(List<FormSubmittedEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_curPage == 1) {
+        //刷新的方式
+        state = state.copyWith(datas: list);
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        state.datas.addAll(List<FormSubmittedEntity>.from(state.datas)..addAll(list));
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_curPage == 1) {
+        //展示无数据的布局
+        state = state.copyWith(datas: []);
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
 }

+ 12 - 5
packages/cpt_form/lib/modules/form/submit/item_form_submit.dart

@@ -1,14 +1,17 @@
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
+import '../form_types.dart';
+
 class FormSubmitItem extends StatelessWidget {
   final int index;
-  final String item;
+  final FormSubmittedEntity item;
 
   const FormSubmitItem({
     required this.index,
@@ -31,12 +34,16 @@ class FormSubmitItem extends StatelessWidget {
           Row(
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
-              const MyAssetImage(Assets.formAccessCard, width: 38.5, height: 31),
+              MyAssetImage(
+                FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['icon_path'],
+                width: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['width'],
+                height: FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['height'],
+              ),
               Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   MyTextView(
-                    "Access Card -Owner",
+                    FormTypes.iconMap[item.estateOnlineForm?.type?.id]?['name'],
                     fontSize: 16,
                     maxLines: 2,
                     textColor: context.appColors.textBlack,
@@ -45,7 +52,7 @@ class FormSubmitItem extends StatelessWidget {
 
                   //预订人
                   MyTextView(
-                    S.current.booked_by_someone("Wu Bing Bing"),
+                    S.current.booked_by_someone(item.account?.name ?? ""),
                     fontSize: 14,
                     marginTop: 2,
                     textColor: context.appColors.textBlack,
@@ -68,7 +75,7 @@ class FormSubmitItem extends StatelessWidget {
             ],
           ),
           MyTextView(
-            S.current.send_on_sometime("04 Feb 2024 at 04:00 PM"),
+            S.current.send_on_sometime(item.sentOn ?? ""),
             fontSize: 14,
             marginTop: 10,
             textColor: context.appColors.textBlack,

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

@@ -76,6 +76,20 @@ class ApiConstants {
   //加入房产单元
   static const apiEstateUnitJoin = "/api/v1/user/estate/unit-user/join";
 
+  // =========================== Form ↓=========================================
+
+  // 在线表单的可申请列表
+  static const apiFormList = "/api/v1/user/online-form/form/index";
+
+  // 在线表单的已批准的申请
+  static const apiFormApprovedList = "/api/v1/user/online-form/approved/index";
+
+  // 在线表单的已拒绝的申请
+  static const apiFormRejectedList = "/api/v1/user/online-form/rejected/index";
+
+  // 在线表单的已提交的申请
+  static const apiFormSubmittedList = "/api/v1/user/online-form/submitted/index";
+
   // =========================== 其他 ↓=========================================
 
   //服务器时间

+ 26 - 0
packages/cs_domain/lib/entity/form_list_entity.dart

@@ -0,0 +1,26 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/form_list_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/form_list_entity.g.dart';
+
+@JsonSerializable()
+class FormListEntity {
+  String? id;
+  @JSONField(name: "online_form_type_id")
+  String? typeId;
+  String? icon;
+  String? name;
+  String? price;
+  String? description;
+
+  FormListEntity();
+
+  factory FormListEntity.fromJson(Map<String, dynamic> json) => $FormListEntityFromJson(json);
+
+  Map<String, dynamic> toJson() => $FormListEntityToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}

+ 75 - 0
packages/cs_domain/lib/entity/form_submitted_entity.dart

@@ -0,0 +1,75 @@
+import 'package:domain/entity/id_name_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/form_submitted_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/form_submitted_entity.g.dart';
+
+@JsonSerializable()
+class FormSubmittedEntity {
+	String? id;
+	@JSONField(name: "user_id")
+	String? userId;
+	@JSONField(name: "estate_online_form_id")
+	String? estateOnlineFormId;
+	FormSubmittedContent? content;
+	@JSONField(name: "sent_on")
+	String? sentOn;
+	@JSONField(name: "rejected_on")
+	String? rejectedOn;
+	@JSONField(name: "approved_on")
+	String? approvedOn;
+	@JSONField(name: "estate_online_form")
+	FormSubmittedEstateOnlineForm? estateOnlineForm;
+	IdNameEntity? account;
+
+	FormSubmittedEntity();
+
+	factory FormSubmittedEntity.fromJson(Map<String, dynamic> json) => $FormSubmittedEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormSubmittedEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class FormSubmittedContent {
+	@JSONField(name: "notes_to_recipient")
+	String? notesToRecipient;
+	@JSONField(name: "notes_to_management")
+	String? notesToManagement;
+	@JSONField(name: "type_of_application")
+	String? typeOfApplication;
+
+	FormSubmittedContent();
+
+	factory FormSubmittedContent.fromJson(Map<String, dynamic> json) => $FormSubmittedContentFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormSubmittedContentToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class FormSubmittedEstateOnlineForm {
+	String? id;
+	String? icon;
+	String? name;
+	IdNameEntity? type;
+
+	FormSubmittedEstateOnlineForm();
+
+	factory FormSubmittedEstateOnlineForm.fromJson(Map<String, dynamic> json) => $FormSubmittedEstateOnlineFormFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormSubmittedEstateOnlineFormToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 27 - 0
packages/cs_domain/lib/entity/form_submitted_page_entity.dart

@@ -0,0 +1,27 @@
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/form_submitted_page_entity.g.dart';
+import 'dart:convert';
+
+export 'package:domain/generated/json/form_submitted_page_entity.g.dart';
+
+@JsonSerializable()
+class FormSubmittedPageEntity {
+	int count = 0;
+	int page =0;
+	int limit =0;
+	@JSONField(name: "count_page")
+	int countPage =0;
+	List<FormSubmittedEntity>? list = [];
+
+	FormSubmittedPageEntity();
+
+	factory FormSubmittedPageEntity.fromJson(Map<String, dynamic> json) => $FormSubmittedPageEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormSubmittedPageEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 56 - 66
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -8,6 +8,9 @@ import 'package:domain/entity/auth_login_entity.dart';
 import 'package:domain/entity/captcha_img_entity.dart';
 import 'package:domain/entity/feedback_detail_entity.dart';
 import 'package:domain/entity/feedback_list_entity.dart';
+import 'package:domain/entity/form_list_entity.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/entity/form_submitted_page_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
 import 'package:domain/entity/newsfeed_following_entity.dart';
@@ -74,14 +77,12 @@ class JsonConvert {
     }
   }
 
-  List<T?>? convertList<T>(List<dynamic>? value,
-      {EnumConvertFunction? enumConvert}) {
+  List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert))
-          .toList();
+      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -91,14 +92,12 @@ class JsonConvert {
     }
   }
 
-  List<T>? convertListNotNull<T>(dynamic value,
-      {EnumConvertFunction? enumConvert}) {
+  List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return (value as List<dynamic>).map((dynamic e) =>
-      _asT<T>(e, enumConvert: enumConvert)!).toList();
+      return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -146,8 +145,7 @@ class JsonConvert {
           return covertFunc(Map<String, dynamic>.from(value)) as T;
         }
       } else {
-        throw UnimplementedError(
-            '$type unimplemented,you can try running the app again');
+        throw UnimplementedError('$type unimplemented,you can try running the app again');
       }
     }
   }
@@ -155,12 +153,10 @@ class JsonConvert {
   //list is returned by type
   static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
     if (<AuthLoginEntity>[] is M) {
-      return data.map<AuthLoginEntity>((Map<String, dynamic> e) =>
-          AuthLoginEntity.fromJson(e)).toList() as M;
+      return data.map<AuthLoginEntity>((Map<String, dynamic> e) => AuthLoginEntity.fromJson(e)).toList() as M;
     }
     if (<CaptchaImgEntity>[] is M) {
-      return data.map<CaptchaImgEntity>((Map<String, dynamic> e) =>
-          CaptchaImgEntity.fromJson(e)).toList() as M;
+      return data.map<CaptchaImgEntity>((Map<String, dynamic> e) => CaptchaImgEntity.fromJson(e)).toList() as M;
     }
     if (<FeedbackDetailEntity>[] is M) {
       return data.map<FeedbackDetailEntity>((Map<String, dynamic> e) => FeedbackDetailEntity.fromJson(e)).toList() as M;
@@ -174,97 +170,89 @@ class JsonConvert {
     if (<FeedbackItemEntity>[] is M) {
       return data.map<FeedbackItemEntity>((Map<String, dynamic> e) => FeedbackItemEntity.fromJson(e)).toList() as M;
     }
+    if (<FormListEntity>[] is M) {
+      return data.map<FormListEntity>((Map<String, dynamic> e) => FormListEntity.fromJson(e)).toList() as M;
+    }
+    if (<FormSubmittedEntity>[] is M) {
+      return data.map<FormSubmittedEntity>((Map<String, dynamic> e) => FormSubmittedEntity.fromJson(e)).toList() as M;
+    }
+    if (<FormSubmittedContent>[] is M) {
+      return data.map<FormSubmittedContent>((Map<String, dynamic> e) => FormSubmittedContent.fromJson(e)).toList() as M;
+    }
+    if (<FormSubmittedEstateOnlineForm>[] is M) {
+      return data.map<FormSubmittedEstateOnlineForm>((Map<String, dynamic> e) => FormSubmittedEstateOnlineForm.fromJson(e)).toList() as M;
+    }
+    if (<FormSubmittedPageEntity>[] is M) {
+      return data.map<FormSubmittedPageEntity>((Map<String, dynamic> e) => FormSubmittedPageEntity.fromJson(e)).toList() as M;
+    }
     if (<IdNameEntity>[] is M) {
-      return data.map<IdNameEntity>((Map<String, dynamic> e) =>
-          IdNameEntity.fromJson(e)).toList() as M;
+      return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
     }
     if (<NewsfeedCommentPublishEntity>[] is M) {
-      return data.map<NewsfeedCommentPublishEntity>((Map<String, dynamic> e) =>
-          NewsfeedCommentPublishEntity.fromJson(e)).toList() as M;
+      return data.map<NewsfeedCommentPublishEntity>((Map<String, dynamic> e) => NewsfeedCommentPublishEntity.fromJson(e)).toList() as M;
     }
     if (<NewsfeedFollowingEntity>[] is M) {
-      return data.map<NewsfeedFollowingEntity>((Map<String, dynamic> e) =>
-          NewsfeedFollowingEntity.fromJson(e)).toList() as M;
+      return data.map<NewsfeedFollowingEntity>((Map<String, dynamic> e) => NewsfeedFollowingEntity.fromJson(e)).toList() as M;
     }
     if (<NewsfeedFollowingList>[] is M) {
-      return data.map<NewsfeedFollowingList>((Map<String, dynamic> e) =>
-          NewsfeedFollowingList.fromJson(e)).toList() as M;
+      return data.map<NewsfeedFollowingList>((Map<String, dynamic> e) => NewsfeedFollowingList.fromJson(e)).toList() as M;
     }
     if (<NewsfeedFollowingListAccount>[] is M) {
-      return data.map<NewsfeedFollowingListAccount>((Map<String, dynamic> e) =>
-          NewsfeedFollowingListAccount.fromJson(e)).toList() as M;
+      return data.map<NewsfeedFollowingListAccount>((Map<String, dynamic> e) => NewsfeedFollowingListAccount.fromJson(e)).toList() as M;
     }
     if (<NewsfeedForyouEntity>[] is M) {
-      return data.map<NewsfeedForyouEntity>((Map<String, dynamic> e) =>
-          NewsfeedForyouEntity.fromJson(e)).toList() as M;
+      return data.map<NewsfeedForyouEntity>((Map<String, dynamic> e) => NewsfeedForyouEntity.fromJson(e)).toList() as M;
     }
     if (<NewsfeedForyouList>[] is M) {
-      return data.map<NewsfeedForyouList>((Map<String, dynamic> e) =>
-          NewsfeedForyouList.fromJson(e)).toList() as M;
+      return data.map<NewsfeedForyouList>((Map<String, dynamic> e) => NewsfeedForyouList.fromJson(e)).toList() as M;
     }
     if (<NewsfeedForyouListAccount>[] is M) {
-      return data.map<NewsfeedForyouListAccount>((Map<String, dynamic> e) =>
-          NewsfeedForyouListAccount.fromJson(e)).toList() as M;
+      return data.map<NewsfeedForyouListAccount>((Map<String, dynamic> e) => NewsfeedForyouListAccount.fromJson(e)).toList() as M;
     }
     if (<NewsfeedNewsEntity>[] is M) {
-      return data.map<NewsfeedNewsEntity>((Map<String, dynamic> e) =>
-          NewsfeedNewsEntity.fromJson(e)).toList() as M;
+      return data.map<NewsfeedNewsEntity>((Map<String, dynamic> e) => NewsfeedNewsEntity.fromJson(e)).toList() as M;
     }
     if (<NewsfeedNewsList>[] is M) {
-      return data.map<NewsfeedNewsList>((Map<String, dynamic> e) =>
-          NewsfeedNewsList.fromJson(e)).toList() as M;
+      return data.map<NewsfeedNewsList>((Map<String, dynamic> e) => NewsfeedNewsList.fromJson(e)).toList() as M;
     }
     if (<NewsfeedNewsListAccount>[] is M) {
-      return data.map<NewsfeedNewsListAccount>((Map<String, dynamic> e) =>
-          NewsfeedNewsListAccount.fromJson(e)).toList() as M;
+      return data.map<NewsfeedNewsListAccount>((Map<String, dynamic> e) => NewsfeedNewsListAccount.fromJson(e)).toList() as M;
     }
     if (<PropertyNewsEntity>[] is M) {
-      return data.map<PropertyNewsEntity>((Map<String, dynamic> e) =>
-          PropertyNewsEntity.fromJson(e)).toList() as M;
+      return data.map<PropertyNewsEntity>((Map<String, dynamic> e) => PropertyNewsEntity.fromJson(e)).toList() as M;
     }
     if (<PropertyNewsList>[] is M) {
-      return data.map<PropertyNewsList>((Map<String, dynamic> e) =>
-          PropertyNewsList.fromJson(e)).toList() as M;
+      return data.map<PropertyNewsList>((Map<String, dynamic> e) => PropertyNewsList.fromJson(e)).toList() as M;
     }
     if (<PropertySaleRentEntity>[] is M) {
-      return data.map<PropertySaleRentEntity>((Map<String, dynamic> e) =>
-          PropertySaleRentEntity.fromJson(e)).toList() as M;
+      return data.map<PropertySaleRentEntity>((Map<String, dynamic> e) => PropertySaleRentEntity.fromJson(e)).toList() as M;
     }
     if (<PropertySaleRentList>[] is M) {
-      return data.map<PropertySaleRentList>((Map<String, dynamic> e) =>
-          PropertySaleRentList.fromJson(e)).toList() as M;
+      return data.map<PropertySaleRentList>((Map<String, dynamic> e) => PropertySaleRentList.fromJson(e)).toList() as M;
     }
     if (<ServerTime>[] is M) {
-      return data.map<ServerTime>((Map<String, dynamic> e) =>
-          ServerTime.fromJson(e)).toList() as M;
+      return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
     }
     if (<UserMeEntity>[] is M) {
-      return data.map<UserMeEntity>((Map<String, dynamic> e) =>
-          UserMeEntity.fromJson(e)).toList() as M;
+      return data.map<UserMeEntity>((Map<String, dynamic> e) => UserMeEntity.fromJson(e)).toList() as M;
     }
     if (<UserMeHouseholds>[] is M) {
-      return data.map<UserMeHouseholds>((Map<String, dynamic> e) =>
-          UserMeHouseholds.fromJson(e)).toList() as M;
+      return data.map<UserMeHouseholds>((Map<String, dynamic> e) => UserMeHouseholds.fromJson(e)).toList() as M;
     }
     if (<UserMeEstates>[] is M) {
-      return data.map<UserMeEstates>((Map<String, dynamic> e) =>
-          UserMeEstates.fromJson(e)).toList() as M;
+      return data.map<UserMeEstates>((Map<String, dynamic> e) => UserMeEstates.fromJson(e)).toList() as M;
     }
     if (<UserMeEstatesAccounts>[] is M) {
-      return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) =>
-          UserMeEstatesAccounts.fromJson(e)).toList() as M;
+      return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) => UserMeEstatesAccounts.fromJson(e)).toList() as M;
     }
     if (<UserMeEstatesAccountsUnit>[] is M) {
-      return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) =>
-          UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
+      return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) => UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
     }
     if (<UserMeDefaultUnit>[] is M) {
-      return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) =>
-          UserMeDefaultUnit.fromJson(e)).toList() as M;
+      return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) => UserMeDefaultUnit.fromJson(e)).toList() as M;
     }
     if (<UserMeInformation>[] is M) {
-      return data.map<UserMeInformation>((Map<String, dynamic> e) =>
-          UserMeInformation.fromJson(e)).toList() as M;
+      return data.map<UserMeInformation>((Map<String, dynamic> e) => UserMeInformation.fromJson(e)).toList() as M;
     }
 
     debugPrint("$M not found");
@@ -277,8 +265,7 @@ class JsonConvert {
       return json;
     }
     if (json is List) {
-      return _getListChildType<M>(
-          json.map((dynamic e) => e as Map<String, dynamic>).toList());
+      return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
     } else {
       return jsonConvert.convert<M>(json);
     }
@@ -293,13 +280,16 @@ class JsonConvertClassCollection {
     (FeedbackDetailReplies).toString(): FeedbackDetailReplies.fromJson,
     (FeedbackListEntity).toString(): FeedbackListEntity.fromJson,
     (FeedbackItemEntity).toString(): FeedbackItemEntity.fromJson,
+    (FormListEntity).toString(): FormListEntity.fromJson,
+    (FormSubmittedEntity).toString(): FormSubmittedEntity.fromJson,
+    (FormSubmittedContent).toString(): FormSubmittedContent.fromJson,
+    (FormSubmittedEstateOnlineForm).toString(): FormSubmittedEstateOnlineForm.fromJson,
+    (FormSubmittedPageEntity).toString(): FormSubmittedPageEntity.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
-    (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity
-        .fromJson,
+    (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity.fromJson,
     (NewsfeedFollowingEntity).toString(): NewsfeedFollowingEntity.fromJson,
     (NewsfeedFollowingList).toString(): NewsfeedFollowingList.fromJson,
-    (NewsfeedFollowingListAccount).toString(): NewsfeedFollowingListAccount
-        .fromJson,
+    (NewsfeedFollowingListAccount).toString(): NewsfeedFollowingListAccount.fromJson,
     (NewsfeedForyouEntity).toString(): NewsfeedForyouEntity.fromJson,
     (NewsfeedForyouList).toString(): NewsfeedForyouList.fromJson,
     (NewsfeedForyouListAccount).toString(): NewsfeedForyouListAccount.fromJson,

+ 61 - 0
packages/cs_domain/lib/generated/json/form_list_entity.g.dart

@@ -0,0 +1,61 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/form_list_entity.dart';
+
+FormListEntity $FormListEntityFromJson(Map<String, dynamic> json) {
+  final FormListEntity formListEntity = FormListEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    formListEntity.id = id;
+  }
+  final String? typeId = jsonConvert.convert<String>(json['online_form_type_id']);
+  if (typeId != null) {
+    formListEntity.typeId = typeId;
+  }
+  final String? icon = jsonConvert.convert<String>(json['icon']);
+  if (icon != null) {
+    formListEntity.icon = icon;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    formListEntity.name = name;
+  }
+  final String? price = jsonConvert.convert<String>(json['price']);
+  if (price != null) {
+    formListEntity.price = price;
+  }
+  final String? description = jsonConvert.convert<String>(json['description']);
+  if (description != null) {
+    formListEntity.description = description;
+  }
+  return formListEntity;
+}
+
+Map<String, dynamic> $FormListEntityToJson(FormListEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['online_form_type_id'] = entity.typeId;
+  data['icon'] = entity.icon;
+  data['name'] = entity.name;
+  data['price'] = entity.price;
+  data['description'] = entity.description;
+  return data;
+}
+
+extension FormListEntityExtension on FormListEntity {
+  FormListEntity copyWith({
+    String? id,
+    String? typeId,
+    String? icon,
+    String? name,
+    String? price,
+    String? description,
+  }) {
+    return FormListEntity()
+      ..id = id ?? this.id
+      ..typeId = typeId ?? this.typeId
+      ..icon = icon ?? this.icon
+      ..name = name ?? this.name
+      ..price = price ?? this.price
+      ..description = description ?? this.description;
+  }
+}

+ 167 - 0
packages/cs_domain/lib/generated/json/form_submitted_entity.g.dart

@@ -0,0 +1,167 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
+
+FormSubmittedEntity $FormSubmittedEntityFromJson(Map<String, dynamic> json) {
+  final FormSubmittedEntity formSubmittedEntity = FormSubmittedEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    formSubmittedEntity.id = id;
+  }
+  final String? userId = jsonConvert.convert<String>(json['user_id']);
+  if (userId != null) {
+    formSubmittedEntity.userId = userId;
+  }
+  final String? estateOnlineFormId = jsonConvert.convert<String>(json['estate_online_form_id']);
+  if (estateOnlineFormId != null) {
+    formSubmittedEntity.estateOnlineFormId = estateOnlineFormId;
+  }
+  final FormSubmittedContent? content = jsonConvert.convert<FormSubmittedContent>(json['content']);
+  if (content != null) {
+    formSubmittedEntity.content = content;
+  }
+  final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
+  if (sentOn != null) {
+    formSubmittedEntity.sentOn = sentOn;
+  }
+  final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
+  if (rejectedOn != null) {
+    formSubmittedEntity.rejectedOn = rejectedOn;
+  }
+  final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
+  if (approvedOn != null) {
+    formSubmittedEntity.approvedOn = approvedOn;
+  }
+  final FormSubmittedEstateOnlineForm? estateOnlineForm = jsonConvert.convert<FormSubmittedEstateOnlineForm>(json['estate_online_form']);
+  if (estateOnlineForm != null) {
+    formSubmittedEntity.estateOnlineForm = estateOnlineForm;
+  }
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
+  if (account != null) {
+    formSubmittedEntity.account = account;
+  }
+  return formSubmittedEntity;
+}
+
+Map<String, dynamic> $FormSubmittedEntityToJson(FormSubmittedEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['user_id'] = entity.userId;
+  data['estate_online_form_id'] = entity.estateOnlineFormId;
+  data['content'] = entity.content?.toJson();
+  data['sent_on'] = entity.sentOn;
+  data['rejected_on'] = entity.rejectedOn;
+  data['approved_on'] = entity.approvedOn;
+  data['estate_online_form'] = entity.estateOnlineForm?.toJson();
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension FormSubmittedEntityExtension on FormSubmittedEntity {
+  FormSubmittedEntity copyWith({
+    String? id,
+    String? userId,
+    String? estateOnlineFormId,
+    FormSubmittedContent? content,
+    String? sentOn,
+    String? rejectedOn,
+    String? approvedOn,
+    FormSubmittedEstateOnlineForm? estateOnlineForm,
+    IdNameEntity? account,
+  }) {
+    return FormSubmittedEntity()
+      ..id = id ?? this.id
+      ..userId = userId ?? this.userId
+      ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId
+      ..content = content ?? this.content
+      ..sentOn = sentOn ?? this.sentOn
+      ..rejectedOn = rejectedOn ?? this.rejectedOn
+      ..approvedOn = approvedOn ?? this.approvedOn
+      ..estateOnlineForm = estateOnlineForm ?? this.estateOnlineForm
+      ..account = account ?? this.account;
+  }
+}
+
+FormSubmittedContent $FormSubmittedContentFromJson(Map<String, dynamic> json) {
+  final FormSubmittedContent formSubmittedContent = FormSubmittedContent();
+  final String? notesToRecipient = jsonConvert.convert<String>(json['notes_to_recipient']);
+  if (notesToRecipient != null) {
+    formSubmittedContent.notesToRecipient = notesToRecipient;
+  }
+  final String? notesToManagement = jsonConvert.convert<String>(json['notes_to_management']);
+  if (notesToManagement != null) {
+    formSubmittedContent.notesToManagement = notesToManagement;
+  }
+  final String? typeOfApplication = jsonConvert.convert<String>(json['type_of_application']);
+  if (typeOfApplication != null) {
+    formSubmittedContent.typeOfApplication = typeOfApplication;
+  }
+  return formSubmittedContent;
+}
+
+Map<String, dynamic> $FormSubmittedContentToJson(FormSubmittedContent entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['notes_to_recipient'] = entity.notesToRecipient;
+  data['notes_to_management'] = entity.notesToManagement;
+  data['type_of_application'] = entity.typeOfApplication;
+  return data;
+}
+
+extension FormSubmittedContentExtension on FormSubmittedContent {
+  FormSubmittedContent copyWith({
+    String? notesToRecipient,
+    String? notesToManagement,
+    String? typeOfApplication,
+  }) {
+    return FormSubmittedContent()
+      ..notesToRecipient = notesToRecipient ?? this.notesToRecipient
+      ..notesToManagement = notesToManagement ?? this.notesToManagement
+      ..typeOfApplication = typeOfApplication ?? this.typeOfApplication;
+  }
+}
+
+FormSubmittedEstateOnlineForm $FormSubmittedEstateOnlineFormFromJson(Map<String, dynamic> json) {
+  final FormSubmittedEstateOnlineForm formSubmittedEstateOnlineForm = FormSubmittedEstateOnlineForm();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    formSubmittedEstateOnlineForm.id = id;
+  }
+  final String? icon = jsonConvert.convert<String>(json['icon']);
+  if (icon != null) {
+    formSubmittedEstateOnlineForm.icon = icon;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    formSubmittedEstateOnlineForm.name = name;
+  }
+  final IdNameEntity? type = jsonConvert.convert<IdNameEntity>(json['type']);
+  if (type != null) {
+    formSubmittedEstateOnlineForm.type = type;
+  }
+  return formSubmittedEstateOnlineForm;
+}
+
+Map<String, dynamic> $FormSubmittedEstateOnlineFormToJson(FormSubmittedEstateOnlineForm entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['icon'] = entity.icon;
+  data['name'] = entity.name;
+  data['type'] = entity.type?.toJson();
+  return data;
+}
+
+extension FormSubmittedEstateOnlineFormExtension on FormSubmittedEstateOnlineForm {
+  FormSubmittedEstateOnlineForm copyWith({
+    String? id,
+    String? icon,
+    String? name,
+    IdNameEntity? type,
+  }) {
+    return FormSubmittedEstateOnlineForm()
+      ..id = id ?? this.id
+      ..icon = icon ?? this.icon
+      ..name = name ?? this.name
+      ..type = type ?? this.type;
+  }
+}

+ 57 - 0
packages/cs_domain/lib/generated/json/form_submitted_page_entity.g.dart

@@ -0,0 +1,57 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/form_submitted_page_entity.dart';
+import 'package:domain/entity/form_submitted_entity.dart';
+
+
+FormSubmittedPageEntity $FormSubmittedPageEntityFromJson(Map<String, dynamic> json) {
+  final FormSubmittedPageEntity formSubmittedPageEntity = FormSubmittedPageEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    formSubmittedPageEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    formSubmittedPageEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    formSubmittedPageEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    formSubmittedPageEntity.countPage = countPage;
+  }
+  final List<FormSubmittedEntity>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<FormSubmittedEntity>(e) as FormSubmittedEntity).toList();
+  if (list != null) {
+    formSubmittedPageEntity.list = list;
+  }
+  return formSubmittedPageEntity;
+}
+
+Map<String, dynamic> $FormSubmittedPageEntityToJson(FormSubmittedPageEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension FormSubmittedPageEntityExtension on FormSubmittedPageEntity {
+  FormSubmittedPageEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<FormSubmittedEntity>? list,
+  }) {
+    return FormSubmittedPageEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}

+ 2 - 4
packages/cs_domain/lib/generated/json/newsfeed_comment_publish_entity.g.dart

@@ -1,8 +1,7 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
 
-NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(
-    Map<String, dynamic> json) {
+NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(Map<String, dynamic> json) {
   final NewsfeedCommentPublishEntity newsfeedCommentPublishEntity = NewsfeedCommentPublishEntity();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -19,8 +18,7 @@ NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(
   return newsfeedCommentPublishEntity;
 }
 
-Map<String, dynamic> $NewsfeedCommentPublishEntityToJson(
-    NewsfeedCommentPublishEntity entity) {
+Map<String, dynamic> $NewsfeedCommentPublishEntityToJson(NewsfeedCommentPublishEntity entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['content'] = entity.content;

+ 9 - 19
packages/cs_domain/lib/generated/json/newsfeed_following_entity.g.dart

@@ -1,8 +1,7 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/newsfeed_following_entity.dart';
 
-NewsfeedFollowingEntity $NewsfeedFollowingEntityFromJson(
-    Map<String, dynamic> json) {
+NewsfeedFollowingEntity $NewsfeedFollowingEntityFromJson(Map<String, dynamic> json) {
   final NewsfeedFollowingEntity newsfeedFollowingEntity = NewsfeedFollowingEntity();
   final int? count = jsonConvert.convert<int>(json['count']);
   if (count != null) {
@@ -20,19 +19,15 @@ NewsfeedFollowingEntity $NewsfeedFollowingEntityFromJson(
   if (countPage != null) {
     newsfeedFollowingEntity.countPage = countPage;
   }
-  final List<NewsfeedFollowingList>? list = (json['list'] as List<dynamic>?)
-      ?.map(
-          (e) =>
-      jsonConvert.convert<NewsfeedFollowingList>(e) as NewsfeedFollowingList)
-      .toList();
+  final List<NewsfeedFollowingList>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<NewsfeedFollowingList>(e) as NewsfeedFollowingList).toList();
   if (list != null) {
     newsfeedFollowingEntity.list = list;
   }
   return newsfeedFollowingEntity;
 }
 
-Map<String, dynamic> $NewsfeedFollowingEntityToJson(
-    NewsfeedFollowingEntity entity) {
+Map<String, dynamic> $NewsfeedFollowingEntityToJson(NewsfeedFollowingEntity entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['count'] = entity.count;
   data['page'] = entity.page;
@@ -59,8 +54,7 @@ extension NewsfeedFollowingEntityExtension on NewsfeedFollowingEntity {
   }
 }
 
-NewsfeedFollowingList $NewsfeedFollowingListFromJson(
-    Map<String, dynamic> json) {
+NewsfeedFollowingList $NewsfeedFollowingListFromJson(Map<String, dynamic> json) {
   final NewsfeedFollowingList newsfeedFollowingList = NewsfeedFollowingList();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -91,16 +85,14 @@ NewsfeedFollowingList $NewsfeedFollowingListFromJson(
   if (createdAt != null) {
     newsfeedFollowingList.createdAt = createdAt;
   }
-  final NewsfeedFollowingListAccount? account = jsonConvert.convert<
-      NewsfeedFollowingListAccount>(json['account']);
+  final NewsfeedFollowingListAccount? account = jsonConvert.convert<NewsfeedFollowingListAccount>(json['account']);
   if (account != null) {
     newsfeedFollowingList.account = account;
   }
   return newsfeedFollowingList;
 }
 
-Map<String, dynamic> $NewsfeedFollowingListToJson(
-    NewsfeedFollowingList entity) {
+Map<String, dynamic> $NewsfeedFollowingListToJson(NewsfeedFollowingList entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['content'] = entity.content;
@@ -136,8 +128,7 @@ extension NewsfeedFollowingListExtension on NewsfeedFollowingList {
   }
 }
 
-NewsfeedFollowingListAccount $NewsfeedFollowingListAccountFromJson(
-    Map<String, dynamic> json) {
+NewsfeedFollowingListAccount $NewsfeedFollowingListAccountFromJson(Map<String, dynamic> json) {
   final NewsfeedFollowingListAccount newsfeedFollowingListAccount = NewsfeedFollowingListAccount();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -158,8 +149,7 @@ NewsfeedFollowingListAccount $NewsfeedFollowingListAccountFromJson(
   return newsfeedFollowingListAccount;
 }
 
-Map<String, dynamic> $NewsfeedFollowingListAccountToJson(
-    NewsfeedFollowingListAccount entity) {
+Map<String, dynamic> $NewsfeedFollowingListAccountToJson(NewsfeedFollowingListAccount entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;

+ 5 - 11
packages/cs_domain/lib/generated/json/newsfeed_foryou_entity.g.dart

@@ -19,11 +19,8 @@ NewsfeedForyouEntity $NewsfeedForyouEntityFromJson(Map<String, dynamic> json) {
   if (countPage != null) {
     newsfeedForyouEntity.countPage = countPage;
   }
-  final List<NewsfeedForyouList>? list = (json['list'] as List<dynamic>?)
-      ?.map(
-          (e) =>
-      jsonConvert.convert<NewsfeedForyouList>(e) as NewsfeedForyouList)
-      .toList();
+  final List<NewsfeedForyouList>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<NewsfeedForyouList>(e) as NewsfeedForyouList).toList();
   if (list != null) {
     newsfeedForyouEntity.list = list;
   }
@@ -88,8 +85,7 @@ NewsfeedForyouList $NewsfeedForyouListFromJson(Map<String, dynamic> json) {
   if (createdAt != null) {
     newsfeedForyouList.createdAt = createdAt;
   }
-  final NewsfeedForyouListAccount? account = jsonConvert.convert<
-      NewsfeedForyouListAccount>(json['account']);
+  final NewsfeedForyouListAccount? account = jsonConvert.convert<NewsfeedForyouListAccount>(json['account']);
   if (account != null) {
     newsfeedForyouList.account = account;
   }
@@ -132,8 +128,7 @@ extension NewsfeedForyouListExtension on NewsfeedForyouList {
   }
 }
 
-NewsfeedForyouListAccount $NewsfeedForyouListAccountFromJson(
-    Map<String, dynamic> json) {
+NewsfeedForyouListAccount $NewsfeedForyouListAccountFromJson(Map<String, dynamic> json) {
   final NewsfeedForyouListAccount newsfeedForyouListAccount = NewsfeedForyouListAccount();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -154,8 +149,7 @@ NewsfeedForyouListAccount $NewsfeedForyouListAccountFromJson(
   return newsfeedForyouListAccount;
 }
 
-Map<String, dynamic> $NewsfeedForyouListAccountToJson(
-    NewsfeedForyouListAccount entity) {
+Map<String, dynamic> $NewsfeedForyouListAccountToJson(NewsfeedForyouListAccount entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;

+ 5 - 10
packages/cs_domain/lib/generated/json/newsfeed_news_entity.g.dart

@@ -19,10 +19,8 @@ NewsfeedNewsEntity $NewsfeedNewsEntityFromJson(Map<String, dynamic> json) {
   if (countPage != null) {
     newsfeedNewsEntity.countPage = countPage;
   }
-  final List<NewsfeedNewsList>? list = (json['list'] as List<dynamic>?)
-      ?.map(
-          (e) => jsonConvert.convert<NewsfeedNewsList>(e) as NewsfeedNewsList)
-      .toList();
+  final List<NewsfeedNewsList>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<NewsfeedNewsList>(e) as NewsfeedNewsList).toList();
   if (list != null) {
     newsfeedNewsEntity.list = list;
   }
@@ -87,8 +85,7 @@ NewsfeedNewsList $NewsfeedNewsListFromJson(Map<String, dynamic> json) {
   if (createdAt != null) {
     newsfeedNewsList.createdAt = createdAt;
   }
-  final NewsfeedNewsListAccount? account = jsonConvert.convert<
-      NewsfeedNewsListAccount>(json['account']);
+  final NewsfeedNewsListAccount? account = jsonConvert.convert<NewsfeedNewsListAccount>(json['account']);
   if (account != null) {
     newsfeedNewsList.account = account;
   }
@@ -131,8 +128,7 @@ extension NewsfeedNewsListExtension on NewsfeedNewsList {
   }
 }
 
-NewsfeedNewsListAccount $NewsfeedNewsListAccountFromJson(
-    Map<String, dynamic> json) {
+NewsfeedNewsListAccount $NewsfeedNewsListAccountFromJson(Map<String, dynamic> json) {
   final NewsfeedNewsListAccount newsfeedNewsListAccount = NewsfeedNewsListAccount();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -153,8 +149,7 @@ NewsfeedNewsListAccount $NewsfeedNewsListAccountFromJson(
   return newsfeedNewsListAccount;
 }
 
-Map<String, dynamic> $NewsfeedNewsListAccountToJson(
-    NewsfeedNewsListAccount entity) {
+Map<String, dynamic> $NewsfeedNewsListAccountToJson(NewsfeedNewsListAccount entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;

+ 2 - 4
packages/cs_domain/lib/generated/json/property_news_entity.g.dart

@@ -19,10 +19,8 @@ PropertyNewsEntity $PropertyNewsEntityFromJson(Map<String, dynamic> json) {
   if (countPage != null) {
     propertyNewsEntity.countPage = countPage;
   }
-  final List<PropertyNewsList>? list = (json['list'] as List<dynamic>?)
-      ?.map(
-          (e) => jsonConvert.convert<PropertyNewsList>(e) as PropertyNewsList)
-      .toList();
+  final List<PropertyNewsList>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<PropertyNewsList>(e) as PropertyNewsList).toList();
   if (list != null) {
     propertyNewsEntity.list = list;
   }

+ 4 - 9
packages/cs_domain/lib/generated/json/property_sale_rent_entity.g.dart

@@ -1,8 +1,7 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/property_sale_rent_entity.dart';
 
-PropertySaleRentEntity $PropertySaleRentEntityFromJson(
-    Map<String, dynamic> json) {
+PropertySaleRentEntity $PropertySaleRentEntityFromJson(Map<String, dynamic> json) {
   final PropertySaleRentEntity propertySaleRentEntity = PropertySaleRentEntity();
   final int? count = jsonConvert.convert<int>(json['count']);
   if (count != null) {
@@ -20,19 +19,15 @@ PropertySaleRentEntity $PropertySaleRentEntityFromJson(
   if (countPage != null) {
     propertySaleRentEntity.countPage = countPage;
   }
-  final List<PropertySaleRentList>? list = (json['list'] as List<dynamic>?)
-      ?.map(
-          (e) =>
-      jsonConvert.convert<PropertySaleRentList>(e) as PropertySaleRentList)
-      .toList();
+  final List<PropertySaleRentList>? list = (json['list'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<PropertySaleRentList>(e) as PropertySaleRentList).toList();
   if (list != null) {
     propertySaleRentEntity.list = list;
   }
   return propertySaleRentEntity;
 }
 
-Map<String, dynamic> $PropertySaleRentEntityToJson(
-    PropertySaleRentEntity entity) {
+Map<String, dynamic> $PropertySaleRentEntityToJson(PropertySaleRentEntity entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['count'] = entity.count;
   data['page'] = entity.page;

+ 15 - 33
packages/cs_domain/lib/generated/json/user_me_entity.g.dart

@@ -23,13 +23,11 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
   if (email != null) {
     userMeEntity.email = email;
   }
-  final String? followsCount = jsonConvert.convert<String>(
-      json['follows_count']);
+  final String? followsCount = jsonConvert.convert<String>(json['follows_count']);
   if (followsCount != null) {
     userMeEntity.followsCount = followsCount;
   }
-  final String? flowersCount = jsonConvert.convert<String>(
-      json['flowers_count']);
+  final String? flowersCount = jsonConvert.convert<String>(json['flowers_count']);
   if (flowersCount != null) {
     userMeEntity.flowersCount = flowersCount;
   }
@@ -37,28 +35,21 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
   if (postsCount != null) {
     userMeEntity.postsCount = postsCount;
   }
-  final List<UserMeHouseholds>? households = (json['households'] as List<
-      dynamic>?)
-      ?.map(
-          (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds)
-      .toList();
+  final List<UserMeHouseholds>? households = (json['households'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds).toList();
   if (households != null) {
     userMeEntity.households = households;
   }
-  final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)
-      ?.map(
-          (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates)
-      .toList();
+  final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates).toList();
   if (estates != null) {
     userMeEntity.estates = estates;
   }
-  final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(
-      json['default_unit']);
+  final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(json['default_unit']);
   if (defaultUnit != null) {
     userMeEntity.defaultUnit = defaultUnit;
   }
-  final UserMeInformation? information = jsonConvert.convert<UserMeInformation>(
-      json['information']);
+  final UserMeInformation? information = jsonConvert.convert<UserMeInformation>(json['information']);
   if (information != null) {
     userMeEntity.information = information;
   }
@@ -161,12 +152,8 @@ UserMeEstates $UserMeEstatesFromJson(Map<String, dynamic> json) {
   if (name != null) {
     userMeEstates.name = name;
   }
-  final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<
-      dynamic>?)
-      ?.map(
-          (e) =>
-      jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts)
-      .toList();
+  final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts).toList();
   if (accounts != null) {
     userMeEstates.accounts = accounts;
   }
@@ -194,8 +181,7 @@ extension UserMeEstatesExtension on UserMeEstates {
   }
 }
 
-UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(
-    Map<String, dynamic> json) {
+UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(Map<String, dynamic> json) {
   final UserMeEstatesAccounts userMeEstatesAccounts = UserMeEstatesAccounts();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -221,16 +207,14 @@ UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(
   if (status != null) {
     userMeEstatesAccounts.status = status;
   }
-  final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<
-      UserMeEstatesAccountsUnit>(json['unit']);
+  final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<UserMeEstatesAccountsUnit>(json['unit']);
   if (unit != null) {
     userMeEstatesAccounts.unit = unit;
   }
   return userMeEstatesAccounts;
 }
 
-Map<String, dynamic> $UserMeEstatesAccountsToJson(
-    UserMeEstatesAccounts entity) {
+Map<String, dynamic> $UserMeEstatesAccountsToJson(UserMeEstatesAccounts entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;
@@ -263,8 +247,7 @@ extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts {
   }
 }
 
-UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(
-    Map<String, dynamic> json) {
+UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(Map<String, dynamic> json) {
   final UserMeEstatesAccountsUnit userMeEstatesAccountsUnit = UserMeEstatesAccountsUnit();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -289,8 +272,7 @@ UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(
   return userMeEstatesAccountsUnit;
 }
 
-Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(
-    UserMeEstatesAccountsUnit entity) {
+Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(UserMeEstatesAccountsUnit entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['block'] = entity.block;

+ 135 - 0
packages/cs_domain/lib/repository/form_repository.dart

@@ -0,0 +1,135 @@
+import 'package:domain/entity/feedback_detail_entity.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import '../constants/api_constants.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+import '../entity/form_list_entity.dart';
+import '../entity/form_submitted_page_entity.dart';
+import '../entity/id_name_entity.dart';
+
+part 'form_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+FormRepository formRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return FormRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 表单的数据仓库
+ */
+class FormRepository {
+  DioEngine dioEngine;
+
+  FormRepository({required this.dioEngine});
+
+  /// 获取表单的可申请列表
+  Future<HttpResult<FormListEntity>> fetchFormApplyList({
+    CancelToken? cancelToken,
+  }) async {
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiFormList,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final jsonList = result.getListJson();
+
+      //获取List数据 需要转换一次
+      var list = jsonList
+          ?.map((value) {
+            if (value is Map<String, dynamic>) {
+              return FormListEntity.fromJson(value);
+            } else {
+              return null;
+            }
+          })
+          .where((item) => item != null)
+          .cast<FormListEntity>()
+          .toList();
+
+      return result.convert<FormListEntity>(list: list);
+    }
+    return result.convert<FormListEntity>();
+  }
+
+  /// 已发布的表单列表
+  Future<HttpResult<FormSubmittedPageEntity>> fetchFormSubmitList({
+    required int curPage,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['page'] = curPage.toString();
+    params['limit'] = "10";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiFormSubmittedList,
+      params: params,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = FormSubmittedPageEntity.fromJson(json!);
+      return result.convert<FormSubmittedPageEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 已批准的表单列表
+  Future<HttpResult<FormSubmittedPageEntity>> fetchFormApproveList({
+    required int curPage,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['page'] = curPage.toString();
+    params['limit'] = "10";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiFormApprovedList,
+      params: params,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = FormSubmittedPageEntity.fromJson(json!);
+      return result.convert<FormSubmittedPageEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 已拒绝的表单列表
+  Future<HttpResult<FormSubmittedPageEntity>> fetchFormRejectList({
+    required int curPage,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['page'] = curPage.toString();
+    params['limit'] = "10";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiFormRejectedList,
+      params: params,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = FormSubmittedPageEntity.fromJson(json!);
+      return result.convert<FormSubmittedPageEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cs_domain/lib/repository/form_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'form_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$formRepositoryHash() => r'36ca0be54f15596cd3dcc463d83d6b427140c64b';
+
+/// See also [formRepository].
+@ProviderFor(formRepository)
+final formRepositoryProvider = Provider<FormRepository>.internal(
+  formRepository,
+  name: r'formRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$formRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef FormRepositoryRef = ProviderRef<FormRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

binární
packages/cs_resources/assets/form/apply_icon.webp


binární
packages/cs_resources/assets/form/approved_icon.webp


binární
packages/cs_resources/assets/form/not_approved_icon.webp


binární
packages/cs_resources/assets/form/submit_icon.webp