Commit 900fcd8b by Lin

fix(strategyAnalysis): 更新效果分析逻辑与数据展示

- 将效果分析中的字段名称从nextCycleIndicator更改为metrics,提升代码可读性。
- 优化效果详情展示逻辑,确保在点击效果项时传递正确的metrics数据。
- 移除不必要的businessForm字段,简化组件结构,提升可维护性。
- 更新效果详情对比逻辑,确保在展示当前与下一周期数据时使用正确的值。
1 parent 6edff81a
......@@ -13,15 +13,16 @@
<div class="business-title">
当前周期
</div>
<template v-for="(item, index) in businessForm">
<!-- {{ row }} -->
<template v-for="(item, index) in row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.label }}
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="businessDetail.beforeLearning[item.key] != null">
{{ businessDetail.beforeLearning[item.key] }}<template v-if="item.unit">
<template v-if="item.currentValue >= 0">
{{ item.currentValue }}<template v-if="item.unit">
{{ item.unit }}
</template>
</template>
......@@ -36,19 +37,19 @@
<div class="business-title">
下一周期
</div>
<template v-for="(item, index) in businessForm">
<template v-for="(item, index) in row">
<div :key="index"
class="business-item">
<div class="label">
{{ item.label }}
{{ item.categoryExtension }}
</div>
<div class="value flex">
<template v-if="businessDetail.afterLearning[item.key] != null">
{{ businessDetail.afterLearning[item.key] }}<template v-if="item.unit">
<template v-if="item.nextValue >= 0">
{{ item.nextValue }}<template v-if="item.unit">
{{ item.unit }}
</template>
<img class="arrow"
:src="getIconSrc(formatIsRatio(item.key))" />
:src="getIconSrc(formatIsRatio(item.nextValue - item.currentValue))" />
</template>
<template v-else>
-
......@@ -104,37 +105,7 @@ export default {
beforeLearning: {},
afterLearning: {},
},
businessForm: [
{
label: "转化率",
key: "conversionRate",
unit: "%",
},
{
label: "客单价",
key: "avgOrderAmount",
},
{
label: "套餐销售率",
key: "packageSalesRate",
unit: "%",
},
{
label: "整车延保渗透率",
key: "wholeVehicleWarrantyPenetration",
unit: "%",
},
{
label: "安心包渗透率",
key: "anxinPackagePenetration",
unit: "%",
},
{
label: "电池渗透率",
key: "batteryPenetration",
unit: "%",
},
],
businessForm: [],
};
},
computed: {
......
......@@ -174,10 +174,10 @@
</div>
</template>
<!-- 效果分析 -->
<template #nextCycleIndicator="scope">
<template #metrics="scope">
<span class="effect-cell"
@click="handleEffectDetail(scope.scope)">
{{ scope.columnsObj.formatter(scope.scope) }}
{{ scope.scope.metrics.length }} <span style="color: #333333;">项提升</span>
</span>
</template>
</d2-table>
......@@ -337,7 +337,7 @@ export default {
return cellValue.areaOperator
.map(item => item.username)
.filter(username => username)
.join("/") || "、";
.join("/") || "-";
},
},
{
......@@ -347,13 +347,13 @@ export default {
type: "slot",
addHtml: "flightSupervision",
formatter: (cellValue) => {
if (!cellValue.flightSupervision || !Array.isArray(cellValue.flightSupervision)) {
if (!cellValue.flightSupervision) {
return "-";
}
return cellValue.flightSupervision
.map(item => item.username)
.filter(username => username)
.join("/") || "、";
.join("/") || "-";
},
},
// {
......@@ -387,12 +387,6 @@ export default {
minWidth: 120,
type: "slot",
addHtml: "metrics",
formatter: (cellValue) => {
if (cellValue.nextCycleIndicator == null || cellValue.nextCycleIndicator === undefined) {
return "-";
}
return `${cellValue.nextCycleIndicator}${this.currentWatchType.value == 1 ? "%" : ""}`;
},
},
],
},
......@@ -740,7 +734,7 @@ export default {
}
},
handleEffectDetail(row) {
this.effectDetailRow = row;
this.effectDetailRow = row.metrics;
this.effectDetailVisible = true;
},
handleViewDetail(e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!