浏览代码

1、更新定位翻译

guanxinyi 1 年之前
父节点
当前提交
a5ccaed24b
共有 2 个文件被更改,包括 35 次插入6 次删除
  1. 34 5
      lib/view/measure/measure_images_bar.dart
  2. 1 1
      pubspec.yaml

+ 34 - 5
lib/view/measure/measure_images_bar.dart

@@ -319,20 +319,36 @@ class _ScrollableImageListState extends State<ScrollableImageList> {
     return description;
   }
 
+  /// 翻译图片位置的描述
+  String _translateLocationDescription(RemedicalInfoDTO remedicalInfo) {
+    String description = '';
+
+    try {
+      description = _getLocationDescription(
+          remedicalInfo.imageLocation?.quadrant,
+          remedicalInfo.imageLocation?.position);
+    } on Exception catch (e) {
+      logger.e("Picture translation exception" + e.toString());
+    } catch (e) {
+      logger.e("Picture translation exception" + e.toString());
+    }
+    return description;
+  }
+
   /// 获取翻译值
-  String _getLanguageValue(String code) {
-    return measureLanguage.t('application', code);
+  String _getLanguageValue(String type, String code) {
+    return measureLanguage.t(type, code);
   }
 
   String _getDescription(String application, String applicationCategory) {
     String description = '';
     if ([application, applicationCategory].contains('FromSonopost')) {
-      description = _getLanguageValue('FromSonopost');
+      description = _getLanguageValue('application', 'FromSonopost');
     } else {
       if (application.isNotEmpty || applicationCategory.isNotEmpty) {
-        description = _getLanguageValue(applicationCategory) +
+        description = _getLanguageValue('application', applicationCategory) +
             "-" +
-            _getLanguageValue(application);
+            _getLanguageValue('application', application);
       } else {
         description = '';
       }
@@ -340,6 +356,18 @@ class _ScrollableImageListState extends State<ScrollableImageList> {
     return description;
   }
 
+  String _getLocationDescription(String? quadrant, String? position) {
+    String description = '';
+    if (quadrant != '' || quadrant != '') {
+      description = _getLanguageValue('location', quadrant ?? '') +
+          "-" +
+          _getLanguageValue('location', position ?? '');
+    } else {
+      description = '';
+    }
+    return description;
+  }
+
   FWidget _buildImageList(List<RemedicalInfoDTO> remedicalItemList) {
     return FContainer(
       key: widget.globalKey,
@@ -360,6 +388,7 @@ class _ScrollableImageListState extends State<ScrollableImageList> {
             },
             serialNo: index + 1,
             description: _translateDescription(item),
+            locationDescription: _translateLocationDescription(item),
           );
 
           String originalImageUrl = item.terminalImages!.originImageUrl ?? "";

+ 1 - 1
pubspec.yaml

@@ -104,7 +104,7 @@ dependency_overrides:
   fis_lib_business_components:
     git:
       url: http://git.ius.plus/Project-Wing/fis_lib_business_components.git
-      ref: 33166353fb
+      ref: ee4e18a
     # path: ../fis_lib_business_components
 dev_dependencies:
   flutter_test: