🐛 补充今日校园任务日志详情展示

为任务日志补充成功标题与失败原因字段,并在缺少 is_success 时根据 error_message 回退显示失败,便于定位执行结果。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
sugarBecomer
2026-04-07 13:30:46 +08:00
parent 08c47cfa03
commit 5baa91e3e7
2 changed files with 28 additions and 7 deletions
+2
View File
@@ -93,6 +93,8 @@ export interface CpTaskLog {
cp_user_id?: number
is_success?: boolean
real_name?: string
real_title?: string
error_message?: string
createTime?: string
created_at?: string
updateTime?: string
+26 -7
View File
@@ -22,14 +22,33 @@ const columns: ColumnDef<CpTaskLog, any>[] = [
header: '执行结果',
cell: ({ row }) => {
const isSuccess = row.original.is_success
if (typeof isSuccess !== 'boolean') {
return h('span', '-')
const errorMessage = row.original.error_message
if (typeof isSuccess === 'boolean') {
return h(
'span',
{ class: isSuccess ? 'text-green-600' : 'text-red-600' },
isSuccess ? '成功' : '失败',
)
}
return h(
'span',
{ class: isSuccess ? 'text-green-600' : 'text-red-600' },
isSuccess ? '成功' : '失败',
)
if (errorMessage) {
return h('span', { class: 'text-red-600' }, '失败')
}
return h('span', '-')
},
},
{
accessorKey: 'real_name',
header: '成功标题',
cell: ({ row }) => {
const realTitle = row.original.real_name || row.original.real_title
return h('span', { class: 'whitespace-pre-wrap break-all' }, realTitle || '-')
},
},
{
accessorKey: 'error_message',
header: '失败原因',
cell: ({ row }) => {
return h('span', { class: 'whitespace-pre-wrap break-all' }, row.original.error_message || '-')
},
},
{