提交
This commit is contained in:
1 parent
e5ba8f097a
commit
62cfb8fbbf
24 files changed
+3323
-249
No files matched your search
@@ -0,0 +1,18 @@
|
||||
/** 身份证号脱敏:18 位保留前 6 后 4,15 位保留前 6 后 3 */
|
||||
export function maskIdCard(value: unknown): string {
|
||||
const raw = String(value ?? '').trim()
|
||||
if (!raw) return '-'
|
||||
const len = raw.length
|
||||
if (len === 18) {
|
||||
return `${raw.slice(0, 6)}${'*'.repeat(8)}${raw.slice(14)}`
|
||||
}
|
||||
if (len === 15) {
|
||||
return `${raw.slice(0, 6)}${'*'.repeat(6)}${raw.slice(12)}`
|
||||
}
|
||||
if (len <= 4) {
|
||||
return '*'.repeat(len)
|
||||
}
|
||||
const head = Math.min(3, Math.floor(len / 3))
|
||||
const tail = Math.min(4, len - head - 1)
|
||||
return `${raw.slice(0, head)}${'*'.repeat(len - head - tail)}${raw.slice(len - tail)}`
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
export function protocolStatusLabel(s: string) {
|
||||
const map: Record<string, string> = {
|
||||
dsx: '待生效',
|
||||
sxz: '生效中',
|
||||
ygq: '已过期',
|
||||
yzf: '已作废',
|
||||
zky: '转科研'
|
||||
}
|
||||
return map[s] || s || '-'
|
||||
}
|
||||
|
||||
export function payModeLabel(s: string) {
|
||||
if (s === 'dj') return '趸交'
|
||||
if (s === 'fq') return '分期'
|
||||
return s || '-'
|
||||
}
|
||||
|
||||
export function payStatusLabel(s: string) {
|
||||
const map: Record<string, string> = {
|
||||
dfj: '待缴费',
|
||||
jfqrz: '缴费确认中',
|
||||
yjf: '已缴费',
|
||||
tfqrz: '退费确认中',
|
||||
ytf: '已退费'
|
||||
}
|
||||
return map[s] || '未知'
|
||||
}
|
||||
|
||||
export function transferTypeLabel(t: string) {
|
||||
const map: Record<string, string> = {
|
||||
wxzz: '微信转账',
|
||||
zzbzz: '支付宝转账',
|
||||
yhkzz: '银行卡转账',
|
||||
xj: '现金'
|
||||
}
|
||||
return map[t] || t || '-'
|
||||
}
|
||||
|
||||
export function formatPaymentDueDate(d: unknown) {
|
||||
const s = String(d || '')
|
||||
if (!s) return '-'
|
||||
if (s.length === 8) return `${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}`
|
||||
return s
|
||||
}
|
||||
|
||||
export function formatPaymentAmount(v: unknown) {
|
||||
if (v == null || v === '') return '-'
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return String(v)
|
||||
return n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
}
|
||||
Reference in new issue
Block a user