第一步优化勾选功能

This commit is contained in:
27942
2026-01-31 23:39:36 +08:00
parent c601e6054a
commit 73cd7a85c9

View File

@@ -898,12 +898,22 @@ class MainWindow(QMainWindow):
search_text = self.table_search_input.text().strip()
terms_raw = [t for t in search_text.split() if t]
if terms_raw:
column_index = self._filter_column_index()
# 根据当前视图类型选择列索引映射
if self.use_model_view:
column_index = self._filter_model_column_index()
col_key_map = {
0: '多多id', 1: '序号', 2: '话题', 3: '定时发布',
4: '间隔时间', 5: '达人链接', 6: '执行人', 7: '情况', 8: '文件路径'
}
else:
column_index = self._filter_column_index()
col_key_map = {
1: '多多id', 2: '序号', 3: '话题', 4: '定时发布',
5: '间隔时间', 6: '达人链接', 7: '执行人', 8: '情况', 9: '文件路径'
}
match = False
if column_index >= 0:
# 按指定列筛选
col_key_map = {0: '多多id', 1: '序号', 2: '话题', 3: '定时发布',
4: '间隔时间', 5: '达人链接', 6: '执行人', 7: '情况', 8: '文件路径'}
if column_index in col_key_map:
cell_value = str(config.get(col_key_map[column_index], '')).lower()
# 所有关键词都要在单元格中
@@ -911,8 +921,8 @@ class MainWindow(QMainWindow):
match = True
else:
# 全列搜索
all_text = ' '.join([str(config.get(k, '')) for k in
['多多id', '序号', '话题', '定时发布', '间隔时间',
all_text = ' '.join([str(config.get(k, '')) for k in
['多多id', '序号', '话题', '定时发布', '间隔时间',
'达人链接', '执行人', '情况', '文件路径']]).lower()
# 所有关键词都要在文本中
if all(term.lower() in all_text for term in terms_raw):