74 lines
2.5 KiB
Python
74 lines
2.5 KiB
Python
# coding: gb2312
|
|
import demo_dataset
|
|
from LSZXPagesLibrary.consensus import *
|
|
from LSZXPagesLibrary.pick_up_page_layout_define import PickUpPageLayoutDefine
|
|
from LSZXPagesLibrary.pop_message_dialog import PopDialogMessage
|
|
from PureBackend.global_execrise_backend import GEB
|
|
|
|
|
|
class PickUpPage(PickUpPageLayoutDefine):
|
|
|
|
def __init__(self):
|
|
super(PickUpPage, self).__init__()
|
|
self.eb = GEB().get_geb()
|
|
self.person_mes = None
|
|
self.exercise_name = None
|
|
# 注册键盘的响应动作
|
|
self.keyboard.connect(self.keyboard_func)
|
|
# 注册返回界面的按钮
|
|
self.back_home_button.clicked.connect(self.back_home)
|
|
# 注册选人界面响应动作
|
|
self.tags_switch_selector.connect(self.pick_up_person)
|
|
# 弹窗
|
|
self.message_pop_windows = PopDialogMessage(self)
|
|
# 注册弹窗确定按钮响应事件
|
|
self.message_pop_windows.connect(self.message_pop_commit)
|
|
# 注册弹窗取消按钮响应事件
|
|
self.message_pop_windows.cancel_connect(self.message_pop_cancel)
|
|
|
|
def pick_up_person(self, person_mes):
|
|
self.person_mes = person_mes
|
|
# 打印人员信息
|
|
self.message_pop_windows.show(
|
|
person_mes["name"]
|
|
+ "(编号:" + person_mes["id"] + ")"
|
|
+ "是否确定开始"
|
|
+ self.exercise_name
|
|
+ "考试?"
|
|
)
|
|
|
|
def refresh(self) -> None:
|
|
exercise_type = self.data.get(EXERCISE_TYPE)
|
|
if exercise_type:
|
|
self.exercise_name = EXERCISE_TYPE_TABLE[exercise_type]
|
|
self.title_label.setText(self.exercise_name)
|
|
# 更新人员列表
|
|
self.tags_switch_selector.set_person(_person_list=self.data.get(PERSON_LIST))
|
|
self.keyboard.delete_content()
|
|
|
|
def keyboard_func(self):
|
|
# 获得键盘输入
|
|
keyboard_value = self.keyboard.get_content()
|
|
# 更新筛选条件
|
|
self.tags_switch_selector.select_person_from_id_segment(id_segment=keyboard_value)
|
|
|
|
# 返回首页时弹窗提示
|
|
def back_home(self):
|
|
self.jump2(HOME_PAGE)
|
|
|
|
# 弹窗点击了确定按钮事件
|
|
def message_pop_commit(self):
|
|
# 跳转
|
|
pkg = {
|
|
EXERCISE_TYPE: self.data.get(EXERCISE_TYPE),
|
|
PERSON_MES: self.person_mes,
|
|
FRAME_GENERATOR: self.eb.get_exercise_video,
|
|
PERSON_LIST: self.data.get(PERSON_LIST)
|
|
}
|
|
self.jump2(PREPARE_PAGE, pkg)
|
|
|
|
# 弹窗点击了取消按钮事件
|
|
def message_pop_cancel(self):
|
|
# 取消所有选择
|
|
self.tags_switch_selector.unselect_all()
|