This commit is contained in:
‘937886381’
2025-12-30 19:36:05 +08:00
parent 7b3873f9ea
commit 20ef2b9763
158 changed files with 3059 additions and 462 deletions

View File

@@ -76,12 +76,13 @@ export default {
// 1. 校验数据有效性
if (!this.trendData || !this.selectedProfit) {
return {
diffs: [],
months: [], // 月份数组x轴标签
rates: [], // 完成率completeRate
reals: [], // 实际值real
targets: [], // 目标值target
flags: [] // 达标状态
flags: [], // 达标状态
diffs: [],
};
}
@@ -124,7 +125,7 @@ export default {
// 重构 chartD替换硬编码数据为动态解析数据
chartD() {
// 获取动态解析的趋势数据
const { months, rates, reals, targets, flags } = this.trendParsedData;
const { months, rates, reals, targets, flags, diffs } = this.trendParsedData;
// 销量场景数据(保留原有结构,替换数据来源)
const salesData = {
allPlaceNames: months, // 优先用基地名称,无则用月份
@@ -190,7 +191,7 @@ export default {
height: 20,
// 关键:去掉换行,让文字在一行显示,适配小尺寸
formatter: function (params) {
const diff = data.diffs || [];
const diff = diffs || [];
const currentDiff = diff[params.dataIndex] || 0;
return `{rate|${currentDiff}}{text|差值}`;
},

View File

@@ -83,11 +83,11 @@ export default {
return html;
}
},
grid: {
grid: {
top: 30,
bottom: 30,
right: 70,
left: 40,
right: 20,
left: 60,
},
xAxis: [
{

View File

@@ -83,11 +83,11 @@ export default {
// return html;
// }
},
grid: {
grid: {
top: 30,
bottom: 30,
right: 70,
left: 40,
right: 20,
left: 60,
},
xAxis: [
{

View File

@@ -163,7 +163,7 @@ export default {
formatter: '{value}'
},
splitLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } }
axisLine: { show: true, lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } }
},
{
type: 'value',
@@ -179,7 +179,7 @@ export default {
formatter: '{value}%'
},
splitLine: { show: false },
axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
axisLine: { show: true, lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
splitNumber: 4
}
],

View File

@@ -83,11 +83,11 @@ export default {
// return html;
// }
},
grid: {
grid: {
top: 30,
bottom: 30,
right: 70,
left: 40,
right: 20,
left: 60,
},
xAxis: [
{
@@ -126,7 +126,7 @@ export default {
formatter: '{value}'
},
splitLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
axisLine: { lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
axisLine: { show: true, lineStyle: { color: 'rgba(0, 0, 0, 0.15)' } },
},
// 右侧Y轴利润占比百分比
{

View File

@@ -56,7 +56,7 @@ export default {
}
// 解构数据,避免重复取值
const { diff, completeRate: rate, real, target, flag } = this.detailData;
const { diff, completeRate, real, target, flag } = this.detailData;
// 确保数值为数字类型
const realValue = Number(real) || 0;
const targetValue = Number(target) || 0;