diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 872e2c4..84f93e0 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -44,8 +44,8 @@ - - + @@ -76,7 +76,6 @@ import CrawlInfo from './components/CrawlInfo.vue' const activeIndex = ref('1') const bids = ref([]) const todayBids = ref([]) -const highPriorityBids = ref([]) const keywords = ref([]) const loading = ref(false) const isCrawling = ref(false) @@ -109,7 +108,7 @@ const handleFetchBids = async (page: number, limit: number, source?: string) => const fetchData = async () => { loading.value = true try { - const [bidsRes, recentRes, highRes, kwRes, sourcesRes, statusRes] = await Promise.all([ + const [bidsRes, recentRes, kwRes, sourcesRes, statusRes] = await Promise.all([ axios.get('/api/bids', { params: { page: 1, @@ -117,7 +116,6 @@ const fetchData = async () => { } }), axios.get('/api/bids/recent'), - axios.get('/api/bids/high-priority'), axios.get('/api/keywords'), axios.get('/api/bids/sources'), axios.get('/api/crawler/status') @@ -125,7 +123,6 @@ const fetchData = async () => { bids.value = bidsRes.data.items total.value = bidsRes.data.total todayBids.value = recentRes.data - highPriorityBids.value = highRes.data keywords.value = kwRes.data sourceOptions.value = sourcesRes.data isCrawling.value = statusRes.data.isCrawling diff --git a/frontend/src/components/Dashboard-AI.vue b/frontend/src/components/Dashboard-AI.vue index b57a274..a5c5bdb 100644 --- a/frontend/src/components/Dashboard-AI.vue +++ b/frontend/src/components/Dashboard-AI.vue @@ -7,39 +7,6 @@ 获取 AI 推荐 - - - - - -
- - - - - - - - - -
-
-
-
-
- @@ -160,7 +127,6 @@ interface AIRecommendation { interface Props { bids: any[] - highPriorityBids: any[] } const props = defineProps() @@ -171,7 +137,6 @@ 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 = () => { @@ -190,18 +155,6 @@ 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/frontend/src/components/Dashboard.vue b/frontend/src/components/Dashboard.vue index 013f6db..e37fcc8 100644 --- a/frontend/src/components/Dashboard.vue +++ b/frontend/src/components/Dashboard.vue @@ -7,38 +7,6 @@ 立刻抓取 - - - - - -
- - - - - - - - - -
-
-
-
-

Today's Bids

@@ -100,7 +68,6 @@ import { Refresh, ArrowDown } from '@element-plus/icons-vue' interface Props { todayBids: any[] - highPriorityBids: any[] keywords: any[] loading: boolean isCrawling: boolean @@ -118,7 +85,6 @@ const selectedKeywords = ref([]) const dateRange = ref<[string, string] | null>(null) const crawling = ref(false) const updating = ref(false) -const highPriorityCollapsed = ref(false) const isInitialized = ref(false) const isManualClick = ref(false) @@ -139,18 +105,6 @@ watch(dateRange, (newDateRange) => { localStorage.setItem('dashboard_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 }) - // 从 localStorage 加载保存的关键字 const loadSavedKeywords = () => { const saved = localStorage.getItem('selectedKeywords') diff --git a/src/bids/controllers/bid.controller.ts b/src/bids/controllers/bid.controller.ts index 87f63c7..1728681 100644 --- a/src/bids/controllers/bid.controller.ts +++ b/src/bids/controllers/bid.controller.ts @@ -15,11 +15,6 @@ export class BidsController { return this.bidsService.getRecentBids(); } - @Get('high-priority') - getHighPriority() { - return this.bidsService.getHighPriorityCorrected(); - } - @Get('sources') getSources() { return this.bidsService.getSources(); diff --git a/src/bids/entities/bid-item.entity.ts b/src/bids/entities/bid-item.entity.ts index 5e012d1..7d05826 100644 --- a/src/bids/entities/bid-item.entity.ts +++ b/src/bids/entities/bid-item.entity.ts @@ -17,15 +17,6 @@ export class BidItem { @Column() source: string; - @Column({ default: false }) - isRead: boolean; - - @Column({ default: 0 }) - priority: number; - - @Column({ nullable: true }) - unit: string; - @CreateDateColumn() createdAt: Date; diff --git a/src/bids/services/bid.service.ts b/src/bids/services/bid.service.ts index acb356e..36be8c8 100644 --- a/src/bids/services/bid.service.ts +++ b/src/bids/services/bid.service.ts @@ -33,24 +33,6 @@ export class BidsService { return { items, total }; } - getHighPriority() { - return this.bidRepository.find({ - where: { priority: LessThan(0) }, // This is just a placeholder logic, priority should be > 0 - order: { priority: 'DESC', publishDate: 'DESC' }, - take: 10, - }); - } - - // Update logic for priority - async getHighPriorityCorrected() { - return this.bidRepository.createQueryBuilder('bid') - .where('bid.priority > 0') - .orderBy('bid.priority', 'DESC') - .addOrderBy('bid.publishDate', 'DESC') - .limit(10) - .getMany(); - } - async createOrUpdate(data: Partial) { // Use title or a hash of title to check for duplicates let item = await this.bidRepository.findOne({ where: { title: data.title } }); diff --git a/src/crawler/services/bid-crawler.service.ts b/src/crawler/services/bid-crawler.service.ts index 2673657..a962715 100644 --- a/src/crawler/services/bid-crawler.service.ts +++ b/src/crawler/services/bid-crawler.service.ts @@ -112,7 +112,6 @@ export class BidCrawlerService { url: item.url, publishDate: item.publishDate, source: crawler.name, - unit: '', }); } @@ -164,7 +163,6 @@ export class BidCrawlerService { url: item.url, publishDate: item.publishDate, source: crawler.name, - unit: '', }); }