# coding: gb2312 import demo_dataset from LSZXPagesLibrary.consensus import * from LSZXPagesLibrary.base_station_page_layout_define import BaseStationPageLayoutDefine from LSZXPagesLibrary.pop_message_dialog import PopDialogMessage class BaseStationPage(BaseStationPageLayoutDefine): def __init__(self): super(BaseStationPage, self).__init__() # 注册返回界面的按钮 self.back_home_button.clicked.connect(self.back_home) # 注册长跑选人界面响应动作 self.next_page_button.clicked.connect(self.next_page_action) # 弹窗 self.message_pop_windows = PopDialogMessage(self) self.message_pop_windows.connect(self.message_pop_commit) def refresh(self) -> None: exercise_type = self.data.get(EXERCISE_TYPE) if exercise_type: exercise_name = EXERCISE_TYPE_TABLE[exercise_type] self.title_label.setText(exercise_name) anchors_mes = self.data.get(ANCHORS_DATA) master_num = len(anchors_mes[MASTER]) slaver_num = len(anchors_mes[SLAVER]) self.master_num.setText(f"{master_num}个") self.slaver_num.setText(f"{slaver_num}个") # 返回首页时弹窗提示 def back_home(self): self.message_pop_windows.show("此操作将结束考试, 是否继续?") # 弹窗点击了确定按钮事件 def message_pop_commit(self): # 跳转 self.jump2(HOME_PAGE) def next_page_action(self): pkg = { EXERCISE_TYPE: self.data[EXERCISE_TYPE], PERSON_LIST: self.data[PERSON_LIST] } self.jump2(RUNNING_PICK_UP, pkg)