优化
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { returnRelabelStatusLabel } from './returnRelabelProgress'
|
||||
describe('退货箱换标状态', () => {
|
||||
it('申请绑定不表示完成,部分和全部完成分别显示', () => {
|
||||
expect(returnRelabelStatusLabel('BOUND')).toBe('处理中')
|
||||
expect(returnRelabelStatusLabel('PROCESSING')).toBe('处理中')
|
||||
expect(returnRelabelStatusLabel('PARTIALLY_COMPLETED')).toBe('部分完成')
|
||||
expect(returnRelabelStatusLabel('COMPLETED')).toBe('全部完成')
|
||||
expect(returnRelabelStatusLabel()).toBe('—')
|
||||
expect(returnRelabelStatusLabel('UNLABELLED')).toBe('未换标')
|
||||
expect(returnRelabelStatusLabel('UNKNOWN')).toBe('—')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
export function returnRelabelStatusLabel(status?: string) {
|
||||
const labels: Record<string, string> = {
|
||||
UNLABELLED: '未换标', BOUND: '处理中', PROCESSING: '处理中',
|
||||
PARTIALLY_COMPLETED: '部分完成', COMPLETED: '全部完成',
|
||||
}
|
||||
return status ? labels[status] || '—' : '—'
|
||||
}
|
||||
Reference in New Issue
Block a user