diff --git a/backend/app/api/maps.py b/backend/app/api/maps.py index 20566514..04043a50 100644 --- a/backend/app/api/maps.py +++ b/backend/app/api/maps.py @@ -186,7 +186,13 @@ def add_connection(map_id: int, data: dict, db: Session = Depends(get_db)): if c.get("from") == from_id and c.get("to") == to_id: raise HTTPException(400, "已存在相同的连线") - conns.append({"from": from_id, "to": to_id, "style": "solid"}) + conns.append({ + "from": from_id, + "to": to_id, + "style": "solid", + "effect": data.get("effect", "positive"), + "label": data.get("label", ""), + }) m.canvas_data["connections"] = conns db.commit() return {"connections": conns} @@ -418,13 +424,13 @@ def get_map_review(map_id: int, level: Optional[str] = None, db: Session = Depen lv = latest_values.get(kpi_def.id, {}) actual = lv.get("actual_value") target = kpi_def.target_value - # 判断红黄绿灯 + # 判断红黄绿灯(绿≥90% / 黄60-90% / 红<60%) level = "gray" if actual is not None and target: ratio = actual / target if ratio >= 0.9: level = "green" - elif ratio >= 0.7: + elif ratio >= 0.6: level = "yellow" else: level = "red" diff --git a/frontend/src/components/map-canvas/MapCanvasToolbar.vue b/frontend/src/components/map-canvas/MapCanvasToolbar.vue index bd9650e4..08ac1cc6 100644 --- a/frontend/src/components/map-canvas/MapCanvasToolbar.vue +++ b/frontend/src/components/map-canvas/MapCanvasToolbar.vue @@ -23,6 +23,12 @@ 🔗 因果 + 🔍 因果链查看{{ chainMode ? '中' : '' }} 🔗 因果链推荐 保存 发布 @@ -54,6 +60,7 @@ const props = defineProps<{ viewDirection: string currentMap: any linkingFrom: { key: string; obj: any } | null + chainMode: boolean }>() const emit = defineEmits<{ @@ -70,6 +77,7 @@ const emit = defineEmits<{ (e: 'show-versions'): void (e: 'go-alignment'): void (e: 'cancel-link'): void + (e: 'toggle-chain-mode'): void }>() const selectedMapLocal = ref(props.selectedMap) diff --git a/frontend/src/components/strategy-map/ConnectionLines.vue b/frontend/src/components/strategy-map/ConnectionLines.vue index 0e20fbc2..d88962cd 100644 --- a/frontend/src/components/strategy-map/ConnectionLines.vue +++ b/frontend/src/components/strategy-map/ConnectionLines.vue @@ -1,15 +1,18 @@