fix: 视频生成状态判断优化
This commit is contained in:
parent
b17aec4a1a
commit
fa99a4fb9b
|
|
@ -580,12 +580,18 @@ export default {
|
|||
el.scrollTop = el.scrollHeight
|
||||
},
|
||||
|
||||
taskRowResultTrim(row) {
|
||||
return String(row?.result ?? '').trim()
|
||||
},
|
||||
|
||||
taskStatusText(row) {
|
||||
// 与后端约定:0 执行中,2 失败,1+http(s) 成功,1 且非 http 为生成失败
|
||||
if (row.status === 2) return '已失败/已取消'
|
||||
if (row.status === 0) return '执行中'
|
||||
if (row.status === 1) {
|
||||
if (row.result && this.isHttpOrHttpsUrl(row.result)) return '已完成'
|
||||
const r = this.taskRowResultTrim(row)
|
||||
if (!r) return '失败'
|
||||
if (this.isHttpOrHttpsUrl(r)) return '已完成'
|
||||
if (/^cgt/i.test(r)) return '任务执行中'
|
||||
return '任务生成失败'
|
||||
}
|
||||
return '执行中'
|
||||
|
|
@ -593,12 +599,19 @@ export default {
|
|||
|
||||
/** 是否展示完整「结果区」(视频 / 链接);其余状态仅紧凑展示在用户行右侧 */
|
||||
isChatRowSuccessWithMedia(row) {
|
||||
return row.status === 1 && row.result && this.isHttpOrHttpsUrl(row.result)
|
||||
const r = this.taskRowResultTrim(row)
|
||||
return row.status === 1 && !!r && this.isHttpOrHttpsUrl(r)
|
||||
},
|
||||
|
||||
chatRowInlineStatusClass(row) {
|
||||
if (row.status === 2) return 'vg-chat-inline-status--failed'
|
||||
if (row.status === 1 && !this.isHttpOrHttpsUrl(row.result)) return 'vg-chat-inline-status--failed'
|
||||
if (row.status === 1) {
|
||||
const r = this.taskRowResultTrim(row)
|
||||
if (!r) return 'vg-chat-inline-status--failed'
|
||||
if (/^cgt/i.test(r)) return 'vg-chat-inline-status--running'
|
||||
if (this.isHttpOrHttpsUrl(r)) return 'vg-chat-inline-status--running'
|
||||
return 'vg-chat-inline-status--failed'
|
||||
}
|
||||
return 'vg-chat-inline-status--running'
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue