From 3cc5a646098218ca91e6c169b1446db542761f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Tue, 8 Sep 2026 21:54:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(brand):=20=E5=93=81=E7=89=8C=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=8F=90=E4=BA=A4=E7=BB=9F=E4=B8=80=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=EF=BC=8C=E5=8E=BB=E6=8E=89=E6=97=A0=E4=BA=BA?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E7=9A=84"=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E9=98=9F=E5=88=97"=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit queue 模式只建 pending 无后台消费者,任务会永久停在排队中;统一走 /api/brand/run 立即执行(与历史链路一致) --- .../pages/brand/components/BrandBrandTab.vue | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/frontend-vue/src/pages/brand/components/BrandBrandTab.vue b/frontend-vue/src/pages/brand/components/BrandBrandTab.vue index b66489f1..bd3d0373 100644 --- a/frontend-vue/src/pages/brand/components/BrandBrandTab.vue +++ b/frontend-vue/src/pages/brand/components/BrandBrandTab.vue @@ -40,16 +40,7 @@
运行方式
-
- - -
+

提交后立即开始检测,可在右侧任务列表查看进度或取消。

@@ -121,7 +112,6 @@ import type { TaskItemView, TaskStatCard } from '@/shared/components/tasks/types import { getPywebviewApi } from '@/shared/bridges/pywebview' import { cancelBrandTask, - createBrandTask, deleteBrandTask, getBrandTaskDownloadUrl, getBrandTasks, @@ -136,7 +126,6 @@ import type { BrandExpandFolderItem } from '@/shared/api/types/modules/brand' const uploadedFiles = ref([]) const strategy = ref<'Terms' | 'Simple'>('Terms') -const runMode = ref<'immediate' | 'queue'>('immediate') const submitting = ref(false) const tasks = ref([]) @@ -364,20 +353,11 @@ async function submitRun() { relativePath: f.relativePath, fileUrl: f.url || f.localPath, })) - if (runMode.value === 'immediate') { - const res = await runBrandNow(files, strategy.value) - if (res.success && res.task_id) { - ElMessage.success(`已创建任务 ${res.task_id},客户端开始检测`) - } else { - throw new Error((res as { error?: string }).error || '运行失败') - } + const res = await runBrandNow(files, strategy.value) + if (res.success && res.task_id) { + ElMessage.success(`已创建任务 ${res.task_id},开始检测`) } else { - const res = await createBrandTask(files, strategy.value) - if (res.success && res.task_id) { - ElMessage.success(`任务 ${res.task_id} 已添加到队列`) - } else { - throw new Error((res as { error?: string }).error || '添加失败') - } + throw new Error((res as { error?: string }).error || '运行失败') } uploadedFiles.value = [] await loadTasks()