diff --git a/frontend/src/components/Dashboard-AI.vue b/frontend/src/components/Dashboard-AI.vue index d7f6e1a..a737d3b 100644 --- a/frontend/src/components/Dashboard-AI.vue +++ b/frontend/src/components/Dashboard-AI.vue @@ -7,7 +7,7 @@ 获取 AI 推荐 - + @@ -328,6 +328,18 @@ const getConfidenceType = (confidence: number) => { return 'info' } +// PinnedProject 组件引用 +const pinnedProjectRef = ref(null) + +// 处理 PinnedProject 组件的 pin 状态改变事件 +const handlePinChanged = async (title: string) => { + // 更新对应推荐项目的 pin 状态 + const rec = aiRecommendations.value.find(r => r.title === title) + if (rec) { + rec.pin = false + } +} + // 切换 AI 推荐项目的 Pin 状态 const togglePin = async (item: AIRecommendation) => { try { @@ -335,6 +347,10 @@ const togglePin = async (item: AIRecommendation) => { await axios.patch(`/api/bids/${encodeURIComponent(item.title)}/pin`, { pin: newPinStatus }) item.pin = newPinStatus ElMessage.success(newPinStatus ? '已置顶' : '已取消置顶') + // 刷新 PinnedProject 组件的数据 + if (pinnedProjectRef.value) { + pinnedProjectRef.value.loadPinnedBids() + } } catch (error) { ElMessage.error('操作失败') } diff --git a/frontend/src/components/Dashboard.vue b/frontend/src/components/Dashboard.vue index 7f19648..982be19 100644 --- a/frontend/src/components/Dashboard.vue +++ b/frontend/src/components/Dashboard.vue @@ -7,7 +7,7 @@ 立刻抓取 - +

Today's Bids

@@ -48,6 +48,20 @@
+ + +