feat(GoodMusic): 替换模拟API为真实语音转文本API调用

refactor(DetailedDataTable): 简化选中人员判断逻辑

feat(RankingList): 将排行榜数据获取逻辑移至组件内部

refactor(topone): 移除冗余代码并优化排行榜数据流

chore: 删除不再使用的DataTable组件
This commit is contained in:
2025-08-18 21:54:20 +08:00
parent d182673552
commit 182130ba6a
5 changed files with 62 additions and 348 deletions

View File

@@ -48,10 +48,8 @@
<div class="dashboard-row row-3">
<!-- 业绩排行榜 -->
<ranking-list
:ranking-data="formattedRankingData"
:format-number="formatNumber"
:get-rank-class="getRankClass"
@periods-change="getCenterSalesRank"
/>
<!-- 客户类型占比 -->
<customer-type :customer-data="customerTypeRatio" @category-change="getCustomerTypeRatio" />
@@ -63,14 +61,13 @@
<CampManagement />
</div>
<!-- 第五行 -->
<div class="dashboard-row row-4">
<div class="dashboard-row">
<DetailedDataTable
:table-data="detailData"
:level-tree="levelTree"
v-model:selected-person="selectedPerson"
@filter-change="handleFilterChange"
/>
<DataDetailCard :selected-person="selectedPerson" />
</div>
<!-- 新建任务模态框 -->
<div
@@ -155,13 +152,12 @@ import RankingList from "./components/RankingList.vue";
import PersonalSalesRanking from "./components/PersonalSalesRanking.vue";
import CommunicationData from "./components/CommunicationData.vue";
import QualityCalls from "./components/QualityCalls.vue";
import DataTable from "./components/DataTable.vue";
// import DataTable from "./components/DataTable.vue";
import DataDetail from "./components/DataDetail.vue";
import CampManagement from "./components/CampManagement.vue";
import DetailedDataTable from "./components/DetailedDataTable.vue";
import DataDetailCard from "./components/DataDetailCard.vue";
import { getOverallCompanyPerformance,getCompanyDepositConversionRate,getCompanyTotalCallCount,getCompanyNewCustomer,getCompanyConversionRate,getCompanyRealTimeProgress
,getCompanyConversionRateVsLast,getSalesMonthlyPerformance,getCenterPerformanceRank,getCustomerTypeDistribution,getUrgentNeedToAddress,getLevelTree,getDetailedDataTable
,getCompanyConversionRateVsLast,getSalesMonthlyPerformance,getCustomerTypeDistribution,getUrgentNeedToAddress,getLevelTree,getDetailedDataTable
} from "@/api/top";
const rankingPeriod = ref("month");
const rankingData = ref([
@@ -461,74 +457,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",…}
check_type
:
"month"
company_current_rate
:
{线索总数: 14051, 加微: 3238, 到课: 7614, 付定金: 168, 成交: 136}
付定金
:
168
到课
:
7614
加微
:
3238
成交
:
136
线索总数
:
14051
company_current_vs_last_rate
:
{线索总数: "-20.16%", 加微: "-2.70%", 到课: "+114.90%", 付定金: "+∞%", 成交: "+∞%"}
付定金
:
"+∞%"
到课
:
"+114.90%"
加微
:
"-2.70%"
成交
:
"+∞%"
线索总数
:
"-20.16%"
company_last_rate
:
{线索总数: 17598, 加微: 3328, 到课: 3543, 付定金: 0, 成交: 0}
付定金
:
0
到课
:
3543
加微
:
3328
成交
:
0
线索总数
:
17598
user_level
:
5
user_name
:
"赵世敬"
*/
} catch (error) {
console.error("获取转化对比失败:", error);
}
@@ -583,37 +511,7 @@ async function getCompanySalesRank(Rank) {
console.error("获取销售月度业绩红黑榜失败:", error);
}
}
// 获取全中心业绩排行榜
const centerSalesRank = ref({});
// 计算属性:转换 centerSalesRank 数据格式以适配 ranking-list 组件
const formattedRankingData = computed(() => {
if (!centerSalesRank.value || !centerSalesRank.value.center_performance_periods_rank) {
return rankingData.value; // 返回默认数据
}
const rankList = centerSalesRank.value.center_performance_periods_rank;
return rankList.map((item, index) => ({
id: index + 1,
name: item.center_leader,
performance: item.total_deals,
average_deals_per_member: item.average_deals_per_member
}));
});
async function getCenterSalesRank(data) {
const params={
check_type:data //periods、month、year
}
try {
const res = await getCenterPerformanceRank(params)
console.log(1222222,res)
centerSalesRank.value = res.data
} catch (error) {
console.error("获取全中心业绩排行榜失败:", error);
}
}
// 获取全中心业绩排行榜逻辑已移至 RankingList 组件
// 客户类型占比
const customerTypeRatio = ref({});
async function getCustomerTypeRatio(data) {
@@ -683,7 +581,6 @@ onMounted(async() => {
await getTotalDeals()
await getConversionComparison('month')
await getCompanySalesRank('red')
await getCenterSalesRank('periods')
await getCustomerTypeRatio('child_education')
await getCustomerUrgency()
await CusotomGetLevelTree()