diff --git a/frontend/index.html b/frontend/index.html
index 5c70f3b..d76e1d4 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -3,7 +3,7 @@
-
+
投标
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index c3388db..6dba4bf 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,10 +1,33 @@
-
-
+
+
+
+
+
+
+
+
+
投标信息一览
-
-
- {{ currentUser }}
- 退出登录
+
+
-
+
-
-
-
+
-
+
-
+
@@ -82,7 +118,7 @@
import { ref, onMounted, onUnmounted } from 'vue'
import api, { setAuthCredentials, clearAuthCredentials, isAuthenticated } from './utils/api'
import { ElMessage } from 'element-plus'
-import { DataBoard, Document, Setting, MagicStick, Connection } from '@element-plus/icons-vue'
+import { DataBoard, Document, Setting, MagicStick, Connection, Fold, SwitchButton } from '@element-plus/icons-vue'
import Dashboard from './components/Dashboard.vue'
import DashboardAI from './components/Dashboard-AI.vue'
import Bids from './components/Bids.vue'
@@ -98,6 +134,10 @@ const isCrawling = ref(false)
const total = ref(0)
const sourceOptions = ref([])
+// 移动端状态
+const isMobile = ref(false)
+const sidebarVisible = ref(false)
+
// 登录相关状态
const loginDialogVisible = ref(false)
const loginLoading = ref(false)
@@ -107,8 +147,24 @@ const loginForm = ref({
})
const currentUser = ref(null)
+// 检测屏幕宽度
+const checkScreenSize = () => {
+ isMobile.value = window.innerWidth < 768
+ if (!isMobile.value) {
+ sidebarVisible.value = true
+ }
+}
+
+const toggleSidebar = () => {
+ sidebarVisible.value = !sidebarVisible.value
+}
+
const handleSelect = (key: string) => {
activeIndex.value = key
+ // 移动端选择后关闭侧边栏
+ if (isMobile.value) {
+ sidebarVisible.value = false
+ }
}
const handleFetchBids = async (page: number, limit: number, source?: string) => {
@@ -256,14 +312,29 @@ onMounted(() => {
// 监听认证要求事件
window.addEventListener('auth-required', handleAuthRequired)
+
+ // 监听屏幕大小变化
+ checkScreenSize()
+ window.addEventListener('resize', checkScreenSize)
})
onUnmounted(() => {
window.removeEventListener('auth-required', handleAuthRequired)
+ window.removeEventListener('resize', checkScreenSize)
})
diff --git a/frontend/src/components/Bids.vue b/frontend/src/components/Bids.vue
index 319f82a..545571f 100644
--- a/frontend/src/components/Bids.vue
+++ b/frontend/src/components/Bids.vue
@@ -1,8 +1,8 @@
-
-
-
All Bids
-
+
+
-
-
+
+
@@ -31,8 +31,8 @@
{{ scope.row.title }}
-
-
+
+
{{ formatDate(scope.row.publishDate) }}
@@ -44,7 +44,7 @@
layout="total, sizes, prev, pager, next, jumper"
@current-change="handlePageChange"
@size-change="handleSizeChange"
- style="margin-top: 20px; justify-content: flex-end;"
+ class="pagination"
/>
@@ -103,6 +103,41 @@ const togglePin = async (item: any) => {
diff --git a/frontend/src/components/CrawlInfo.vue b/frontend/src/components/CrawlInfo.vue
index 90bd473..2a5fdf5 100644
--- a/frontend/src/components/CrawlInfo.vue
+++ b/frontend/src/components/CrawlInfo.vue
@@ -1,9 +1,9 @@
-
+
-
-
-
-
+
+
+
+
{{ formatDateTime(row.latestUpdate) }}
-
+
{{ formatDateTime(row.latestPublishDate) }}
-
+
{{ row.error && row.error.trim() ? '出错' : (row.count > 0 ? '正常' : '无数据') }}
-
+
- {{ row.error }}
+ {{ row.error }}
-
-
+
- 更新
-
+
{{ crawlStats.length }}
@@ -168,7 +167,11 @@ onBeforeUnmount(() => {
diff --git a/frontend/src/components/Dashboard-AI.vue b/frontend/src/components/Dashboard-AI.vue
index e60cf6d..20f4551 100644
--- a/frontend/src/components/Dashboard-AI.vue
+++ b/frontend/src/components/Dashboard-AI.vue
@@ -1,22 +1,20 @@
-
-
-
Dashboard AI
+
+
-
+
-
-
-
+
AI 正在分析中...
@@ -27,14 +25,14 @@
点击上方按钮获取 AI 推荐
-
-
+
+
@@ -47,13 +45,13 @@
{{ scope.row.title }}
-
-
+
+
{{ formatDate(scope.row.publishDate) }}
-
+
{{ scope.row.confidence }}%
@@ -65,26 +63,28 @@
-
-
选择日期范围
-
+
+
选择日期范围
+
-
3天
-
7天
-
-
- 列出时间范围内所有工程
-
+
+ 3天
+ 7天
+
+
+ 列出时间范围内所有工程
+
+
@@ -105,14 +105,14 @@
该时间范围内暂无工程
-
+
{{ scope.row.title }}
-
-
+
+
{{ formatDate(scope.row.publishDate) }}
@@ -358,18 +358,72 @@ const togglePin = async (item: AIRecommendation) => {
diff --git a/frontend/src/components/Dashboard.vue b/frontend/src/components/Dashboard.vue
index f6602b5..a34c644 100644
--- a/frontend/src/components/Dashboard.vue
+++ b/frontend/src/components/Dashboard.vue
@@ -1,7 +1,7 @@
-
-
-
Dashboard
+
+
-
-
Today's Bids
-
+
+
Today's Bids
+
-
3天
-
7天
-
-
- 更新
-
+
+ 3天
+ 7天
+
+
+ 更新
+
+
-
+
{{ scope.row.title }}
-
-
+
+
{{ formatDate(scope.row.publishDate) }}
@@ -122,7 +124,7 @@ watch(dateRange, (newDateRange) => {
localStorage.setItem('dashboard_dateRange', JSON.stringify(newDateRange))
}, { deep: true })
-// 从 localStorage 加载保存的关键字
+// 从 localStorage 保存的关键字
const loadSavedKeywords = () => {
const saved = localStorage.getItem('selectedKeywords')
if (saved) {
@@ -320,6 +322,60 @@ if (!dateRange.value) {
diff --git a/frontend/src/components/Keywords.vue b/frontend/src/components/Keywords.vue
index 9a6de6e..8b186c6 100644
--- a/frontend/src/components/Keywords.vue
+++ b/frontend/src/components/Keywords.vue
@@ -1,37 +1,37 @@
-
-