|
|
@@ -3,23 +3,6 @@ import 'dart:collection';
|
|
|
import 'package:app_business/service/api.dart';
|
|
|
import 'package:track_common/widget.dart';
|
|
|
|
|
|
-class Rule {
|
|
|
- var id = 0;
|
|
|
- var name = '';
|
|
|
- RuleValue value = RuleValueBool();
|
|
|
-}
|
|
|
-
|
|
|
-class RuleValue {}
|
|
|
-
|
|
|
-class RuleValueBool extends RuleValue {
|
|
|
- var value = false;
|
|
|
-}
|
|
|
-
|
|
|
-class RuleValueArrStr extends RuleValue {
|
|
|
- var value = '';
|
|
|
- var options = <String>[];
|
|
|
-}
|
|
|
-
|
|
|
class SettingsController extends GetxController {
|
|
|
final rules = HashMap<int, Rule>().obs;
|
|
|
|
|
|
@@ -36,7 +19,7 @@ class SettingsController extends GetxController {
|
|
|
..id = e.arrId
|
|
|
..name = e.arName
|
|
|
..value = e.arType == 1
|
|
|
- ? (RuleValueBool()..value = e.isLock)
|
|
|
+ ? (RuleValueBool()..value = e.arValue == 'true')
|
|
|
: (RuleValueArrStr()
|
|
|
..value = e.arValue
|
|
|
..options =
|
|
|
@@ -70,7 +53,10 @@ class DialogSettings extends GetView<SettingsController> {
|
|
|
width: double.infinity,
|
|
|
height: 38,
|
|
|
child: const Text('确认'),
|
|
|
- onPressed: () {}))
|
|
|
+ onPressed: () {
|
|
|
+ final r = controller.rules.value.values;
|
|
|
+ Get.back(result: r);
|
|
|
+ }))
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -130,7 +116,7 @@ class _RuleElem extends GetView<SettingsController> {
|
|
|
return Row(
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
children: [
|
|
|
- SizedBox(width: 84, child: Text(data.name, textAlign: TextAlign.end)),
|
|
|
+ SizedBox(width: 110, child: Text(data.name, textAlign: TextAlign.end)),
|
|
|
const SizedBox(width: 22),
|
|
|
option!,
|
|
|
],
|