个人使用记录导入放置入面板

This commit is contained in:
weiye.wang 2024-06-21 21:54:42 +08:00
parent bf37f6d264
commit fb6ac1f43b
5 changed files with 27 additions and 7 deletions

2
.gitignore vendored
View File

@ -13,5 +13,5 @@
*.sh *.sh
*static *static
*.log *.log
文本文件/* */文本文件/*

View File

@ -180,6 +180,9 @@ class Ui_MainWindow(object):
self.tab_gxsy = QWidget() self.tab_gxsy = QWidget()
self.tab_gxsy.setObjectName(u"tab_gxsy") self.tab_gxsy.setObjectName(u"tab_gxsy")
self.tabWidget_syjl.addTab(self.tab_gxsy, "") self.tabWidget_syjl.addTab(self.tab_gxsy, "")
self.tab_grdr = QWidget()
self.tab_grdr.setObjectName(u"tab_grdr")
self.tabWidget_syjl.addTab(self.tab_grdr, "")
self.tabWidget_main.addTab(self.tab_syjl, "") self.tabWidget_main.addTab(self.tab_syjl, "")
self.tab_notesandanswers = QWidget() self.tab_notesandanswers = QWidget()
self.tab_notesandanswers.setObjectName(u"tab_notesandanswers") self.tab_notesandanswers.setObjectName(u"tab_notesandanswers")
@ -226,14 +229,14 @@ class Ui_MainWindow(object):
self.retranslateUi(MainWindow) self.retranslateUi(MainWindow)
self.tabWidget_main.setCurrentIndex(7) self.tabWidget_main.setCurrentIndex(3)
self.tabWidget_luru.setCurrentIndex(0) self.tabWidget_luru.setCurrentIndex(0)
self.tabWidget_weihu.setCurrentIndex(0) self.tabWidget_weihu.setCurrentIndex(0)
self.tabWidget_shiyong.setCurrentIndex(5) self.tabWidget_shiyong.setCurrentIndex(5)
self.tabWidget_beikezu.setCurrentIndex(0) self.tabWidget_beikezu.setCurrentIndex(0)
self.tabWidget_latex.setCurrentIndex(0) self.tabWidget_latex.setCurrentIndex(0)
self.tabWidget_mubiaojichu.setCurrentIndex(1) self.tabWidget_mubiaojichu.setCurrentIndex(1)
self.tabWidget_syjl.setCurrentIndex(0) self.tabWidget_syjl.setCurrentIndex(6)
self.tabWidget_notesandanswers.setCurrentIndex(2) self.tabWidget_notesandanswers.setCurrentIndex(2)
@ -278,6 +281,7 @@ class Ui_MainWindow(object):
self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_xxxz), QCoreApplication.translate("MainWindow", u"\u5c0f\u95f2\u4e0b\u8f7d", None)) self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_xxxz), QCoreApplication.translate("MainWindow", u"\u5c0f\u95f2\u4e0b\u8f7d", None))
self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_scjl), QCoreApplication.translate("MainWindow", u"\u5220\u9664\u4f7f\u7528\u8bb0\u5f55", None)) self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_scjl), QCoreApplication.translate("MainWindow", u"\u5220\u9664\u4f7f\u7528\u8bb0\u5f55", None))
self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_gxsy), QCoreApplication.translate("MainWindow", u"\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None)) self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_gxsy), QCoreApplication.translate("MainWindow", u"\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
self.tabWidget_syjl.setTabText(self.tabWidget_syjl.indexOf(self.tab_grdr), QCoreApplication.translate("MainWindow", u"\u4e2a\u4eba\u4f7f\u7528\u8bb0\u5f55\u5bfc\u5165", None))
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_syjl), QCoreApplication.translate("MainWindow", u"\u4f7f\u7528\u8bb0\u5f55", None)) self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_syjl), QCoreApplication.translate("MainWindow", u"\u4f7f\u7528\u8bb0\u5f55", None))
self.tabWidget_notesandanswers.setTabText(self.tabWidget_notesandanswers.indexOf(self.tab_jglr), QCoreApplication.translate("MainWindow", u"\u8bb2\u4e49\u7ed3\u6784\u4e0e\u5185\u5bb9\u5f55\u5165", None)) self.tabWidget_notesandanswers.setTabText(self.tabWidget_notesandanswers.indexOf(self.tab_jglr), QCoreApplication.translate("MainWindow", u"\u8bb2\u4e49\u7ed3\u6784\u4e0e\u5185\u5bb9\u5f55\u5165", None))
self.tabWidget_notesandanswers.setTabText(self.tabWidget_notesandanswers.indexOf(self.tab_dtlr), QCoreApplication.translate("MainWindow", u"\u7b54\u9898\u7eb8\u5bf9\u5e94\u5f55\u5165", None)) self.tabWidget_notesandanswers.setTabText(self.tabWidget_notesandanswers.indexOf(self.tab_dtlr), QCoreApplication.translate("MainWindow", u"\u7b54\u9898\u7eb8\u5bf9\u5e94\u5f55\u5165", None))

View File

@ -34,6 +34,7 @@ from 赋能卷生成 import MyWindow_fnsc
from 排序材料内难度 import MyWindow_pxnd from 排序材料内难度 import MyWindow_pxnd
from 单人讲义生成 import MyWindow_drsc from 单人讲义生成 import MyWindow_drsc
from 讲义与答题纸信息查询 import MyWindow_jycx from 讲义与答题纸信息查询 import MyWindow_jycx
from 个人使用记录导入 import MyWindow_grdr
from database_tools_2 import * from database_tools_2 import *
class MyWindow(QMainWindow,Ui_MainWindow): class MyWindow(QMainWindow,Ui_MainWindow):
@ -182,6 +183,10 @@ class MyWindow(QMainWindow,Ui_MainWindow):
self.jycx = MyWindow_jycx(self.database) self.jycx = MyWindow_jycx(self.database)
self.layout_jycx.addWidget(self.jycx) #以上三行为初始化"讲义答题纸查询"tab self.layout_jycx.addWidget(self.jycx) #以上三行为初始化"讲义答题纸查询"tab
self.layout_grdr = QVBoxLayout(self.tab_grdr)
self.grdr = MyWindow_grdr(self.database)
self.layout_grdr.addWidget(self.grdr) #以上三行为初始化"讲义答题纸查询"tab
@ -212,7 +217,8 @@ class MyWindow(QMainWindow,Ui_MainWindow):
self.jglr.setdbname, self.jglr.setdbname,
self.dtlr.setdbname, self.dtlr.setdbname,
self.drsc.setdbname, self.drsc.setdbname,
self.jycx.setdbname self.jycx.setdbname,
self.grdr.setdbname
]: #在列表中的tab里传送数据库名的连接 ]: #在列表中的tab里传送数据库名的连接
self.sendDBname.connect(func) self.sendDBname.connect(func)
def sendValue(self): def sendValue(self):

View File

@ -27,7 +27,7 @@
<enum>QTabWidget::Triangular</enum> <enum>QTabWidget::Triangular</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>7</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="tab_luru"> <widget class="QWidget" name="tab_luru">
<attribute name="title"> <attribute name="title">
@ -319,7 +319,7 @@
<enum>QTabWidget::Triangular</enum> <enum>QTabWidget::Triangular</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>6</number>
</property> </property>
<widget class="QWidget" name="tab_xxdr"> <widget class="QWidget" name="tab_xxdr">
<attribute name="title"> <attribute name="title">
@ -351,6 +351,11 @@
<string>共享使用记录</string> <string>共享使用记录</string>
</attribute> </attribute>
</widget> </widget>
<widget class="QWidget" name="tab_grdr">
<attribute name="title">
<string>个人使用记录导入</string>
</attribute>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab_notesandanswers"> <widget class="QWidget" name="tab_notesandanswers">

View File

@ -23,6 +23,9 @@ class MyWindow_grdr(QWidget,Ui_Form):
self.database_name = database_name self.database_name = database_name
self.bind() self.bind()
def setdbname(self,string):
self.database_name = string
# print(self.database_name)
def bind(self): def bind(self):
self.tableWidget_filelist.setColumnWidth(0,270) self.tableWidget_filelist.setColumnWidth(0,270)
@ -56,6 +59,8 @@ class MyWindow_grdr(QWidget,Ui_Form):
def exec(self): def exec(self):
tempdir = "临时文件/zips" tempdir = "临时文件/zips"
self.tableWidget_result.clearContents()
self.tableWidget_result.setRowCount(0)
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
mycursor = mydb.cursor() mycursor = mydb.cursor()
for zf in tqdm.tqdm(self.filelist,desc = "文件处理进度 "): for zf in tqdm.tqdm(self.filelist,desc = "文件处理进度 "):