Commit 6edff81a by Lin

fix(strategyAnalysis): 更新盯防类型与指标类型字段名称及数据处理逻辑

- 将盯防类型字段名称从areaOperator更改为flightSupervision,确保字段名称更符合实际含义。
- 更新指标类型字段名称从nextCycleIndicator更改为metrics,提升代码可读性与一致性。
- 优化数据请求逻辑,确保从API获取的数据格式与组件需求一致,提升数据处理的准确性。
- 新增tooltip展示逻辑,增强用户界面的交互性与信息可读性。
1 parent fece6599
......@@ -158,6 +158,21 @@
<span v-else>{{ scope.columnsObj.formatter(scope.scope) }}</span>
</div>
</template>
<template #flightSupervision="scope">
<div>
<el-tooltip v-if="scope.columnsObj.formatter(scope.scope) && scope.columnsObj.formatter(scope.scope) !== '-' && scope.columnsObj.formatter(scope.scope) !== '、'"
effect="dark"
placement="top">
<template #content>
<div class="tooltip-content-max">
<div>{{ scope.columnsObj.formatter(scope.scope) }}</div>
</div>
</template>
<span class="two-line-ellipsis">{{ scope.columnsObj.formatter(scope.scope) }}</span>
</el-tooltip>
<span v-else>{{ scope.columnsObj.formatter(scope.scope) }}</span>
</div>
</template>
<!-- 效果分析 -->
<template #nextCycleIndicator="scope">
<span class="effect-cell"
......@@ -277,7 +292,7 @@ export default {
tableColumns: [
{
label: "门店名称",
prop: "merchantName4s",
prop: "storeName",
minWidth: 160,
},
{
......@@ -327,15 +342,15 @@ export default {
},
{
label: "区域督导",
prop: "areaOperator",
prop: "flightSupervision",
minWidth: 80,
type: "slot",
addHtml: "areaOperator",
addHtml: "flightSupervision",
formatter: (cellValue) => {
if (!cellValue.areaOperator || !Array.isArray(cellValue.areaOperator)) {
if (!cellValue.flightSupervision || !Array.isArray(cellValue.flightSupervision)) {
return "-";
}
return cellValue.areaOperator
return cellValue.flightSupervision
.map(item => item.username)
.filter(username => username)
.join("/") || "、";
......@@ -368,10 +383,10 @@ export default {
},
{
label: "效果分析",
prop: "nextCycleIndicator",
prop: "metrics",
minWidth: 120,
type: "slot",
addHtml: "nextCycleIndicator",
addHtml: "metrics",
formatter: (cellValue) => {
if (cellValue.nextCycleIndicator == null || cellValue.nextCycleIndicator === undefined) {
return "-";
......@@ -461,15 +476,18 @@ export default {
async wrapStrategyEffectList(params) {
try {
// const data = await getStrategyEffectList(params);
params.cycleType = params.periodType;
params.cycleType = params.periodType == 1 ? 2 : params.periodType == 2 ? 3 : params.periodType;
params.startDate = dayjs(this.startDate).format("YYYY-MM-DD");
params.endDate = dayjs(this.endDate).format("YYYY-MM-DD");
const data = await getStrategyAnalysisEffect(params);
console.log("getStrategyAnalysisEffect", data);
// axios 响应拦截器已返回 data 字段的内容(数组)
// 需要包装成 d2-table 期望的格式:{ data: [...], total: number }
return {
data: data || [],
total: (data && data.length) || 0,
pageNum: params.pageNum || 1,
pageSize: params.pageSize || 1000,
data: data.list || [],
total: data.total,
pageNum: data.pageNum,
pageSize: data.pageSize,
};
} catch (error) {
console.error("获取策略效果分析列表失败:", error);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!