feat(DetailedDataTable): 重构筛选器为层级联动选择并添加禁用状态

重构筛选器组件,将原有的独立下拉框改为基于组织架构的层级联动选择(中心领导->高级经理->经理),并添加禁用状态逻辑。当未选择上级时,下级选择器将被禁用。同时移除注释掉的代码和调试日志。
This commit is contained in:
2025-08-18 12:13:57 +08:00
parent 80f4d82a75
commit 8f709aa1f5
2 changed files with 114 additions and 147 deletions

View File

@@ -70,6 +70,7 @@
<div class="dashboard-row row-4">
<DetailedDataTable
:table-data="tableData"
:level-tree="levelTree"
v-model:selected-person="selectedPerson"
/>
<DataDetailCard :selected-person="selectedPerson" />
@@ -674,34 +675,6 @@ async function getConversionComparison(data) {
const res = await getCompanyConversionRateVsLast(params)
console.log(111111,res)
conversionComparison.value = res.data
/**
* "data": {
"user_name": "赵世敬",
"user_level": 5,
"check_type": "month",
"company_current_rate": {
"线索总数": 14050,
"加微": 3238,
"到课": 7613,
"付定金": 167,
"成交": 135
},
"company_last_rate": {
"线索总数": 17598,
"加微": 3328,
"到课": 3543,
"付定金": 0,
"成交": 0
},
"company_current_vs_last_rate": {
"线索总数": "-20.16%",
"加微": "-2.70%",
"到课": "+114.87%",
"付定金": "+∞%",
"成交": "+∞%"
}
}
*/
} catch (error) {
console.error("获取转化对比失败:", error);
}
@@ -942,25 +915,6 @@ async function getCenterSalesRank(data) {
const res = await getCenterPerformanceRank(params)
console.log(1222222,res)
centerSalesRank.value = res.data
/**
* "data": {
"user_name": "赵世敬",
"user_level": 5,
"rank_type": "periods",
"center_performance_periods_rank": [
{
"center_leader": "郭可英",
"total_deals": 0,
"average_deals_per_member": 0
},
{
"center_leader": "刘瑞",
"total_deals": 4,
"average_deals_per_member": 0
}
]
}
*/
} catch (error) {
console.error("获取全中心业绩排行榜失败:", error);
}
@@ -975,49 +929,6 @@ async function getCustomerTypeRatio(data) {
const res = await getCustomerTypeDistribution(params)
console.log(1222222,res)
customerTypeRatio.value = res.data
/**
* data
:
customer_type_distribution
:
Array(7)
0
:
{category: '初二', ratio: '37.50%'}
1
:
{category: '高一', ratio: '18.75%'}
2
:
{category: '初一', ratio: '12.50%'}
3
:
{category: '五年级', ratio: '12.50%'}
4
:
{category: '六年级', ratio: '6.25%'}
5
:
{category: '三年级以下', ratio: '6.25%'}
6
:
{category: '高三', ratio: '6.25%'}
length
:
7
[[Prototype]]
:
Array(0)
distribution_type
:
"child_education"
user_level
:
5
user_name
:
"赵世敬"
*/
} catch (error) {
console.error("获取客户类型占比失败:", error);
}
@@ -1029,50 +940,6 @@ 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);
}
@@ -1084,6 +951,55 @@ async function CusotomGetLevelTree() {
const res = await getLevelTree()
console.log(1222222,res)
levelTree.value = res.data
/**
* "data": {
"user_name": "赵世敬",
"user_level": 5,
"level_tree": {
"center_leaders": [
{
"name": "郭可英",
"advanced_managers": [
{
"name": "李小燕",
"managers": []
},
{
"name": "郭子奇",
"managers": [
{
"name": "杨朵朵"
},
{
"name": "张明起"
}
]
}
]
},
{
"name": "刘瑞",
"advanced_managers": [
{
"name": "陈盼良",
"managers": [
{
"name": "马然"
},
{
"name": "杨启晨"
},
{
"name": "韦少杰"
}
]
}
]
}
]
}
}
*/
} catch (error) {
console.error("获取级别树失败:", error);
}
@@ -1110,9 +1026,9 @@ onMounted(async() => {
// await getConversionComparison('month')
// await getCompanySalesRank('red')
// await getCenterSalesRank('periods')
await getCustomerTypeRatio('child_education')
await getCustomerUrgency()
// await getCustomerTypeRatio('child_education')
// await getCustomerUrgency()
await CusotomGetLevelTree()
});
</script>