refactor(person/sale): 简化紧急问题数据转换逻辑

移除百分比转换步骤,直接使用API返回的数值格式
This commit is contained in:
2025-08-25 11:05:24 +08:00
parent d385d22cf5
commit f1fe585fc4

View File

@@ -327,11 +327,8 @@ async function getUrgentProblem() {
const res = await getProblemDistribution(hasParams ? params : undefined) const res = await getProblemDistribution(hasParams ? params : undefined)
if(res.code === 200) { if(res.code === 200) {
// 将API返回的对象格式转换为数组格式 // 将API返回的对象格式转换为数组格式
const problemDistribution = res.data.problem_distribution const problemDistributionCount = res.data.problem_distribution_count
urgentProblemData.value = Object.entries(problemDistribution).map(([name, percentage]) => ({ urgentProblemData.value = Object.entries(problemDistributionCount).map(([name, value]) => ({ name, value }))
name: name,
value: parseInt(percentage.replace('%', '')) || 0
}))
} }
} catch (error) { } catch (error) {
console.error('获取紧急问题数据失败:', error) console.error('获取紧急问题数据失败:', error)