Browse Source

1、测量项配置的配置新增

guanxinyi 1 năm trước cách đây
mục cha
commit
f3caf9966c

+ 9 - 0
lib/process/workspace/measure_data_controller.dart

@@ -151,6 +151,9 @@ class MeasureDataController implements IMeasureDataController {
       PresetCommentItemResultDTO();
   List<CommentItemDTO> _measureCommentItemResult = [];
   List<ItemMetaGroup> _itemMetaListGroup = [];
+
+  /// 新增的
+  List<ItemMetaDTO> _itemMetaListConfig = [];
   Paint _paintLinePan = Paint()
     ..color = MeasureColors.Primary
     ..isAntiAlias = true
@@ -214,6 +217,12 @@ class MeasureDataController implements IMeasureDataController {
     }
   }
 
+  List<ItemMetaDTO> get itemMetaListConfig => _itemMetaListConfig;
+  @override
+  set itemMetaListConfig(List<ItemMetaDTO> value) {
+    _itemMetaListConfig = value;
+  }
+
   @override
   List<String> get annotationList => _annotationList;
   @override

+ 63 - 35
lib/view/measure/measure_config/measure_configuation_page.dart

@@ -1,3 +1,5 @@
+import 'dart:convert';
+
 import 'package:fis_i18n/i18n.dart';
 import 'package:fis_jsonrpc/rpc.dart';
 import 'package:fis_measure/interfaces/process/items/terms.dart';
@@ -6,6 +8,7 @@ import 'package:fis_measure/interfaces/process/workspace/application.dart';
 import 'package:fis_measure/process/language/measure_language.dart';
 import 'package:fis_measure/process/workspace/measure_data_controller.dart';
 import 'package:fis_measure/process/workspace/measure_handler.dart';
+import 'package:fis_measure/view/measure/measure_config/widgets/has_selected_setting_dialog.dart';
 import 'package:fis_measure/view/measure/measure_config/widgets/measure_configuration_style.dart';
 import 'package:fis_measure/view/measure/measure_config/widgets/measurement_tool_selection.dart';
 import 'package:fis_measure/view/measure/measure_view_controller.dart';
@@ -13,7 +16,6 @@ import 'package:fis_measure/view/player/controller.dart';
 import 'package:fis_theme/theme.dart';
 import 'package:fis_ui/index.dart';
 import 'package:fis_ui/interface/interactive_container.dart';
