更新任务存储、权限与货源查询流程
Build Backend JAR / build (push) Has been cancelled

This commit is contained in:
supernijia
2026-08-22 21:23:01 +08:00
parent 7a7f1dfa21
commit 159d52194c
32 changed files with 1239 additions and 69 deletions
@@ -170,7 +170,7 @@ const TaskRow = defineComponent({
props.item.error ? h('div', { class: 'files error-text' }, `错误:${props.item.error}`) : null,
]),
h('div', { class: 'task-right' }, [
h('span', { class: ['status', statusClass(props.item.taskStatus)] }, statusText(props.item.taskStatus)),
h('span', { class: ['status', statusClass(props.item.taskStatus)] }, statusText(props.item)),
canDownload(props.item) ? h('button', { type: 'button', class: 'download', onClick: () => emit('download', props.item) }, '下载') : null,
h('button', { type: 'button', class: 'btn-delete', onClick: () => emit('delete', props.item) }, '删除'),
]),
@@ -226,7 +226,13 @@ function countryLabel(code: string) { return COUNTRY_OPTIONS.find((row) => row.c
function isCountrySelected(code: string) { return orderedCountryCodes.value.includes(code) }
function isCountrySelectionLocked(code: string) { return orderedCountryCodes.value.length === 1 && orderedCountryCodes.value[0] === code }
function isTerminal(status?: string) { return status === 'SUCCESS' || status === 'FAILED' || status === 'COMPLETED' }
function statusText(status?: string) { return status === 'SUCCESS' || status === 'COMPLETED' ? '已完成' : status === 'FAILED' ? '失败' : '执行中' }
function statusText(item: ShopDataCrawlHistoryItem) {
const status = item.taskStatus
if (status === 'SUCCESS' || status === 'COMPLETED') return '已完成'
if (status === 'FAILED') return '失败'
if (item.success === true) return '结果文件生成中'
return 'Python 处理中'
}
function statusClass(status?: string) { return status === 'SUCCESS' || status === 'COMPLETED' ? 'success' : status === 'FAILED' ? 'failed' : 'running' }
function canDownload(item: ShopDataCrawlHistoryItem) { return Boolean(item.resultId && (item.fileReady || item.downloadUrl)) }
function formatDateTime(value?: string) { if (!value) return '-'; const date = new Date(value); return Number.isNaN(date.getTime()) ? value : date.toLocaleString('zh-CN', { hour12: false }) }
@@ -596,7 +602,7 @@ onUnmounted(() => {
:deep(.id) { display: block; margin-bottom: 5px; color: #eee; font-weight: 700; }
:deep(.files) { margin-top: 3px; color: #888; font-size: 12px; }
:deep(.task-right) { display: flex; align-items: center; gap: 10px; }
:deep(.status) { min-width: 52px; font-size: 12px; text-align: center; }
:deep(.status) { min-width: 88px; font-size: 12px; text-align: center; white-space: nowrap; }
:deep(.status.success) { color: #67c23a; }:deep(.status.failed) { color: #f56c6c; }:deep(.status.running) { color: #e6a23c; }
:deep(.download), :deep(.btn-delete) { padding: 5px 10px; border: 1px solid #444; border-radius: 4px; background: transparent; color: #ccc; cursor: pointer; }
:deep(.download) { border-color: #409eff; color: #8dc4ff; }:deep(.btn-delete) { color: #f56c6c; }