制造成本分析bug修改
This commit is contained in:
@@ -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') {
|
||||
// 切换为月度数据
|
||||
|
||||
Reference in New Issue
Block a user