-import 'package:fis_ui/widgets/layout/offstage.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 
@@ -80,16 +82,8 @@ class MeasureConfigurationPageState extends State<MeasureConfigurationPage> {
   List<String> chooseMeasureList = [];
   List<ItemMetaGroup> itemMetaListGroup = [];
   String activeName = '';
+  List<MeasureModeDTO> measureMode = [];
 
-  /// 打开已选测量工具设置
-  ///
-  /// [name] 测量的名字 后期改版后应该是一个测量对象
-  void openHasSelectedSettingDialog(String name) {
-    // state.childItemMeta = state.allItemMeta.firstWhere(
-    //   (element) => element.name == name,
-    // );
-    // router.dialog(() => HasSelectedSettingDialog(name: name));
-  }
   Future<void> getName() async {
     List<String> getModes = [];
     for (var element in playerController.currentFrame?.visuals[0].modes ?? []) {
@@ -116,7 +110,8 @@ class MeasureConfigurationPageState extends State<MeasureConfigurationPage> {
 
   void submit() async {
     /// 判断两个数组是否相同
-    if (savedMeasureList.toString() != chooseMeasureList.toString()) {
+    if (savedMeasureList.toString() != chooseMeasureList.toString() ||
+        measureData.itemMetaListConfig.isNotEmpty) {
       var measureModeSubmitChanged = MeasureModeSubmit(
         measureData.measureApplicationVersion,
         application.applicationName,
@@ -130,6 +125,7 @@ class MeasureConfigurationPageState extends State<MeasureConfigurationPage> {
                 UserDefinedMeasureFolderDTO(
                   name: 'General',
                   workingItemNames: chooseMeasureList,
+                  itemMetas: measureData.itemMetaListConfig,
                 ),
               ],
             ),
@@ -165,10 +161,20 @@ class MeasureConfigurationPageState extends State<MeasureConfigurationPage> {
       measureToolsTab = 2;
     }
     measureMetaController.measureConfig();
+
     itemMetaListGroup = measureData.itemMetaListGroup;
     chooseMeasure = measureData.getMeasureApplicationList
         .where((element) => !MeasureUnsupportedTerms.items.contains(element))
         .toList();
+
+    // 将原始列表转换为JSON字符串
+    String jsonString = jsonEncode(measureData.availableModes);
+
+    // 将JSON字符串转换回对象列表
+    List<dynamic> jsonList = jsonDecode(jsonString);
+    measureMode =
+        jsonList.map((json) => MeasureModeDTO.fromJson(json)).toList();
+
     savedMeasureList = chooseMeasure.toSet().toList();
     chooseMeasureList = chooseMeasure.toSet().toList();
   }
@@ -197,6 +203,8 @@ class MeasureConfigurationPageState extends State<MeasureConfigurationPage> {
       },
       onCancel: () {
         chooseMeasureList = measureData.getMeasureApplicationList;
+        measureData.availableModes = measureMode;
+        measureMetaController.setMeasureConfigItemMetaList();
         Get.back();
         setState(() {});
       },
@@ -345,12 +353,22 @@ class _HasSelectedModulePage extends StatelessWidget implements FWidget {
   /// 数据
   final measureData = Get.find<MeasureDataController>();
 
+  /// 测量项控制器
+  final measureMetaController = Get.find<MeasureMetaController>();
+
   /// 测量语言包
   final measureLanguage = MeasureLanguage();
   _HasSelectedModulePage({
     required this.chooseMeasureList,
   });
 
+  /// 打开已选测量工具设置
+  ///
+  /// [itemMeta] 测量的对象
+  void openHasSelectedSettingDialog(ItemMetaDTO itemMeta) {
+    Get.dialog(HasSelectedSettingDialog(itemMeta: itemMeta));
+  }
+
   @override
   FWidget build(BuildContext context) {
     return FListView(
@@ -370,37 +388,47 @@ class _HasSelectedModulePage extends StatelessWidget implements FWidget {
                 children: List<FWidget>.generate(
                   chooseMeasureList.length,
                   (index) {
-                    return FContainer(
-                      width: 180,
-                      height: 60,
-                      decoration: BoxDecoration(
-                        border: Border.all(
-                          width: 0.5,
-                          color: FTheme.ins.colorScheme.primary,
+                    return FInkWell(
+                      onTap: () {
+                        var item = measureMetaController
+                            .setMeasureConfigItemMetaList()
+                            .firstWhere((element) =>
+                                element.description ==
+                                chooseMeasureList[index]);
+                        openHasSelectedSettingDialog(item);
+                      },
+                      child: FContainer(
+                        width: 180,
+                        height: 60,
+                        decoration: BoxDecoration(
+                          border: Border.all(
+                            width: 0.5,
+                            color: FTheme.ins.colorScheme.primary,
+                          ),
                         ),
-                      ),
-                      child: FColumn(
-                        mainAxisAlignment: MainAxisAlignment.center,
-                        children: [
-                          if (i18nBook.isCurrentChinese)
-                            FText(
-                              measureLanguage.t(
-                                'measure',
-                                chooseMeasureList[index].toString(),
+                        child: FColumn(
+                          mainAxisAlignment: MainAxisAlignment.center,
+                          children: [
+                            if (i18nBook.isCurrentChinese)
+                              FText(
+                                measureLanguage.t(
+                                  'measure',
+                                  chooseMeasureList[index].toString(),
+                                ),
+                                style: const TextStyle(
+                                  color: Colors.black,
+                                ),
                               ),
+                            FText(
+                              chooseMeasureList[index].toString(),
                               style: const TextStyle(
                                 color: Colors.black,
                               ),
                             ),
-                          FText(
-                            chooseMeasureList[index].toString(),
-                            style: const TextStyle(
-                              color: Colors.black,
-                            ),
-                          ),
-                        ],
+                          ],
+                        ),
+                        // ),
                       ),
-                      // ),
                     );
                   },
                 ),

+ 335 - 219
lib/view/measure/measure_config/widgets/has_selected_setting_dialog.dart

@@ -1,6 +1,8 @@
 import 'package:fis_i18n/i18n.dart';
 import 'package:fis_jsonrpc/rpc.dart';
 import 'package:fis_measure/interfaces/process/items/terms.dart';
+import 'package:fis_measure/process/language/measure_language.dart';
+import 'package:fis_measure/process/workspace/measure_data_controller.dart';
 import 'package:fis_theme/theme.dart';
 import 'package:fis_ui/index.dart';
 import 'package:fis_ui/interface/interactive_container.dart';
@@ -11,11 +13,14 @@ import 'package:get/get.dart';
 ///选中设置对话框
 class HasSelectedSettingDialog extends FStatelessWidget
     implements FInteractiveContainer {
-  const HasSelectedSettingDialog({
+  HasSelectedSettingDialog({
     Key? key,
-    required this.name,
+    required this.itemMeta,
   }) : super(key: key);
-  final String name;
+  final ItemMetaDTO itemMeta;
+
+  final measureData = Get.find<MeasureDataController>();
+
   @override
   final String pageName = 'HasSelectedSettingDialog';
   @override
@@ -28,7 +33,18 @@ class HasSelectedSettingDialog extends FStatelessWidget
           fontSize: 18,
         ),
       ),
-      isDefault: true,
+      isDefault: false,
+      bottomButton: FContainer(
+        padding: EdgeInsets.symmetric(vertical: 10),
+        child: FRow(
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: [
+            _buildCommonButton('返回', () {
+              Get.back();
+            }),
+          ],
+        ),
+      ),
       onOk: () {
         Get.back();
       },
@@ -38,19 +54,41 @@ class HasSelectedSettingDialog extends FStatelessWidget
         Get.back();
       },
       children: [
-        _DialogPage(parent: this, name: name),
+        Container(
+          width: 830,
+          height: 500,
+          child: _DialogPage(parent: this, itemMeta: itemMeta),
+        ),
       ],
     );
   }
+
+  FWidget _buildCommonButton(String buttonName, VoidCallback onPressed) {
+    return FElevatedButton(
+      child: FText(buttonName),
+      onPressed: () {
+        onPressed.call();
+      },
+      businessParent: this,
+      name: buttonName,
+      style: ElevatedButton.styleFrom(
+        elevation: 0,
+        padding: EdgeInsets.symmetric(
+          vertical: 15,
+          horizontal: 25,
+        ),
+      ),
+    );
+  }
 }
 
 ///对话框界面
-class _DialogPage extends StatelessWidget {
+class _DialogPage extends StatefulWidget {
   ///父级节点
   final FInteractiveContainer parent;
-  const _DialogPage({
+  _DialogPage({
     required this.parent,
-    required this.name,
+    required this.itemMeta,
   });
   static BoxDecoration createBorder() {
     const border = BoxDecoration(
@@ -64,245 +102,323 @@ class _DialogPage extends StatelessWidget {
     return border;
   }
 
-  final String name;
-  // final controller = Get.put(MeasureConfigurationController());
+  final ItemMetaDTO itemMeta;
 
+  @override
+  State<_DialogPage> createState() => _DialogPageState();
+}
+
+class _DialogPageState extends State<_DialogPage> {
+  /// 测量语言包
+  final measureLanguage = MeasureLanguage();
+  final measureData = Get.find<MeasureDataController>();
+
+  /// 左侧tab列表
+  late List<ChildItemMetaDTO> selectChildItemMeta =
+      widget.itemMeta.multiMethodItems ?? [];
+
+  /// 测量方式
+  late List<ChildItemMetaDTO> multiMethodItems =
+      widget.itemMeta.multiMethodItems ?? [];
+
+  late List<OutputItemMetaDTO> availableOutputs =
+      widget.itemMeta.calculator?.availableOutputs ?? [];
+
+  late int selectedTabIndex = -1;
+
+  @override
+  void initState() {
+    super.initState();
+    setTabList();
+  }
+
+  @override
+  void dispose() {
+    measureData.itemMetaListConfig.add(widget.itemMeta);
+
+    super.dispose();
+  }
+
+  void setTabList() {
+    List<ChildItemMetaDTO> tabList = [];
+    List<ChildItemMetaDTO> childTabList = [];
+
+    /// 最下面的子集
+    List<ChildItemMetaDTO> selectChildItem = [];
+    tabList = (widget.itemMeta.multiMethodItems ?? [])
+            .firstWhereOrNull((element) => element.isWorking)
+            ?.childItems ??
+        [];
+
+    tabList.forEach((element) {
+      childTabList.add(element);
+      selectChildItem = element.childItems ?? [];
+      childTabList.addAll(selectChildItem
+              .firstWhereOrNull((element) =>
+                  element.isWorking && element.childItems?.length != 0)
+              ?.childItems ??
+          []);
+    });
+    selectChildItemMeta = childTabList;
+    setState(() {});
+  }
+
+  // final controller = Get.put(MeasureConfigurationController());
   @override
   FWidget build(BuildContext context) {
+    return FRow(
+      children: [
+        _buildLeftMeasureMethod(),
+        FExpanded(child: _buildRightMeasurementResultAndUnit()),
+      ],
+    );
+  }
+
+  /// 左侧测量方法
+  FWidget _buildLeftMeasureMethod() {
     return FContainer(
-      width: 700,
-      height: 500,
-      padding: const EdgeInsets.symmetric(horizontal: 15),
-      child: FListView(
-        shrinkWrap: true,
+      width: 150,
+      decoration: BoxDecoration(
+        border: Border(
+          left: BorderSide(
+            color: FTheme.ins.colorScheme.line,
+          ),
+        ),
+        color: Colors.grey[300],
+      ),
+      child: FColumn(
         children: [
-          FColumn(
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: [
-              FContainer(
-                child: FText(i18nBook.measure.currentMeasureTool.t),
-                margin: const EdgeInsets.symmetric(vertical: 10),
-              ),
-              FContainer(
-                margin: const EdgeInsets.only(left: 15),
-                child: FElevatedButton(
-                  name: name,
-                  businessParent: parent,
-                  onPressed: () {},
-                  style: ButtonStyle(
-                    backgroundColor: MaterialStateProperty.all(
-                      FTheme.ins.colorScheme.primary,
-                    ),
+          FContainer(
+            width: double.infinity,
+            color: selectedTabIndex == -1
+                ? FTheme.ins.colorScheme.primary
+                : Colors.white,
+            height: 60,
+            child: FInkWell(
+              child: FCenter(
+                child: FText(
+                  widget.itemMeta.description ?? '',
+                  style: TextStyle(
+                    color: selectedTabIndex == -1 ? Colors.white : Colors.black,
                   ),
-                  child: _buildMeasureName(name),
                 ),
               ),
-              const FSizedBox(
-                height: 15,
-              ),
-              FContainer(
-                decoration: _DialogPage.createBorder(),
-              ),
-              // controller.state.childItemMeta.multiMethodItems!.length
-              if (2 != 0) ...[
-                FContainer(
-                  child: FText(i18nBook.measure.SelectMeasureMethod.t),
-                  margin: const EdgeInsets.symmetric(vertical: 10),
-                ),
-                _HasSelectedModule(),
-                const FSizedBox(
-                  height: 15,
-                ),
-                FContainer(
-                  decoration: _DialogPage.createBorder(),
-                ),
-                FContainer(
-                  child: FText(i18nBook.measure.SelectCalculateResultAndUnit.t),
-                  margin: const EdgeInsets.symmetric(vertical: 10),
-                ),
-                FContainer(
-                  margin: const EdgeInsets.only(left: 15),
-                  child: FColumn(
-                    crossAxisAlignment: CrossAxisAlignment.start,
-                    children: [
-                      // FObx(() {
-                      //   return
-                      FContainer(
-                        padding: const EdgeInsets.only(
-                            left: 15, top: 15, bottom: 15),
-                        child: FWrap(
-                          spacing: 16.0, // 主轴(水平)方向间距
-                          runSpacing: 8.0, // 纵轴(垂直)方向间距
-                          direction: Axis.horizontal,
-                          crossAlignment: WrapCrossAlignment.center,
-                          alignment: WrapAlignment.start,
-                          children: List<FWidget>.generate(
-                            // controller.state.childItemMetaCalculator.length,
-                            10,
-                            (index) {
-                              return FElevatedButton(
-                                businessParent: parent,
-                                name: "buildMeasureName",
-                                onPressed: () {},
-                                style: ButtonStyle(
-                                  backgroundColor: MaterialStateProperty.all(
-                                    index == 0
-                                        ? FTheme.ins.colorScheme.primary
-                                        : Colors.white,
-                                  ),
-                                ),
-                                child: _buildMeasureName(
-                                    // controller.state
-                                    //     .childItemMetaCalculator[index].name,
-                                    ''),
-                              );
-                            },
-                          ),
-                        ),
-                        //   );
-                        // },
-                      )
-                    ],
-                  ),
-                ),
-                const FSizedBox(
-                  height: 15,
-                ),
-                FContainer(
-                  decoration: _DialogPage.createBorder(),
+              onTap: () {
+                selectedTabIndex = -1;
+                // availableOutputs =
+                multiMethodItems = widget.itemMeta.multiMethodItems ?? [];
+                availableOutputs =
+                    widget.itemMeta.calculator?.availableOutputs ?? [];
+                setState(() {});
+              },
+            ),
+          ),
+          FColumn(
+            children: selectChildItemMeta.map((e) {
+              int index = selectChildItemMeta.indexOf(e);
+              return FContainer(
+                width: double.infinity,
+                height: 60,
+                color: selectedTabIndex == index
+                    ? FTheme.ins.colorScheme.primary
+                    : Colors.white,
+                child: FInkWell(
+                  child: FCenter(
+                      child: FText(e.description ?? e.name ?? '',
+                          style: TextStyle(
+                            color: selectedTabIndex == index
+                                ? Colors.white
+                                : Colors.black,
+                          ))),
+                  onTap: () {
+                    selectedTabIndex = index;
+                    multiMethodItems = e.childItems ?? [];
+                    availableOutputs = e.calculator?.availableOutputs ?? [];
+                    setState(() {});
+                  },
                 ),
-              ],
-            ],
-          )
+              );
+            }).toList(),
+          ),
         ],
       ),
     );
   }
 
-  /// 测量名字
-  ///
-  /// [name] 测量名
-  FWidget _buildMeasureName(name) {
-    return FContainer(
-      width: 180,
-      height: 60,
-      child: FColumn(
-        mainAxisAlignment: MainAxisAlignment.center,
-        children: [
-          FText(
-            name,
-            style: const TextStyle(
-              color: Colors.white,
-            ),
+  /// 计算结果和单位
+  FWidget _buildRightMeasurementResultAndUnit() {
+    return FColumn(
+      mainAxisSize: MainAxisSize.max,
+      mainAxisAlignment: MainAxisAlignment.start,
+      children: [
+        if (multiMethodItems != null && multiMethodItems.isNotEmpty)
+          _buildMeasureResult(),
+        if (availableOutputs.length != 0) _buildMeasureUnit(),
+      ],
+    );
+  }
+
+  FWidget _buildTitleContainer(String title, FWidget wrapList) {
+    return FColumn(
+      crossAxisAlignment: CrossAxisAlignment.start,
+      children: [
+        FContainer(
+          margin: EdgeInsets.all(15),
+          child: FText(title),
+        ),
+        FContainer(
+          padding: const EdgeInsets.only(
+            left: 35,
+            right: 25,
+            top: 25,
+            bottom: 25,
           ),
-          FText(
-            name,
-            style: const TextStyle(
-              color: Colors.white,
-            ),
+          margin: EdgeInsets.symmetric(
+            horizontal: 15,
           ),
-        ],
-      ),
+          width: double.infinity,
+          decoration: BoxDecoration(
+            border: Border.all(color: FTheme.ins.colorScheme.line),
+            borderRadius: BorderRadius.circular(8),
+          ),
+          child: wrapList,
+        ),
+      ],
     );
   }
-}
 
-class _HasSelectedModule extends FStatefulWidget {
-  @override
-  FState<_HasSelectedModule> createState() => _HasSelectedModuleState();
-}
+  FWidget _buildMeasureResult() {
+    return _buildTitleContainer(
+      '选择测量方法',
+      _buildResultWrapList(multiMethodItems),
+    );
+  }
 
-class _HasSelectedModuleState extends FState<_HasSelectedModule> {
-  /// 测量的控制器
-  // final controller = Get.put(MeasureConfigurationController());
+  FWidget _buildMeasureUnit() {
+    return _buildTitleContainer(
+      '选择计算结果和单位',
+      _buildUnitWrapList(availableOutputs),
+    );
+  }
 
-  /// 选中的方法
-  late String selectedMeasureFun = '';
-  List<ChildItemMetaDTO> multiMethodItems = [];
+  /// 这边是测量结果
+  FWidget _buildResultWrapList(List<ChildItemMetaDTO> list) {
+    return FWrap(
+      spacing: 20.0, // 主轴(水平)方向间距
+      runSpacing: 10.0, // 纵轴(垂直)方向间距
+      direction: Axis.horizontal,
+      crossAlignment: WrapCrossAlignment.center,
+      alignment: WrapAlignment.start,
+      children: list
+          .map(
+            (e) => _buildResultItem(e.description ?? e.name ?? '', e),
+          )
+          .toList(),
+    );
+  }
 
-  @override
-  void initState() {
-    super.initState();
-    // multiMethodItems = controller.state.childItemMeta.multiMethodItems!;
-    selectedMeasureFun = multiMethodItems
-        .firstWhere((element) =>
-            element.isWorking == true &&
-            !MeasureUnsupportedTerms.items.contains(element.name))
-        .name!;
+  /// 这边是测量单位
+  FWidget _buildUnitWrapList(List<OutputItemMetaDTO> list) {
+    return FWrap(
+      spacing: 20.0, // 主轴(水平)方向间距
+      runSpacing: 10.0, // 纵轴(垂直)方向间距
+      direction: Axis.horizontal,
+      crossAlignment: WrapCrossAlignment.center,
+      alignment: WrapAlignment.start,
+      children: list.map((e) {
+        int _index = list.indexOf(e);
+        bool _isCanClick = true;
+        if (_index == 0) {
+          _isCanClick = false;
+        }
+        return _buildUnitItem(e.description ?? e.name ?? '', e, _isCanClick);
+      }).toList(),
+    );
+  }
 
-    // controller.state.childItemMetaCalculator = multiMethodItems
-    //     .firstWhere((element) => element.isWorking == true)
-    //     .calculator!
-    //     .availableOutputs!;
+  FWidget _buildResultItem(String name, ChildItemMetaDTO childItemMeta) {
+    return FGestureDetector(
+      name: name,
+      businessParent: widget.parent,
+      onTap: () {
+        if (!childItemMeta.isWorking) {
+          multiMethodItems.forEach((element) {
+            element.isWorking = false;
+          });
+          childItemMeta.isWorking = true;
+          setTabList();
+        }
+        setState(() {});
+      },
+      child: FContainer(
+        width: 180,
+        height: 65,
+        decoration: BoxDecoration(
+          color: childItemMeta.isWorking
+              ? FTheme.ins.colorScheme.primary
+              : Colors.white,
+          border: Border.all(
+            color: FTheme.ins.colorScheme.line,
+          ),
+        ),
+        child: FCenter(
+          child: FColumn(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              FText(
+                name,
+                style: TextStyle(
+                  color: childItemMeta.isWorking ? Colors.white : Colors.black,
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
   }
 
-  @override
-  FWidget build(BuildContext context) {
-    return FListView(
-      shrinkWrap: true,
-      children: [
-        FColumn(
-          crossAxisAlignment: CrossAxisAlignment.start,
-          children: [
-            FContainer(
-              padding: const EdgeInsets.only(left: 15, top: 15, bottom: 15),
-              child: FWrap(
-                spacing: 16.0, // 主轴(水平)方向间距
-                runSpacing: 8.0, // 纵轴(垂直)方向间距
-                direction: Axis.horizontal,
-                crossAlignment: WrapCrossAlignment.center,
-                alignment: WrapAlignment.start,
-                children: List<FWidget>.generate(
-                  multiMethodItems.length,
-                  (index) {
-                    return
-                        // FElevatedButton(
-                        //   onPressed: () {
-                        //     setState(() {
-                        //       // controller.state.childItemMetaCalculator =
-                        //       //     multiMethodItems[index]
-                        //       //         .calculator!
-                        //       //         .availableOutputs!;
-                        //       selectedMeasureFun = multiMethodItems[index].name!;
-                        //     });
-                        //   },
-                        //   style: ButtonStyle(
-                        //     backgroundColor: MaterialStateProperty.all(
-                        //       multiMethodItems[index].name == selectedMeasureFun
-                        //           ? FTheme.ins.colorScheme.primary
-                        //           : Colors.white,
-                        //     ),
-                        //   ),
-                        //   child:
-                        FContainer(
-                      width: 180,
-                      height: 60,
-                      decoration: BoxDecoration(
-                        border: Border.all(
-                          width: 0.5,
-                          color: FTheme.ins.colorScheme.primary,
-                        ),
-                      ),
-                      child: FCenter(
-                        child: FText(
-                          multiMethodItems[index].name!,
-                          style: TextStyle(
-                            color: multiMethodItems[index].name ==
-                                    selectedMeasureFun
-                                ? Colors.white
-                                : Colors.black,
-                          ),
-                        ),
-                      ),
-                      // ),
-                    );
-                  },
+  FWidget _buildUnitItem(
+      String name, OutputItemMetaDTO outputItemMeta, bool isCanClick) {
+    return FGestureDetector(
+      name: name,
+      businessParent: widget.parent,
+      onTap: () {
+        if (isCanClick) {
+          if (outputItemMeta.isWorking == null) {
+            outputItemMeta.isWorking = false;
+          }
+          outputItemMeta.isWorking = !outputItemMeta.isWorking!;
+          setState(() {});
+        }
+      },
+      child: FContainer(
+        width: 180,
+        height: 65,
+        decoration: BoxDecoration(
+          color: outputItemMeta.isWorking ?? false
+              ? FTheme.ins.colorScheme.primary
+              : Colors.white,
+          border: Border.all(
+            color: FTheme.ins.colorScheme.line,
+          ),
+        ),
+        child: FCenter(
+          child: FColumn(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              FText(
+                name,
+                style: TextStyle(
+                  color: outputItemMeta.isWorking ?? false
+                      ? Colors.white
+                      : Colors.black,
                 ),
               ),
-            ),
-          ],
+            ],
+          ),
         ),
-      ],
+      ),
     );
   }
 }

+ 17 - 0
lib/view/measure/measure_view_controller.dart

@@ -91,6 +91,23 @@ class MeasureMetaController extends GetxController {
     }
   }
 
+  List<ItemMetaDTO> setMeasureConfigItemMetaList() {
+    List<ItemMetaDTO> _measureConfigItemMetaList = [];
+    var groups = measureData.availableModes
+        .firstWhereOrNull(
+            (element) => element.modeName == measureData.currentMode)
+        ?.availableGroups;
+    (groups![0].availableFolders![0].availableItems)?.toList().forEach(
+      (e) {
+        if (!MeasureUnsupportedTerms.items.contains(e.name)) {
+          _measureConfigItemMetaList.add(e);
+        }
+      },
+    );
+
+    return _measureConfigItemMetaList;
+  }
+
   /// 测量项配置组
   void measureConfig() {
     List<ItemMetaGroup> _itemMetaConfigurationList = [];

+ 1 - 1
pubspec.yaml

@@ -100,7 +100,7 @@ dependency_overrides:
   fis_jsonrpc:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_jsonrpc.git
-      ref: 9fe5e10
+      ref: 68177f3
   fis_lib_business_components:
     git:
       url: http://git.ius.plus/Project-Wing/fis_lib_business_components.git