refactor(person/sale): 简化紧急问题数据转换逻辑
移除百分比转换步骤,直接使用API返回的数值格式
This commit is contained in:
@@ -327,11 +327,8 @@ async function getUrgentProblem() {
|
||||
const res = await getProblemDistribution(hasParams ? params : undefined)
|
||||
if(res.code === 200) {
|
||||
// 将API返回的对象格式转换为数组格式
|
||||
const problemDistribution = res.data.problem_distribution
|
||||
urgentProblemData.value = Object.entries(problemDistribution).map(([name, percentage]) => ({
|
||||
name: name,
|
||||
value: parseInt(percentage.replace('%', '')) || 0
|
||||
}))
|
||||
const problemDistributionCount = res.data.problem_distribution_count
|
||||
urgentProblemData.value = Object.entries(problemDistributionCount).map(([name, value]) => ({ name, value }))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取紧急问题数据失败:', error)
|
||||
|
||||
Reference in New Issue
Block a user