diff --git a/src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue b/src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue index e168b773..9aa6d5e2 100644 --- a/src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue +++ b/src/views/crm/statistics/customer/components/CustomerDealCycleByArea.vue @@ -11,13 +11,7 @@ - + ({ /** 获取数据并填充图表 */ const fetchAndFill = async () => { // 1. 加载统计数据 - const customerDealCycleByArea = await StatisticsCustomerApi.getCustomerDealCycleByArea( - props.queryParams - ) + const customerDealCycleByArea = ( + await StatisticsCustomerApi.getCustomerDealCycleByArea(props.queryParams) + ).map((s: CrmStatisticsCustomerDealCycleByAreaRespVO) => { + return { + areaName: s.areaName, + customerDealCycle: s.customerDealCycle, + customerDealCount: s.customerDealCount + } + }) // 2.1 更新 Echarts 数据 if (echartsOption.xAxis && echartsOption.xAxis['data']) { echartsOption.xAxis['data'] = customerDealCycleByArea.map( - (s: CrmStatisticsCustomerDealCycleByAreaRespVO) => s.areaName ?? '未知' + (s: CrmStatisticsCustomerDealCycleByAreaRespVO) => s.areaName ) } if (echartsOption.series && echartsOption.series[0] && echartsOption.series[0]['data']) { diff --git a/src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue b/src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue index 3dff3645..74558d15 100644 --- a/src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue +++ b/src/views/crm/statistics/customer/components/CustomerDealCycleByProduct.vue @@ -11,13 +11,7 @@ - + ({ /** 获取数据并填充图表 */ const fetchAndFill = async () => { // 1. 加载统计数据 - const customerDealCycleByProduct = await StatisticsCustomerApi.getCustomerDealCycleByProduct( - props.queryParams - ) + const customerDealCycleByProduct = ( + await StatisticsCustomerApi.getCustomerDealCycleByProduct(props.queryParams) + ).map((s: CrmStatisticsCustomerDealCycleByProductRespVO) => { + return { + productName: s.productName ?? '未知', + customerDealCycle: s.customerDealCount, + customerDealCount: s.customerDealCount + } + }) // 2.1 更新 Echarts 数据 if (echartsOption.xAxis && echartsOption.xAxis['data']) { echartsOption.xAxis['data'] = customerDealCycleByProduct.map( - (s: CrmStatisticsCustomerDealCycleByProductRespVO) => s.productName ?? '未知' + (s: CrmStatisticsCustomerDealCycleByProductRespVO) => s.productName ) } if (echartsOption.series && echartsOption.series[0] && echartsOption.series[0]['data']) {