|
@@ -227,7 +227,8 @@ class ElTree(QWidget):
|
227
|
227
|
if parent_name == '水准测段高差稳定计算':
|
228
|
228
|
tables_to_delete = ['GC_Input_Param', 'GC_Input_Point', 'GC_Output_Point']
|
229
|
229
|
elif parent_name == '控制网复测平面基准计算':
|
230
|
|
- tables_to_delete = ['GS_Input_Param', 'GS_Input_Point', 'GS_Result_Point', 'GS_Trans_Param', 'GS_Trans_Point']
|
|
230
|
+ tables_to_delete = ['GS_Input_Param', 'GS_Input_Point', 'GS_Result_Point', 'GS_Trans_Param',
|
|
231
|
+ 'GS_Trans_Point']
|
231
|
232
|
elif parent_name == '平面控制网稳定性计算':
|
232
|
233
|
tables_to_delete = ['WD_Input_Param', 'WD_Input_Point', 'WD_Result_Param', 'WD_Result_Point']
|
233
|
234
|
else:
|
|
@@ -235,7 +236,8 @@ class ElTree(QWidget):
|
235
|
236
|
return
|
236
|
237
|
|
237
|
238
|
# 确认删除操作
|
238
|
|
- reply = QMessageBox.question(self, '确认删除', f'确定要删除项目表 {tablename} 吗?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
|
239
|
+ reply = QMessageBox.question(self, '确认删除', f'确定要删除项目表 {tablename} 吗?',
|
|
240
|
+ QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
239
|
241
|
if reply == QMessageBox.No:
|
240
|
242
|
return
|
241
|
243
|
|
|
@@ -300,6 +302,7 @@ class ElTree1(QWidget):
|
300
|
302
|
# 挂载到树上
|
301
|
303
|
widgets.qureyTreeWidget.insertTopLevelItems(0, treeWidgetItems)
|
302
|
304
|
|
|
305
|
+
|
303
|
306
|
class DatabaseChangeHandler(FileSystemEventHandler):
|
304
|
307
|
def __init__(self, main_window):
|
305
|
308
|
self.main_window = main_window
|
|
@@ -309,6 +312,7 @@ class DatabaseChangeHandler(FileSystemEventHandler):
|
309
|
312
|
print(f"Database file {event.src_path} has been modified.")
|
310
|
313
|
self.main_window.refresh_tree()
|
311
|
314
|
|
|
315
|
+
|
312
|
316
|
class MainWindow(QMainWindow):
|
313
|
317
|
|
314
|
318
|
def __init__(self):
|
|
@@ -426,6 +430,7 @@ class MainWindow(QMainWindow):
|
426
|
430
|
# tree_button = self.sql_init()
|
427
|
431
|
# tree_button.itemClicked.connect(self.itembuttonClick)
|
428
|
432
|
# tree_button.itemDoubleClicked.connect(self.itembuttonClick)
|
|
433
|
+
|
429
|
434
|
def closeEvent(self, event):
|
430
|
435
|
# 停止监控
|
431
|
436
|
self.observer.stop()
|
|
@@ -561,6 +566,8 @@ class MainWindow(QMainWindow):
|
561
|
566
|
|
562
|
567
|
# 初始化数据一览(数据库全展示)
|
563
|
568
|
def sql_init(self):
|
|
569
|
+ # 清空 dblist 以确保每次初始化时都是空的
|
|
570
|
+ self.dblist = []
|
564
|
571
|
# 初始化全部数据库
|
565
|
572
|
# inpath = r'D:\4work_now\20240819GS\20241211\SQL'
|
566
|
573
|
inpath = os.path.abspath('../SQL')
|
|
@@ -645,8 +652,6 @@ class MainWindow(QMainWindow):
|
645
|
652
|
tree_button.itemClicked.connect(self.itembuttonClick)
|
646
|
653
|
tree_button.itemDoubleClicked.connect(self.itembuttonClick)
|
647
|
654
|
|
648
|
|
-
|
649
|
|
-
|
650
|
655
|
# 关键词查询
|
651
|
656
|
def searchClick(self):
|
652
|
657
|
# GET BUTTON CLICKED
|
|
@@ -710,6 +715,7 @@ class MainWindow(QMainWindow):
|
710
|
715
|
search_button.itemDoubleClicked.connect(self.itembuttonClick1)
|
711
|
716
|
# 隐藏默认label
|
712
|
717
|
self.ui.defaultLabel.setVisible(False)
|
|
718
|
+
|
713
|
719
|
# 全树的item展示
|
714
|
720
|
def itembuttonClick(self):
|
715
|
721
|
# 判定是否获取的是根节点
|
|
@@ -768,7 +774,7 @@ class MainWindow(QMainWindow):
|
768
|
774
|
# 数据库路径,哪种方法,表名
|
769
|
775
|
UIFunctions.search_data_to_show(self, file_path, current_text, str1)
|
770
|
776
|
|
771
|
|
-# 键盘回车事件,目前用于搜索按钮
|
|
777
|
+ # 键盘回车事件,目前用于搜索按钮
|
772
|
778
|
def datainfo_keyPressEvent(self, event):
|
773
|
779
|
if event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter:
|
774
|
780
|
# 检查 lineEdit_2 中是否有内容
|
|
@@ -779,6 +785,7 @@ class MainWindow(QMainWindow):
|
779
|
785
|
# 调用默认的 keyPressEvent 处理其他按键事件
|
780
|
786
|
super(widgets.datainfo.__class__, widgets.datainfo).keyPressEvent(event)
|
781
|
787
|
|
|
788
|
+
|
782
|
789
|
if __name__ == "__main__":
|
783
|
790
|
app = QApplication(sys.argv)
|
784
|
791
|
app.setWindowIcon(QIcon("icon.ico"))
|