From 5358863fc6430419deaf0cb6afa48e99106574d7 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Tue, 9 Apr 2024 18:47:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E7=90=86null=E6=95=B0=E6=8D=AE=E4=B8=BA'=E6=9C=AA=E7=9F=A5'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomerDealCycleByArea.vue | 22 +++++++++---------- .../components/CustomerDealCycleByProduct.vue | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) 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']) {