|
|
|
|
@ -11,13 +11,7 @@
|
|
|
|
|
<el-card shadow="never" class="mt-16px">
|
|
|
|
|
<el-table v-loading="loading" :data="list">
|
|
|
|
|
<el-table-column label="序号" align="center" type="index" width="80" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="产品名称"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="productName"
|
|
|
|
|
min-width="200"
|
|
|
|
|
:formatter="(_, __, val: any) => val ?? '未知'"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="产品名称" align="center" prop="productName" min-width="200" />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="成交周期(天)"
|
|
|
|
|
align="center"
|
|
|
|
|
@ -112,13 +106,19 @@ const echartsOption = reactive<EChartsOption>({
|
|
|
|
|
/** 获取数据并填充图表 */
|
|
|
|
|
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']) {
|
|
|
|
|
|