diff --git a/web/frontend/src/styles/global.css b/web/frontend/src/styles/global.css index 573a397..2c78ecf 100644 --- a/web/frontend/src/styles/global.css +++ b/web/frontend/src/styles/global.css @@ -163,8 +163,21 @@ body { background: transparent !important; } +.el-button--primary.is-link { + color: #18181b !important; +} + .el-button--primary.is-link:hover { background: transparent !important; + color: #27272a !important; +} + +.el-button--danger.is-link { + color: #ef4444 !important; +} + +.el-button--danger.is-link:hover { + color: #dc2626 !important; } /* Small buttons */ diff --git a/web/frontend/src/views/Dashboard.vue b/web/frontend/src/views/Dashboard.vue index b16a8f4..2117b07 100644 --- a/web/frontend/src/views/Dashboard.vue +++ b/web/frontend/src/views/Dashboard.vue @@ -2,7 +2,13 @@
-
+
{{ stat.emoji }}
@@ -14,8 +20,65 @@
- +
+ +
+
+

处理进度

+ + {{ statusText }} + +
+ +
+
+
+
+
+
+
+ {{ currentTask.progress }}% + {{ currentTask.message }} +
+
+
+ + + + +

等待任务启动

+
+
+ + +
+
+

处理日志

+ 清空 +
+
+
+

暂无日志

+
+
+ {{ fmtTime(i) }} + {{ line }} +
+
+
+
+ + +
@@ -68,9 +131,9 @@

快捷操作

-
- - -
- -
-
-

处理进度

- - {{ statusText }} - -
- -
-
-
-
-
-
-
- {{ currentTask.progress }}% - {{ currentTask.message }} -
-
-
- - - - -

等待任务启动

-
-
- - -
-
-

处理日志

- 清空 -
-
-
-

暂无日志

-
-
- {{ fmtTime(i) }} - {{ line }} -
-
-
-
@@ -226,24 +232,28 @@ const stats = computed(() => [ value: detailedStats.value.unprocessed_images, emoji: '🖼️', bg: '#f4f4f5', + route: '/files/images', }, { label: '待处理Excel', value: detailedStats.value.unprocessed_excel, emoji: '📊', bg: '#f4f4f5', + route: '/files/tables', }, { label: '已完成采购单', value: detailedStats.value.completed_results, emoji: '✅', bg: '#f0fdf4', + route: '/files/orders', }, { label: '已处理总数', value: detailedStats.value.total_processed, emoji: '📦', bg: '#f4f4f5', + route: null, }, ]) @@ -314,6 +324,7 @@ function getFileTypeLabel(fileName: string): string { async function upload(files: File[]): Promise { uploading.value = true uploadPct.value = 0 + const uploadedFiles: { name: string; type: string }[] = [] for (let i = 0; i < files.length; i++) { const file = files[i] uploadingName.value = file.name @@ -329,6 +340,7 @@ async function upload(files: File[]): Promise { }, }) const typeLabel = getFileTypeLabel(file.name) + uploadedFiles.push({ name: file.name, type: typeLabel }) ElMessage.success(`${file.name} → ${typeLabel === 'OCR' ? 'OCR识别队列' : 'Excel处理队列'}`) } catch (err: any) { ElMessage.error(`上传失败: ${file.name}`) @@ -338,6 +350,19 @@ async function upload(files: File[]): Promise { uploadingName.value = '' uploadPct.value = 0 refreshStats() + + // Auto-process: run pipeline for images, excel for Excel files + if (uploadedFiles.length > 0) { + const hasImages = uploadedFiles.some(f => f.type === 'OCR') + const hasExcel = uploadedFiles.some(f => f.type === 'Excel') + if (hasImages) { + ElMessage.info('自动启动OCR识别...') + await doAction('/processing/ocr-batch') + } else if (hasExcel) { + ElMessage.info('自动启动Excel处理...') + await doAction('/processing/excel') + } + } } async function doAction(endpoint: string): Promise { @@ -384,7 +409,7 @@ onMounted(() => {