fix: 调整任务筛选栏布局 (#4)

This commit is contained in:
chengma
2026-08-06 14:36:35 +08:00
parent aad20fece8
commit 8f6e657820
+15 -23
View File
@@ -344,7 +344,7 @@ class PDDTaskPage(QWidget):
self.keywordInput = SearchLineEdit(self) self.keywordInput = SearchLineEdit(self)
self.keywordInput.setPlaceholderText("任务编号、商品编号或商品标题") self.keywordInput.setPlaceholderText("任务编号、商品编号或商品标题")
self.keywordInput.setClearButtonEnabled(True) self.keywordInput.setClearButtonEnabled(True)
self.keywordInput.setMinimumWidth(240) self.keywordInput.setFixedWidth(190)
self.keywordInput.setAccessibleName("任务关键词") self.keywordInput.setAccessibleName("任务关键词")
self.searchButton = PushButton(FIF.SEARCH, "搜索", self) self.searchButton = PushButton(FIF.SEARCH, "搜索", self)
@@ -355,19 +355,18 @@ class PDDTaskPage(QWidget):
self.commandCard = CardWidget(self) self.commandCard = CardWidget(self)
commandLayout = QGridLayout(self.commandCard) commandLayout = QGridLayout(self.commandCard)
commandLayout.setContentsMargins(20, 16, 20, 18) commandLayout.setContentsMargins(20, 14, 20, 14)
commandLayout.setHorizontalSpacing(12) 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, 1)
commandLayout.addWidget(CaptionLabel("任务状态", self.commandCard), 0, 2) commandLayout.addWidget(self.taskTypeCombo, 0, 2)
commandLayout.addWidget(CaptionLabel("关键词", self.commandCard), 0, 3) commandLayout.addWidget(CaptionLabel("任务状态", self.commandCard), 0, 3)
commandLayout.addWidget(self.autoFetchButton, 1, 0) commandLayout.addWidget(self.statusCombo, 0, 4)
commandLayout.addWidget(self.taskTypeCombo, 1, 1) commandLayout.addWidget(CaptionLabel("关键词", self.commandCard), 0, 5)
commandLayout.addWidget(self.statusCombo, 1, 2) commandLayout.addWidget(self.keywordInput, 0, 6)
commandLayout.addWidget(self.keywordInput, 1, 3) commandLayout.addWidget(self.searchButton, 0, 7)
commandLayout.addWidget(self.searchButton, 1, 4) commandLayout.setColumnStretch(8, 1)
commandLayout.addWidget(self.refreshButton, 1, 5) commandLayout.addWidget(self.refreshButton, 0, 9)
commandLayout.setColumnStretch(3, 1)
def _build_content_area(self) -> None: def _build_content_area(self) -> None:
self.taskTable = TableView(self) self.taskTable = TableView(self)
@@ -402,12 +401,8 @@ class PDDTaskPage(QWidget):
emptyTextLayout = QVBoxLayout() emptyTextLayout = QVBoxLayout()
emptyTextLayout.setSpacing(2) emptyTextLayout.setSpacing(2)
self.emptyTitleLabel = SubtitleLabel( self.emptyTitleLabel = SubtitleLabel("", self.emptyStateCard)
"还没有领取过任务", self.emptyStateCard self.emptyMessageLabel = BodyLabel("", self.emptyStateCard)
)
self.emptyMessageLabel = BodyLabel(
"点击“开始自动获取”开始领取任务。", self.emptyStateCard
)
self.emptyMessageLabel.setWordWrap(True) self.emptyMessageLabel.setWordWrap(True)
emptyTextLayout.addWidget(self.emptyTitleLabel) emptyTextLayout.addWidget(self.emptyTitleLabel)
emptyTextLayout.addWidget(self.emptyMessageLabel) emptyTextLayout.addWidget(self.emptyMessageLabel)
@@ -572,11 +567,8 @@ class PDDTaskPage(QWidget):
) )
return return
self._show_empty_state( self.emptyStateCard.hide()
"还没有领取过任务", self._update_placeholder_rows()
"点击“开始自动获取”开始领取任务。",
False,
)
def _show_empty_state( def _show_empty_state(
self, title: str, message: str, show_clear_button: bool self, title: str, message: str, show_clear_button: bool