Browse Source

修复心电页面不显示名称

loki.wu 1 year ago
parent
commit
8498424c81

+ 8 - 37
lib/pages/medical/views/heart_check_new.dart

@@ -11,6 +11,8 @@ import 'package:vnote_device_plugin/consts/types.dart';
 import 'package:vitalapp/pages/medical/controller.dart';
 import 'package:vitalapp/store/store.dart';
 
+import 'table_input_dialog/widgets/physical_exam_electrocardiogram.dart';
+
 class HeartCheckNew extends GetView<MedicalController> {
   const HeartCheckNew({super.key});
 
@@ -22,49 +24,18 @@ class HeartCheckNew extends GetView<MedicalController> {
         height: double.maxFinite,
         color: Colors.white,
         child: HeartTableCheck(
-          checkDialog: _buildMedical(),
+          checkDialog: PhysicalExamElectrocardiogram(
+            _buildDeviceImage(DeviceTypes.TWELVEHEART),
+            _buildMedicalInput(DeviceTypes.TWELVEHEART),
+            _buildSaveButton()
+          ),
           checkKey: "HEIECG",
         ),
       ),
     );
   }
 
-  Widget _buildMedical() {
-    return Scaffold(
-      appBar: VAppBar(
-        titleText: "体检心电",
-        actions: [
-          if (Get.arguments != null)
-            Container(
-              margin: EdgeInsets.only(right: 16),
-              child: Text(
-                Get.arguments,
-                style: TextStyle(fontSize: 25, color: Colors.white),
-              ),
-            ),
-        ],
-      ),
-      body: Container(
-        color: Colors.white,
-        child: Stack(
-          children: [
-            Row(
-              children: [
-                _buildDeviceImage(DeviceTypes.TWELVEHEART),
-                _buildMedicalInput(DeviceTypes.TWELVEHEART),
-              ],
-            ),
-            Positioned(
-              right: 16,
-              bottom: 16,
-              child: _buildSaveButton(),
-            ),
-          ],
-        ),
-      ),
-    );
-  }
-
+ 
   Widget _buildMedicalInput(String? currentTab) {
     return Expanded(
       flex: currentTab == DeviceTypes.TWELVEHEART ? 18 : 11,

+ 58 - 0
lib/pages/medical/views/table_input_dialog/widgets/physical_exam_electrocardiogram.dart

@@ -0,0 +1,58 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vitalapp/components/appbar.dart';
+import 'package:vnote_device_plugin/consts/types.dart';
+
+class PhysicalExamElectrocardiogram extends StatefulWidget {
+  final Widget deviceImage;
+  final Widget medicalInput;
+  final Widget saveButton;
+
+  PhysicalExamElectrocardiogram(
+      this.deviceImage, this.medicalInput, this.saveButton);
+
+  @override
+  State<StatefulWidget> createState() {
+    return PhysicalExamElectrocardiogramState();
+  }
+}
+
+class PhysicalExamElectrocardiogramState
+    extends State<PhysicalExamElectrocardiogram> {
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: VAppBar(
+        titleText: "体检心电",
+        actions: [
+          if (Get.arguments != null)
+            Container(
+              margin: EdgeInsets.only(right: 16),
+              child: Text(
+                Get.arguments,
+                style: TextStyle(fontSize: 25, color: Colors.white),
+              ),
+            ),
+        ],
+      ),
+      body: Container(
+        color: Colors.white,
+        child: Stack(
+          children: [
+            Row(
+              children: [
+                widget.deviceImage,
+                widget.medicalInput,
+              ],
+            ),
+            Positioned(
+              right: 16,
+              bottom: 16,
+              child: widget.saveButton,
+            ),
+          ],
+        ),
+      ),
+    );
+  }
+}