酒店
build / task (16.x, npm, macOS-latest) (push) Canceled after 0s
build / task (16.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, npm, windows-latest) (push) Canceled after 0s
build / task (16.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (16.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (16.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (16.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, yarn, windows-latest) (push) Canceled after 0s
build / task (18.x, npm, macOS-latest) (push) Canceled after 0s
build / task (18.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, npm, windows-latest) (push) Canceled after 0s
build / task (18.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (18.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (18.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (18.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, yarn, windows-latest) (push) Canceled after 0s
build / task (20.x, npm, macOS-latest) (push) Canceled after 0s
build / task (20.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, npm, windows-latest) (push) Canceled after 0s
build / task (20.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (20.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (20.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (20.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, yarn, windows-latest) (push) Canceled after 0s

This commit is contained in:
zjf committed 2026-10-30 15:46:08 +08:00
1 parent ac9b734bfd
commit 668fb93644
1 file changed
+68 -15
+68 -15
View File
@@ -107,7 +107,7 @@
</template>
</el-table-column>
<el-table-column prop="operator" label="操作人" width="100" show-overflow-tooltip />
<el-table-column label="操作" width="360" fixed="right">
<el-table-column label="操作" width="420" fixed="right">
<template #default="scope">
<el-button
v-if="canPause(scope.row)"
@@ -147,6 +147,16 @@
>
失败明细
</el-button>
<el-button
v-if="canRetryFailedRow(scope.row)"
text
type="warning"
v-auth="'supermarket_smHotel_sync'"
:loading="retryingLogId === scope.row.id"
@click="onRetryFailedRow(scope.row)"
>
重试失败
</el-button>
<el-button
v-if="scope.row.failCount > 0 || scope.row.failDetail"
text
@@ -284,14 +294,25 @@ const failDetailLogId = ref<string | number | null>(null)
const failDetailSyncType = ref("")
const failDetailHasCount = ref(false)
const retryFailedLoading = ref(false)
const retryingLogId = ref<string | number | null>(null)
const isRetryableSyncType = (t?: string) =>
t === "DETAIL_PULL" || t === "PRICE_ROLL" || t === "DOWNSTREAM_PUSH"
const canRetryFailed = computed(
() =>
!!failDetailLogId.value &&
!!failDetailText.value &&
(failDetailSyncType.value === "DETAIL_PULL" || failDetailSyncType.value === "PRICE_ROLL"),
isRetryableSyncType(failDetailSyncType.value),
)
/** 列表行:已结束且有失败明细时可只重试失败酒店 */
const canRetryFailedRow = (row: any) =>
!!row?.failDetail &&
isRetryableSyncType(row?.syncType) &&
row?.status !== "RUNNING" &&
row?.status !== "PAUSED"
const canPause = (row: any) =>
row?.status === "RUNNING" && (row.syncType === "DOWNSTREAM_PUSH" || row.syncType === "DETAIL_PULL")
@@ -391,28 +412,42 @@ const exportDownstreamGaps = (row: any) => {
downBlobFile(exportGapsBySyncLogId(row.id), {}, `下游推送完善清单_${row.id}.xlsx`)
}
const retryConfirmText = (syncType?: string) => {
if (syncType === "PRICE_ROLL") {
return "将只重试本日志失败明细中的酒店滚价(同日),不会全量再跑。完善数据后若仍有失败,可对「新的重试日志」再点重试。"
}
if (syncType === "DOWNSTREAM_PUSH") {
return "将只重推本日志失败明细中的酒店到下游,不会全量再推。可:导出失败/完善清单 → 改数据 → 再点重试,直到失败清零。"
}
return "将只重试本日志失败明细中的酒店详情拉取,不会全量再跑。完善后仍失败可对重试日志继续重试。"
}
const submitRetryFailed = async (logId: string | number, syncType?: string) => {
const res: any = await retryFailedFromLog(logId)
const data = res?.data || {}
const newId = data.logId || data.id
if (!newId) {
useMessage().error(res?.msg || data.message || "提交重试失败")
return false
}
useMessage().success(res?.msg || `已提交失败重试(新日志 ${newId}),请在本页刷新查看`)
return true
}
const onRetryFailed = async () => {
if (!failDetailLogId.value) return
try {
await useMessageBox().confirm(
failDetailSyncType.value === "PRICE_ROLL"
? "将只重试本日志失败明细中的酒店滚价(同日),确定?"
: "将只重试本日志失败明细中的酒店详情拉取,确定?",
)
await useMessageBox().confirm(retryConfirmText(failDetailSyncType.value))
} catch {
return
}
retryFailedLoading.value = true
try {
const res: any = await retryFailedFromLog(failDetailLogId.value)
const data = res?.data || {}
if (!data.logId) {
useMessage().error(res?.msg || data.message || "提交重试失败")
return
const ok = await submitRetryFailed(failDetailLogId.value, failDetailSyncType.value)
if (ok) {
failDetailVisible.value = false
loadSyncLogs(1)
}
failDetailVisible.value = false
useMessage().success(res?.msg || "已提交失败重试,请在本页刷新查看进度")
loadSyncLogs(1)
} catch (err: any) {
useMessage().error(err?.msg || err?.message || "提交重试失败")
} finally {
@@ -420,6 +455,24 @@ const onRetryFailed = async () => {
}
}
const onRetryFailedRow = async (row: any) => {
if (!row?.id) return
try {
await useMessageBox().confirm(retryConfirmText(row.syncType))
} catch {
return
}
retryingLogId.value = row.id
try {
const ok = await submitRetryFailed(row.id, row.syncType)
if (ok) loadSyncLogs(1)
} catch (err: any) {
useMessage().error(err?.msg || err?.message || "提交重试失败")
} finally {
retryingLogId.value = null
}
}
const handlePauseLog = async (row: any) => {
try {
await useMessageBox().confirm(