精华内容
下载资源
问答
  • PyQt项目实战-工作小助手(4 利用QSqlTableModel和tableView 实现Todolist) 本部分通过QSqlTableModel和tableView控件实现todolist工作待办的查询、新增、修改、删除和导出功能 文章目录PyQt项目实战-工作小助手(4...

    PyQt项目实战-工作小助手(4 利用QSqlTableModel和tableView 实现Todolist)

    本部分通过QSqlTableModel和tableView控件实现todolist工作待办的查询、新增、修改、删除和导出功能

    1、界面设计

    界面支持筛选查询、新增、删除和导出功能。先上图。
    工作计划界面

    1. 第一行为筛选查询字段,实现查询功能:

    日期范围为comboBox,预设为全部、本日、本周、上周、本月、上月、本年、本年之前。

    程度为comboBox,根据重要和紧急程度分为:

    • 重要紧急,该部分任务优先处理
    • 不重要紧急,次之
    • 重要不紧急,再次之
    • 不重要不紧急 ,最后处理

    事项为lineEdit,支持通过输入文本模糊匹配查询。

    1. 第二行为tableview控件,展示查询结果和支持直接修改数据库。
    2. 第三行为toolButton,分别实现新增记录、删除记录和导出任务功能。

    2、实现todolist查询

    1. 新建QSqlTableModel实例todomodel。QSqlTableModel类提供了一个可读写单张SQL表的可编辑数据模型。支持修改,插入,删除,查询,和排序。EditStrategy使用OnFiledChange策略实现编辑功能。
    self.todomodel = QSqlTableModel()
    self.todomodel.setTable("todolist")       self.todomodel.setEditStrategy(QSqlTableModel.OnFieldChange)
    

    setEditStrategy各取值含义如下:
    QSqlTableModel.OnFieldChange,一改动马上提交数据库
    QSqlTableModel.OnRowChange,当前行号变化再提交数据库
    QSqlTableModel.OnManualSubmit,默认值,手动提交submitAll()修改才生效。

    1. 默认情况下,QSqlTableModel查询返回所有记录。可通过setFilter()实现sql中where语句的功能,即设置查询过滤条件。查询条件要转化为Sqlite3数据库所能识别的过滤语句,特别是要处理各类日期字典。

    本日:date(pdate) = date(‘now’)
    本周:date(pdate) >= date(‘now’,‘weekday 1’,’-7 day’))
    上周:(date(pdate) >= date(‘now’,‘weekday 1’,’-14 day’) and date(pdate) < date(‘now’,‘weekday 1’,’-7 day’))
    本月:(date(pdate) >= date(‘now’,‘start of month’))
    上月:(date(pdate) >= date(‘now’,‘start of month’,’-1 month’) and date(pdate) < date(‘now’,‘start of month’))
    本年:(date(pdate) >= date(‘now’,‘start of year’))
    本年以前:(date(pdate) < date(‘now’,‘start of year’))

            # 2、业务条件转换为查询过滤语句。
            ##2.1文本模糊匹配
            sql1 = "(content like '%{}%')".format(scontent)
            filterlist = sql1
            ##2.2待办事项建立日期范围。
            if sdaterange in [1, 2, 3, 4, 5, 6, 7]:
                if sdaterange == 1:  # 本日
                    sql2 = "(date(pdate) = date('now'))"
                elif sdaterange == 2:  # 本周
                    sql2 = "(date(pdate) >= date('now','weekday 1','-7 day'))"
                elif sdaterange == 3:  # 上周
                    sql2 = "(date(pdate) >= date('now','weekday 1','-14 day') and date(pdate) < date('now','weekday 1','-7 day'))"
                elif sdaterange == 4:  # 本月
                    sql2 = "(date(pdate) >= date('now','start of month'))"
                elif sdaterange == 5:  # 上月
                    sql2 = "(date(pdate) >= date('now','start of month','-1 month') and date(pdate) < date('now','start of month'))"
                elif sdaterange == 6:  # 本年
                    sql2 = "(date(pdate) >= date('now','start of year'))"
                elif sdaterange == 7:  # 去年及以前
                    sql2 = "(date(pdate) < date('now','start of year'))"
                filterlist = filterlist + " and " + sql2
            else:
                sql2 = ''
            ##2.3待办事项状态。
            if sfinstatus in [1, 2]:
                sql3 = "(finstatus={})".format(sfinstatus)
                filterlist = filterlist + " and " + sql3
            else:
                sql3 = ''
            ##2.4待办事项分类条件。
            if scatalog in [1, 2, 3, 4]:
                sql4 = "(catalog={})".format(scatalog)
                filterlist = filterlist + " and " + sql4
            else:
                sql4 = ''
    
    1. 获取数据库数据,设置表头显示内容
    		self.todomodel.setFilter(filterlist)
            self.todomodel.select()
            
            self.todomodel.setHeaderData(0, Qt.Horizontal, '编号')
            self.todomodel.setHeaderData(1, Qt.Horizontal, '重要紧急')
            self.todomodel.setHeaderData(2, Qt.Horizontal, '事项')
            self.todomodel.setHeaderData(3, Qt.Horizontal, '状态')
            self.todomodel.setHeaderData(4, Qt.Horizontal, '建立日期')
            self.todomodel.setHeaderData(5, Qt.Horizontal, '完成日期')
            self.todomodel.setHeaderData(6, Qt.Horizontal, '完成情况')
            self.todomodel.setHeaderData(7, Qt.Horizontal, '下一步计划')
    
    1. 设置tableview各列属性,包括columnwidth,autoscroll,行交叉颜色变化等
    		self.todo_un.setModel(self.todomodel)
            # 设置todo tableview格式
            self.todo_un.setColumnWidth(0, 50)
            self.todo_un.setColumnWidth(1, 100)
            self.todo_un.setColumnWidth(2, 300)
            self.todo_un.setColumnWidth(3, 80)
            self.todo_un.setColumnWidth(4, 100)
            self.todo_un.setColumnWidth(5, 100)
            self.todo_un.setColumnWidth(6, 300)
            self.todo_un.setColumnWidth(7, 300)
            self.todo_un.setAutoScroll(True)
            self.todo_un.setAlternatingRowColors(True)  # 行交叉变化颜色
            self.todo_un.resizeRowsToContents()
            self.todo_un.horizontalHeader().setStyleSheet("QHeaderView::section{background:grey;}")
            self.todo_un.setSelectionBehavior(QAbstractItemView.SelectRows)
            self.todo_un.setColumnHidden(0, True)
            self.todo_un.setItemDelegate(listDelegate(self))
    

    3、利用delegate实现tableview数据的个性化显示

    tableview默认使用QItemDelegate,本项目中由于涉及到comboBox,需重写delegate代理listDelegate,实现数据库中字典项index显示为对应的字典项名称。

    1. 重写paint函数,使用drawDisplay()显示字典项目名称。
    2. 重写createEditor函数,实现tableview中使用comboBox编辑数字
    3. 重写setModelData函数,实现字典选择后,data取值字典index
    4. 重写setEditorData函数,实现字典数据选择。
    class listDelegate(QItemDelegate):  # 设置todo代理
        def __init__(self, parent):
            super(listDelegate, self).__init__(parent)
    
        def paint(self, painter, option, index):
            '''缺少将重要紧急任务标注颜色功能'''
            myoption = option
            myoption.displayAlignment = Qt.AlignCenter
            if index.column() == 1:#comboBox显示为字典文本
                value = index.model().data(index, role=Qt.DisplayRole)
                text = todocatalog[value]
                self.drawDisplay(painter, myoption, myoption.rect, text)
            elif index.column() == 3:#comboBox显示为字典文本
                value = index.model().data(index, role=Qt.DisplayRole)
                text = finstatus[value]
                self.drawDisplay(painter, myoption, myoption.rect, text)
            else:
                QItemDelegate.paint(self, painter, myoption, index)
    
        def createEditor(self, parent, option, index):
            if index.column() == 0:  # 不允许编辑
                return None
            elif index.column() == 1:
                combox = QComboBox(parent)
                combox.addItems(todocatalog)
                combox.setEditable(True)
                return combox
            elif index.column() == 3:
                combox = QComboBox(parent)
                combox.addItems(finstatus)
                # combox.setCurrentText(QModelIndex.value)
                combox.setEditable(True)
                return combox
            elif index.column() in [4, 5]:
                dateedit = QDateEdit(parent)
                dateedit.setDate(QDate.currentDate())
                dateedit.setCalendarPopup(True)
                return dateedit
            elif index.column() in [2, 6, 7]:
                plaintextedit = QPlainTextEdit(parent)
                return plaintextedit
            else:
                return QItemDelegate.createEditor(self, parent, option,
                                                  index)
    
        def setModelData(self, editor, model, index):
            if index.column() == 1:
                model.setData(index, QVariant(editor.currentIndex()))
            elif index.column() == 3:
                model.setData(index, QVariant(editor.currentIndex()))
            else:
                QItemDelegate.setModelData(self, editor, model, index)
    
        def setEditorData(self, editor, index):
            text = index.model().data(index, Qt.DisplayRole)
            # print(text)
            if index.column() == 1:
                editor.setCurrentIndex(text)
            elif index.column() == 3:
                editor.setCurrentIndex(text)
            else:
                QItemDelegate.setEditorData(self, editor, index)
    

    3、实现新增功能

    1. model.insertRow()新增行
    2. 设置点击新增后部分字段的默认取值,setData()
    3. submitAll()提交
    # 1.2计划新增
        def todo_add(self):
            self.todomodel.insertRow(0)  # 在第一行新增,避免翻页
            self.todomodel.setData(self.todomodel.index(0, 1), 1)  # 默认初始分类为重要紧急
            self.todomodel.setData(self.todomodel.index(0, 3), 1)  # 默认初始状态未完成
            self.todomodel.setData(self.todomodel.index(0, 4), QDate.currentDate())  # 默认建立日期为当天
            self.todomodel.submitAll()
    

    4、实现删除功能

    1. 获取当前行。index=tableview.currentIndex(),结果为QItemIndex,row=index.row()
    2. 利用SqlTableModel.removeRow(row)实现删除某一行功能。
    3. 重新查询,让结果立即呈现。
     # 1.3计划删除
        def todo_del(self):
            row = self.todo_un.currentIndex().row()
            self.todomodel.removeRow(row)
            self.todo_query()
    

    5、导出功能

    利用xlwt库实现导出modeldata为xls。

    1. 获取导出文件夹和文件名QFileDialog().getSaveFileName()
    2. 判断filename是否为空
    3. 获取数据的行数和列数,
    4. 利用xlwt.XFStyle设置导出文件格式
    5. 利用循环实现表头的写入
    6. 利用行列嵌套循环,实现所有数据的写入,特别注意将字典项数字转为字典项名称输出。
    7. 写入成功后,利用QMessageBox弹出结果窗口。
    # 1.4计划导出
        def todo_export(self):
            filename, filetype = QFileDialog().getSaveFileName(self, '请选择保存文件', './Data/', 'Text Files (*.xls)')
            if filename != '':
                row = self.todomodel.rowCount()
                col = self.todomodel.columnCount()
                f = xlwt.Workbook(encoding='utf-8')
                sheet1 = f.add_sheet('sheet1', cell_overwrite_ok=True)
                style = xlwt.XFStyle()
                al = xlwt.Alignment()
                al.horz = 0x02  # 设置水平居中
                al.vert = 0x01  # 设置垂直居中
                style.alignment = al
                for h in range(col):
                    sheet1.write(0, h, self.todomodel.headerData(h, Qt.Horizontal, Qt.DisplayRole), style)
                for i in range(row):
                    for j in range(col):
                        index = self.todomodel.index(i, j)
                        data = self.todomodel.data(index)
                        if j == 1:
                            data = todocatalog[data]
                        if j == 3:
                            data = finstatus[data]
                        sheet1.write(i + 1, j, data, style)
                f.save(filename)
                QMessageBox.information(self, "保存结果", "数据导出成功,共计{}条数据导出!".format(row), QMessageBox.Yes)
            else:
                QMessageBox.warning(self, "警告", "文件打开错误,数据导出失败", QMessageBox.Ok)
    

    6、界面各Button点击事件和槽函数的链接

            self.pushButton_todo_query.clicked.connect(self.todo_query)  # 待办事项查询
            self.toolButton__task_add.clicked.connect(self.todo_add)  # x新增待办事项
            self.toolButton__task_export.clicked.connect(self.todo_export)  # 导出待办事项
            self.toolButton__task_del.clicked.connect(self.todo_del)  # 删除待办事项
    
    展开全文
  • PyQt项目实战-工作小助手(2 Button控件与stackedWidget页面连接) 画完界面UI后,需要建立左侧导航栏中各按键Button与右侧stackedWidget各页面的连接关系,利用Pyqt信号与槽的连接机制,实现点击不同的Button跳转到...

    PyQt项目实战-工作小助手(2 Button控件与stackedWidget页面连接)

    画完界面UI后,需要建立左侧导航栏中各按键Button与右侧stackedWidget各页面的连接关系,利用Pyqt信号与槽的连接机制,实现点击不同的Button跳转到不同的页面。

    1、stackedwidget多页面设置

    通过Designer在Ui界面中设置

    选择界面中stackedwidget,鼠标右击弹出菜单,可以插入新页面,删除页面、切换页面page。也可以变更各页面的index顺序。

    stackedwidge设置
    设置stackedwidget各page index

    2、左侧菜单中各Button的clicked信号与各槽函数关联

    self.toolButton_index.clicked.connect(self.on_toolButton_index_clicked) 槽函数无需括号

    class MainWin(QMainWindow, Ui_MainWindow):
        def __init__(self, parent=None):
            super(MainWin, self).__init__(parent)
            self.setupUi(self)
            self.setWindowTitle('工作汪小助手')  # 设置窗体标题
    
            # 左侧菜单按键信号与槽链接
            self.toolButton_index.clicked.connect(self.on_toolButton_index_clicked)
            self.toolButton_todo.clicked.connect(self.on_toolButton_todo_clicked)
            self.toolButton_req.clicked.connect(self.on_toolButton_req_clicked)
            self.toolButton_qa.clicked.connect(self.on_toolButton_qa_clicked)
            self.toolButton_compa.clicked.connect(self.on_toolButton_compa_clicked)
            self.toolButton_conta.clicked.connect(self.on_toolButton_conta_clicked)
            self.toolButton_weekreport.clicked.connect(self.on_toolButton_workreport_clicked)
    

    3、设计触发的槽函数功能

    每个槽函数,响应button点击信号后:
    一是需将Stackedwidget对应的页面index设置为当前页面,从而实现页面的跳转。

    self.stackedWidget.setCurrentIndex(i) # i为stackedwidget 的 page index
    

    二是实现调用不同页面初始化的功能函数。在本项目中,希望点击后能实现数据库的实时查询,所以各相关页面在跳转后,均增加了相应的数据查询获取函数。通过这些函数实现对不同数据表中数据的查询返回。

    # 槽函数,显示不同的界面
        def on_toolButton_index_clicked(self):
            self.stackedWidget.setCurrentIndex(0)  # 0工作站
            self.gettodosum()
            self.getreqsum()
        def on_toolButton_todo_clicked(self):
            self.stackedWidget.setCurrentIndex(1)  # 1.1工作计划
            self.todo_query()  # 自动查询todolist
        def on_toolButton_workreport_clicked(self):
            self.stackedWidget.setCurrentIndex(2)  # 1.2工作周报
            self.report_query()
        def on_toolButton_req_clicked(self):
            self.stackedWidget.setCurrentIndex(3)  # 2.1需求管理
            self.req_query()
        def on_toolButton_qa_clicked(self):
            self.stackedWidget.setCurrentIndex(4)  # 3.1系统问题
            self.qa_query()
        def on_toolButton_compa_clicked(self):
            self.stackedWidget.setCurrentIndex(5)  # 数据罗盘
        def on_toolButton_conta_clicked(self):
            self.stackedWidget.setCurrentIndex(6)  # 通讯录
    

    各页面具体功能将通过功能函数实现。

    未完待续。。。

    展开全文
  • PyQt项目实战-工作小助手(开篇+界面设计) 金融产品狗一枚,日常爱好广泛,自学python已有一段时间。疫情期间正好在家办公,时间相对充足,就想着利用Python和PyQt把自己的日常常规工作设计成一款桌面办公程序,以...

    PyQt项目实战-工作小助手(1 开篇+界面设计)

    金融产品狗一枚,日常爱好广泛,自学python已有一段时间。疫情期间正好在家办公,时间相对充足,就想着利用Python和PyQt把自己的日常常规工作设计成一款桌面办公程序,以提高工作效率。非专业人士,一边探索一边学习,将项目实战中的碰到的问题和解决方法,特在此记录。

    一、项目目标

    我的日常工作主要涉及到项目产品研发需求管理和系统运维,这个项目主要用于自己日常工作辅助,主要实现以下几方面的功能内容:

    1. 工作台,能够展示目前还有多少待办任务没有完成和各需求项目的当期状态统计情况
    2. 每日工作,一是每日待办工作清单,也就是现在较普遍的Todolist功能,结合工作实际,需要增加工作完成情况和下一步工作计划。二是能够形成工作周报并支持导出。
    3. 项目需求管理,实现项目需求的新增和流程状态管理、以及需求清单导出功能。
    4. 运营管理,一是系统问题的收集整理,形成知识库。二是运营数据的图表展示。
    5. 其他小工具,包括通讯录的导入和查询等。

    二、项目工具环境

    1. windows 7 64位系统

    2. python 版本为3.7

    3. IDE使用pycharm

    4. Qt Designer用于设计窗体界面

    5. 数据库使用Python自带的sqlite3

    6. 各类支持库

    三、Qt界面UI设计

    1、主界面-工作台

    1、程序界面为左右风格,左边为工具栏,主要用QtoolBox控件实现;右边为QstackedWidget控件实现多个展示区域。主窗体设置最小大小为(1024, 768)

    from PyQt5 import QtCore, QtGui, QtWidgets
    
    
    class Ui_MainWindow(object):
        def setupUi(self, MainWindow):
            MainWindow.setObjectName("MainWindow")
            MainWindow.resize(1251, 768)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
            MainWindow.setSizePolicy(sizePolicy)
            MainWindow.setMinimumSize(QtCore.QSize(1024, 768))
            MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
            self.centralwidget = QtWidgets.QWidget(MainWindow)
            self.centralwidget.setObjectName("centralwidget")
            self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
            self.horizontalLayout_2.setObjectName("horizontalLayout_2")
            self.verticalLayout_5 = QtWidgets.QVBoxLayout()
            self.verticalLayout_5.setObjectName("verticalLayout_5")
    

    2、Logo为两个Qlabel,一个设置为图片,一个设置为文字。不知道是否可以通过一个Qlabel同时实现图片和文字的展示

    3、”首页“为 一个QtoolButton,设置图片和文字,设置toolButtonStyle值为ToolButtonTextBesideIcon。除这个值外,toolButtonStyle可使用的值如下:

    2、任务计划界面

    3、工作周报界面

    在这里插入图片描述

    4、需求管理界面

    在这里插入图片描述

    5、常见问题界面

    在这里插入图片描述

    6、其他界面(尚未完成)

    三、碰到的问题和解决方案

    1. 拖动窗口改变窗口大小时右边模块自动随窗口大小变化。

      主要通过布局和控件最大最小值来设定 主窗口要增加布局,然后在布局中放置控件或再布局。如果主窗体没有布局,则不自动缩放。 如果要设置窗体的最小最大值,可通过属性窗口设置minimal size \ maxmize size 如果报持某控件大小不变,需配置该控件的大小和size政策。

    2. 实现窗口最大化、最小化和关闭按键。

      mainWindow.setWindowFlags(QtCore.Qt.WindowMaximizeButtonHint
      |QtCore.Qt.WindowMinimizeButtonHint|QtCore.Qt.WindowCloseButtonHint)
      

      窗口最大尺寸要设置为默认值(16777215, 16777215)。否则会有问题。

    四、Ui界面文件转为py文件后的代码

    # -*- coding: utf-8 -*-
    
    # Form implementation generated from reading ui file 'wokkit.ui'
    #
    # Created by: PyQt5 UI code generator 5.13.0
    #
    # WARNING! All changes made in this file will be lost!
    
    
    from PyQt5 import QtCore, QtGui, QtWidgets
    
    
    class Ui_MainWindow(object):
        def setupUi(self, MainWindow):
            MainWindow.setObjectName("MainWindow")
            MainWindow.resize(1251, 768)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
            MainWindow.setSizePolicy(sizePolicy)
            MainWindow.setMinimumSize(QtCore.QSize(1024, 768))
            MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
            self.centralwidget = QtWidgets.QWidget(MainWindow)
            self.centralwidget.setObjectName("centralwidget")
            self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
            self.horizontalLayout_2.setObjectName("horizontalLayout_2")
            self.verticalLayout_5 = QtWidgets.QVBoxLayout()
            self.verticalLayout_5.setObjectName("verticalLayout_5")
            self.leftframe = QtWidgets.QFrame(self.centralwidget)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(self.leftframe.sizePolicy().hasHeightForWidth())
            self.leftframe.setSizePolicy(sizePolicy)
            self.leftframe.setAutoFillBackground(False)
            self.leftframe.setFrameShape(QtWidgets.QFrame.StyledPanel)
            self.leftframe.setFrameShadow(QtWidgets.QFrame.Raised)
            self.leftframe.setObjectName("leftframe")
            self.verticalLayout = QtWidgets.QVBoxLayout(self.leftframe)
            self.verticalLayout.setObjectName("verticalLayout")
            self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_5.setObjectName("horizontalLayout_5")
            self.label_pic = QtWidgets.QLabel(self.leftframe)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(self.label_pic.sizePolicy().hasHeightForWidth())
            self.label_pic.setSizePolicy(sizePolicy)
            self.label_pic.setMinimumSize(QtCore.QSize(50, 50))
            self.label_pic.setMaximumSize(QtCore.QSize(50, 50))
            self.label_pic.setText("")
            self.label_pic.setPixmap(QtGui.QPixmap("image/dog.png"))
            self.label_pic.setScaledContents(True)
            self.label_pic.setObjectName("label_pic")
            self.horizontalLayout_5.addWidget(self.label_pic)
            self.label_logotxt = QtWidgets.QLabel(self.leftframe)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(10)
            self.label_logotxt.setFont(font)
            self.label_logotxt.setObjectName("label_logotxt")
            self.horizontalLayout_5.addWidget(self.label_logotxt)
            self.verticalLayout.addLayout(self.horizontalLayout_5)
            self.line = QtWidgets.QFrame(self.leftframe)
            self.line.setFrameShape(QtWidgets.QFrame.HLine)
            self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
            self.line.setObjectName("line")
            self.verticalLayout.addWidget(self.line)
            self.toolButton_index = QtWidgets.QToolButton(self.leftframe)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolButton_index.setFont(font)
            self.toolButton_index.setAutoFillBackground(False)
            icon = QtGui.QIcon()
            icon.addPixmap(QtGui.QPixmap("image/index.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_index.setIcon(icon)
            self.toolButton_index.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_index.setAutoRaise(True)
            self.toolButton_index.setObjectName("toolButton_index")
            self.verticalLayout.addWidget(self.toolButton_index, 0, QtCore.Qt.AlignHCenter)
            self.toolBox = QtWidgets.QToolBox(self.leftframe)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(self.toolBox.sizePolicy().hasHeightForWidth())
            self.toolBox.setSizePolicy(sizePolicy)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolBox.setFont(font)
            self.toolBox.setAutoFillBackground(False)
            self.toolBox.setObjectName("toolBox")
            self.widget = QtWidgets.QWidget()
            self.widget.setGeometry(QtCore.QRect(0, 0, 167, 463))
            self.widget.setObjectName("widget")
            self.toolButton_weekreport = QtWidgets.QToolButton(self.widget)
            self.toolButton_weekreport.setGeometry(QtCore.QRect(0, 40, 112, 32))
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolButton_weekreport.setFont(font)
            self.toolButton_weekreport.setStyleSheet("background-color:transparent")
            icon1 = QtGui.QIcon()
            icon1.addPixmap(QtGui.QPixmap("image/issue.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_weekreport.setIcon(icon1)
            self.toolButton_weekreport.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_weekreport.setObjectName("toolButton_weekreport")
            self.toolButton_todo = QtWidgets.QToolButton(self.widget)
            self.toolButton_todo.setGeometry(QtCore.QRect(0, 0, 112, 32))
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolButton_todo.setFont(font)
            self.toolButton_todo.setStyleSheet("background-color:transparent")
            self.toolButton_todo.setIcon(icon1)
            self.toolButton_todo.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_todo.setObjectName("toolButton_todo")
            self.toolBox.addItem(self.widget, "")
            self.page_2 = QtWidgets.QWidget()
            self.page_2.setGeometry(QtCore.QRect(0, 0, 167, 463))
            self.page_2.setObjectName("page_2")
            self.toolButton_req = QtWidgets.QToolButton(self.page_2)
            self.toolButton_req.setGeometry(QtCore.QRect(0, 10, 112, 32))
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            font.setBold(False)
            font.setWeight(50)
            self.toolButton_req.setFont(font)
            self.toolButton_req.setStyleSheet("background-color:transparent")
            icon2 = QtGui.QIcon()
            icon2.addPixmap(QtGui.QPixmap("image/tool.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_req.setIcon(icon2)
            self.toolButton_req.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_req.setObjectName("toolButton_req")
            self.toolBox.addItem(self.page_2, "")
            self.page = QtWidgets.QWidget()
            self.page.setGeometry(QtCore.QRect(0, 0, 167, 463))
            self.page.setObjectName("page")
            self.toolButton_qa = QtWidgets.QToolButton(self.page)
            self.toolButton_qa.setGeometry(QtCore.QRect(0, 0, 112, 32))
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolButton_qa.setFont(font)
            self.toolButton_qa.setStyleSheet("background-color:transparent")
            icon3 = QtGui.QIcon()
            icon3.addPixmap(QtGui.QPixmap("image/question.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_qa.setIcon(icon3)
            self.toolButton_qa.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_qa.setObjectName("toolButton_qa")
            self.toolButton_compa = QtWidgets.QToolButton(self.page)
            self.toolButton_compa.setGeometry(QtCore.QRect(0, 40, 112, 32))
            self.toolButton_compa.setStyleSheet("background-color:transparent")
            icon4 = QtGui.QIcon()
            icon4.addPixmap(QtGui.QPixmap("image/compass.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_compa.setIcon(icon4)
            self.toolButton_compa.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_compa.setObjectName("toolButton_compa")
            self.toolBox.addItem(self.page, "")
            self.page_3 = QtWidgets.QWidget()
            self.page_3.setGeometry(QtCore.QRect(0, 0, 167, 463))
            self.page_3.setObjectName("page_3")
            self.toolButton_conta = QtWidgets.QToolButton(self.page_3)
            self.toolButton_conta.setGeometry(QtCore.QRect(0, 0, 112, 32))
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.toolButton_conta.setFont(font)
            self.toolButton_conta.setStyleSheet("background-color:transparent")
            icon5 = QtGui.QIcon()
            icon5.addPixmap(QtGui.QPixmap("image/contac.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_conta.setIcon(icon5)
            self.toolButton_conta.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_conta.setObjectName("toolButton_conta")
            self.toolBox.addItem(self.page_3, "")
            self.verticalLayout.addWidget(self.toolBox)
            self.verticalLayout_5.addWidget(self.leftframe)
            self.horizontalLayout_2.addLayout(self.verticalLayout_5)
            self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(self.stackedWidget.sizePolicy().hasHeightForWidth())
            self.stackedWidget.setSizePolicy(sizePolicy)
            self.stackedWidget.setObjectName("stackedWidget")
            self.page_index = QtWidgets.QWidget()
            self.page_index.setObjectName("page_index")
            self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.page_index)
            self.verticalLayout_3.setObjectName("verticalLayout_3")
            self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_9.setObjectName("horizontalLayout_9")
            self.toolButton_task_add_2 = QtWidgets.QToolButton(self.page_index)
            icon6 = QtGui.QIcon()
            icon6.addPixmap(QtGui.QPixmap("image/workplatm.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_task_add_2.setIcon(icon6)
            self.toolButton_task_add_2.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_2.setAutoRaise(True)
            self.toolButton_task_add_2.setObjectName("toolButton_task_add_2")
            self.horizontalLayout_9.addWidget(self.toolButton_task_add_2)
            self.label_3 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_3.setFont(font)
            self.label_3.setObjectName("label_3")
            self.horizontalLayout_9.addWidget(self.label_3)
            spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_9.addItem(spacerItem)
            self.label_ad = QtWidgets.QLabel(self.page_index)
            self.label_ad.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
            self.label_ad.setObjectName("label_ad")
            self.horizontalLayout_9.addWidget(self.label_ad)
            spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_9.addItem(spacerItem1)
            self.verticalLayout_3.addLayout(self.horizontalLayout_9)
            self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_8.setObjectName("horizontalLayout_8")
            self.label_9 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            font.setBold(True)
            font.setWeight(75)
            self.label_9.setFont(font)
            self.label_9.setObjectName("label_9")
            self.horizontalLayout_8.addWidget(self.label_9)
            spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_8.addItem(spacerItem2)
            self.verticalLayout_3.addLayout(self.horizontalLayout_8)
            self.line_3 = QtWidgets.QFrame(self.page_index)
            self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
            self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
            self.line_3.setObjectName("line_3")
            self.verticalLayout_3.addWidget(self.line_3)
            self.gridLayout = QtWidgets.QGridLayout()
            self.gridLayout.setObjectName("gridLayout")
            self.label_6 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            font.setBold(True)
            font.setWeight(75)
            self.label_6.setFont(font)
            self.label_6.setText("")
            self.label_6.setTextFormat(QtCore.Qt.AutoText)
            self.label_6.setPixmap(QtGui.QPixmap("image/unfinished.png"))
            self.label_6.setAlignment(QtCore.Qt.AlignCenter)
            self.label_6.setObjectName("label_6")
            self.gridLayout.addWidget(self.label_6, 0, 0, 1, 1)
            self.unfinish = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            self.unfinish.setFont(font)
            self.unfinish.setText("")
            self.unfinish.setTextFormat(QtCore.Qt.AutoText)
            self.unfinish.setAlignment(QtCore.Qt.AlignCenter)
            self.unfinish.setObjectName("unfinish")
            self.gridLayout.addWidget(self.unfinish, 1, 0, 1, 1)
            self.label_11 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            font.setBold(True)
            font.setWeight(75)
            self.label_11.setFont(font)
            self.label_11.setText("")
            self.label_11.setTextFormat(QtCore.Qt.AutoText)
            self.label_11.setPixmap(QtGui.QPixmap("image/finish.png"))
            self.label_11.setAlignment(QtCore.Qt.AlignCenter)
            self.label_11.setObjectName("label_11")
            self.gridLayout.addWidget(self.label_11, 0, 1, 1, 1)
            self.label_13 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            font.setBold(True)
            font.setWeight(75)
            self.label_13.setFont(font)
            self.label_13.setText("")
            self.label_13.setTextFormat(QtCore.Qt.AutoText)
            self.label_13.setPixmap(QtGui.QPixmap("image/work.png"))
            self.label_13.setAlignment(QtCore.Qt.AlignCenter)
            self.label_13.setObjectName("label_13")
            self.gridLayout.addWidget(self.label_13, 0, 2, 1, 1)
            self.finish = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            self.finish.setFont(font)
            self.finish.setText("")
            self.finish.setTextFormat(QtCore.Qt.AutoText)
            self.finish.setAlignment(QtCore.Qt.AlignCenter)
            self.finish.setObjectName("finish")
            self.gridLayout.addWidget(self.finish, 1, 1, 1, 1)
            self.total = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(20)
            self.total.setFont(font)
            self.total.setText("")
            self.total.setTextFormat(QtCore.Qt.AutoText)
            self.total.setAlignment(QtCore.Qt.AlignCenter)
            self.total.setObjectName("total")
            self.gridLayout.addWidget(self.total, 1, 2, 1, 1)
            self.verticalLayout_3.addLayout(self.gridLayout)
            self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_7.setObjectName("horizontalLayout_7")
            self.label_8 = QtWidgets.QLabel(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            font.setBold(True)
            font.setWeight(75)
            self.label_8.setFont(font)
            self.label_8.setObjectName("label_8")
            self.horizontalLayout_7.addWidget(self.label_8)
            spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_7.addItem(spacerItem3)
            self.verticalLayout_3.addLayout(self.horizontalLayout_7)
            self.line_2 = QtWidgets.QFrame(self.page_index)
            self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
            self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
            self.line_2.setObjectName("line_2")
            self.verticalLayout_3.addWidget(self.line_2)
            self.tableWidget_req = QtWidgets.QTableWidget(self.page_index)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(9)
            self.tableWidget_req.setFont(font)
            self.tableWidget_req.setLayoutDirection(QtCore.Qt.LeftToRight)
            self.tableWidget_req.setAutoFillBackground(False)
            self.tableWidget_req.setFrameShape(QtWidgets.QFrame.NoFrame)
            self.tableWidget_req.setFrameShadow(QtWidgets.QFrame.Raised)
            self.tableWidget_req.setLineWidth(7)
            self.tableWidget_req.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
            self.tableWidget_req.setObjectName("tableWidget_req")
            self.tableWidget_req.setColumnCount(0)
            self.tableWidget_req.setRowCount(0)
            self.verticalLayout_3.addWidget(self.tableWidget_req)
            self.stackedWidget.addWidget(self.page_index)
            self.page_todo = QtWidgets.QWidget()
            self.page_todo.setObjectName("page_todo")
            self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.page_todo)
            self.verticalLayout_7.setObjectName("verticalLayout_7")
            self.verticalLayout_4 = QtWidgets.QVBoxLayout()
            self.verticalLayout_4.setObjectName("verticalLayout_4")
            self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_10.setObjectName("horizontalLayout_10")
            self.toolButton_task_add_3 = QtWidgets.QToolButton(self.page_todo)
            icon7 = QtGui.QIcon()
            icon7.addPixmap(QtGui.QPixmap("image/todo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_task_add_3.setIcon(icon7)
            self.toolButton_task_add_3.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_3.setAutoRaise(True)
            self.toolButton_task_add_3.setObjectName("toolButton_task_add_3")
            self.horizontalLayout_10.addWidget(self.toolButton_task_add_3)
            self.label_5 = QtWidgets.QLabel(self.page_todo)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_5.setFont(font)
            self.label_5.setObjectName("label_5")
            self.horizontalLayout_10.addWidget(self.label_5)
            spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_10.addItem(spacerItem4)
            self.verticalLayout_4.addLayout(self.horizontalLayout_10)
            self.horizontalLayout_11 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_11.setObjectName("horizontalLayout_11")
            self.label_10 = QtWidgets.QLabel(self.page_todo)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.label_10.setFont(font)
            self.label_10.setObjectName("label_10")
            self.horizontalLayout_11.addWidget(self.label_10)
            self.comboBox_date = QtWidgets.QComboBox(self.page_todo)
            self.comboBox_date.setObjectName("comboBox_date")
            self.horizontalLayout_11.addWidget(self.comboBox_date)
            self.label_15 = QtWidgets.QLabel(self.page_todo)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            font.setBold(False)
            font.setWeight(50)
            self.label_15.setFont(font)
            self.label_15.setObjectName("label_15")
            self.horizontalLayout_11.addWidget(self.label_15)
            self.comboBox_catalog = QtWidgets.QComboBox(self.page_todo)
            self.comboBox_catalog.setObjectName("comboBox_catalog")
            self.horizontalLayout_11.addWidget(self.comboBox_catalog)
            self.label_4 = QtWidgets.QLabel(self.page_todo)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.label_4.setFont(font)
            self.label_4.setObjectName("label_4")
            self.horizontalLayout_11.addWidget(self.label_4)
            self.comboBox_finstatus = QtWidgets.QComboBox(self.page_todo)
            self.comboBox_finstatus.setObjectName("comboBox_finstatus")
            self.horizontalLayout_11.addWidget(self.comboBox_finstatus)
            self.label_14 = QtWidgets.QLabel(self.page_todo)
            font = QtGui.QFont()
            font.setFamily("微软雅黑")
            font.setPointSize(10)
            self.label_14.setFont(font)
            self.label_14.setObjectName("label_14")
            self.horizontalLayout_11.addWidget(self.label_14)
            self.lineEdit_todo = QtWidgets.QLineEdit(self.page_todo)
            self.lineEdit_todo.setObjectName("lineEdit_todo")
            self.horizontalLayout_11.addWidget(self.lineEdit_todo)
            self.pushButton_todo_query = QtWidgets.QPushButton(self.page_todo)
            self.pushButton_todo_query.setObjectName("pushButton_todo_query")
            self.horizontalLayout_11.addWidget(self.pushButton_todo_query)
            self.verticalLayout_4.addLayout(self.horizontalLayout_11)
            self.todo_un = QtWidgets.QTableView(self.page_todo)
            self.todo_un.setObjectName("todo_un")
            self.verticalLayout_4.addWidget(self.todo_un)
            self.horizontalLayout_16 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_16.setObjectName("horizontalLayout_16")
            self.toolButton__task_add = QtWidgets.QToolButton(self.page_todo)
            icon8 = QtGui.QIcon()
            icon8.addPixmap(QtGui.QPixmap("image/add.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton__task_add.setIcon(icon8)
            self.toolButton__task_add.setIconSize(QtCore.QSize(30, 30))
            self.toolButton__task_add.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton__task_add.setAutoRaise(True)
            self.toolButton__task_add.setObjectName("toolButton__task_add")
            self.horizontalLayout_16.addWidget(self.toolButton__task_add)
            self.toolButton__task_del = QtWidgets.QToolButton(self.page_todo)
            self.toolButton__task_del.setIcon(icon8)
            self.toolButton__task_del.setIconSize(QtCore.QSize(30, 30))
            self.toolButton__task_del.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton__task_del.setAutoRaise(True)
            self.toolButton__task_del.setObjectName("toolButton__task_del")
            self.horizontalLayout_16.addWidget(self.toolButton__task_del)
            self.toolButton__task_export = QtWidgets.QToolButton(self.page_todo)
            icon9 = QtGui.QIcon()
            icon9.addPixmap(QtGui.QPixmap("image/export.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton__task_export.setIcon(icon9)
            self.toolButton__task_export.setIconSize(QtCore.QSize(30, 30))
            self.toolButton__task_export.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton__task_export.setAutoRaise(True)
            self.toolButton__task_export.setObjectName("toolButton__task_export")
            self.horizontalLayout_16.addWidget(self.toolButton__task_export)
            self.verticalLayout_4.addLayout(self.horizontalLayout_16)
            self.verticalLayout_7.addLayout(self.verticalLayout_4)
            self.stackedWidget.addWidget(self.page_todo)
            self.page_wreport = QtWidgets.QWidget()
            self.page_wreport.setObjectName("page_wreport")
            self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.page_wreport)
            self.verticalLayout_10.setObjectName("verticalLayout_10")
            self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_4.setObjectName("horizontalLayout_4")
            self.toolButton_task_add_4 = QtWidgets.QToolButton(self.page_wreport)
            self.toolButton_task_add_4.setIcon(icon7)
            self.toolButton_task_add_4.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_4.setAutoRaise(True)
            self.toolButton_task_add_4.setObjectName("toolButton_task_add_4")
            self.horizontalLayout_4.addWidget(self.toolButton_task_add_4)
            self.label_7 = QtWidgets.QLabel(self.page_wreport)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_7.setFont(font)
            self.label_7.setObjectName("label_7")
            self.horizontalLayout_4.addWidget(self.label_7)
            spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_4.addItem(spacerItem5)
            self.verticalLayout_10.addLayout(self.horizontalLayout_4)
            self.tableView_report = QtWidgets.QTableView(self.page_wreport)
            self.tableView_report.setObjectName("tableView_report")
            self.verticalLayout_10.addWidget(self.tableView_report)
            self.groupBox_2 = QtWidgets.QGroupBox(self.page_wreport)
            self.groupBox_2.setAutoFillBackground(False)
            self.groupBox_2.setFlat(False)
            self.groupBox_2.setCheckable(False)
            self.groupBox_2.setObjectName("groupBox_2")
            self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_2)
            self.verticalLayout_6.setObjectName("verticalLayout_6")
            self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_6.setObjectName("horizontalLayout_6")
            self.label = QtWidgets.QLabel(self.groupBox_2)
            self.label.setObjectName("label")
            self.horizontalLayout_6.addWidget(self.label)
            self.dateEdit_repdate = QtWidgets.QDateEdit(self.groupBox_2)
            self.dateEdit_repdate.setObjectName("dateEdit_repdate")
            self.horizontalLayout_6.addWidget(self.dateEdit_repdate)
            spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_6.addItem(spacerItem6)
            self.verticalLayout_6.addLayout(self.horizontalLayout_6)
            self.formLayout_2 = QtWidgets.QFormLayout()
            self.formLayout_2.setObjectName("formLayout_2")
            self.label_16 = QtWidgets.QLabel(self.groupBox_2)
            self.label_16.setObjectName("label_16")
            self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_16)
            self.lineEdit_reptitle = QtWidgets.QLineEdit(self.groupBox_2)
            self.lineEdit_reptitle.setObjectName("lineEdit_reptitle")
            self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit_reptitle)
            self.verticalLayout_6.addLayout(self.formLayout_2)
            self.horizontalLayout_12 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_12.setObjectName("horizontalLayout_12")
            self.label_12 = QtWidgets.QLabel(self.groupBox_2)
            self.label_12.setObjectName("label_12")
            self.horizontalLayout_12.addWidget(self.label_12)
            self.plainTextEdit_repcontent = QtWidgets.QPlainTextEdit(self.groupBox_2)
            self.plainTextEdit_repcontent.setFrameShape(QtWidgets.QFrame.StyledPanel)
            self.plainTextEdit_repcontent.setFrameShadow(QtWidgets.QFrame.Sunken)
            self.plainTextEdit_repcontent.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored)
            self.plainTextEdit_repcontent.setPlainText("")
            self.plainTextEdit_repcontent.setObjectName("plainTextEdit_repcontent")
            self.horizontalLayout_12.addWidget(self.plainTextEdit_repcontent)
            self.verticalLayout_6.addLayout(self.horizontalLayout_12)
            self.horizontalLayout_13 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_13.setObjectName("horizontalLayout_13")
            self.pushButton_repadd = QtWidgets.QToolButton(self.groupBox_2)
            self.pushButton_repadd.setIcon(icon8)
            self.pushButton_repadd.setIconSize(QtCore.QSize(30, 30))
            self.pushButton_repadd.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.pushButton_repadd.setAutoRaise(True)
            self.pushButton_repadd.setObjectName("pushButton_repadd")
            self.horizontalLayout_13.addWidget(self.pushButton_repadd)
            self.pushButton_repsumit = QtWidgets.QToolButton(self.groupBox_2)
            icon10 = QtGui.QIcon()
            icon10.addPixmap(QtGui.QPixmap("image/finish.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.pushButton_repsumit.setIcon(icon10)
            self.pushButton_repsumit.setIconSize(QtCore.QSize(30, 30))
            self.pushButton_repsumit.setAutoRepeatDelay(300)
            self.pushButton_repsumit.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.pushButton_repsumit.setAutoRaise(True)
            self.pushButton_repsumit.setObjectName("pushButton_repsumit")
            self.horizontalLayout_13.addWidget(self.pushButton_repsumit)
            self.verticalLayout_6.addLayout(self.horizontalLayout_13)
            self.verticalLayout_10.addWidget(self.groupBox_2)
            self.stackedWidget.addWidget(self.page_wreport)
            self.page_requ = QtWidgets.QWidget()
            self.page_requ.setObjectName("page_requ")
            self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.page_requ)
            self.verticalLayout_9.setObjectName("verticalLayout_9")
            self.verticalLayout_8 = QtWidgets.QVBoxLayout()
            self.verticalLayout_8.setObjectName("verticalLayout_8")
            self.horizontalLayout_26 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_26.setObjectName("horizontalLayout_26")
            self.toolButton_task_add_6 = QtWidgets.QToolButton(self.page_requ)
            icon11 = QtGui.QIcon()
            icon11.addPixmap(QtGui.QPixmap("image/work.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_task_add_6.setIcon(icon11)
            self.toolButton_task_add_6.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_6.setAutoRaise(True)
            self.toolButton_task_add_6.setObjectName("toolButton_task_add_6")
            self.horizontalLayout_26.addWidget(self.toolButton_task_add_6)
            self.label_27 = QtWidgets.QLabel(self.page_requ)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_27.setFont(font)
            self.label_27.setObjectName("label_27")
            self.horizontalLayout_26.addWidget(self.label_27)
            spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_26.addItem(spacerItem7)
            self.verticalLayout_8.addLayout(self.horizontalLayout_26)
            self.horizontalLayout_25 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_25.setObjectName("horizontalLayout_25")
            self.label_28 = QtWidgets.QLabel(self.page_requ)
            self.label_28.setObjectName("label_28")
            self.horizontalLayout_25.addWidget(self.label_28)
            self.comboBox_req_channel = QtWidgets.QComboBox(self.page_requ)
            self.comboBox_req_channel.setObjectName("comboBox_req_channel")
            self.horizontalLayout_25.addWidget(self.comboBox_req_channel)
            self.label_29 = QtWidgets.QLabel(self.page_requ)
            self.label_29.setObjectName("label_29")
            self.horizontalLayout_25.addWidget(self.label_29)
            self.comboBox_req_statu = QtWidgets.QComboBox(self.page_requ)
            self.comboBox_req_statu.setObjectName("comboBox_req_statu")
            self.horizontalLayout_25.addWidget(self.comboBox_req_statu)
            self.label_30 = QtWidgets.QLabel(self.page_requ)
            self.label_30.setObjectName("label_30")
            self.horizontalLayout_25.addWidget(self.label_30)
            self.lineEdit_req_title = QtWidgets.QLineEdit(self.page_requ)
            self.lineEdit_req_title.setObjectName("lineEdit_req_title")
            self.horizontalLayout_25.addWidget(self.lineEdit_req_title)
            self.pushButton_req_query = QtWidgets.QPushButton(self.page_requ)
            self.pushButton_req_query.setObjectName("pushButton_req_query")
            self.horizontalLayout_25.addWidget(self.pushButton_req_query)
            self.verticalLayout_8.addLayout(self.horizontalLayout_25)
            self.tableView_3 = QtWidgets.QTableView(self.page_requ)
            self.tableView_3.setObjectName("tableView_3")
            self.verticalLayout_8.addWidget(self.tableView_3)
            self.horizontalLayout_27 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_27.setObjectName("horizontalLayout_27")
            self.toolButton_req_add = QtWidgets.QToolButton(self.page_requ)
            self.toolButton_req_add.setIcon(icon8)
            self.toolButton_req_add.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_req_add.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_req_add.setAutoRaise(True)
            self.toolButton_req_add.setObjectName("toolButton_req_add")
            self.horizontalLayout_27.addWidget(self.toolButton_req_add)
            self.toolButton_req_del = QtWidgets.QToolButton(self.page_requ)
            self.toolButton_req_del.setIcon(icon8)
            self.toolButton_req_del.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_req_del.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_req_del.setAutoRaise(True)
            self.toolButton_req_del.setObjectName("toolButton_req_del")
            self.horizontalLayout_27.addWidget(self.toolButton_req_del)
            self.toolButton_req_export = QtWidgets.QToolButton(self.page_requ)
            self.toolButton_req_export.setIcon(icon8)
            self.toolButton_req_export.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_req_export.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_req_export.setAutoRaise(True)
            self.toolButton_req_export.setObjectName("toolButton_req_export")
            self.horizontalLayout_27.addWidget(self.toolButton_req_export)
            self.verticalLayout_8.addLayout(self.horizontalLayout_27)
            self.verticalLayout_9.addLayout(self.verticalLayout_8)
            self.stackedWidget.addWidget(self.page_requ)
            self.page_qa = QtWidgets.QWidget()
            self.page_qa.setObjectName("page_qa")
            self.verticalLayout_12 = QtWidgets.QVBoxLayout(self.page_qa)
            self.verticalLayout_12.setObjectName("verticalLayout_12")
            self.horizontalLayout_19 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_19.setObjectName("horizontalLayout_19")
            self.toolButton_task_add_7 = QtWidgets.QToolButton(self.page_qa)
            self.toolButton_task_add_7.setIcon(icon3)
            self.toolButton_task_add_7.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_7.setAutoRaise(True)
            self.toolButton_task_add_7.setObjectName("toolButton_task_add_7")
            self.horizontalLayout_19.addWidget(self.toolButton_task_add_7)
            self.label_17 = QtWidgets.QLabel(self.page_qa)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_17.setFont(font)
            self.label_17.setObjectName("label_17")
            self.horizontalLayout_19.addWidget(self.label_17)
            spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_19.addItem(spacerItem8)
            self.label_20 = QtWidgets.QLabel(self.page_qa)
            self.label_20.setObjectName("label_20")
            self.horizontalLayout_19.addWidget(self.label_20)
            self.comboBox_qsys = QtWidgets.QComboBox(self.page_qa)
            self.comboBox_qsys.setObjectName("comboBox_qsys")
            self.horizontalLayout_19.addWidget(self.comboBox_qsys)
            self.label_40 = QtWidgets.QLabel(self.page_qa)
            self.label_40.setObjectName("label_40")
            self.horizontalLayout_19.addWidget(self.label_40)
            self.comboBox_qstatus = QtWidgets.QComboBox(self.page_qa)
            self.comboBox_qstatus.setObjectName("comboBox_qstatus")
            self.horizontalLayout_19.addWidget(self.comboBox_qstatus)
            self.label_2 = QtWidgets.QLabel(self.page_qa)
            self.label_2.setObjectName("label_2")
            self.horizontalLayout_19.addWidget(self.label_2)
            self.lineEdit_question = QtWidgets.QLineEdit(self.page_qa)
            self.lineEdit_question.setText("")
            self.lineEdit_question.setObjectName("lineEdit_question")
            self.horizontalLayout_19.addWidget(self.lineEdit_question)
            self.pushButton_qa_query = QtWidgets.QPushButton(self.page_qa)
            self.pushButton_qa_query.setObjectName("pushButton_qa_query")
            self.horizontalLayout_19.addWidget(self.pushButton_qa_query)
            self.toolButton_qa_export = QtWidgets.QToolButton(self.page_qa)
            self.toolButton_qa_export.setIcon(icon9)
            self.toolButton_qa_export.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_qa_export.setAutoRaise(True)
            self.toolButton_qa_export.setObjectName("toolButton_qa_export")
            self.horizontalLayout_19.addWidget(self.toolButton_qa_export)
            self.verticalLayout_12.addLayout(self.horizontalLayout_19)
            self.tableView_qa = QtWidgets.QTableView(self.page_qa)
            self.tableView_qa.setObjectName("tableView_qa")
            self.verticalLayout_12.addWidget(self.tableView_qa)
            self.groupBox = QtWidgets.QGroupBox(self.page_qa)
            self.groupBox.setObjectName("groupBox")
            self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.groupBox)
            self.verticalLayout_11.setObjectName("verticalLayout_11")
            self.horizontalLayout_31 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_31.setObjectName("horizontalLayout_31")
            self.horizontalLayout_30 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_30.setObjectName("horizontalLayout_30")
            self.label_21 = QtWidgets.QLabel(self.groupBox)
            self.label_21.setObjectName("label_21")
            self.horizontalLayout_30.addWidget(self.label_21)
            self.dateEdit_qadate = QtWidgets.QDateEdit(self.groupBox)
            self.dateEdit_qadate.setObjectName("dateEdit_qadate")
            self.horizontalLayout_30.addWidget(self.dateEdit_qadate)
            self.label_18 = QtWidgets.QLabel(self.groupBox)
            self.label_18.setObjectName("label_18")
            self.horizontalLayout_30.addWidget(self.label_18)
            self.lineEdit_qafrom = QtWidgets.QLineEdit(self.groupBox)
            self.lineEdit_qafrom.setObjectName("lineEdit_qafrom")
            self.horizontalLayout_30.addWidget(self.lineEdit_qafrom)
            self.horizontalLayout_31.addLayout(self.horizontalLayout_30)
            self.horizontalLayout_29 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_29.setObjectName("horizontalLayout_29")
            self.label_19 = QtWidgets.QLabel(self.groupBox)
            self.label_19.setObjectName("label_19")
            self.horizontalLayout_29.addWidget(self.label_19)
            self.comboBox_qasys = QtWidgets.QComboBox(self.groupBox)
            self.comboBox_qasys.setObjectName("comboBox_qasys")
            self.horizontalLayout_29.addWidget(self.comboBox_qasys)
            self.horizontalLayout_31.addLayout(self.horizontalLayout_29)
            self.horizontalLayout_28 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_28.setObjectName("horizontalLayout_28")
            self.label_33 = QtWidgets.QLabel(self.groupBox)
            self.label_33.setObjectName("label_33")
            self.horizontalLayout_28.addWidget(self.label_33)
            self.comboBox_qastatus = QtWidgets.QComboBox(self.groupBox)
            self.comboBox_qastatus.setObjectName("comboBox_qastatus")
            self.horizontalLayout_28.addWidget(self.comboBox_qastatus)
            spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_28.addItem(spacerItem9)
            self.horizontalLayout_31.addLayout(self.horizontalLayout_28)
            self.verticalLayout_11.addLayout(self.horizontalLayout_31)
            self.horizontalLayout_20 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_20.setObjectName("horizontalLayout_20")
            self.label_34 = QtWidgets.QLabel(self.groupBox)
            self.label_34.setObjectName("label_34")
            self.horizontalLayout_20.addWidget(self.label_34)
            self.lineEdit_qaquestion = QtWidgets.QLineEdit(self.groupBox)
            self.lineEdit_qaquestion.setPlaceholderText("")
            self.lineEdit_qaquestion.setObjectName("lineEdit_qaquestion")
            self.horizontalLayout_20.addWidget(self.lineEdit_qaquestion)
            self.verticalLayout_11.addLayout(self.horizontalLayout_20)
            self.label_35 = QtWidgets.QLabel(self.groupBox)
            self.label_35.setObjectName("label_35")
            self.verticalLayout_11.addWidget(self.label_35)
            self.textEdit_qa = QtWidgets.QTextEdit(self.groupBox)
            self.textEdit_qa.setObjectName("textEdit_qa")
            self.verticalLayout_11.addWidget(self.textEdit_qa)
            self.horizontalLayout_32 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_32.setObjectName("horizontalLayout_32")
            self.toolButton_qa_add = QtWidgets.QToolButton(self.groupBox)
            self.toolButton_qa_add.setIcon(icon8)
            self.toolButton_qa_add.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_qa_add.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_qa_add.setAutoRaise(True)
            self.toolButton_qa_add.setObjectName("toolButton_qa_add")
            self.horizontalLayout_32.addWidget(self.toolButton_qa_add)
            self.toolButton_qa_edit = QtWidgets.QToolButton(self.groupBox)
            icon12 = QtGui.QIcon()
            icon12.addPixmap(QtGui.QPixmap("image/edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_qa_edit.setIcon(icon12)
            self.toolButton_qa_edit.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_qa_edit.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_qa_edit.setAutoRaise(True)
            self.toolButton_qa_edit.setObjectName("toolButton_qa_edit")
            self.horizontalLayout_32.addWidget(self.toolButton_qa_edit)
            self.toolButton_qa_sumit = QtWidgets.QToolButton(self.groupBox)
            self.toolButton_qa_sumit.setIcon(icon10)
            self.toolButton_qa_sumit.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_qa_sumit.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
            self.toolButton_qa_sumit.setAutoRaise(True)
            self.toolButton_qa_sumit.setObjectName("toolButton_qa_sumit")
            self.horizontalLayout_32.addWidget(self.toolButton_qa_sumit)
            self.verticalLayout_11.addLayout(self.horizontalLayout_32)
            self.verticalLayout_12.addWidget(self.groupBox)
            self.stackedWidget.addWidget(self.page_qa)
            self.page_compa = QtWidgets.QWidget()
            self.page_compa.setObjectName("page_compa")
            self.verticalLayout_13 = QtWidgets.QVBoxLayout(self.page_compa)
            self.verticalLayout_13.setObjectName("verticalLayout_13")
            self.verticalLayout_2 = QtWidgets.QVBoxLayout()
            self.verticalLayout_2.setObjectName("verticalLayout_2")
            self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
            self.horizontalLayout_3.setObjectName("horizontalLayout_3")
            self.toolButton_task_add_8 = QtWidgets.QToolButton(self.page_compa)
            self.toolButton_task_add_8.setIcon(icon4)
            self.toolButton_task_add_8.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_8.setAutoRaise(True)
            self.toolButton_task_add_8.setObjectName("toolButton_task_add_8")
            self.horizontalLayout_3.addWidget(self.toolButton_task_add_8)
            self.label_36 = QtWidgets.QLabel(self.page_compa)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_36.setFont(font)
            self.label_36.setObjectName("label_36")
            self.horizontalLayout_3.addWidget(self.label_36)
            spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_3.addItem(spacerItem10)
            self.label_38 = QtWidgets.QLabel(self.page_compa)
            self.label_38.setObjectName("label_38")
            self.horizontalLayout_3.addWidget(self.label_38)
            self.comboBox_compa_branch = QtWidgets.QComboBox(self.page_compa)
            self.comboBox_compa_branch.setObjectName("comboBox_compa_branch")
            self.comboBox_compa_branch.addItem("")
            self.comboBox_compa_branch.addItem("")
            self.horizontalLayout_3.addWidget(self.comboBox_compa_branch)
            self.label_37 = QtWidgets.QLabel(self.page_compa)
            self.label_37.setObjectName("label_37")
            self.horizontalLayout_3.addWidget(self.label_37)
            self.comboBox_compa_date = QtWidgets.QComboBox(self.page_compa)
            self.comboBox_compa_date.setObjectName("comboBox_compa_date")
            self.comboBox_compa_date.addItem("")
            self.comboBox_compa_date.addItem("")
            self.comboBox_compa_date.addItem("")
            self.horizontalLayout_3.addWidget(self.comboBox_compa_date)
            self.pushButton_compa_search = QtWidgets.QPushButton(self.page_compa)
            self.pushButton_compa_search.setObjectName("pushButton_compa_search")
            self.horizontalLayout_3.addWidget(self.pushButton_compa_search)
            spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout_3.addItem(spacerItem11)
            self.toolButton_compa_exp = QtWidgets.QToolButton(self.page_compa)
            self.toolButton_compa_exp.setIcon(icon8)
            self.toolButton_compa_exp.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_compa_exp.setAutoRaise(True)
            self.toolButton_compa_exp.setObjectName("toolButton_compa_exp")
            self.horizontalLayout_3.addWidget(self.toolButton_compa_exp)
            self.verticalLayout_2.addLayout(self.horizontalLayout_3)
            self.graphicsView_compa = QtWidgets.QGraphicsView(self.page_compa)
            self.graphicsView_compa.setObjectName("graphicsView_compa")
            self.verticalLayout_2.addWidget(self.graphicsView_compa)
            self.verticalLayout_13.addLayout(self.verticalLayout_2)
            self.stackedWidget.addWidget(self.page_compa)
            self.page_contac = QtWidgets.QWidget()
            self.page_contac.setObjectName("page_contac")
            self.verticalLayout_14 = QtWidgets.QVBoxLayout(self.page_contac)
            self.verticalLayout_14.setObjectName("verticalLayout_14")
            self.horizontalLayout = QtWidgets.QHBoxLayout()
            self.horizontalLayout.setObjectName("horizontalLayout")
            self.toolButton_task_add_9 = QtWidgets.QToolButton(self.page_contac)
            self.toolButton_task_add_9.setIcon(icon5)
            self.toolButton_task_add_9.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_task_add_9.setAutoRaise(True)
            self.toolButton_task_add_9.setObjectName("toolButton_task_add_9")
            self.horizontalLayout.addWidget(self.toolButton_task_add_9)
            self.label_39 = QtWidgets.QLabel(self.page_contac)
            font = QtGui.QFont()
            font.setFamily("黑体")
            font.setPointSize(18)
            self.label_39.setFont(font)
            self.label_39.setObjectName("label_39")
            self.horizontalLayout.addWidget(self.label_39)
            spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout.addItem(spacerItem12)
            self.comboBox_contac_branch = QtWidgets.QComboBox(self.page_contac)
            self.comboBox_contac_branch.setObjectName("comboBox_contac_branch")
            self.comboBox_contac_branch.addItem("")
            self.comboBox_contac_branch.addItem("")
            self.comboBox_contac_branch.addItem("")
            self.horizontalLayout.addWidget(self.comboBox_contac_branch)
            self.lineEdit_searchpeople = QtWidgets.QLineEdit(self.page_contac)
            self.lineEdit_searchpeople.setObjectName("lineEdit_searchpeople")
            self.horizontalLayout.addWidget(self.lineEdit_searchpeople)
            self.pushButton_contac_query = QtWidgets.QPushButton(self.page_contac)
            self.pushButton_contac_query.setObjectName("pushButton_contac_query")
            self.horizontalLayout.addWidget(self.pushButton_contac_query)
            spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
            self.horizontalLayout.addItem(spacerItem13)
            self.toolButton_contac_import = QtWidgets.QToolButton(self.page_contac)
            icon13 = QtGui.QIcon()
            icon13.addPixmap(QtGui.QPixmap("image/import.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
            self.toolButton_contac_import.setIcon(icon13)
            self.toolButton_contac_import.setIconSize(QtCore.QSize(30, 30))
            self.toolButton_contac_import.setAutoRaise(True)
            self.toolButton_contac_import.setObjectName("toolButton_contac_import")
            self.horizontalLayout.addWidget(self.toolButton_contac_import)
            self.verticalLayout_14.addLayout(self.horizontalLayout)
            self.tableView_contac_result = QtWidgets.QTableView(self.page_contac)
            self.tableView_contac_result.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
            self.tableView_contac_result.setObjectName("tableView_contac_result")
            self.verticalLayout_14.addWidget(self.tableView_contac_result)
            self.stackedWidget.addWidget(self.page_contac)
            self.horizontalLayout_2.addWidget(self.stackedWidget)
            MainWindow.setCentralWidget(self.centralwidget)
    
            self.retranslateUi(MainWindow)
            self.toolBox.setCurrentIndex(2)
            self.stackedWidget.setCurrentIndex(4)
            QtCore.QMetaObject.connectSlotsByName(MainWindow)
    
        def retranslateUi(self, MainWindow):
            _translate = QtCore.QCoreApplication.translate
            MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
            self.label_logotxt.setText(_translate("MainWindow", "工作汪小助手"))
            self.toolButton_index.setText(_translate("MainWindow", "首页"))
            self.toolButton_weekreport.setText(_translate("MainWindow", "工作周报"))
            self.toolButton_todo.setText(_translate("MainWindow", "任务计划"))
            self.toolBox.setItemText(self.toolBox.indexOf(self.widget), _translate("MainWindow", "每日工作"))
            self.toolButton_req.setText(_translate("MainWindow", "需求管理"))
            self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), _translate("MainWindow", "需求管理"))
            self.toolButton_qa.setText(_translate("MainWindow", "常见问题"))
            self.toolButton_compa.setText(_translate("MainWindow", "数据罗盘"))
            self.toolBox.setItemText(self.toolBox.indexOf(self.page), _translate("MainWindow", "运营管理"))
            self.toolButton_conta.setText(_translate("MainWindow", "通讯联络"))
            self.toolBox.setItemText(self.toolBox.indexOf(self.page_3), _translate("MainWindow", "小工具"))
            self.toolButton_task_add_2.setText(_translate("MainWindow", "..."))
            self.label_3.setText(_translate("MainWindow", "工作台"))
            self.label_ad.setText(_translate("MainWindow", "工作使人快乐"))
            self.label_9.setText(_translate("MainWindow", "待办事项"))
            self.label_8.setText(_translate("MainWindow", "需求统计"))
            self.toolButton_task_add_3.setText(_translate("MainWindow", "..."))
            self.label_5.setText(_translate("MainWindow", "任务计划"))
            self.label_10.setText(_translate("MainWindow", "日期范围"))
            self.label_15.setText(_translate("MainWindow", "程度"))
            self.label_4.setText(_translate("MainWindow", "状态"))
            self.label_14.setText(_translate("MainWindow", "事项"))
            self.pushButton_todo_query.setText(_translate("MainWindow", "搜索"))
            self.toolButton__task_add.setText(_translate("MainWindow", "新增计划"))
            self.toolButton__task_del.setText(_translate("MainWindow", "删除计划"))
            self.toolButton__task_export.setText(_translate("MainWindow", "导出计划"))
            self.toolButton_task_add_4.setText(_translate("MainWindow", "..."))
            self.label_7.setText(_translate("MainWindow", "工作周报"))
            self.groupBox_2.setTitle(_translate("MainWindow", "详细信息"))
            self.label.setText(_translate("MainWindow", " 日期"))
            self.label_16.setText(_translate("MainWindow", " 标题"))
            self.label_12.setText(_translate("MainWindow", " 内容"))
            self.pushButton_repadd.setText(_translate("MainWindow", "新增"))
            self.pushButton_repsumit.setText(_translate("MainWindow", "提交"))
            self.toolButton_task_add_6.setText(_translate("MainWindow", "..."))
            self.label_27.setText(_translate("MainWindow", "需求管理"))
            self.label_28.setText(_translate("MainWindow", "系统渠道"))
            self.label_29.setText(_translate("MainWindow", "进度状态"))
            self.label_30.setText(_translate("MainWindow", "需求内容"))
            self.pushButton_req_query.setText(_translate("MainWindow", "搜索"))
            self.toolButton_req_add.setText(_translate("MainWindow", "新增需求"))
            self.toolButton_req_del.setText(_translate("MainWindow", "删除需求"))
            self.toolButton_req_export.setText(_translate("MainWindow", "需求导出"))
            self.toolButton_task_add_7.setText(_translate("MainWindow", "..."))
            self.label_17.setText(_translate("MainWindow", "常见问题"))
            self.label_20.setText(_translate("MainWindow", "相关系统"))
            self.label_40.setText(_translate("MainWindow", "是否解决"))
            self.label_2.setText(_translate("MainWindow", "问题"))
            self.lineEdit_question.setPlaceholderText(_translate("MainWindow", "请输入问题搜索答案"))
            self.pushButton_qa_query.setText(_translate("MainWindow", "搜索"))
            self.toolButton_qa_export.setText(_translate("MainWindow", "..."))
            self.groupBox.setTitle(_translate("MainWindow", "详细信息"))
            self.label_21.setText(_translate("MainWindow", "日期"))
            self.label_18.setText(_translate("MainWindow", "问题来源"))
            self.label_19.setText(_translate("MainWindow", "相关系统"))
            self.label_33.setText(_translate("MainWindow", "是否解决"))
            self.label_34.setText(_translate("MainWindow", "问题"))
            self.label_35.setText(_translate("MainWindow", "问题解答"))
            self.toolButton_qa_add.setText(_translate("MainWindow", "新增"))
            self.toolButton_qa_edit.setText(_translate("MainWindow", "修改"))
            self.toolButton_qa_sumit.setText(_translate("MainWindow", "提交"))
            self.toolButton_task_add_8.setText(_translate("MainWindow", "..."))
            self.label_36.setText(_translate("MainWindow", "数据罗盘"))
            self.label_38.setText(_translate("MainWindow", "查询范围"))
            self.comboBox_compa_branch.setItemText(0, _translate("MainWindow", "总行"))
            self.comboBox_compa_branch.setItemText(1, _translate("MainWindow", "分行"))
            self.label_37.setText(_translate("MainWindow", "数据维度"))
            self.comboBox_compa_date.setItemText(0, _translate("MainWindow", "日"))
            self.comboBox_compa_date.setItemText(1, _translate("MainWindow", "月"))
            self.comboBox_compa_date.setItemText(2, _translate("MainWindow", "年"))
            self.pushButton_compa_search.setText(_translate("MainWindow", "查询"))
            self.toolButton_compa_exp.setText(_translate("MainWindow", "..."))
            self.toolButton_task_add_9.setText(_translate("MainWindow", "..."))
            self.label_39.setText(_translate("MainWindow", "通讯录"))
            self.comboBox_contac_branch.setItemText(0, _translate("MainWindow", "全行"))
            self.comboBox_contac_branch.setItemText(1, _translate("MainWindow", "总行"))
            self.comboBox_contac_branch.setItemText(2, _translate("MainWindow", "分行"))
            self.pushButton_contac_query.setText(_translate("MainWindow", "搜索"))
            self.toolButton_contac_import.setText(_translate("MainWindow", "..."))
    
    
    展开全文
  • PyQt项目实战-工作小助手(3 利用QSqlQuery和tableWidget 实现工作台) 项目的工作台需展示当前待办事项的总体情况和需求状态总体情况,作为首页,能够一目了然当期手工主要工作进展。 文章目录PyQt项目实战-工作...

    PyQt项目实战-工作小助手(3 利用QSqlQuery和tableWidget 实现工作台)

    项目的工作台需展示当前待办事项的总体情况和需求状态总体情况,作为首页,能够一目了然当期手工主要工作进展。

    1、功能需求

    1. 实时更新查询待办事项的完成情况,包括已完成数量、未完成数量、待办事项总数
    2. 实时更新查询需求的总体情况,按照涉及的系统和需求的进展阶段二维统计

    2、数据库设计

    项目相对简单,直接使用python自带的sqlite3数据库。

    1. 链接数据库database.db
    import sqlite3
    conn = sqlite3.connect('database.db')
    

    如果数据库database.db不存在,则会自动在当前目录创建一个。

    1. 建立待办事项表todolist和需求情况表require,重点在 “IF NOT EXISTS”。
    import sqlite3
    
    def create_table():
        conn=sqlite3.connect("test.db")
        c=conn.cursor()
        create_todolist='''CREATE TABLE IF NOT EXISTS todolist
            (listid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                catalog integer NOT NULL DEFAULT 1,
                content TEXT NOT NULL,
                finstatus integer NOT NULL ON CONFLICT FAIL,
                pdate TEXT NOT NULL,
                fdate TEXT,
                frecord TEXT,
                plan TEXT)'''
        create_require='''CREATE TABLE IF NOT EXISTS require
           ("reqid" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    		"sysrelated" integer NOT NULL,
    		"ideadate" TEXT NOT NULL,
    		"source" TEXT NOT NULL,
    		"title" TEXT NOT NULL,
    		"content" TEXT,
    		"catagory" integer NOT NULL,
    		"developer" TEXT,
    		"priority" integer,
    		"status" integer NOT NULL,
    		"posdate" TEXT,
    		"edate" TEXT,
    		"fdate" TEXT,
    		"memo" TEXT)'''
    
        c.execute(create_todolist)
        c.execute(create_require)
    
        conn.commit()
        conn.close()
    
    1. 另外一种方式,用QSqlDatabase来创建数据库和表
    from PyQt5.QtSql import QSqlDatabase,QSqlQuery
    
    db = QSqlDatabase.addDatabase('QSQLITE')
    db.setDatabaseName('test2.db')
    if not db.open():
        db.open()
    query=QSqlQuery(db)
    create_todolist='''CREATE TABLE IF NOT EXISTS todolist
            (listid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                catalog integer NOT NULL DEFAULT 1,
                content TEXT NOT NULL,
                finstatus integer NOT NULL ON CONFLICT FAIL,
                pdate TEXT NOT NULL,
                fdate TEXT,
                frecord TEXT,
                plan TEXT)'''
    query.prepare(create_todolist)
    query.exec_()
    db.commit()
    db.close()
    

    3、界面设计

    工作台界面

    1、界面图标均来自于网络,推荐使用(https://www.iconfont.cn/)

    2、待办事项,用的是grid布局,用三个图标和三个label分别表示未完成、已完成和总数量。

    3、需求统计使用的是QTableView控件。

    4、功能代码

    1、获取和展示待办事项数据统计。

    这里需要获取todolist表中总记录数、已完成状态记录数和未完成状态记录数,然后分别显示在三个label文字中。

    1、SELECT COUNT(*) FROM table_name where用于返回表中符合Where条件的记录数。Sql count() 函数各项功能总结如下

    • COUNT(column_name) 函数返回指定列的值的数目(NULL 不计入)
    • COUNT(*) 函数返回表中的记录数
    • COUNT(DISTINCT column_name) 函数返回指定列的不同值的数目

    2、执行完query.exec_()后返回结果集,但是这时指针是指向结果集外面的,所以要使用query.next()去指向第一条记录,也可以使用query.seek(0),并通过query.value(0)获取第一条记录中的第1个属性值,也就是我们需要的统计值。

    结果集其实就是查询到的所有记录的集合,在QSqlQuery类中提供了多个函数来操作这个集合,需要注意这个集合中的记录是从0开始编号的。最常用的操作有:
    seek(int n) :query指向结果集的第n条记录;
    first() :query指向结果集的第一条记录;
    last() :query指向结果集的最后一条记录;
    next() :query指向下一条记录,每执行一次该函数,便指向相邻的下一条记录;
    previous() :query指向上一条记录,每执行一次该函数,便指向相邻的上一条记录;
    record() :获得现在指向的记录;
    value(int n) :获得属性的值。其中n表示你查询的第n个属性,返回的是QVariant类型的数据。
    at() :获得现在query指向的记录在结果集中的编号。

    3、使用Qlabel的setText()方法,将查询获取的数据分别展示在三个label上。注意需要先转换为str。

    4、具体代码如下:

    	'''
        0 工作台数据显示
        '''
    
        def gettodosum(self):  # 待办事项统计
            if not db.open():
                db.open()
            query = QSqlQuery()
            query.exec_('select count(*) from todolist')
            query.next()
            total = query.value(0)  # 获取待办事项记录总数
            query1 = QSqlQuery()
            query1.exec_('select count(*) from todolist where finstatus=1')
            query1.next()
            unfinish = query1.value(0)  # 获取未完成待办事项记录数
            query2 = QSqlQuery()
            query2.exec_('select count(*) from todolist where finstatus=2')
            query2.next()
            finish = query2.value(0)  # 获取已完成待办事项记录数
            self.total.setText(str(total))
            self.unfinish.setText(str(unfinish))
            self.finish.setText(str(finish))
    

    2、获取和展示需求情况数据统计。

    这里需要获取require表中按需求进度和系统分别统计的记录数,然后展示在tablewidget中。

    1、设置tablewidget的行数和列数、行标题和列标题、设置不允许修改。

    2、使用两个for循环嵌套来获取符合条件的记录数。其中第一行和第一列是分类汇总值。

    3、使用tablewidget.setItem()函数循环添加Item。

        def getreqsum(self):  # 需求统计,按照需求状态和相关渠道统计
            if not db.open():
                db.open()
    
            self.tableWidget_req.setColumnCount(len(statuslist))  # 列数
            self.tableWidget_req.setRowCount(len(syslist))  # 行数
            self.tableWidget_req.setHorizontalHeaderLabels(statuslist)  # 列标题
            self.tableWidget_req.setVerticalHeaderLabels(syslist)  # 行标题
            self.tableWidget_req.setEditTriggers(QTableWidget.NoEditTriggers)  # 不允许修改
            	self.tableWidget_req.horizontalHeader().setStyleSheet("QHeaderView::section{background:grey;}")  # 设置标题背景
            self.tableWidget_req.verticalHeader().setStyleSheet("QHeaderView::section{background:grey;}")
            for i in range(len(syslist)):
                row = []
                for j in range(len(statuslist)):
                    query = QSqlQuery()
                    if i == 0 and j == 0:
                        query.exec_('select count(*) from require')
                    elif i == 0 and j > 0:
                        query.exec_('select count(*) from require where status={}'.format(j))
                    elif i > 0 and j == 0:
                        query.exec_('select count(*) from require where sysrelated={}'.format(i))
                    else:
                        query.exec_('select count(*) from require where sysrelated={} and status={}'.format(i, j))
                    query.next()
                    # print(query.value(0))
                    item = QTableWidgetItem(str(query.value(0)))
                    item.setTextAlignment(Qt.AlignCenter)
                    if i == 0 or j == 0:
                        item.setFont(QFont('Times', 12, QFont.Black))  # 设置第一行和第一列字体大小和加粗
                    self.tableWidget_req.setItem(i, j, item)
    
    展开全文
  • 这是一门python GUI编程的项目实战课程,目标是让学员学会使用pyqt设计基本的GUI程序,让你从“不知道python能干什么”和“学完了基础语法不知道再学什么”过渡到知道“python能做任何事情”和“我学的还不够多”,...
  • NetAssist_PyQt 项目已开源分享至GitHub,如果这个项目和这篇博客对你有帮助的话,希望你能给我一颗小星星✨ 0.序 寒假学习了计算机网络方面的知识,把之前稍有了解的socket编程进一步学习,加之从夏天学到冬天一直...
  • PyQT是Python桌面GUI的一个非常流行的框架。可以做很多界面优美的库 上代码: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ZLTool.ui' # # Created by: PyQt5 UI code ...
  • 实战项目为构建一个桌面应用,功能是定制二维码,实现多种数据类型的嵌入,和二维码样式的多样化。 涉及知识点:基于 PyQt5 的界面构建和功能实现(包括标签、按钮、文本框、滑块、选项卡、工具箱、菜单栏、状态栏...
  • python pyqt开发 gui项目实战(目前最新)

    千次阅读 2019-03-21 18:23:31
    这是一门python GUI编程的项目实战课程,目标是让学员学会使用pyqt设计基本的GUI程序,让你从“不知道python能干什么”和“学完了基础语法不知道再学什么”过渡到知道“python能做任何事情”和“我学的还不够多”,...
  • python gui框架简介,pyqt介绍,为什么使用pyqt.mp4 ├─02. 使用python开发pyqt程序的环境搭建.mp4 ├─03. pyqt在ubuntu系统下的体验最终~1.mp4 ├─04. pyqt在mac os系统下的体验.mp4% `5 l: d- w; u" ...

空空如也

空空如也

1 2 3 4 5 ... 8
收藏数 157
精华内容 62
关键字:

pyqt项目实战