feat(web-admin): show transferred status on OA progress lines

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-23 15:16:40 +08:00
1 parent dc54170771
commit 35c60f95e8
4 files changed
+37 -4

No files matched your search

@@ -78,6 +78,36 @@ function run() {
assert.equal(rejected[0].tone, 'danger')
assert.equal(rejected[1].text, '乙 无需处理')
// 转交
const xfer: ProgressPersonInput[] = [
{
nickName: '李四',
status: 'transferred',
commentText: '',
timestamp: '2026-07-23 10:05:00'
},
{ nickName: '赵六', status: 'pending', commentText: '', timestamp: '' }
]
const xferLines = formatProgressPersonLines(xfer)
assert.deepEqual(
xferLines.map((x) => x.text),
['李四 已转交 2026-07-23 10:05:00', '赵六 待处理']
)
assert.equal(xferLines[0].tone, 'mute')
const xferComment: ProgressPersonInput[] = [
{
nickName: '李四',
status: 'transferred',
commentText: '出差代批',
timestamp: '2026-07-23 10:05:00'
}
]
assert.equal(
formatProgressPersonLines(xferComment)[0].text,
'李四 出差代批 2026-07-23 10:05:00'
)
// 空 people
assert.deepEqual(formatProgressPersonLines([]), [])
assert.deepEqual(formatProgressPersonLines(undefined), [])
@@ -126,7 +126,8 @@
done: '已结束',
submitted: '已提交',
not_reached: '未到达',
returned: '已打回'
returned: '已打回',
transferred: '已转交'
}
return map[s] || s
}
+2 -1
View File
@@ -61,7 +61,8 @@ const STATUS_TEXT: Record<string, string> = {
done: '已结束',
submitted: '已提交',
not_reached: '未到达',
returned: '已打回'
returned: '已打回',
transferred: '已转交'
}
const UPLOAD_TYPES = new Set([
@@ -18,7 +18,7 @@ export type ProgressPersonLine = {
tone: PersonLineTone
}
const ACTED_STATUS = new Set(['approved', 'rejected', 'returned', 'completed'])
const ACTED_STATUS = new Set(['approved', 'rejected', 'returned', 'completed', 'transferred'])
function displayName(p: ProgressPersonInput): string {
return String(p.nickName || p.id || '').trim()
@@ -30,6 +30,7 @@ function statusFallbackLabel(status: string): string {
if (s === 'rejected') return '已拒绝'
if (s === 'returned') return '已打回'
if (s === 'completed') return '已完成'
if (s === 'transferred') return '已转交'
return s || '已处理'
}
@@ -38,7 +39,7 @@ function toneForStatus(status: string): PersonLineTone {
if (s === 'approved' || s === 'completed') return 'ok'
if (s === 'pending' || s === 'running' || s === 'not_reached') return 'pending'
if (s === 'rejected' || s === 'returned' || s === 'cancelled') return 'danger'
if (s === 'done') return 'mute'
if (s === 'done' || s === 'transferred') return 'mute'
return ''
}