This commit is contained in:
‘937886381’
2026-01-07 16:47:49 +08:00
parent 51e66cf6e1
commit b76f3bfd37
164 changed files with 4179 additions and 2297 deletions

View File

@@ -97,21 +97,11 @@ export default {
overflow: 'break',
formatter: (value) => {
const dateParts = value.split('-'); // ["2025", "07", "01"]
if (dateParts.length < 2) return value; // 处理异常格式
if (dateParts.length < 2) return value;
switch (this.dateData.mode) {
case 1: // 日模式,显示“月-日”
// 确保有日的部分
return dateParts.length >= 3
? `${dateParts[1]}${dateParts[2]}`
: `${dateParts[1]}`; // fallback
case 2: // 月模式,显示“月”
return `${dateParts[1]}`;
case 3: // 年模式,显示“年”
return `${dateParts[1]}`;
default: // 默认月模式
return `${dateParts[1]}`;
}
// 去掉月份前面的0然后加上"月"
const month = dateParts[1].replace(/^0+/, '');
return `${month}`;
}
},
data: this.xAxisData