diff --git a/client/src/pdd_ui.py b/client/src/pdd_ui.py index bc1fc40..58f1b16 100644 --- a/client/src/pdd_ui.py +++ b/client/src/pdd_ui.py @@ -344,7 +344,7 @@ class PDDTaskPage(QWidget): self.keywordInput = SearchLineEdit(self) self.keywordInput.setPlaceholderText("任务编号、商品编号或商品标题") self.keywordInput.setClearButtonEnabled(True) - self.keywordInput.setMinimumWidth(240) + self.keywordInput.setFixedWidth(190) self.keywordInput.setAccessibleName("任务关键词") self.searchButton = PushButton(FIF.SEARCH, "搜索", self) @@ -355,19 +355,18 @@ class PDDTaskPage(QWidget): self.commandCard = CardWidget(self) commandLayout = QGridLayout(self.commandCard) - commandLayout.setContentsMargins(20, 16, 20, 18) + commandLayout.setContentsMargins(20, 14, 20, 14) commandLayout.setHorizontalSpacing(12) - commandLayout.setVerticalSpacing(6) + commandLayout.addWidget(self.autoFetchButton, 0, 0) commandLayout.addWidget(CaptionLabel("任务类型", self.commandCard), 0, 1) - commandLayout.addWidget(CaptionLabel("任务状态", self.commandCard), 0, 2) - commandLayout.addWidget(CaptionLabel("关键词", self.commandCard), 0, 3) - commandLayout.addWidget(self.autoFetchButton, 1, 0) - commandLayout.addWidget(self.taskTypeCombo, 1, 1) - commandLayout.addWidget(self.statusCombo, 1, 2) - commandLayout.addWidget(self.keywordInput, 1, 3) - commandLayout.addWidget(self.searchButton, 1, 4) - commandLayout.addWidget(self.refreshButton, 1, 5) - commandLayout.setColumnStretch(3, 1) + commandLayout.addWidget(self.taskTypeCombo, 0, 2) + commandLayout.addWidget(CaptionLabel("任务状态", self.commandCard), 0, 3) + commandLayout.addWidget(self.statusCombo, 0, 4) + commandLayout.addWidget(CaptionLabel("关键词", self.commandCard), 0, 5) + commandLayout.addWidget(self.keywordInput, 0, 6) + commandLayout.addWidget(self.searchButton, 0, 7) + commandLayout.setColumnStretch(8, 1) + commandLayout.addWidget(self.refreshButton, 0, 9) def _build_content_area(self) -> None: self.taskTable = TableView(self) @@ -402,12 +401,8 @@ class PDDTaskPage(QWidget): emptyTextLayout = QVBoxLayout() emptyTextLayout.setSpacing(2) - self.emptyTitleLabel = SubtitleLabel( - "还没有领取过任务", self.emptyStateCard - ) - self.emptyMessageLabel = BodyLabel( - "点击“开始自动获取”开始领取任务。", self.emptyStateCard - ) + self.emptyTitleLabel = SubtitleLabel("", self.emptyStateCard) + self.emptyMessageLabel = BodyLabel("", self.emptyStateCard) self.emptyMessageLabel.setWordWrap(True) emptyTextLayout.addWidget(self.emptyTitleLabel) emptyTextLayout.addWidget(self.emptyMessageLabel) @@ -572,11 +567,8 @@ class PDDTaskPage(QWidget): ) return - self._show_empty_state( - "还没有领取过任务", - "点击“开始自动获取”开始领取任务。", - False, - ) + self.emptyStateCard.hide() + self._update_placeholder_rows() def _show_empty_state( self, title: str, message: str, show_clear_button: bool