feat: 添加路由权限控制和高级经理数据动态加载
refactor(router): 实现基于用户等级的路由守卫 feat(secondTop): 动态加载高级经理列表数据 fix(SalesTimelineWithTaskList): 修正默认职业和教育显示 perf(CustomerType): 优化图表数据绑定和交互 chore: 更新API基础路径配置
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div class="BB-section">
|
||||
<!--客户类型占比-->
|
||||
<CustomerType />
|
||||
<CustomerType :customer-data="customerTypeDistribution" @category-change="handleCustomerTypeChange" />
|
||||
<!-- 优秀录音 -->
|
||||
<GoodMusic />
|
||||
<!-- 客户问题排行 -->
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<!-- Right Section - Group Comparison -->
|
||||
<div class="right-section">
|
||||
<GroupComparison :groups="groups" @select-group="selectGroup" />
|
||||
<GroupComparison :groups="groups" :senior-manager-data="seniorManagerList" @select-group="selectGroup" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -285,18 +285,25 @@
|
||||
}
|
||||
}
|
||||
// 客户类型
|
||||
async function CenterCustomerType() {
|
||||
async function CenterCustomerType(distributionType = 'occupation') {
|
||||
const params = getRequestParams()
|
||||
const hasParams = params.user_name
|
||||
// 添加distribution_type参数
|
||||
const requestParams = hasParams ? { ...params, distribution_type: distributionType } : { distribution_type: distributionType }
|
||||
try {
|
||||
const res = await getCustomerTypeDistribution(hasParams ? params : undefined)
|
||||
const res = await getCustomerTypeDistribution(requestParams)
|
||||
if (res.code === 200) {
|
||||
customerTypeDistribution.value = res.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取中心整体概览失败:', error)
|
||||
console.error('获取客户类型分布失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 处理客户类型选择变化
|
||||
const handleCustomerTypeChange = (distributionType) => {
|
||||
CenterCustomerType(distributionType)
|
||||
}
|
||||
// 客户迫切解决的问题
|
||||
async function CenterUrgentNeedToAddress() {
|
||||
const params = getRequestParams()
|
||||
@@ -305,46 +312,29 @@
|
||||
const res = await getUrgentNeedToAddress(hasParams ? params : undefined)
|
||||
if (res.code === 200) {
|
||||
urgentNeedToAddress.value = res.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取中心整体概览失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 综合排名---高级经理列表
|
||||
const seniorManagerList = ref([])
|
||||
async function CenterSeniorManagerList() {
|
||||
const params = getRequestParams()
|
||||
const hasParams = params.user_name
|
||||
try {
|
||||
const res = await getCenterAdvancedManagerList(hasParams ? params : undefined)
|
||||
if (res.code === 200) {
|
||||
seniorManagerList.value = res.data
|
||||
/**
|
||||
* data
|
||||
:
|
||||
{user_name: "刘瑞", user_level: 4,…}
|
||||
center_urgent_issue_counts
|
||||
:
|
||||
{成绩提升: 1, 少玩手机: 1, 回归学校: 0, 心理健康: 0}
|
||||
回归学校
|
||||
:
|
||||
0
|
||||
少玩手机
|
||||
:
|
||||
1
|
||||
心理健康
|
||||
:
|
||||
0
|
||||
成绩提升
|
||||
:
|
||||
1
|
||||
center_urgent_issue_ratio
|
||||
:
|
||||
{成绩提升: "50.00%", 少玩手机: "50.00%", 回归学校: "0.00%", 心理健康: "0.00%"}
|
||||
回归学校
|
||||
:
|
||||
"0.00%"
|
||||
少玩手机
|
||||
:
|
||||
"50.00%"
|
||||
心理健康
|
||||
:
|
||||
"0.00%"
|
||||
成绩提升
|
||||
:
|
||||
"50.00%"
|
||||
user_level
|
||||
:
|
||||
4
|
||||
user_name
|
||||
:
|
||||
"刘瑞"
|
||||
* "data": {
|
||||
"user_name": "刘瑞",
|
||||
"user_level": 4,
|
||||
"center_advanced_managers": [
|
||||
"陈盼良"
|
||||
]
|
||||
}
|
||||
*/
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -396,6 +386,7 @@ user_name
|
||||
await CenterDepositConversionRate()
|
||||
await CenterCustomerType()
|
||||
await CenterUrgentNeedToAddress()
|
||||
await CenterSeniorManagerList()
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user