From 7f36e014e6063c862efaddda20c60b6a40f511ae Mon Sep 17 00:00:00 2001 From: dmy Date: Tue, 13 Jan 2026 16:34:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8AI=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E9=AB=98=E4=BC=98=E5=85=88=E7=BA=A7?= =?UTF-8?q?=E6=8A=95=E6=A0=87=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 1 + frontend/src/components/Dashboard-AI.vue | 48 +++++++++++++++++++++++- src/crawler/services/chng_target.ts | 6 +-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c161c56..49184dc 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -53,6 +53,7 @@ + + + + + +
+ + + + + + + + + +
+
+
+
+

选择日期范围

@@ -114,7 +146,7 @@ import { ref, watch } from 'vue' import axios from 'axios' import { ElMessage } from 'element-plus' -import { MagicStick, Loading, InfoFilled, List } from '@element-plus/icons-vue' +import { MagicStick, Loading, InfoFilled, List, ArrowDown } from '@element-plus/icons-vue' interface AIRecommendation { @@ -127,6 +159,7 @@ interface AIRecommendation { interface Props { bids: any[] + highPriorityBids: any[] } const props = defineProps() @@ -137,6 +170,7 @@ const dateRange = ref<[string, string] | null>(null) const showAllBids = ref(false) const bidsLoading = ref(false) const bidsByDateRange = ref([]) +const highPriorityCollapsed = ref(false) // 从 localStorage 加载保存的日期范围 const loadSavedDateRange = () => { @@ -155,6 +189,18 @@ watch(dateRange, (newDateRange) => { localStorage.setItem('dashboardAI_dateRange', JSON.stringify(newDateRange)) }, { deep: true }) +// 切换 High Priority Bids 的折叠状态 +const toggleHighPriority = () => { + highPriorityCollapsed.value = !highPriorityCollapsed.value +} + +// 监听 highPriorityBids,当没有数据时自动折叠 +watch(() => props.highPriorityBids, (newBids) => { + if (newBids.length === 0) { + highPriorityCollapsed.value = true + } +}, { immediate: true }) + // 从数据库加载最新的 AI 推荐 const loadLatestRecommendations = async () => { try { diff --git a/src/crawler/services/chng_target.ts b/src/crawler/services/chng_target.ts index 8eb8710..6ab2815 100644 --- a/src/crawler/services/chng_target.ts +++ b/src/crawler/services/chng_target.ts @@ -88,7 +88,7 @@ export const ChngCrawler = { await page.waitForNavigation({ waitUntil: 'networkidle2' }); logger.log('Clicking search result...'); - await page.screenshot({ path: 'bing.png' }); + // await page.screenshot({ path: 'bing.png' }); const firstResultSelector = '#b_results .b_algo h2 a'; await page.waitForSelector(firstResultSelector); @@ -99,7 +99,7 @@ export const ChngCrawler = { const newPage = await newTarget.page(); if (newPage) { - await newPage.screenshot({ path: 'newPage.png' }); + // await newPage.screenshot({ path: 'newPage.png' }); await page.close(); page = newPage; if (username && password) { @@ -125,7 +125,7 @@ export const ChngCrawler = { // PAUSE 15 SECONDS as requested logger.log('Pausing 15 seconds before looking for "采购专栏"...'); await new Promise(r => setTimeout(r, 15000)); - await page.screenshot({ path: 'huaneng.png' }); + // await page.screenshot({ path: 'huaneng.png' }); logger.log('Looking for "采购专栏" link...'); await page.waitForFunction(() => {