|
|
@@ -1,6 +1,7 @@
|
|
|
import 'package:app_business/service/api.dart';
|
|
|
import 'package:app_business/view/home/dialog_event_register.dart';
|
|
|
import 'package:pretty_qr_code/pretty_qr_code.dart';
|
|
|
+import 'package:track_common/model/event_state.dart';
|
|
|
import 'package:track_common/widget.dart';
|
|
|
import 'package:track_common/widget/prelude.dart';
|
|
|
|
|
|
@@ -27,44 +28,52 @@ class EventManage extends GetView<EventManagerController> {
|
|
|
)),
|
|
|
const Spacer(),
|
|
|
SizedBox(
|
|
|
- height: 27.73,
|
|
|
- width: 260,
|
|
|
- child: Row(
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- SizedBox(
|
|
|
- width: 70,
|
|
|
- child: SmallButton(
|
|
|
- isOutline: true,
|
|
|
- color: Colors.orange,
|
|
|
- onPressed: controller.userRestartAll,
|
|
|
- child: const Text('一键重赛'),
|
|
|
- )),
|
|
|
- SizedBox(
|
|
|
- width: 70,
|
|
|
- child: SmallButton(
|
|
|
- isOutline: true,
|
|
|
- color: Colors.blue,
|
|
|
- onPressed: controller.routeAllocAll,
|
|
|
- child: const Text('一键分发'),
|
|
|
- )),
|
|
|
- SizedBox(
|
|
|
- width: 70,
|
|
|
- child: SmallButton(
|
|
|
- isOutline: true,
|
|
|
- color: Colors.green,
|
|
|
- onPressed: controller.userStartAll,
|
|
|
- child: const Text('一键开始'),
|
|
|
- ))
|
|
|
- ],
|
|
|
- ),
|
|
|
+ // height: 27.73,
|
|
|
+ width: 360,
|
|
|
+ child: wTopButtons(context),
|
|
|
),
|
|
|
const SizedBox(width: 20)
|
|
|
],
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ Widget wTopButtons(BuildContext context) {
|
|
|
+ return Obx(() {
|
|
|
+ var enable = true;
|
|
|
+
|
|
|
+ if (controller.selected?.state == EventState.idle) {
|
|
|
+ enable = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return Row(
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ AppButton.outlined(
|
|
|
+ color: Colors.orange,
|
|
|
+ onPressed: enable ? controller.userRestartAll : null,
|
|
|
+ child: const Text('一键重赛'),
|
|
|
+ ),
|
|
|
+ AppButton.outlined(
|
|
|
+ color: Colors.blue,
|
|
|
+ onPressed: enable ? controller.routeAllocAll : null,
|
|
|
+ child: const Text('一键分发'),
|
|
|
+ ),
|
|
|
+ AppButton.outlined(
|
|
|
+ color: Colors.green,
|
|
|
+ onPressed: enable ? controller.userStartAll : null,
|
|
|
+ child: const Text('一键开始'),
|
|
|
+ ),
|
|
|
+ AppButton.outlined(
|
|
|
+ color: Colors.red,
|
|
|
+ onPressed: enable ? controller.userDelAll : null,
|
|
|
+ child: const Text('一键删除'),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
Widget wDate(BuildContext context) {
|
|
|
return GestureDetector(
|
|
|
onTap: () => _onTapDate(context),
|
|
|
@@ -180,17 +189,7 @@ class EventManage extends GetView<EventManagerController> {
|
|
|
}
|
|
|
|
|
|
return LineChartElem([
|
|
|
- Checkbox(
|
|
|
- value: controller.selectedUser.value.contains(one.checkId),
|
|
|
- onChanged: (v) {
|
|
|
- controller.selectedUser.update((val) {
|
|
|
- if (v == true) {
|
|
|
- val?.add(one.checkId);
|
|
|
- } else {
|
|
|
- val?.remove(one.checkId);
|
|
|
- }
|
|
|
- });
|
|
|
- }),
|
|
|
+ _CheckBox(one),
|
|
|
Text('${i + 1}'),
|
|
|
Text(one.name),
|
|
|
Text(one.phone),
|
|
|
@@ -253,6 +252,27 @@ class EventManage extends GetView<EventManagerController> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class _CheckBox extends GetView<EventManagerController> {
|
|
|
+ const _CheckBox(this.one);
|
|
|
+
|
|
|
+ final UserInManage one;
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return Obx(() => Checkbox(
|
|
|
+ value: controller.selectedUser.value.contains(one.checkId),
|
|
|
+ onChanged: (v) {
|
|
|
+ controller.selectedUser.update((val) {
|
|
|
+ if (v == true) {
|
|
|
+ val?.add(one.checkId);
|
|
|
+ } else {
|
|
|
+ val?.remove(one.checkId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
class _RouteSelectDialog extends GetView<EventManagerController> {
|
|
|
const _RouteSelectDialog({required this.list});
|
|
|
final Iterable<RouteInfo> list;
|