制造成本分析bug修改

This commit is contained in:
2026-04-21 09:40:57 +08:00
parent 835d4efd5b
commit f6aa736bff
19 changed files with 112 additions and 39 deletions

View File

@@ -62,7 +62,8 @@ export default {
return {
chart: null,
// 核心:当前激活的成本数据集(默认月度数据,与第二个组件逻辑一致)
activeData: this.relatedData.relatedMon || []
activeData: this.relatedData.relatedMon || [],
currentTab: 'month'
}
},
computed: {
@@ -108,7 +109,11 @@ export default {
// 监听父组件传递的itemData变化同步更新激活数据集与第二个组件逻辑一致
relatedData: {
handler(newVal) {
this.activeData = newVal.relatedMon || [];
if (this.currentTab === 'month') {
this.activeData = newVal.relatedMon || [];
}else{
this.activeData = newVal.relatedTotal || [];
}
},
immediate: true,
deep: true
@@ -121,6 +126,7 @@ export default {
handleChange(value) {
console.log('Tab 切换值:', value);
this.currentTab = value;
// 根据 Tab 值更新当前激活的数据集
if (value === 'month') {
// 切换为月度数据