Browse Source

1、fixed:0016749: 【12导心电】提交12导心电的检测,12导分析结果显示{"advice":..."}

guanxinyi 1 year ago
parent
commit
1f2b1e5f1d
2 changed files with 86 additions and 0 deletions
  1. 43 0
      lib/components/dialog_table.dart
  2. 43 0
      lib/pages/patient/detail/widgets/last_record.dart

+ 43 - 0
lib/components/dialog_table.dart

@@ -3,7 +3,9 @@ import 'dart:convert';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:get/get.dart';
+import 'package:vnote_device_plugin/models/exams/twelve_heart.dart';
 
+import '../pages/medical/widgets/twelve_ecg_view/widgets/conclusion_dialog.dart';
 import 'alert_dialog.dart';
 
 class VDialogTable extends StatelessWidget {
@@ -112,6 +114,9 @@ class VDialogTable extends StatelessWidget {
               if (tableData[i][1] == '十二导心电图') {
                 return _buildImageDataCell(cellData);
               }
+              if (tableData[i][1] == '十二导分析结果') {
+                return _buildEcg12DataCell(cellData);
+              }
               return _buildDataCell(cellData);
             },
           ).toList(),
@@ -195,6 +200,44 @@ class VDialogTable extends StatelessWidget {
       ),
     );
   }
+
+  /// 12导心电的结果
+  TableCell _buildEcg12DataCell(String value) {
+    if (value.contains("advice")) {
+      return TableCell(
+        child: InkWell(
+          onTap: () async {
+            TwelveHeartResultEntity resultConclusion =
+                TwelveHeartResultEntity.fromJson(jsonDecode(value));
+            await ConclusionDialog.show(twelveHeartResult: resultConclusion);
+          },
+          child: Container(
+            padding: const EdgeInsets.symmetric(horizontal: 14),
+            alignment: Alignment.centerLeft,
+            height: 57,
+            child: const Text(
+              "点击查看当前结果",
+              style: TextStyle(
+                color: Colors.blue,
+              ),
+            ),
+          ),
+        ),
+      );
+    }
+
+    return TableCell(
+      child: Container(
+        padding: const EdgeInsets.symmetric(horizontal: 14),
+        alignment: Alignment.centerLeft,
+        height: 57,
+        child: Text(
+          value,
+          style: const TextStyle(fontSize: 14),
+        ),
+      ),
+    );
+  }
 }
 
 class ImagePreviewDialog extends StatelessWidget {

+ 43 - 0
lib/pages/patient/detail/widgets/last_record.dart

@@ -4,6 +4,8 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:get/get.dart';
 import 'package:vitalapp/components/dialog_table.dart';
+import 'package:vitalapp/pages/medical/widgets/twelve_ecg_view/widgets/conclusion_dialog.dart';
+import 'package:vnote_device_plugin/models/exams/twelve_heart.dart';
 
 class LastRecordTable extends StatelessWidget {
   final bool? isExistLocalData;
@@ -93,6 +95,9 @@ class LastRecordTable extends StatelessWidget {
               if (tableData[i][0] == '十二导心电图') {
                 return _buildImageDataCell(cellData);
               }
+              if (tableData[i][0] == '十二导分析结果') {
+                return _buildEcg12DataCell(cellData);
+              }
 
               return _buildDataCell(cellData);
             },
@@ -117,6 +122,44 @@ class LastRecordTable extends StatelessWidget {
     );
   }
 
+  /// 12导心电的结果
+  TableCell _buildEcg12DataCell(String value) {
+    if (value.contains("advice")) {
+      return TableCell(
+        child: InkWell(
+          onTap: () async {
+            TwelveHeartResultEntity resultConclusion =
+                TwelveHeartResultEntity.fromJson(jsonDecode(value));
+            await ConclusionDialog.show(twelveHeartResult: resultConclusion);
+          },
+          child: Container(
+            padding: const EdgeInsets.symmetric(horizontal: 14),
+            alignment: Alignment.centerLeft,
+            height: 57,
+            child: const Text(
+              "点击查看当前结果",
+              style: TextStyle(
+                color: Colors.blue,
+              ),
+            ),
+          ),
+        ),
+      );
+    }
+
+    return TableCell(
+      child: Container(
+        padding: const EdgeInsets.symmetric(horizontal: 14),
+        alignment: Alignment.centerLeft,
+        height: 57,
+        child: Text(
+          value,
+          style: const TextStyle(fontSize: 14),
+        ),
+      ),
+    );
+  }
+
   TableCell _buildDataCell(String title) {
     return TableCell(
       child: Container(