diff --git a/admin-frontend-vue/src/pages/task-center/TaskCenterBoardPage.vue b/admin-frontend-vue/src/pages/task-center/TaskCenterBoardPage.vue index 8afe6a101..f09d458bf 100644 --- a/admin-frontend-vue/src/pages/task-center/TaskCenterBoardPage.vue +++ b/admin-frontend-vue/src/pages/task-center/TaskCenterBoardPage.vue @@ -7,11 +7,12 @@ import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue' import { useRoute } from 'vue-router' import { userNotice } from '@/api/user-notice' import { ElMessage } from 'element-plus' -import OldPagination from '@/components/OldPagination.vue' import { useCompanyTabStore } from '@/stores/company-tab' import { formatDateTime, orderedPair } from '@/utils/datetime' import { showAdminFeedback } from '@/components/admin-feedback-ui' import LoadFailureBar from '@/components/LoadFailureBar.vue' +import TaskCenterTaskTable from './TaskCenterTaskTable.vue' +import TaskCenterVariantTable from './TaskCenterVariantTable.vue' import { fetchTaskCenterOverview, fetchTaskCenterShopOptions, @@ -30,19 +31,14 @@ import { VARIANT_STATUS_OPTIONS, buildTaskQuery, buildVariantQuery, - countryLabel, createTaskFilter, createVariantFilter, deviceDisplayName, - progressPercent, progressText, shopDisplayName, tabCount, taskStatusLabel, taskStatusType, - variantAccountText, - variantStatusLabel, - variantStatusType, type TaskCenterTaskFilter, type TaskCenterVariantFilter, } from './task-center-model' @@ -216,6 +212,10 @@ function resetFilter() { void loadTasks() } +function retryTasks() { + void loadTasks() +} + function changeTaskPage(next: number) { if (next < 1 || next > taskTotalPages.value) return taskPage.value = next @@ -423,78 +423,16 @@ onUnmounted(() => { - -
- - - - - - - - - - - - - - - - - - - - - - - - -
账号店铺国家业务状态任务ID开始时间最近上报结束时间进度
加载中...
暂无符合条件的任务
-
- + @@ -522,55 +460,14 @@ onUnmounted(() => { -
- - - - - - - - - - - - - - - - - - - - -
账号任务号状态开始时间更新时间结果信息
加载中...
暂无变体采集任务
-
- @@ -763,10 +660,6 @@ h3 { color: #8598ab; font-size: 12.5px; } -.is-warn-text { - color: #b3803a; - font-weight: 650; -} .shop-filter { position: relative; } @@ -854,60 +747,6 @@ h3 { border-color: #95b1cb; color: #2f5d8b; } -.table-scroll { - width: 100%; - overflow-x: auto; -} -table { - width: 100%; - border-collapse: collapse; - font-size: 13px; -} -th { - padding: 10px 12px; - text-align: left; - color: #5b6f83; - font-weight: 650; - font-size: 12.5px; - border-bottom: 1px solid #dbe6f0; - white-space: nowrap; -} -td { - padding: 10px 12px; - border-bottom: 1px solid #eaf1f7; - vertical-align: top; -} -.strong { - display: block; - font-weight: 600; - word-break: break-all; -} -.sub { - display: block; - color: #8598ab; - font-size: 11.5px; - word-break: break-all; -} -.mono { - font-family: Consolas, 'Courier New', monospace; - font-size: 12px; - word-break: break-all; -} -/* 任务 ID 单元格:「操作」列删除后,它是详情抽屉唯一的入口。 */ -.cell-link { - padding: 0; - border: none; - background: none; - color: #2f5d8b; - cursor: pointer; -} -.cell-link:hover { - text-decoration: underline; -} -.res-mes { - display: block; - word-break: break-all; -} .st-pill { display: inline-flex; align-items: center; @@ -959,24 +798,6 @@ td { background: #f8ebeb; color: #91474f; } -.progress-line { - display: flex; - align-items: center; - gap: 8px; - flex-wrap: wrap; - margin-bottom: 5px; -} -.p-track { - height: 6px; - border-radius: 999px; - background: #eaf1f7; - overflow: hidden; -} -.p-fill { - height: 100%; - border-radius: 999px; - background: linear-gradient(90deg, #6f97bd, #4f78a5); -} .empty-tip { padding: 30px 24px; text-align: center; diff --git a/admin-frontend-vue/src/pages/task-center/TaskCenterTaskTable.vue b/admin-frontend-vue/src/pages/task-center/TaskCenterTaskTable.vue new file mode 100644 index 000000000..a8e2fdb37 --- /dev/null +++ b/admin-frontend-vue/src/pages/task-center/TaskCenterTaskTable.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/admin-frontend-vue/src/pages/task-center/TaskCenterVariantTable.vue b/admin-frontend-vue/src/pages/task-center/TaskCenterVariantTable.vue new file mode 100644 index 000000000..969c261f0 --- /dev/null +++ b/admin-frontend-vue/src/pages/task-center/TaskCenterVariantTable.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/admin-frontend-vue/tests/task-center-board.test.ts b/admin-frontend-vue/tests/task-center-board.test.ts index 07d307d14..640dc6f7d 100644 --- a/admin-frontend-vue/tests/task-center-board.test.ts +++ b/admin-frontend-vue/tests/task-center-board.test.ts @@ -28,6 +28,8 @@ import { // 客户端任务管理看板(后台):路由注册 / guides 对齐 / 接口层 / 纯逻辑映射。 const PAGE = 'src/pages/task-center/TaskCenterBoardPage.vue' +const TASK_TABLE = 'src/pages/task-center/TaskCenterTaskTable.vue' +const VARIANT_TABLE = 'src/pages/task-center/TaskCenterVariantTable.vue' const API = 'src/api/task-center.ts' test('task_center_route_registered_with_menu_key', () => { @@ -222,8 +224,8 @@ test('task_center_collect_data_progress_wording_matches_the_client', () => { * 留一条 0% 空进度轨会被读成「进度 0%」,和「这里没有进度可看」是两件事。 */ test('task_center_progress_bar_is_dropped_when_there_is_no_progress', () => { - const page = readSource(PAGE) - assert.match(page, /
/, '无进度时不画进度轨') + const table = readSource(TASK_TABLE) + assert.match(table, /
/, '无进度时不画进度轨') }) /** @@ -232,11 +234,11 @@ test('task_center_progress_bar_is_dropped_when_there_is_no_progress', () => { * 失败行(含详情抽屉)只给失败徽标,不给进度条也不说「已完成」。 */ test('task_center_failed_rows_never_render_a_progress_bar', () => { - const page = readSource(PAGE) + const sources = { row: readSource(TASK_TABLE), detail: readSource(PAGE) } for (const scope of ['row', 'detail']) { const branch = new RegExp( ``, - ).exec(page) + ).exec(sources[scope as keyof typeof sources]) assert.ok(branch, `${scope} 的失败分支存在`) assert.equal(branch[0].includes('p-track'), false, '失败分支不画进度轨') assert.equal(branch[0].includes('progressText'), false, '失败分支不说「已完成 X / 总 Y」') @@ -287,12 +289,12 @@ test('task_center_filter_reset_clears_every_field', () => { test('task_center_page_handles_empty_and_error_states', () => { const page = readSource(PAGE) - assert.match(page, /暂无符合条件的任务/, '任务空态') - assert.match(page, /暂无变体采集任务/, '变体空态:四态口径下不再限定「在跑」') + assert.match(readSource(TASK_TABLE), /暂无符合条件的任务/, '任务空态') + assert.match(readSource(VARIANT_TABLE), /暂无变体采集任务/, '变体空态:四态口径下不再限定「在跑」') assert.match(page, /showAdminFeedback\([^\n]*, 'error'\)/, '接口失败提示走统一出口') assert.match(page, /resetFilter/, '筛选重置接线') - assert.match(page, /@size-change="changeTaskSize"/, '分页每页条数切换') - assert.match(page, /@size-change="changeVariantSize"/, '变体分页每页条数切换') + assert.match(page, /@size="changeTaskSize"/, '分页每页条数切换') + assert.match(page, /@size="changeVariantSize"/, '变体分页每页条数切换') }) test('task_center_has_no_shop_panel_anymore', () => { @@ -303,7 +305,7 @@ test('task_center_has_no_shop_panel_anymore', () => { assert.equal(readSource(API).includes('/api/admin/task-center/shops'), false, '接口层不留 /shops') assert.match(page, /fetchTaskCenterShopOptions/, '店铺筛选候选仍要取数') assert.match(page, /v-for="shop in shopOptions"/, '下拉候选就是店铺库本身,不再并入面板出现的店铺') - assert.match(page, /最近上报/, '任务表仍带最近上报') + assert.match(readSource(TASK_TABLE), /最近上报/, '任务表仍带最近上报') assert.equal(page.includes('device-strip'), false, '设备卡条已删除') }) @@ -318,18 +320,20 @@ test('task_center_has_no_shop_panel_anymore', () => { */ test('task_center_task_list_columns_are_trimmed_to_the_data_that_exists', () => { const page = readSource(PAGE) + const table = readSource(TASK_TABLE) const style = page.slice(page.indexOf(' diff --git a/frontend-vue/src/pages/brand/components/BrandWithdrawTab.vue b/frontend-vue/src/pages/brand/components/BrandWithdrawTab.vue index fa15699d0..9b6e0ab62 100644 --- a/frontend-vue/src/pages/brand/components/BrandWithdrawTab.vue +++ b/frontend-vue/src/pages/brand/components/BrandWithdrawTab.vue @@ -121,67 +121,16 @@ 完成“匹配店铺”后,这里会展示匹配结果。
- - - - - - - - - - - - - - - - - - -
@@ -273,6 +222,15 @@ import { formatDateTime } from '@/shared/utils/datetime' import { RUNNING_UNTIL_DONE_STATUS_OPTIONS, taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text' import { useHistoryPolling } from '@/shared/composables/useHistoryPolling' import { runBatchDelete } from '@/shared/utils/batch-delete' +import BrandShopMatchTable from './BrandShopMatchTable.vue' +import { + formatMatchRemark, + formatMatchStatus, + historyItemKey, + isTransientBackendError, + rowKeyForMatch, + uidForStorage, +} from './brand-shop-match-shared' import { isRecordMissingError, parseTaskStartTimes, removeTaskStartTime, upsertTaskStartTime } from '@/shared/utils/task-queue-state.ts' import { useTablePaging } from '@/shared/composables/useTablePaging.ts' import { getModuleProgressLight } from '@/shared/api/progress-light.ts' @@ -389,11 +347,6 @@ function toWithdrawTaskView(item: WithdrawTaskGroupItem): TaskItemView { }; } -function uidForStorage() { - return typeof window !== "undefined" - ? window.localStorage.getItem("uid") || "0" - : "0"; -} function matchedStorageKey() { return `withdraw:matched:${uidForStorage()}`; @@ -407,13 +360,7 @@ function taskStartTimeStorageKey() { return `withdraw:start-times:${uidForStorage()}`; } -function rowKeyForMatch(row: WithdrawShopQueueItem) { - return `${(row.shopName || "").trim()}::${row.shopId || ""}`; -} -function historyItemKey(item: WithdrawHistoryItem) { - return `${item.taskId ?? 0}:${item.resultId ?? 0}`; -} function batchKeyForItems(items: WithdrawShopQueueItem[]) { return items.map((item) => rowKeyForMatch(item)).join("||"); @@ -513,20 +460,6 @@ function clearSleepTimers() { timers.clearCategory("queue-wait"); } -function isTransientBackendError(error: unknown) { - const message = - error instanceof Error ? error.message.toLowerCase() : String(error || "").toLowerCase(); - return ( - message.includes("network error") || - message.includes("failed to fetch") || - message.includes("timeout") || - message.includes("503") || - message.includes("502") || - message.includes("504") || - message.includes("500") || - message.includes("load failed") - ); -} async function withTransientRetry( action: () => Promise, @@ -553,34 +486,7 @@ function createSubmissionId(taskId: number, shopName?: string) { return `withdraw:${taskId}:${shopName || "shop"}:${Date.now()}`; } -function formatMatchStatus(status?: string) { - const value = (status || "").trim(); - const map: Record = { - MATCHED: "已匹配", - PENDING: "待匹配", - CONFLICT: "需人工确认", - INDEX_STALE: "匹配已过期", - }; - return map[value] || value || "-"; -} -function formatMatchRemark(row: WithdrawShopQueueItem) { - const message = (row.matchMessage || "").trim(); - if (message) return message; - if (row.matched && row.matchStatus === "MATCHED") { - return "已匹配成功,可启动任务"; - } - if (row.matched) { - return "已匹配成功,请查看状态确认"; - } - if (row.matchStatus === "CONFLICT") { - return "存在多个同名店铺,请人工确认"; - } - if (row.matchStatus === "PENDING") { - return "店铺尚未匹配完成,请稍后查看"; - } - return "未匹配成功,请检查店铺名"; -} function withWithdrawFallback( item: T, diff --git a/frontend-vue/src/pages/brand/components/brand-shop-match-shared.ts b/frontend-vue/src/pages/brand/components/brand-shop-match-shared.ts new file mode 100644 index 000000000..2dfd24126 --- /dev/null +++ b/frontend-vue/src/pages/brand/components/brand-shop-match-shared.ts @@ -0,0 +1,61 @@ +/** 品牌队列类 Tab(巡店删除/取款/查 ASIN)共用的纯逻辑与存储口径。 + * 这三个页面历史上各抄一份,改一处漏两处;这里只收**逐字同形**的部分。 */ + +export type BrandShopMatchRow = { + shopName?: string | null + shopId?: number | string | null + platform?: string | null + companyName?: string | null + matchStatus?: string | null + matchMessage?: string | null + matched?: boolean +} + +const TRANSIENT_BACKEND_ERROR_PATTERNS = [ + 'network error', + 'failed to fetch', + 'timeout', + '503', + '502', + '504', + '500', + 'load failed', +] + +export function uidForStorage(): string { + return typeof window !== 'undefined' ? window.localStorage.getItem('uid') || '0' : '0' +} + +export function isTransientBackendError(error: unknown): boolean { + const message = (error instanceof Error ? error.message : String(error || '')).toLowerCase() + return TRANSIENT_BACKEND_ERROR_PATTERNS.some((pattern) => message.includes(pattern)) +} + +export function formatMatchStatus(status?: string | null): string { + const value = (status || '').trim() + const map: Record = { + MATCHED: '已匹配', + PENDING: '待匹配', + CONFLICT: '需人工确认', + INDEX_STALE: '匹配已过期', + } + return map[value] || value || '-' +} + +export function formatMatchRemark(row: BrandShopMatchRow): string { + const message = (row.matchMessage || '').trim() + if (message) return message + if (row.matched && row.matchStatus === 'MATCHED') return '已匹配成功,可启动任务' + if (row.matched) return '已匹配成功,请查看状态确认' + if (row.matchStatus === 'CONFLICT') return '存在多个同名店铺,请人工确认' + if (row.matchStatus === 'PENDING') return '店铺尚未匹配完成,请稍后查看' + return '未匹配成功,请检查店铺名' +} + +export function rowKeyForMatch(row: { shopName?: string | null; shopId?: number | string | null }): string { + return `${(row.shopName || '').trim()}::${row.shopId || ''}` +} + +export function historyItemKey(item: { taskId?: number | null; resultId?: number | null }): string { + return `${item.taskId ?? 0}:${item.resultId ?? 0}` +} diff --git a/frontend-vue/src/pages/image-video/components/DeliveryImagePreviewDialog.vue b/frontend-vue/src/pages/image-video/components/DeliveryImagePreviewDialog.vue new file mode 100644 index 000000000..e3062e6c1 --- /dev/null +++ b/frontend-vue/src/pages/image-video/components/DeliveryImagePreviewDialog.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/frontend-vue/src/pages/image-video/components/DeliveryVideoResultPanel.vue b/frontend-vue/src/pages/image-video/components/DeliveryVideoResultPanel.vue new file mode 100644 index 000000000..4c25c1461 --- /dev/null +++ b/frontend-vue/src/pages/image-video/components/DeliveryVideoResultPanel.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/frontend-vue/src/pages/image-video/components/DeliveryVideoSecretDialog.vue b/frontend-vue/src/pages/image-video/components/DeliveryVideoSecretDialog.vue new file mode 100644 index 000000000..4cec393e8 --- /dev/null +++ b/frontend-vue/src/pages/image-video/components/DeliveryVideoSecretDialog.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/frontend-vue/src/pages/image-video/components/DeliveryVideoVoiceDialog.vue b/frontend-vue/src/pages/image-video/components/DeliveryVideoVoiceDialog.vue new file mode 100644 index 000000000..200d2919d --- /dev/null +++ b/frontend-vue/src/pages/image-video/components/DeliveryVideoVoiceDialog.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/frontend-vue/src/pages/image-video/components/DeliveryVideoWorkspace.vue b/frontend-vue/src/pages/image-video/components/DeliveryVideoWorkspace.vue index 15ee5e3de..415ef833d 100644 --- a/frontend-vue/src/pages/image-video/components/DeliveryVideoWorkspace.vue +++ b/frontend-vue/src/pages/image-video/components/DeliveryVideoWorkspace.vue @@ -318,177 +318,53 @@ - - - -

快速生成预览视频,用于验证场景结构、镜头调度、主体动作和提示词意图,消耗更少 token。

-
- -

关闭样片模式,按正常规格生成视频。

-
-
-
-
- 模式 - {{ activeTab === 'remake' ? '视频复刻' : '图生视频' }} -
-
- 规格 - {{ currentWorkspace.ratio }} / {{ currentWorkspace.resolution }} / {{ - currentWorkspace.durationSeconds }}秒 -
-
- 产品 - {{ currentWorkspace.productName || '未设置' }} -
-
-
- - {{ assemblyPrimaryActionText }} - - - 重置内容 - -
-
- -
- {{ assemblyPolling ? '正在生成视频,请保持页面打开' : '工作流已提交' }} - 执行 ID:{{ assemblyExecuteId }} - 已查询 {{ assemblyPollCount }} 次,系统会每 5 秒自动刷新结果。 -
-
-
-
- -
-
- {{ assemblyPolling ? '视频生成中,完成后会在这里显示结果。' : '提交生成后,这里会显示生成的视频结果。' }} -
- - -
- 查看原始返回 - -
-
-
+ - -
- {{ secretStatusText }} - {{ secretExpireText }} -
+ - - - -
当前:{{ secretStatus.copyApiKeyMasked }} -
-
- - -
当前:{{ secretStatus.t8KeyMasked }}
-
- - -
当前:{{ secretStatus.t8VideoKeyMasked }} -
-
- - -
当前:{{ secretStatus.voiceApiKeyMasked }} -
-
- - -
当前:{{ secretStatus.voiceGroupIdMasked - }}
-
- - - - - - - - -
+ - -
- - - - -
-
- {{ filteredVoiceListItems.length }} - / {{ voiceListItems.length }} 个音色 -
- - -
-
-
-
- {{ item.name || item.voiceId }} - {{ item.voiceId }} - {{ item.description }} -
- {{ item.sourceLabel }} - - -
-
- -
- - -
- 音色名称 - -
- -
- -
-
- -
-
- - - - + @@ -500,6 +376,21 @@ import { ElMessage, ElMessageBox } from 'element-plus' import AiAssetDropzone from '@/shared/components/ai-workflow/AiAssetDropzone.vue' import AiChoicePills from '@/shared/components/ai-workflow/AiChoicePills.vue' import AiSectionCard from '@/shared/components/ai-workflow/AiSectionCard.vue' +import DeliveryVideoSecretDialog from './DeliveryVideoSecretDialog.vue' +import DeliveryVideoVoiceDialog from './DeliveryVideoVoiceDialog.vue' +import DeliveryVideoResultPanel from './DeliveryVideoResultPanel.vue' +import DeliveryImagePreviewDialog from './DeliveryImagePreviewDialog.vue' +import type { + AssetKey, + AssetState, + AssemblyState, + MediaType, + PreviewKind, + VoiceListItem, + VoiceStatusType, + WorkspaceState, + WorkspaceTab, +} from '@/pages/image-video/delivery-video-workspace-types' import { saveUrlWithProgress } from '@/shared/utils/download-progress' import { createRowId } from '@/shared/utils/row-id' import { safeHttpUrl } from '@/shared/utils/safe-url' @@ -520,13 +411,6 @@ import { } from '@/shared/api/java-modules' import { isTerminalImageVideoTask } from '@/pages/image-video/delivery-video-task-state' -type WorkspaceTab = 'remake' | 'imageToVideo' -type PreviewKind = 'image' | 'video' | 'file' -type MediaType = 'image' | 'video' | 'audio' | 'file' -type AssetKey = 'referenceAsset' | 'sceneAsset' | 'modelAsset' | 'speechAsset' -type VoiceMode = 'textOnly' | 'uploadAudio' | 'synthesize' -type VoiceStatusType = 'info' | 'success' | 'error' - const IMAGE_VIDEO_TASK_POLL_DELAY_MS = 5000 const IMAGE_VIDEO_TASK_MAX_POLLS = 720 @@ -537,70 +421,6 @@ const IMAGE_VIDEO_TASK_MAX_POLLS = 720 */ let disposed = false -type AssetState = { - /** v-for 稳定 key(审查 C6):产品图可删中间行,用 index 当 key 会让上传槽组件实例错位复用 */ - id: string - fileName: string - previewUrl: string - previewKind: PreviewKind - sourceUrl: string - mediaType: MediaType - uploading: boolean -} - -type AssemblyState = { - loading: boolean - resultText: string - executeId: string - polling: boolean - pollCount: number - videoUrl: string - debugUrl: string - downloading: boolean - pollTimer: number -} - -type WorkspaceState = { - referenceAsset: AssetState - productAssets: AssetState[] - sceneAsset: AssetState - modelAsset: AssetState - speechAsset: AssetState - ratio: string - resolution: string - model: string - generationMode: 'draft' | 'standard' - duration: string - durationSeconds: number - videoPrompt: string - sceneMode: string - scenePrompt: string - faceInputType: string - gender: string - modelFigure: string - language: string - audioType: string - voiceMode: VoiceMode - voiceId: string - voiceName: string - scriptText: string - scriptSourceUrl: string - categoryName: string - productName: string - productFocus: string - assembly: AssemblyState -} - -type VoiceListItem = { - voiceId: string - name: string - groupId: string - description: string - sourceKey: string - sourceLabel: string - raw: unknown -} - const activeTab = ref('remake') const copyLearningLoading = ref(false) const voiceLoading = ref(false) @@ -1804,7 +1624,7 @@ onBeforeUnmount(() => {