|
@@ -246,12 +246,22 @@ class _DialogPageState extends State<_DialogPage> {
|
|
|
if (multiMethodItems.isNotEmpty) {
|
|
|
/// 判断是否是组合测量项
|
|
|
if (isMultiMethodItems) {
|
|
|
- availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
- .childItems
|
|
|
- ?.firstWhere((element) => element.isWorking)
|
|
|
- .calculator
|
|
|
- ?.availableOutputs ??
|
|
|
- [];
|
|
|
+ List<ChildItemMetaDTO>? childItems =
|
|
|
+ methodChildItems[selectedTabIndex].childItems;
|
|
|
+ if (childItems?.length != 0 && childItems != null) {
|
|
|
+ availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
+ .childItems
|
|
|
+ ?.firstWhereOrNull(
|
|
|
+ (element) => element.isWorking)
|
|
|
+ ?.calculator
|
|
|
+ ?.availableOutputs ??
|
|
|
+ [];
|
|
|
+ } else {
|
|
|
+ availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
+ .calculator
|
|
|
+ ?.availableOutputs ??
|
|
|
+ [];
|
|
|
+ }
|
|
|
} else {
|
|
|
/// 当前选中方法名字
|
|
|
if (currentMeasureFName == "") {
|
|
@@ -273,12 +283,23 @@ class _DialogPageState extends State<_DialogPage> {
|
|
|
|
|
|
multiMethodItems = e.childItems ?? [];
|
|
|
} else if (methodChildItems.isNotEmpty) {
|
|
|
- availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
- .childItems
|
|
|
- ?.firstWhere((element) => element.isWorking)
|
|
|
- .calculator
|
|
|
- ?.availableOutputs ??
|
|
|
- [];
|
|
|
+ List<ChildItemMetaDTO>? childItems =
|
|
|
+ methodChildItems[selectedTabIndex].childItems;
|
|
|
+ if (childItems?.length != 0 && childItems != null) {
|
|
|
+ availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
+ .childItems
|
|
|
+ ?.firstWhereOrNull(
|
|
|
+ (element) => element.isWorking)
|
|
|
+ ?.calculator
|
|
|
+ ?.availableOutputs ??
|
|
|
+ [];
|
|
|
+ } else {
|
|
|
+ availableOutputs = methodChildItems[selectedTabIndex]
|
|
|
+ .calculator
|
|
|
+ ?.availableOutputs ??
|
|
|
+ [];
|
|
|
+ }
|
|
|
+
|
|
|
multiMethodItems =
|
|
|
methodChildItems[selectedTabIndex].childItems ?? [];
|
|
|
} else {
|