Browse Source

fix some bugs

Melon 1 year ago
parent
commit
553fbcc8be
3 changed files with 1 additions and 11 deletions
  1. 0 3
      lib/database/db.dart
  2. 0 5
      lib/pages/patient/list/controller.dart
  3. 1 3
      lib/routes/routes.dart

+ 0 - 3
lib/database/db.dart

@@ -57,9 +57,6 @@ class VitalDatabaseAccessor
     // database.execute("DROP TABLE ${FollowUpEntity().tableName};");
     // database.execute("DROP TABLE ${ExamBatchEntity().tableName};");
     // database.execute("DROP TABLE ${ExamEntity().tableName};");
-    database.execute("DELETE FROM diagnosis WHERE 1=1;");
-    database.execute("DELETE FROM followup WHERE 1=1;");
-    database.execute("DELETE FROM patients WHERE 1=1;");
   }
 
   ///检查本地数据库版本,以判断是否需要升级

+ 0 - 5
lib/pages/patient/list/controller.dart

@@ -37,14 +37,9 @@ class PatientListController extends FControllerBase {
     PatientDTO? patientInfoDto,
     PatientBaseDTO? patientInfo,
   ]) async {
-    if (!Get.isRegistered<MedicalController>()) {
-      Get.lazyPut(() => MedicalController());
-    }
-    final medicalController = Get.find<MedicalController>();
     await _patientDetailController.loadData(code: code);
     // _homeController.updateMenus();
     _homeController.switchNavByName("/patient/detail");
-    await medicalController.initData();
     //这里应该刷新病人诊断数据缓存
     // _medicalController.changePatient.emit(this, code);
   }

+ 1 - 3
lib/routes/routes.dart

@@ -390,9 +390,7 @@ class Routes {
       () => const MedicalPage(),
       binding: BindingsBuilder(
         () {
-          if (!Get.isRegistered<MedicalController>()) {
-            Get.lazyPut(() => MedicalController());
-          }
+          Get.put(MedicalController());
           Get.put(PatientDetailController());
         },
       ),