fix(workbench): 工作台待关注优化+隔离补漏——类型标签/排序固化/标题措辞 + my_dashboard按entity_id过滤 (dashboard-optimize)

This commit is contained in:
Hermes CI Fix
2026-08-31 15:51:39 +08:00
parent 26e0c8da53
commit 815acda0da
2 changed files with 20 additions and 7 deletions
+6 -2
View File
@@ -476,13 +476,17 @@ def my_dashboard(
from app.models import ActionPlan
if current_user.role == "ceo":
# CEO/管理员查看全部行动方案(2026-08-26修复: 原逻辑只按assignee过滤导致工作台显示空)
my_plans = db.query(ActionPlan).order_by(ActionPlan.updated_at.desc()).all()
# 2026-08-31 隔离补漏: CEO 看全部也须按 entity_id 过滤,防跨账套待办串数据
my_plans = db.query(ActionPlan).filter(
ActionPlan.entity_id == entity_id,
).order_by(ActionPlan.updated_at.desc()).all()
else:
my_plans = db.query(ActionPlan).filter(
or_(
ActionPlan.assignee == username,
ActionPlan.assignee == name,
)
),
ActionPlan.entity_id == entity_id,
).order_by(ActionPlan.updated_at.desc()).all()
plan_list = []