feat: KPI详情历史数据来源/状态中文显示 — sourceLabel/statusLabel映射(Excel导入/账簿提取/手动录入/已验证/估算等)

This commit is contained in:
Hermes CI Fix
2026-08-26 09:39:21 +08:00
parent a253eadeb0
commit b9076e6818
+23 -3
View File
@@ -169,9 +169,11 @@
<el-tag v-else type="info" size="small"></el-tag>
</template>
</el-table-column>
<el-table-column prop="source_type" label="来源" width="90" />
<el-table-column prop="data_status" label="状态" width="90">
<template #default="{ row }"><el-tag :type="row.data_status==='verified'?'success':'warning'" size="small">{{ row.data_status }}</el-tag></template>
<el-table-column label="来源" width="90">
<template #default="{ row }">{{ sourceLabel(row.source_type) }}</template>
</el-table-column>
<el-table-column label="状态" width="90">
<template #default="{ row }"><el-tag :type="row.data_status==='verified'?'success':'warning'" size="small">{{ statusLabel(row.data_status) }}</el-tag></template>
</el-table-column>
<el-table-column prop="source_batch" label="数据批次" min-width="160" show-overflow-tooltip />
</el-table>
@@ -333,6 +335,24 @@ function formatValue(v: any) {
// 整数不带小数,非整数保留2位
return n.toLocaleString('zh-CN', { minimumFractionDigits: 0, maximumFractionDigits: 2 })
}
// 来源中文映射
function sourceLabel(s: string) {
const map: Record<string, string> = {
excel: 'Excel导入', ledger: '账簿提取', manual: '手动录入',
'excel-import': 'Excel导入', forecast: '预测', sales_ranking: '销售排行',
'bot-bridge-v2': 'Bot桥接', verify: '验证数据', erp: 'ERP',
}
return map[s] || s || '—'
}
// 状态中文映射
function statusLabel(s: string) {
const map: Record<string, string> = {
verified: '已验证', estimated: '估算', pending: '待处理', error: '错误',
}
return map[s] || s || '—'
}
const mapOptions = ref<any[]>([])
const activeTab = ref('basic')