feat: 完成布局优化 - 操作列固定、批量按钮自适应、分类标签带数量

优化内容:
1. 表格布局:
   - 使用 calc(100vw - 160px) 确保表格不超出视口
   - 操作列 fixed='right' 固定在右侧,宽度 300px
   - 按钮 3 个后自动换行 (max-width: 200px)
   - 恢复合理列宽,不再过度压缩

2. 批量操作区域:
   - 容器改为 inline-block,宽度自适应按钮内容
   - 背景宽度与按钮总宽度匹配

3. 分类标签:
   - 显示数量 (如 '待处理 (20)')
   - 点击切换筛选,去掉误导的 'X' 图标

4. 删除功能:
   - 操作列增加删除按钮
   - 删除前弹出确认对话框

5. 系统日志:
   - 修复后端日志路径 (parents[4])
   - 404 时显示友好提示

6. 其他:
   - 左侧菜单宽度 160px
   - 所有功能保留 (登录、用户管理、批量操作等)
This commit is contained in:
lt
2026-04-27 11:32:17 +08:00
parent 59d2a76df4
commit 277b13eaae
137 changed files with 8615 additions and 1213 deletions
+32 -1
View File
@@ -37,7 +37,7 @@ args = parser.parse_args()
# 平台配置
PLATFORMS = {
"zhihu": {"name": "知乎", "enabled": True, "template": "zhihu.html"},
"wechat": {"name": "微信公众号", "enabled": False, "template": "wechat.html"}, # 需手动授权
"wechat": {"name": "微信公众号", "enabled": True, "template": "wechat.html"}, # 需手动授权
"xiaohongshu": {"name": "小红书", "enabled": True, "template": "xiaohongshu.html"},
"bilibili": {"name": "B站", "enabled": False, "template": "bilibili.html"}, # 规划中
"toutiao": {"name": "头条号", "enabled": False, "template": "toutiao.html"} # 规划中
@@ -178,6 +178,37 @@ def main():
with open(summary_file, 'w', encoding='utf-8') as f:
json.dump(summary, f, ensure_ascii=False, indent=2)
# === 发送日报通知 ===
try:
# 统计发布数据(按话题去重)
unique_tids = set(r[0] for r in results)
platforms_set = set(r[1] for r in results)
notify_data = {
"task": "daily_summary",
"date": TODAY,
"published_count": len(unique_tids),
"platforms": list(platforms_set),
"publish_dir": str(PROJECT_ROOT / "content" / "published")
}
notify_file = LOGS_DIR / f"publisher_notify_{TODAY}.json"
with open(notify_file, 'w', encoding='utf-8') as f:
json.dump(notify_data, f, ensure_ascii=False, indent=2)
# 调用 notifier
notifier_script = PROJECT_ROOT / "scripts" / "wecom_notifier.py"
if notifier_script.exists():
subprocess.run(
[sys.executable, str(notifier_script), str(notify_file)],
cwd=str(PROJECT_ROOT),
capture_output=True,
text=True,
timeout=30
)
else:
logger.warning("Notifier script not found, skipping notification")
except Exception as e:
logger.error(f"发送日报通知失败: {e}")
# === 通知结束 ===
logger.info(f"📦 发布包生成完成: {len(results)} 个平台发布包已就绪")
print(f"PUBLISH_PACKAGES_READY: {len(results)} packages generated")
sys.exit(0)