Browse Source

feat : 问题筛选UI

dev
徐振升 5 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';
enum ProblemBindStatus {
bound('绑定', Colors.green),
bound('绑定', Colors.green),
unbound('未绑定', Colors.red);
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: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<CompanyType?>(null);
final selectedStatus = Rx<SyncStatus?>(null);
final selectedBound = Rx<ProblemBindStatus?>(null);
final startDate = Rx<DateTime?>(null);
final endDate = Rx<DateTime?>(null);
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_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<ProblemListController> {
),
SizedBox(height: 12.h),
// // 2.
// Obx(
// () => DropdownButtonFormField<CompanyType>(
// 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<SyncStatus>(
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<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.
Row(

Loading…
Cancel
Save