|
@@ -1,9 +1,11 @@
|
|
|
// ignore: must_be_immutable
|
|
|
-import 'dart:convert';
|
|
|
|
|
|
+import 'package:fis_jsonrpc/rpc.dart';
|
|
|
+import 'package:fis_measure/process/language/measure_language.dart';
|
|
|
import 'package:fis_measure/process/workspace/measure_data_controller.dart';
|
|
|
import 'package:fis_measure/view/measure/measure_config/measure_configuation_page.dart';
|
|
|
import 'package:fis_ui/index.dart';
|
|
|
+import 'package:fis_theme/theme.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
@@ -28,7 +30,7 @@ class _SelectModulePageState extends FState<SelectModulePage> {
|
|
|
///
|
|
|
/// [code] 翻译编码
|
|
|
String getValues(String code) {
|
|
|
- final value = jsonDecode(measureData.measureLanguage)["Language"][code];
|
|
|
+ final value = MeasureLanguage().languageValue(code);
|
|
|
return value ?? code;
|
|
|
}
|
|
|
|
|
@@ -69,18 +71,6 @@ class _SelectModulePageState extends FState<SelectModulePage> {
|
|
|
)
|
|
|
.toList(),
|
|
|
);
|
|
|
-
|
|
|
- FListView(
|
|
|
- // shrinkWrap: true,
|
|
|
- children: widget.itemMetaListGroup
|
|
|
- .map(
|
|
|
- (e) => FColumn(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: _buildMeasureConfiguration(e),
|
|
|
- ),
|
|
|
- )
|
|
|
- .toList(),
|
|
|
- );
|
|
|
}
|
|
|
|
|
|
List<FWidget> _buildMeasureConfiguration(ItemMetaGroup e) {
|
|
@@ -132,6 +122,97 @@ class _SelectModulePageState extends FState<SelectModulePage> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ // FContainer(
|
|
|
+ // onPressed: () {
|
|
|
+ // removeChooseMeasure(
|
|
|
+ // e.name ?? '',
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // style: const ButtonStyle(),
|
|
|
+ // child:
|
|
|
+
|
|
|
+ /// 选中的测量项
|
|
|
+ FWidget _buildSlected(ItemMetaDTO e) {
|
|
|
+ return FGestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ removeChooseMeasure(
|
|
|
+ e.name ?? '',
|
|
|
+ );
|
|
|
+ },
|
|
|
+ child: FContainer(
|
|
|
+ width: 180,
|
|
|
+ height: 65,
|
|
|
+ color: FTheme.ins.colorScheme.primary,
|
|
|
+ child: FCenter(
|
|
|
+ child: FColumn(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ FText(
|
|
|
+ getValues(
|
|
|
+ e.name ?? '',
|
|
|
+ ),
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ FText(
|
|
|
+ e.name ?? '',
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ // ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 未选中的测量项
|
|
|
+ FWidget _buildNoSlected(ItemMetaDTO e) {
|
|
|
+ return FGestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ addChooseMeasure(
|
|
|
+ e.name ?? '',
|
|
|
+ );
|
|
|
+ },
|
|
|
+ child: FContainer(
|
|
|
+ width: 180,
|
|
|
+ height: 60,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(
|
|
|
+ width: 0.5,
|
|
|
+ color: FTheme.ins.colorScheme.primary,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: FCenter(
|
|
|
+ child: FColumn(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ FText(
|
|
|
+ getValues(
|
|
|
+ e.name ?? '',
|
|
|
+ ),
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.black,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ FText(
|
|
|
+ e.name ?? '',
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.black,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
FWidget _buildGroupBody(ItemMetaGroup e) {
|
|
|
return FContainer(
|
|
|
padding: const EdgeInsets.only(left: 15),
|
|
@@ -142,83 +223,42 @@ class _SelectModulePageState extends FState<SelectModulePage> {
|
|
|
direction: Axis.horizontal,
|
|
|
crossAlignment: WrapCrossAlignment.center,
|
|
|
alignment: WrapAlignment.start,
|
|
|
- children: e.itemMeta
|
|
|
- .map(
|
|
|
- (e) => widget.chooseMeasureList.contains(
|
|
|
- e.name,
|
|
|
- )
|
|
|
- ? FElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- removeChooseMeasure(
|
|
|
- e.name ?? '',
|
|
|
- );
|
|
|
- },
|
|
|
- style: const ButtonStyle(),
|
|
|
- child: FContainer(
|
|
|
- width: 180,
|
|
|
- height: 60,
|
|
|
- child: FCenter(
|
|
|
- child: FColumn(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- FText(
|
|
|
- getValues(
|
|
|
- e.name ?? '',
|
|
|
- ),
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- ),
|
|
|
- FText(
|
|
|
- e.name ?? '',
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- : FElevatedButton(
|
|
|
- onPressed: () {
|
|
|
- addChooseMeasure(
|
|
|
- e.name ?? '',
|
|
|
- );
|
|
|
- },
|
|
|
- style: ButtonStyle(
|
|
|
- backgroundColor: MaterialStateProperty.all(
|
|
|
- Colors.white,
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: FContainer(
|
|
|
- width: 180,
|
|
|
- height: 60,
|
|
|
- child: FCenter(
|
|
|
- child: FColumn(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- FText(
|
|
|
- getValues(
|
|
|
- e.name ?? '',
|
|
|
- ),
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.black,
|
|
|
- ),
|
|
|
- ),
|
|
|
- FText(
|
|
|
- e.name ?? '',
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.black,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- .toList()
|
|
|
+ children: e.itemMeta.map((e) {
|
|
|
+ if (widget.chooseMeasureList.contains(
|
|
|
+ e.name,
|
|
|
+ )) {
|
|
|
+ return _buildSlected(e);
|
|
|
+ } else {
|
|
|
+ return _buildNoSlected(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // ?
|
|
|
+ // : FContainer(
|
|
|
+ // width: 180,
|
|
|
+ // height: 60,
|
|
|
+ // child: FCenter(
|
|
|
+ // child: FColumn(
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ // children: [
|
|
|
+ // FText(
|
|
|
+ // getValues(
|
|
|
+ // e.name ?? '',
|
|
|
+ // ),
|
|
|
+ // style: const TextStyle(
|
|
|
+ // color: Colors.black,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // FText(
|
|
|
+ // e.name ?? '',
|
|
|
+ // style: const TextStyle(
|
|
|
+ // color: Colors.black,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ ).toList()
|
|
|
|
|
|
// List<FWidget>.generate(
|
|
|
// e.itemMeta.length,
|