制造成本分析bug修改
This commit is contained in:
@@ -100,7 +100,8 @@ export default {
|
||||
chart: null,
|
||||
// 核心:当前激活的物料数据集(默认月度数据,与第二个组件逻辑一致)
|
||||
activeData: this.relatedData.relatedMon || [],
|
||||
activeMaterial: '' // 记录选中的物料状态,与第二个组件一致
|
||||
activeMaterial: '', // 记录选中的物料状态,与第二个组件一致
|
||||
currentTab: 'month'
|
||||
}
|
||||
},
|
||||
// 对齐第二个组件:添加计算属性,精准筛选各物料数据
|
||||
@@ -153,7 +154,11 @@ export default {
|
||||
// 对齐第二个组件:监听物料数据变化,同步更新激活数据集
|
||||
relatedData: {
|
||||
handler(newVal) {
|
||||
this.activeData = newVal.relatedMon || [];
|
||||
if (this.currentTab === 'month') {
|
||||
this.activeData = newVal.relatedMon || [];
|
||||
}else{
|
||||
this.activeData = newVal.relatedTotal || [];
|
||||
}
|
||||
},
|
||||
immediate: true, // 组件挂载时立即执行
|
||||
deep: true // 深度监听对象内部变化
|
||||
@@ -165,6 +170,7 @@ export default {
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
console.log('Tab 切换值:', value);
|
||||
this.currentTab = value;
|
||||
// 根据 Tab 值更新当前激活的数据集
|
||||
if (value === 'month') {
|
||||
// 切换为月度数据
|
||||
|
||||
Reference in New Issue
Block a user