后台管理接口修复 后端BUG修复
This commit is contained in:
@@ -84,9 +84,6 @@
|
||||
<div class="file-progress-track">
|
||||
<div class="file-progress-bar" :style="{ width: `${fileProgressPercent(item)}%` }"></div>
|
||||
</div>
|
||||
<div class="file-progress-count">
|
||||
{{ item.fileProgressCurrent || 0 }}/{{ item.fileProgressTotal || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-right">
|
||||
@@ -119,9 +116,6 @@
|
||||
<div class="file-progress-track">
|
||||
<div class="file-progress-bar" :style="{ width: `${fileProgressPercent(item)}%` }"></div>
|
||||
</div>
|
||||
<div class="file-progress-count">
|
||||
{{ item.fileProgressCurrent || 0 }}/{{ item.fileProgressTotal || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.error" class="files">错误:{{ item.error }}</div>
|
||||
</div>
|
||||
@@ -702,8 +696,13 @@ function canDownload(item: AppearancePatentHistoryItem) {
|
||||
|
||||
function fileProgressPercent(item: AppearancePatentHistoryItem) {
|
||||
const percent = Number(item.fileProgressPercent || 0)
|
||||
if (!Number.isFinite(percent)) return 0
|
||||
return Math.max(0, Math.min(100, Math.round(percent)))
|
||||
if (Number.isFinite(percent) && percent > 0) {
|
||||
return Math.max(0, Math.min(100, Math.round(percent)))
|
||||
}
|
||||
if (shouldShowFallbackJobProgress(item)) {
|
||||
return activeFileJobStatus(item) === 'PENDING' ? 6 : 10
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function displayFileProgressMessage(item: AppearancePatentHistoryItem, fallback: string) {
|
||||
@@ -736,7 +735,30 @@ function translateFileProgressMessage(message: string) {
|
||||
|
||||
function showFileProgress(item: AppearancePatentHistoryItem) {
|
||||
const status = normalizeTaskStatus(item)
|
||||
return (status === 'RUNNING' || isResultPreparing(item)) && (item.fileProgressTotal || 0) > 0
|
||||
return (status === 'RUNNING' || isResultPreparing(item)) && (hasExplicitFileProgress(item) || shouldShowFallbackJobProgress(item))
|
||||
}
|
||||
|
||||
function hasExplicitFileProgress(item: AppearancePatentHistoryItem) {
|
||||
return hasFileProgressCount(item)
|
||||
|| Number(item.fileProgressPercent || 0) > 0
|
||||
|| Boolean((item.fileProgressMessage || '').trim())
|
||||
}
|
||||
|
||||
function hasFileProgressCount(item: AppearancePatentHistoryItem) {
|
||||
return (item.fileProgressTotal || 0) > 0
|
||||
}
|
||||
|
||||
function activeFileJobStatus(item: AppearancePatentHistoryItem) {
|
||||
return (item.fileStatus || '').toUpperCase()
|
||||
}
|
||||
|
||||
function hasActiveFileJob(item: AppearancePatentHistoryItem) {
|
||||
const fileStatus = activeFileJobStatus(item)
|
||||
return item.fileJobId != null || fileStatus === 'PENDING' || fileStatus === 'RUNNING'
|
||||
}
|
||||
|
||||
function shouldShowFallbackJobProgress(item: AppearancePatentHistoryItem) {
|
||||
return hasActiveFileJob(item) && !hasExplicitFileProgress(item)
|
||||
}
|
||||
|
||||
async function downloadResult(item: AppearancePatentHistoryItem) {
|
||||
@@ -842,7 +864,6 @@ onUnmounted(() => {
|
||||
.file-progress-meta { display: flex; justify-content: space-between; gap: 12px; color: #d8c278; font-size: 12px; }
|
||||
.file-progress-track { margin-top: 5px; height: 8px; border-radius: 999px; overflow: hidden; background: #303030; border: 1px solid #3b3b3b; }
|
||||
.file-progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4aa3ff, #f0c75e); transition: width .25s ease; }
|
||||
.file-progress-count { margin-top: 4px; color: #858585; font-size: 11px; }
|
||||
.download { padding: 6px 10px; color: #d6ecff; background: rgba(52, 152, 219, .18); }
|
||||
.btn-delete { padding: 6px 10px; color: #ff8f8f; background: rgba(231, 76, 60, .12); }
|
||||
@media (max-width: 1100px) {
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
<div v-if="!parsedRows.length" class="empty-tasks">暂无解析结果</div>
|
||||
<el-table v-else :data="previewRows" height="120" class="result-table">
|
||||
<el-table-column prop="displayId" label="ID" width="90" />
|
||||
<el-table-column prop="sku" label="SKU" width="130" />
|
||||
<el-table-column prop="asin" label="ASIN" width="130" />
|
||||
<el-table-column prop="country" label="国家" width="100" />
|
||||
<el-table-column prop="price" label="价格" width="90" />
|
||||
|
||||
@@ -1721,6 +1721,7 @@ export interface SimilarAsinParsedRow {
|
||||
groupKey?: string;
|
||||
asin: string;
|
||||
country: string;
|
||||
sku?: string;
|
||||
price?: string;
|
||||
url?: string;
|
||||
title?: string;
|
||||
|
||||
Reference in New Issue
Block a user