feat(数据分析): 重构客户问题排行榜和客户类型图表数据处理
- 将客户问题排行榜数据从静态数据改为基于API响应的计算属性 - 重构客户类型图表数据处理逻辑,支持按省份聚合地域数据 - 将客户类型图表从柱状图改为饼图,优化数据显示效果
This commit is contained in:
@@ -280,16 +280,18 @@ const customerTypeData = ref([
|
||||
{ name: "55岁以上", value: 50 },
|
||||
]);
|
||||
|
||||
// 客户问题排行榜数据
|
||||
const problemRankingData = ref([
|
||||
{ name: "提高学习成绩", value: "65%" },
|
||||
{ name: "课程费用咨询", value: "58%" },
|
||||
{ name: "师资力量了解", value: "52%" },
|
||||
{ name: "时间安排问题", value: "48%" },
|
||||
{ name: "学习兴趣培养", value: "42%" },
|
||||
{ name: "学习方法指导", value: "38%" },
|
||||
{ name: "课程内容详情", value: "35%" },
|
||||
]);
|
||||
// 客户问题排行榜数据 - 计算属性:将API数据转换为组件所需格式
|
||||
const problemRankingData = computed(() => {
|
||||
if (!customerUrgency.value || !customerUrgency.value.company_urgent_issue_ratio) {
|
||||
return []
|
||||
}
|
||||
|
||||
const ratioData = customerUrgency.value.company_urgent_issue_ratio
|
||||
return Object.entries(ratioData).map(([name, value]) => ({
|
||||
name,
|
||||
value
|
||||
}))
|
||||
})
|
||||
|
||||
// 表格数据和筛选
|
||||
const tableData = ref([
|
||||
@@ -1027,6 +1029,50 @@ async function getCustomerUrgency() {
|
||||
const res = await getUrgentNeedToAddress()
|
||||
console.log(1222222,res)
|
||||
customerUrgency.value = res.data
|
||||
/**
|
||||
* data
|
||||
:
|
||||
company_urgent_issue_counts
|
||||
:
|
||||
回归学校
|
||||
:
|
||||
2
|
||||
少玩手机
|
||||
:
|
||||
6
|
||||
心理健康
|
||||
:
|
||||
0
|
||||
成绩提升
|
||||
:
|
||||
8
|
||||
[[Prototype]]
|
||||
:
|
||||
Object
|
||||
company_urgent_issue_ratio
|
||||
:
|
||||
回归学校
|
||||
:
|
||||
"12.50%"
|
||||
少玩手机
|
||||
:
|
||||
"37.50%"
|
||||
心理健康
|
||||
:
|
||||
"0.00%"
|
||||
成绩提升
|
||||
:
|
||||
"50.00%"
|
||||
[[Prototype]]
|
||||
:
|
||||
Object
|
||||
user_level
|
||||
:
|
||||
5
|
||||
user_name
|
||||
:
|
||||
"赵世敬"
|
||||
*/
|
||||
} catch (error) {
|
||||
console.error("获取客户迫切解决的问题排行榜失败:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user