From 20f2eabc751ee69adbc4012a128be58cf8db1153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Wed, 5 Nov 2025 17:33:04 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E9=97=AE=E9=A2=98=E7=AD=9B=E9=80=89?= =?UTF-8?q?UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entities/problem_bind_status.dart | 2 +- .../controllers/problem_list_controller.dart | 5 +- .../presentation/pages/problem_list_page.dart | 86 +++++++++++++------ 3 files changed, 65 insertions(+), 28 deletions(-) diff --git a/lib/app/features/problem/domain/entities/problem_bind_status.dart b/lib/app/features/problem/domain/entities/problem_bind_status.dart index c7cf5d0..3d974f8 100644 --- a/lib/app/features/problem/domain/entities/problem_bind_status.dart +++ b/lib/app/features/problem/domain/entities/problem_bind_status.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; enum ProblemBindStatus { - bound('绑定', Colors.green), + bound('已绑定', Colors.green), unbound('未绑定', Colors.red); final String displayName; diff --git a/lib/app/features/problem/presentation/controllers/problem_list_controller.dart b/lib/app/features/problem/presentation/controllers/problem_list_controller.dart index 592df08..52ac9ac 100644 --- a/lib/app/features/problem/presentation/controllers/problem_list_controller.dart +++ b/lib/app/features/problem/presentation/controllers/problem_list_controller.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:problem_check_system/app/core/domain/entities/sync_status.dart'; import 'package:problem_check_system/app/core/extensions/datetime_extension.dart'; import 'package:problem_check_system/app/core/models/form_mode.dart'; import 'package:problem_check_system/app/core/routes/app_routes.dart'; +import 'package:problem_check_system/app/features/problem/domain/entities/problem_bind_status.dart'; import 'package:problem_check_system/app/features/problem/domain/entities/problem_entity.dart'; import 'package:problem_check_system/app/features/problem/domain/entities/problem_list_item_entity.dart'; import 'package:problem_check_system/app/features/problem/domain/repositories/problem_repository.dart'; @@ -26,7 +28,8 @@ class ProblemListController extends GetxController { final isSyncing = false.obs; final nameController = TextEditingController(); - // final selectedType = Rx(null); + final selectedStatus = Rx(null); + final selectedBound = Rx(null); final startDate = Rx(null); final endDate = Rx(null); final selectedProblems = {}.obs; diff --git a/lib/app/features/problem/presentation/pages/problem_list_page.dart b/lib/app/features/problem/presentation/pages/problem_list_page.dart index 43595a3..396b9d1 100644 --- a/lib/app/features/problem/presentation/pages/problem_list_page.dart +++ b/lib/app/features/problem/presentation/pages/problem_list_page.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:problem_check_system/app/core/domain/entities/sync_status.dart'; import 'package:problem_check_system/app/core/extensions/datetime_extension.dart'; import 'package:problem_check_system/app/core/pages/widgets/custom_app_bar.dart'; +import 'package:problem_check_system/app/features/problem/domain/entities/problem_bind_status.dart'; import 'package:problem_check_system/app/features/problem/presentation/controllers/problem_list_controller.dart'; import 'package:problem_check_system/app/features/problem/presentation/pages/widgets/problem_card.dart'; @@ -64,32 +66,64 @@ class ProblemListPage extends GetView { ), SizedBox(height: 12.h), - // // 2. 企业类型下拉框 - // Obx( - // () => DropdownButtonFormField( - // initialValue: controller.selectedType.value, - // decoration: InputDecoration( - // labelText: '企业类型', - // prefixIcon: const Icon(Icons.category), - // border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8.r), - // ), - // isDense: true, - // ), - // hint: const Text('请选择企业类型'), - // isExpanded: true, - // items: CompanyType.values.map((type) { - // return DropdownMenuItem( - // value: type, - // child: Text(type.displayText), - // ); - // }).toList(), - // onChanged: (value) { - // controller.selectedType.value = value; - // }, - // ), - // ), - // SizedBox(height: 12.h), + Row( + children: [ + Expanded( + child: Obx( + () => DropdownButtonFormField( + initialValue: controller.selectedStatus.value, + decoration: InputDecoration( + labelText: '问题状态', + prefixIcon: const Icon(Icons.category), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.r), + ), + isDense: true, + ), + hint: const Text('请选择问题状态'), + isExpanded: true, + items: SyncStatus.values.map((status) { + return DropdownMenuItem( + value: status, + child: Text(status.displayName), + ); + }).toList(), + onChanged: (value) { + controller.selectedStatus.value = value; + }, + ), + ), + ), + SizedBox(width: 12.w), + Expanded( + child: Obx( + () => DropdownButtonFormField( + initialValue: controller.selectedBound.value, + decoration: InputDecoration( + labelText: '绑定状态', + prefixIcon: const Icon(Icons.category), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.r), + ), + isDense: true, + ), + hint: const Text('请选择绑定状态'), + isExpanded: true, + items: ProblemBindStatus.values.map((bound) { + return DropdownMenuItem( + value: bound, + child: Text(bound.displayName), + ); + }).toList(), + onChanged: (value) { + controller.selectedBound.value = value; + }, + ), + ), + ), + ], + ), + SizedBox(height: 12.h), // 3. 日期范围选择器 Row(