Commit 900fcd8b by Lin

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

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