Prechádzať zdrojové kódy

场控app,赛事结束后,操作列按钮也要禁用掉

周睿 2 rokov pred
rodič
commit
c4c9b2fee3

+ 9 - 4
app_business/lib/view/home/event_manage/event_manage.dart

@@ -199,6 +199,7 @@ class EventManage extends GetView<EventManagerController> {
         snStr = one.bandSN;
       }
 
+      final enable = controller.selected?.state == EventState.start;
       return LineChartElem([
         _CheckBox(one),
         Text('${i + 1}'),
@@ -209,7 +210,7 @@ class EventManage extends GetView<EventManagerController> {
         one.state == UserState.idle
             ? button(
                 color: Colors.blue,
-                onPressed: () => routeSelect(one),
+                onPressed: enable ? () => routeSelect(one) : null,
                 text: '分发')
             : Row(mainAxisSize: MainAxisSize.min, children: [
                 Expanded(
@@ -222,17 +223,21 @@ class EventManage extends GetView<EventManagerController> {
                     width: 32,
                     child: one.state == UserState.hasRoute
                         ? GestureDetector(
-                            onTap: () => routeSelect(one),
+                            onTap: enable ? () => routeSelect(one) : null,
                             child: const Icon(Icons.mode_edit_outline))
                         : const SizedBox())
               ]),
         one.state == UserState.hasRoute
             ? button(
                 color: Colors.green,
-                onPressed: () => controller.userStart(one),
+                onPressed: enable ? () => controller.userStart(one) : null,
                 text: '开始')
             : Text(stateStr, style: TextStyle(color: stateColor)),
-        button(text: optStr, color: optColor, isOutline: true, onPressed: opt)
+        button(
+            text: optStr,
+            color: optColor,
+            isOutline: true,
+            onPressed: enable ? opt : null)
       ]);
     });
   }

+ 1 - 1
app_business/pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.1.1+1
+version: 1.1.2+1
 
 environment:
   sdk: '>=3.1.5 <4.0.0'

+ 1 - 1
libs/common_pub

@@ -1 +1 @@
-Subproject commit 11a1d3e4e321ebe965219f07497a6148ffe5fdb7
+Subproject commit 4acbb36ecd8758d9e1c092ec40c3da3cb3f0016e