Verbesserung: Hinzufügen von Protokollausgaben zur Fehlerdiagnose in StatusBar.vue und BranchView.vue
Änderungen: - In der StatusBar.vue wurden Protokollausgaben hinzugefügt, um den Start und die Ergebnisse des fetchStatus-Aufrufs zu dokumentieren. - In der BranchView.vue wurden Protokollausgaben hinzugefügt, um den Status der Aktualisierung der verschiedenen Sektionen zu verfolgen und sicherzustellen, dass die Referenzen verfügbar sind. Diese Anpassungen erhöhen die Nachvollziehbarkeit der Eventverarbeitung und erleichtern die Fehlersuche.
This commit is contained in:
@@ -75,7 +75,7 @@ export default {
|
||||
// Daemon WebSocket deaktiviert - verwende Socket.io
|
||||
this.setupSocketEvents();
|
||||
|
||||
// Live-Socket-Events
|
||||
// Live-Socket-Events - nur für Events ohne spezielle Behandlung
|
||||
[
|
||||
"production_ready",
|
||||
"stock_change",
|
||||
@@ -83,8 +83,6 @@ export default {
|
||||
"director_death",
|
||||
"production_started",
|
||||
"selled_items",
|
||||
"falukantUpdateStatus",
|
||||
"falukantBranchUpdate",
|
||||
"knowledge_update"
|
||||
].forEach(eventName => {
|
||||
if (this.socket) {
|
||||
@@ -95,8 +93,10 @@ export default {
|
||||
|
||||
beforeUnmount() {
|
||||
if (this.socket) {
|
||||
// Entferne spezielle Event-Listener
|
||||
this.socket.off("falukantBranchUpdate");
|
||||
this.socket.off("falukantUpdateStatus");
|
||||
// Entferne allgemeine Event-Listener
|
||||
this.socket.off("production_ready");
|
||||
this.socket.off("stock_change");
|
||||
this.socket.off("price_update");
|
||||
@@ -247,10 +247,38 @@ export default {
|
||||
case 'falukantBranchUpdate':
|
||||
console.log('🔄 BranchView: Lade alle Sektionen für', eventData.event);
|
||||
console.log('🔄 BranchView: StatusBar ref:', this.$refs.statusBar);
|
||||
this.$refs.statusBar?.fetchStatus();
|
||||
this.$refs.productionSection?.loadProductions();
|
||||
this.$refs.storageSection?.loadStorageData();
|
||||
this.$refs.saleSection?.loadInventory();
|
||||
console.log('🔄 BranchView: ProductionSection ref:', this.$refs.productionSection);
|
||||
console.log('🔄 BranchView: StorageSection ref:', this.$refs.storageSection);
|
||||
console.log('🔄 BranchView: SaleSection ref:', this.$refs.saleSection);
|
||||
|
||||
if (this.$refs.statusBar) {
|
||||
console.log('🔄 BranchView: Rufe StatusBar.fetchStatus() auf...');
|
||||
this.$refs.statusBar.fetchStatus();
|
||||
} else {
|
||||
console.log('⚠️ BranchView: StatusBar ref nicht verfügbar');
|
||||
}
|
||||
|
||||
if (this.$refs.productionSection) {
|
||||
console.log('🔄 BranchView: Rufe ProductionSection.loadProductions() auf...');
|
||||
this.$refs.productionSection.loadProductions();
|
||||
} else {
|
||||
console.log('⚠️ BranchView: ProductionSection ref nicht verfügbar');
|
||||
}
|
||||
|
||||
if (this.$refs.storageSection) {
|
||||
console.log('🔄 BranchView: Rufe StorageSection.loadStorageData() auf...');
|
||||
this.$refs.storageSection.loadStorageData();
|
||||
} else {
|
||||
console.log('⚠️ BranchView: StorageSection ref nicht verfügbar');
|
||||
}
|
||||
|
||||
if (this.$refs.saleSection) {
|
||||
console.log('🔄 BranchView: Rufe SaleSection.loadInventory() auf...');
|
||||
this.$refs.saleSection.loadInventory();
|
||||
} else {
|
||||
console.log('⚠️ BranchView: SaleSection ref nicht verfügbar');
|
||||
}
|
||||
|
||||
console.log('✅ BranchView: Alle Sektionen aktualisiert');
|
||||
break;
|
||||
case 'knowledge_update':
|
||||
|
||||
Reference in New Issue
Block a user