first commit
This commit is contained in:
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.venv
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
files
|
||||||
25
main.py
Normal file
25
main.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from PySide6.QtWidgets import QApplication
|
||||||
|
|
||||||
|
from ui.main import MainWindow
|
||||||
|
|
||||||
|
appdata_dir = Path(os.environ["APPDATA"])
|
||||||
|
dtg_dir = appdata_dir / "dtg"
|
||||||
|
target_csv = dtg_dir / "questions.csv"
|
||||||
|
|
||||||
|
if not target_csv.exists():
|
||||||
|
dtg_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
source_csv = Path("template/questions.csv")
|
||||||
|
if not source_csv.exists():
|
||||||
|
raise FileNotFoundError(f"源文件不存在:{source_csv.resolve()}")
|
||||||
|
shutil.copy(source_csv, target_csv)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
window = MainWindow()
|
||||||
|
window.show()
|
||||||
|
sys.exit(app.exec())
|
||||||
38
main.spec
Normal file
38
main.spec
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['main.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[('template', 'template')],
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
noarchive=False,
|
||||||
|
optimize=0,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
name='答辩题目生成器',
|
||||||
|
)
|
||||||
62
module/doc.py
Normal file
62
module/doc.py
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import pathlib
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
|
from docx import Document
|
||||||
|
from docx.shared import Cm
|
||||||
|
|
||||||
|
from module.schema import Course, Student, Question
|
||||||
|
|
||||||
|
|
||||||
|
class DocPaper:
|
||||||
|
def __init__(self, filename: str = 'Paper', template_path: str = '../template/template.docx'):
|
||||||
|
self._doc = Document()
|
||||||
|
self._template = Document(template_path)
|
||||||
|
self._filename = filename
|
||||||
|
|
||||||
|
section = self._doc.sections[0]
|
||||||
|
section.top_margin = Cm(2)
|
||||||
|
section.bottom_margin = Cm(1)
|
||||||
|
section.left_margin = Cm(1.4)
|
||||||
|
section.right_margin = Cm(1.4)
|
||||||
|
|
||||||
|
def add_paper(self, course: Course, student: Student):
|
||||||
|
temp_table = self._template.tables[0]
|
||||||
|
new_table = deepcopy(temp_table)
|
||||||
|
para = self._doc.add_paragraph()
|
||||||
|
para._p.addprevious(new_table._element)
|
||||||
|
|
||||||
|
data_list = {
|
||||||
|
'%CNAME%': course.name,
|
||||||
|
'%CLASS%': student.class_name,
|
||||||
|
'%SNAME%': student.name,
|
||||||
|
'%NO%': student.no,
|
||||||
|
'%SO%': student.so,
|
||||||
|
'%Q1%': student.picked_questions[0].topic,
|
||||||
|
'%Q2%': student.picked_questions[1].topic,
|
||||||
|
'%Q3%': student.picked_questions[2].topic
|
||||||
|
}
|
||||||
|
|
||||||
|
# 替换表格中的占位符
|
||||||
|
for row in new_table.rows:
|
||||||
|
for cell in row.cells:
|
||||||
|
for para in cell.paragraphs:
|
||||||
|
for run in para.runs:
|
||||||
|
for key, val in data_list.items():
|
||||||
|
if key in run.text:
|
||||||
|
run.text = run.text.replace(key, val)
|
||||||
|
break
|
||||||
|
|
||||||
|
def save(self, path: str = './'):
|
||||||
|
self._doc.save(str(pathlib.Path(path) / f"{self._filename}.docx"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
course = Course.load_from_xls('../files/21工程管理-工程造价Ⅱ-点名册-系统0828.xlsx')
|
||||||
|
students = Student.load_from_xls('../files/21工程管理-工程造价Ⅱ-点名册-系统0828.xlsx')
|
||||||
|
questions = Question.load_from_csv()
|
||||||
|
|
||||||
|
d = DocPaper()
|
||||||
|
for student in students:
|
||||||
|
student.pick_question(questions)
|
||||||
|
d.add_paper(course, student)
|
||||||
|
d.save()
|
||||||
115
module/schema.py
Normal file
115
module/schema.py
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import random
|
||||||
|
from typing import Optional
|
||||||
|
from openpyxl.reader.excel import load_workbook
|
||||||
|
|
||||||
|
|
||||||
|
class Question:
|
||||||
|
def __init__(self, no: str, topic: str):
|
||||||
|
self._no: str = no
|
||||||
|
self._topic: str = topic
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"Question<No: {self._no}, Topic: {self._topic}>"
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__str__()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def load_from_csv(path: Optional[str] = None) -> list['Question']:
|
||||||
|
questions = []
|
||||||
|
with open(path if path else '../files/questions.csv', encoding='gbk') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
questions.append(Question(*line.strip('\n').split(',')))
|
||||||
|
return questions
|
||||||
|
|
||||||
|
@property
|
||||||
|
def no(self) -> str:
|
||||||
|
return self._no
|
||||||
|
|
||||||
|
@property
|
||||||
|
def topic(self) -> str:
|
||||||
|
return self._topic
|
||||||
|
|
||||||
|
|
||||||
|
class Student:
|
||||||
|
def __init__(self, no: str, so: str, name: str, major: str, class_name: str):
|
||||||
|
self._no: str = no
|
||||||
|
self._so: str = so
|
||||||
|
self._name: str = name
|
||||||
|
self._major: str = major
|
||||||
|
self._class_name: str = class_name
|
||||||
|
self._picked_questions: list[Question] = []
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"Student<No: {self._no}, SO: {self._so}, Name: {self._name}, Major: {self._major}, Class: {self._class_name}>"
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__str__()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def load_from_xls(path: str) -> list['Student']:
|
||||||
|
wb = load_workbook(path, read_only=True)
|
||||||
|
ws = wb.active
|
||||||
|
students = []
|
||||||
|
for row in ws.iter_rows(min_row=6, max_col=5, values_only=True):
|
||||||
|
students.append(Student(*row))
|
||||||
|
return [x for x in students if x.valid]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def valid(self) -> bool:
|
||||||
|
return bool(self._no and self._so and self._name and self._major and self._class_name)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def picked_questions(self) -> list[Question]:
|
||||||
|
return self._picked_questions
|
||||||
|
|
||||||
|
@property
|
||||||
|
def no(self) -> str:
|
||||||
|
return self._no
|
||||||
|
|
||||||
|
@property
|
||||||
|
def so(self) -> str:
|
||||||
|
return self._so
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self) -> str:
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def major(self) -> str:
|
||||||
|
return self._major
|
||||||
|
|
||||||
|
@property
|
||||||
|
def class_name(self) -> str:
|
||||||
|
return self._class_name
|
||||||
|
|
||||||
|
def pick_question(self, questions: list[Question], num: int = 3) -> None:
|
||||||
|
if len(questions) < num:
|
||||||
|
raise ValueError("Not enough questions to pick from.")
|
||||||
|
self._picked_questions = random.sample(questions, num)
|
||||||
|
|
||||||
|
|
||||||
|
class Course:
|
||||||
|
def __init__(self, name: str):
|
||||||
|
self._name = name
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"Course<Name: {self._name}>"
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__str__()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def load_from_xls(path: str) -> 'Course':
|
||||||
|
wb = load_workbook(path, read_only=True)
|
||||||
|
ws = wb.active
|
||||||
|
name: str = ws['E3'].value
|
||||||
|
return Course(name[5:])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self) -> str:
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
...
|
||||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
openpyxl
|
||||||
|
pyside6
|
||||||
|
python-docx
|
||||||
90
template/questions.csv
Normal file
90
template/questions.csv
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
0.0.01,简述本课程设计的基本内容。
|
||||||
|
0.0.03,简述本课程设计的基本步骤。
|
||||||
|
0.0.05,本课程设计采用的主要依据有哪些?
|
||||||
|
1.1.04,新建项目与扩建项目如何区分?
|
||||||
|
1.1.15,请举例说明基建的组成。
|
||||||
|
1.1.18,请说明基建的程序。
|
||||||
|
1.1.22,请说明工程造价的两层含义。
|
||||||
|
2.0.06,定额按用途划分一般有哪几种?各自的主要作用是什么?
|
||||||
|
2.1.06,施工定额与其它定额有何区别?
|
||||||
|
2.2.04,江苏省计价定额中的“综合单价”包括哪几部分?怎么计算出来的?
|
||||||
|
2.2.07,定额的换算方法一般有哪几种?请简单说明。
|
||||||
|
2.2.08,什么是材料的预算价格?
|
||||||
|
2.2.22,材料的预算价格包括哪些组成部分?
|
||||||
|
3.0.08,什么是设计概算?其一般由谁编制?
|
||||||
|
3.1.06,施工图预算一般由谁编制?主要依据有哪些?
|
||||||
|
3.1.15,常用的投标策略有哪些?
|
||||||
|
3.2.12,什么是“两算对比”?由谁完成?有何意义?
|
||||||
|
3.3.04,竣工决算由谁完成?其主要方法有哪些?
|
||||||
|
3.3.08,竣工决算的主要依据有哪些?
|
||||||
|
4.1.02,什么是工程量清单?
|
||||||
|
4.1.05,什么是招标工程量清单?什么是已标价工程量清单?
|
||||||
|
4.1.09,工程量清单包括哪五大类?
|
||||||
|
4.1.09,什么是招标控制价?它由谁编制?
|
||||||
|
4.1.11,清单的项目编码该如何确定?
|
||||||
|
4.1.13,清单中的项目名称该如何确定?
|
||||||
|
4.2.05,什么是综合单价?
|
||||||
|
4.2.12,综合单价包括哪些组成部分?各组成部分如何计算得到?
|
||||||
|
4.2.14,综合单价如何形成?
|
||||||
|
4.3.22,工程量的计算精度有何要求?
|
||||||
|
5.0.02,统筹法算量中提到的“三线一面”是指什么?
|
||||||
|
5.0.12,普通的单层建筑如何计算建筑面积?
|
||||||
|
5.0.15,坡屋顶该如何计算建筑面积?
|
||||||
|
5.0.16,阳台该如何计算建筑面积?
|
||||||
|
5.0.19,楼梯该如何计算建筑面积?
|
||||||
|
5.0.24,雨篷该如何计算建筑面积?
|
||||||
|
5.0.28,飘窗计算建筑面积的条件有什么?
|
||||||
|
5.01.01,回填土一般有哪几类?
|
||||||
|
5.01.04,计算挖基坑土方时,如何考虑工作面和放坡?
|
||||||
|
5.01.05,挖土深度该如何确定?
|
||||||
|
5.01.08,挖土时干、湿土该如何划分?
|
||||||
|
5.01.18,挖沟槽土方和挖基坑土方有何区别?
|
||||||
|
5.01.37,平整场地的内容是什么?它该如何计算工程量?
|
||||||
|
5.01.57,如何判定是缺土内运还是余土外运?
|
||||||
|
5.03.05,预制钢筋混凝土管桩该如何计算工程量?
|
||||||
|
5.03.08,什么是送桩?其该如何计算工程量?
|
||||||
|
5.03.16,打孔灌注桩一般应计算哪些子项的工程量?
|
||||||
|
5.03.24,钻孔灌注桩一般应计算哪些子项的工程量?
|
||||||
|
5.03.39,截桩该如何计算工程量?
|
||||||
|
5.04.08,砖墙与基础如何划分?
|
||||||
|
5.04.11,计算砖墙工程量时,墙高该如何取定?
|
||||||
|
5.04.15,请简述不同厚度的标准砖墙的计算厚度分别是多少。
|
||||||
|
5.04.19,计算砖墙工程量时,应扣除哪些内容?
|
||||||
|
5.04.21,砖砌大放脚该如何计算工程量?
|
||||||
|
5.04.33,砖砌台阶该如何计算工程量?
|
||||||
|
5.05.04,什么是钢筋的理论重量?如何得到?
|
||||||
|
5.05.05,钢筋工程量有几种计算方法?如何选用?
|
||||||
|
5.06.04,基础下的混凝土垫层,其厚度有何约定?
|
||||||
|
5.06.04,混凝土墙该如何计算工程量?
|
||||||
|
5.06.08,钢筋混凝土独立基础该如何计算工程量?杯形基础该如何计算工程量并套定额?
|
||||||
|
5.06.12,混凝土柱高该如何确定?
|
||||||
|
5.06.18,构造柱该如何计算工程量?
|
||||||
|
5.06.34,钢筋混凝土过梁长度该如何取定?
|
||||||
|
5.06.46,有梁板和无梁板分别如何计算工程量?
|
||||||
|
5.06.55,混凝土墙计算工程量时,有哪些内容应扣除?
|
||||||
|
5.06.73,钢筋混凝土直形楼梯该如何计算工程量?
|
||||||
|
5.06.78,钢筋混凝土阳台(其栏板为砖砌)该如何计算工程量?
|
||||||
|
5.06.82,钢筋混凝土雨篷该如何计算工程量?
|
||||||
|
5.10.05,卷材防水屋面该如何计算工程量?
|
||||||
|
5.10.09,刚性防水屋面该如何计算工程量?
|
||||||
|
5.13.07,整体面层地面和块料面层地面工程量的计算有何区别?
|
||||||
|
5.13.23,楼梯整体面层和楼梯块料面层工程量的计算有何区别?
|
||||||
|
5.14.05,内墙面抹灰该如何计算工程量?
|
||||||
|
5.14.11,外墙面抹灰该如何计算工程量?
|
||||||
|
5.15.05,吊顶中,简单型龙骨和复杂性龙骨有何区别?
|
||||||
|
5.15.15,天棚抹灰该如何计算工程量?
|
||||||
|
5.19.03,何时应计算超高费?
|
||||||
|
5.20.05,综合脚手架和单项脚手架分别什么时候采用?
|
||||||
|
5.21.03,模板工程量有几种计算方法?如何选用?
|
||||||
|
6.1.03,清单计价条件下,工程造价包括哪几大部分?
|
||||||
|
6.1.14,机械费包括哪些组成部分?
|
||||||
|
6.1.23,单价措施费和总价措施费有何区别?
|
||||||
|
6.1.32,什么是暂列金额?如果工程中未列支完,剩余的暂列金额归谁所有?
|
||||||
|
6.1.33,什么是暂列金额?它由谁确定?
|
||||||
|
6.1.37,什么是材料暂估价?它在结算中如何完成结算?
|
||||||
|
6.1.42,规费有哪些?它们的计算基础是什么?
|
||||||
|
6.1.65,哪些费用为不可竞争费用?
|
||||||
|
6.2.04,工程类别该如何确定?
|
||||||
|
6.3.11,人工费调差如何实现?
|
||||||
|
6.3.23,总承包服务费该如何计取?
|
||||||
|
7.0.05,判定废标的常见情况有哪些?
|
||||||
|
BIN
template/template.docx
Normal file
BIN
template/template.docx
Normal file
Binary file not shown.
110
ui/main.py
Normal file
110
ui/main.py
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from PySide6.QtCore import QObject, QThread, Signal
|
||||||
|
from PySide6.QtWidgets import QMainWindow, QFileDialog
|
||||||
|
|
||||||
|
from module.doc import DocPaper
|
||||||
|
from module.schema import Course, Student, Question
|
||||||
|
from ui.pyui.main import Ui_MainWindow
|
||||||
|
|
||||||
|
|
||||||
|
def resource_path(relative_path: str) -> str:
|
||||||
|
if hasattr(sys, '_MEIPASS'):
|
||||||
|
base_path = sys._MEIPASS
|
||||||
|
else:
|
||||||
|
base_path = os.path.abspath(".")
|
||||||
|
return os.path.join(base_path, relative_path)
|
||||||
|
|
||||||
|
|
||||||
|
class Worker(QObject):
|
||||||
|
progress = Signal(str)
|
||||||
|
finished = Signal()
|
||||||
|
|
||||||
|
def __init__(self, input_filepath: str, output_filepath: str, output_filename: str):
|
||||||
|
super().__init__()
|
||||||
|
self.input_filepath = input_filepath
|
||||||
|
self.output_filepath = output_filepath
|
||||||
|
self.output_filename = output_filename
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.progress.emit("第一步:正在读取课程信息...")
|
||||||
|
course = Course.load_from_xls(self.input_filepath)
|
||||||
|
self.progress.emit("第二步:正在读取学生信息...")
|
||||||
|
students = Student.load_from_xls(self.input_filepath)
|
||||||
|
self.progress.emit("第三步:正在读取题目信息...")
|
||||||
|
questions = Question.load_from_csv(str(Path(os.environ["APPDATA"]) / "dtg" / "questions.csv"))
|
||||||
|
|
||||||
|
d = DocPaper(self.output_filename, template_path=resource_path("template/template.docx"))
|
||||||
|
for student in students:
|
||||||
|
self.progress.emit(f"第四步:({student.no}/{len(students)})正在处理学生:{student.name},学号:{student.so}")
|
||||||
|
student.pick_question(questions)
|
||||||
|
d.add_paper(course, student)
|
||||||
|
self.progress.emit("第五步:正在保存文件...")
|
||||||
|
d.save(self.output_filepath)
|
||||||
|
self.progress.emit("第六步:文件保存成功!")
|
||||||
|
os.startfile(Path(self.output_filepath) / f"{self.output_filename}.docx")
|
||||||
|
|
||||||
|
|
||||||
|
class MainWindow(QMainWindow, Ui_MainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setupUi(self)
|
||||||
|
self.setWindowTitle("答辩题目生成器")
|
||||||
|
|
||||||
|
self.select_student_list.clicked.connect(self.choose_student_list)
|
||||||
|
self.select_output_dir.clicked.connect(self.choose_output_dir)
|
||||||
|
self.edit_topics.clicked.connect(self.edit_questions)
|
||||||
|
self.start.clicked.connect(self.start_generate)
|
||||||
|
|
||||||
|
def on_button_clicked(self):
|
||||||
|
self.statusBar().showMessage("这是状态栏信息")
|
||||||
|
|
||||||
|
def choose_student_list(self):
|
||||||
|
file_path, _ = QFileDialog.getOpenFileName(self, "选择文件", "", "Excel 文件 (*.xlsx);")
|
||||||
|
if file_path:
|
||||||
|
self.student_list_path.setText(file_path)
|
||||||
|
|
||||||
|
input_dir_path = file_path[:file_path.rfind('/')]
|
||||||
|
default_output_filename = file_path[file_path.rfind('/') + 1:file_path.rfind('-点名册')]
|
||||||
|
|
||||||
|
self.output_path.setText(input_dir_path)
|
||||||
|
self.output_filename.setText(default_output_filename)
|
||||||
|
|
||||||
|
def choose_output_dir(self):
|
||||||
|
dir_path = QFileDialog.getExistingDirectory(self, "选择文件夹", "")
|
||||||
|
if dir_path:
|
||||||
|
self.output_path.setText(dir_path)
|
||||||
|
|
||||||
|
def edit_questions(self):
|
||||||
|
csv_path = Path(os.environ["APPDATA"]) / "dtg" / "questions.csv"
|
||||||
|
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
os.startfile(csv_path.resolve())
|
||||||
|
elif platform.system() == "Darwin": # macOS
|
||||||
|
subprocess.run(["open", csv_path.resolve()])
|
||||||
|
else: # Linux
|
||||||
|
subprocess.run(["xdg-open", csv_path.resolve()])
|
||||||
|
|
||||||
|
self.update_statusbar("已打开题目文件,请在外部程序编辑后保存。")
|
||||||
|
|
||||||
|
def start_generate(self):
|
||||||
|
self.thread = QThread()
|
||||||
|
self.worker = Worker(self.student_list_path.text(), self.output_path.text(), self.output_filename.text())
|
||||||
|
self.worker.moveToThread(self.thread)
|
||||||
|
|
||||||
|
# 线程启动与信号连接
|
||||||
|
self.thread.started.connect(self.worker.run)
|
||||||
|
self.worker.progress.connect(self.update_statusbar)
|
||||||
|
self.worker.finished.connect(self.thread.quit)
|
||||||
|
self.worker.finished.connect(self.worker.deleteLater)
|
||||||
|
self.thread.finished.connect(self.thread.deleteLater)
|
||||||
|
|
||||||
|
# 启动线程
|
||||||
|
self.thread.start()
|
||||||
|
|
||||||
|
def update_statusbar(self, message):
|
||||||
|
self.statusBar().showMessage(message)
|
||||||
159
ui/main.ui
Normal file
159
ui/main.ui
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::WindowModality::ApplicationModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>200</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>500</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>500</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>学生名单</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="student_list_path"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="select_student_list">
|
||||||
|
<property name="text">
|
||||||
|
<string>选择</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>导出设置</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>目 录</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="output_path"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="select_output_dir">
|
||||||
|
<property name="text">
|
||||||
|
<string>选择</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>文件名</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="output_filename"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="edit_topics">
|
||||||
|
<property name="text">
|
||||||
|
<string>编辑题库</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="start">
|
||||||
|
<property name="text">
|
||||||
|
<string>导出</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
140
ui/pyui/main.py
Normal file
140
ui/pyui/main.py
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file 'main.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 6.9.0
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||||
|
QMetaObject, QObject, QPoint, QRect,
|
||||||
|
QSize, QTime, QUrl, Qt)
|
||||||
|
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||||
|
QFont, QFontDatabase, QGradient, QIcon,
|
||||||
|
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||||
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||||
|
from PySide6.QtWidgets import (QApplication, QGridLayout, QGroupBox, QHBoxLayout,
|
||||||
|
QLabel, QLineEdit, QMainWindow, QPushButton,
|
||||||
|
QSizePolicy, QSpacerItem, QStatusBar, QWidget)
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
if not MainWindow.objectName():
|
||||||
|
MainWindow.setObjectName(u"MainWindow")
|
||||||
|
MainWindow.setWindowModality(Qt.WindowModality.ApplicationModal)
|
||||||
|
MainWindow.resize(500, 200)
|
||||||
|
MainWindow.setMinimumSize(QSize(500, 200))
|
||||||
|
MainWindow.setMaximumSize(QSize(500, 200))
|
||||||
|
self.centralwidget = QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName(u"centralwidget")
|
||||||
|
self.gridLayout_2 = QGridLayout(self.centralwidget)
|
||||||
|
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||||
|
self.horizontalLayout_3 = QHBoxLayout()
|
||||||
|
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||||
|
self.label = QLabel(self.centralwidget)
|
||||||
|
self.label.setObjectName(u"label")
|
||||||
|
|
||||||
|
self.horizontalLayout_3.addWidget(self.label)
|
||||||
|
|
||||||
|
self.student_list_path = QLineEdit(self.centralwidget)
|
||||||
|
self.student_list_path.setObjectName(u"student_list_path")
|
||||||
|
|
||||||
|
self.horizontalLayout_3.addWidget(self.student_list_path)
|
||||||
|
|
||||||
|
self.select_student_list = QPushButton(self.centralwidget)
|
||||||
|
self.select_student_list.setObjectName(u"select_student_list")
|
||||||
|
|
||||||
|
self.horizontalLayout_3.addWidget(self.select_student_list)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout_2.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.groupBox = QGroupBox(self.centralwidget)
|
||||||
|
self.groupBox.setObjectName(u"groupBox")
|
||||||
|
self.gridLayout = QGridLayout(self.groupBox)
|
||||||
|
self.gridLayout.setObjectName(u"gridLayout")
|
||||||
|
self.horizontalLayout = QHBoxLayout()
|
||||||
|
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||||
|
self.label_2 = QLabel(self.groupBox)
|
||||||
|
self.label_2.setObjectName(u"label_2")
|
||||||
|
self.label_2.setMinimumSize(QSize(40, 0))
|
||||||
|
self.label_2.setMaximumSize(QSize(40, 16777215))
|
||||||
|
|
||||||
|
self.horizontalLayout.addWidget(self.label_2)
|
||||||
|
|
||||||
|
self.output_path = QLineEdit(self.groupBox)
|
||||||
|
self.output_path.setObjectName(u"output_path")
|
||||||
|
|
||||||
|
self.horizontalLayout.addWidget(self.output_path)
|
||||||
|
|
||||||
|
self.select_output_dir = QPushButton(self.groupBox)
|
||||||
|
self.select_output_dir.setObjectName(u"select_output_dir")
|
||||||
|
|
||||||
|
self.horizontalLayout.addWidget(self.select_output_dir)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.horizontalLayout_2 = QHBoxLayout()
|
||||||
|
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||||
|
self.label_3 = QLabel(self.groupBox)
|
||||||
|
self.label_3.setObjectName(u"label_3")
|
||||||
|
self.label_3.setMinimumSize(QSize(40, 0))
|
||||||
|
self.label_3.setMaximumSize(QSize(40, 16777215))
|
||||||
|
|
||||||
|
self.horizontalLayout_2.addWidget(self.label_3)
|
||||||
|
|
||||||
|
self.output_filename = QLineEdit(self.groupBox)
|
||||||
|
self.output_filename.setObjectName(u"output_filename")
|
||||||
|
|
||||||
|
self.horizontalLayout_2.addWidget(self.output_filename)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.groupBox, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
self.horizontalLayout_4 = QHBoxLayout()
|
||||||
|
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||||
|
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
||||||
|
|
||||||
|
self.horizontalLayout_4.addItem(self.horizontalSpacer)
|
||||||
|
|
||||||
|
self.edit_topics = QPushButton(self.centralwidget)
|
||||||
|
self.edit_topics.setObjectName(u"edit_topics")
|
||||||
|
|
||||||
|
self.horizontalLayout_4.addWidget(self.edit_topics)
|
||||||
|
|
||||||
|
self.start = QPushButton(self.centralwidget)
|
||||||
|
self.start.setObjectName(u"start")
|
||||||
|
|
||||||
|
self.horizontalLayout_4.addWidget(self.start)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout_2.addLayout(self.horizontalLayout_4, 2, 0, 1, 1)
|
||||||
|
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.statusbar = QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName(u"statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||||
|
self.label.setText(QCoreApplication.translate("MainWindow", u"\u5b66\u751f\u540d\u5355", None))
|
||||||
|
self.select_student_list.setText(QCoreApplication.translate("MainWindow", u"\u9009\u62e9", None))
|
||||||
|
self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"\u5bfc\u51fa\u8bbe\u7f6e", None))
|
||||||
|
self.label_2.setText(QCoreApplication.translate("MainWindow", u"\u76ee \u5f55", None))
|
||||||
|
self.select_output_dir.setText(QCoreApplication.translate("MainWindow", u"\u9009\u62e9", None))
|
||||||
|
self.label_3.setText(QCoreApplication.translate("MainWindow", u"\u6587\u4ef6\u540d", None))
|
||||||
|
self.edit_topics.setText(QCoreApplication.translate("MainWindow", u"\u7f16\u8f91\u9898\u5e93", None))
|
||||||
|
self.start.setText(QCoreApplication.translate("MainWindow", u"\u5bfc\u51fa", None))
|
||||||
|
# retranslateUi
|
||||||
|
|
||||||
Reference in New Issue
Block a user