fix(bugcollect): 补充缺失的 statusTag/statusLabel/formatTime 函数
这三个函数在模板中调用但未在 script 中定义,导致 TypeScript 编译失败。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
e2b85c76a4
当前提交
55cd65899c
@ -156,8 +156,28 @@ function levelTag(level: string): '' | 'success' | 'warning' | 'info' | 'danger'
|
||||
return map[level?.toLowerCase()] ?? ''
|
||||
}
|
||||
|
||||
function statusTag(status: string): '' | 'success' | 'warning' | 'info' | 'danger' {
|
||||
const map: Record<string, '' | 'success' | 'warning' | 'info' | 'danger'> = {
|
||||
open: 'danger', resolved: 'success', ignored: 'info',
|
||||
}
|
||||
return map[status?.toLowerCase()] ?? ''
|
||||
}
|
||||
|
||||
function statusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
open: '未解决', resolved: '已解决', ignored: '已忽略',
|
||||
}
|
||||
return map[status?.toLowerCase()] ?? status ?? '-'
|
||||
}
|
||||
|
||||
function formatTime(time: string | undefined | null): string {
|
||||
if (!time) return '-'
|
||||
try {
|
||||
return new Date(time).toLocaleString('zh-CN', { hour12: false })
|
||||
} catch {
|
||||
return time
|
||||
}
|
||||
}
|
||||
|
||||
async function handleResolve() {
|
||||
if (!detail.value) return
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户