// onCheckRoomsBays(values, event) { // console.log(values); // const checked = event.target.checked; // if (checked) { // this.sldRoomsBaysList.push(values); // this.sldGymBridList.push(values.GymBRID); // this.sldGymBRID = values.GymBRID; // } else { // this.sldRoomsBaysList = this.sldRoomsBaysList.filter( // (item) => item.GymBRID !== values.GymBRID // ); // this.sldGymBridList = this.sldGymBridList.filter( // (id) => id !== values.GymBRID // ); // } // console.log(this.sldRoomsBaysList); // //Ensure icons update correctly when unchecking // this.isActiveAdd = this.sldRoomsBaysList.length === 0; // this.isActiveDelete = this.sldRoomsBaysList.length > 0; // this.isActiveEdit = this.sldRoomsBaysList.length === 1; // } goToCategory() { this.isCategoryCompleted = false; this.isEquipmentCompleted = true; this.getAllCategoryList(); // Retrieve selectedMachines from localStorage const savedSelection = JSON.parse(localStorage.getItem('selectedMachines') || '[]'); this.filteredBaysRooms.forEach((value) => { value.AddedStatus = this.isEquipmentAlreadyInBay(value.AssetID); // Ensure previously selected items remain checked value.checked = savedSelection.some(category => category.assets.some(asset => asset.assetID === value.AssetID) ); }); }