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(() => {