Browse Source

feat : 问题筛选UI

dev
徐振升 9 hours ago
parent
commit
20f2eabc75
  1. 2
      lib/app/features/problem/domain/entities/problem_bind_status.dart
  2. 5
      lib/app/features/problem/presentation/controllers/problem_list_controller.dart
  3. 86
      lib/app/features/problem/presentation/pages/problem_list_page.dart

2
lib/app/features/problem/domain/entities/problem_bind_status.dart

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
enum ProblemBindStatus { enum ProblemBindStatus {
bound('绑定', Colors.green), bound('绑定', Colors.green),
unbound('未绑定', Colors.red); unbound('未绑定', Colors.red);
final String displayName; final String displayName;

5
lib/app/features/problem/presentation/controllers/problem_list_controller.dart

@ -1,8 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.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/extensions/datetime_extension.dart';
import 'package:problem_check_system/app/core/models/form_mode.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/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_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/entities/problem_list_item_entity.dart';
import 'package:problem_check_system/app/features/problem/domain/repositories/problem_repository.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 isSyncing = false.obs;
final nameController = TextEditingController(); final nameController = TextEditingController();
// final selectedType = Rx<CompanyType?>(null); final selectedStatus = Rx<SyncStatus?>(null);
final selectedBound = Rx<ProblemBindStatus?>(null);
final startDate = Rx<DateTime?>(null); final startDate = Rx<DateTime?>(null);
final endDate = Rx<DateTime?>(null); final endDate = Rx<DateTime?>(null);
final selectedProblems = <ProblemEntity>{}.obs; final selectedProblems = <ProblemEntity>{}.obs;

86
lib/app/features/problem/presentation/pages/problem_list_page.dart

@ -1,8 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.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/extensions/datetime_extension.dart';
import 'package:problem_check_system/app/core/pages/widgets/custom_app_bar.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/controllers/problem_list_controller.dart';
import 'package:problem_check_system/app/features/problem/presentation/pages/widgets/problem_card.dart'; import 'package:problem_check_system/app/features/problem/presentation/pages/widgets/problem_card.dart';
@ -64,32 +66,64 @@ class ProblemListPage extends GetView<ProblemListController> {
), ),
SizedBox(height: 12.h), SizedBox(height: 12.h),
// // 2. Row(
// Obx( children: [
// () => DropdownButtonFormField<CompanyType>( Expanded(
// initialValue: controller.selectedType.value, child: Obx(
// decoration: InputDecoration( () => DropdownButtonFormField<SyncStatus>(
// labelText: '企业类型', initialValue: controller.selectedStatus.value,
// prefixIcon: const Icon(Icons.category), decoration: InputDecoration(
// border: OutlineInputBorder( labelText: '问题状态',
// borderRadius: BorderRadius.circular(8.r), prefixIcon: const Icon(Icons.category),
// ), border: OutlineInputBorder(
// isDense: true, borderRadius: BorderRadius.circular(8.r),
// ), ),
// hint: const Text('请选择企业类型'), isDense: true,
// isExpanded: true, ),
// items: CompanyType.values.map((type) { hint: const Text('请选择问题状态'),
// return DropdownMenuItem( isExpanded: true,
// value: type, items: SyncStatus.values.map((status) {
// child: Text(type.displayText), return DropdownMenuItem(
// ); value: status,
// }).toList(), child: Text(status.displayName),
// onChanged: (value) { );
// controller.selectedType.value = value; }).toList(),
// }, onChanged: (value) {
// ), controller.selectedStatus.value = value;
// ), },
// SizedBox(height: 12.h), ),
),
),
SizedBox(width: 12.w),
Expanded(
child: Obx(
() => DropdownButtonFormField<ProblemBindStatus>(
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. // 3.
Row( Row(

Loading…
Cancel
Save