Commit 0534f5d0 by Alex

Primer commit

parents
Showing with 1057 additions and 0 deletions
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
]
}
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}
# ProyectoRobotAmbientales
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.5.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ProyectoRobotAmbientales": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"standalone": false
},
"@schematics/angular:directive": {
"standalone": false
},
"@schematics/angular:pipe": {
"standalone": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/proyecto-robot-ambientales",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "ProyectoRobotAmbientales:build:production"
},
"development": {
"buildTarget": "ProyectoRobotAmbientales:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "ProyectoRobotAmbientales:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}
This diff could not be displayed because it is too large.
{
"name": "proyecto-robot-ambientales",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.0",
"@angular/cdk": "^17.3.5",
"@angular/common": "^17.3.0",
"@angular/compiler": "^17.3.0",
"@angular/core": "^17.3.0",
"@angular/forms": "^17.3.0",
"@angular/material": "^17.3.5",
"@angular/platform-browser": "^17.3.0",
"@angular/platform-browser-dynamic": "^17.3.0",
"@angular/router": "^17.3.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.5",
"@angular/cli": "^17.3.5",
"@angular/compiler-cli": "^17.3.0",
"@types/jasmine": "~5.1.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.4.2"
}
}
\ No newline at end of file
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
.crear-pedido-btn {
/* Ajusta los estilos a los de tu diseño de Figma */
background-color: #007bff; /* Color azul, por ejemplo */
padding: 20px 20px;
border: none;
border-radius: 8px;
font-size: 20px;
width: 60%; /* Para que tome todo el ancho del contenedor */
text-transform: uppercase;
color: white;
cursor: pointer;
margin-top: 1rem;
width: 100%;
}
.crear-pedido-btn:hover {
background-color: #0056b3; /* Color azul más oscuro para el efecto hover */
}
.container {
gap: 10rem;
padding: 7rem;
display: flex;
flex-wrap: nowrap;
}
.left-column {
flex: 1;
padding: 40px;
max-width: 40%; /* o lo que prefieras */
}
.right-column {
flex: 1;
padding: 10px;
max-width: 100%; /* o lo que prefieras */
}
\ No newline at end of file
<!--<h1>CONTROLADOR DE RECOGIDA Y ENTREGA DE PEDIDOS</h1>-->
<!-- app.component.html -->
<div class="container">
<div class="left-column">
<app-estado-pedido></app-estado-pedido>
<app-cola-pedidos></app-cola-pedidos>
<button class="crear-pedido-btn" (click)="abrirPopupCrearPedido()">Crear nuevo pedido</button>
</div>
<div class="right-column">
<app-mapa></app-mapa>
</div>
</div>
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'ProyectoRobotAmbientales'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ProyectoRobotAmbientales');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, ProyectoRobotAmbientales');
});
});
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { CrearPedidoDialogComponent } from './crear-pedido-dialog/crear-pedido-dialog.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
constructor(public dialog: MatDialog) {}
abrirPopupCrearPedido(): void {
const dialogRef = this.dialog.open(CrearPedidoDialogComponent, {
width: '1200px',
height: '800px',
});
dialogRef.afterClosed().subscribe(result => {
console.log('El diálogo se ha cerrado');
});
}
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MapaComponent } from './mapa/mapa.component';
import { EstadoPedidoComponent } from './estado-pedido/estado-pedido.component';
import { ColaPedidosComponent } from './cola-pedidos/cola-pedidos.component';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { CrearPedidoDialogComponent } from './crear-pedido-dialog/crear-pedido-dialog.component';
import { MatDialogModule } from '@angular/material/dialog';
@NgModule({
declarations: [
AppComponent,
MapaComponent,
EstadoPedidoComponent,
ColaPedidosComponent,
CrearPedidoDialogComponent
],
imports: [
BrowserModule,
AppRoutingModule,
MatDialogModule
],
providers: [
provideAnimationsAsync()
],
bootstrap: [AppComponent]
})
export class AppModule { }
.cola-pedidos {
border: 1px solid #ccc;
border-radius: 8px;
padding: 20px;
background-color: #f9f9f9;
}
.pedido {
font-size: 19px;
border: 1px solid #aaa;
border-radius: 5px;
margin-bottom: 8px;
padding: 20px;
background-color: #eaeaea;
}
\ No newline at end of file
<div class="cola-pedidos">
<h2>Cola de pedidos</h2>
<div class="pedido" *ngFor="let pedido of pedidos">
<div><strong>Pedido {{ pedido.id }}</strong></div>
<div>Punto de recogida: {{ pedido.puntoDeRecogida }}</div>
<div>Punto de entrega: {{ pedido.puntoDeEntrega }}</div>
<!-- Añade botones o acciones si es necesario -->
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ColaPedidosComponent } from './cola-pedidos.component';
describe('ColaPedidosComponent', () => {
let component: ColaPedidosComponent;
let fixture: ComponentFixture<ColaPedidosComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ColaPedidosComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ColaPedidosComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Pedido } from '../pedido.model'; // Ajusta la ruta del import según tu estructura
@Component({
selector: 'app-cola-pedidos',
templateUrl: './cola-pedidos.component.html',
styleUrls: ['./cola-pedidos.component.css']
})
export class ColaPedidosComponent implements OnInit {
pedidos: Pedido[] = [
{ id: 'A', puntoDeRecogida: 'casilla', puntoDeEntrega: 'casilla' },
{ id: 'B', puntoDeRecogida: 'casilla', puntoDeEntrega: 'casilla' },
];
constructor() { }
ngOnInit(): void {
// Aquí es donde se llenaría la cola de pedidos, posiblemente desde un servicio o al crear un nuevo pedido
}
// Funciones para gestionar pedidos, como añadir, eliminar, etc.
}
.map-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.map-row {
display: flex;
}
.map-block {
width: 50px; /* o el tamaño de tus cuadros */
height: 50px;
margin: 2px;
position: relative; /* para que el pseudo-elemento se posicione correctamente */
}
.map-block:hover::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.2); /* Cambia el color y la opacidad para el efecto de resaltado */
}
.highlighted {
border: 2px solid blue; /* O cualquier otro estilo para resaltar */
}
/* Asegúrate de ajustar también los estilos de .punto-recogida y .punto-entrega */
.punto-recogida img, .punto-entrega img {
max-width: 100px; /* Cambiar a lo que sea adecuado para tu diseño */
max-height: 100px;
display: block; /* Para que se centre en el div si es más pequeño */
margin: auto;
}
.seleccion {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
.puntos {
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom: 10px;
}
.acciones {
width: 100%;
display: flex;
justify-content: space-between;
}
button {
padding: 10px 20px;
cursor: pointer;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
margin: 0 5px; /* Asegura algo de espacio entre los botones */
}
button:hover {
background-color: #0056b3; /* Un color más oscuro para el efecto hover */
}
button:disabled {
background-color: #ccc; /* Un color neutro para botones deshabilitados */
}
\ No newline at end of file
<h2>Crear nuevo pedido</h2>
<div class="seleccion">
<div class="puntos">
<div class="punto-recogida">
<div>Punto de recogida</div>
<img *ngIf="puntoDeRecogida" [src]="getImagePath(puntoDeRecogida)" />
</div>
<div class="punto-entrega">
<div>Punto de entrega</div>
<img *ngIf="puntoDeEntrega" [src]="getImagePath(puntoDeEntrega)" />
</div>
</div>
<div class="acciones">
<button (click)="resetSelection()">Cambiar puntos</button>
<button (click)="confirmSelection()">Confirmar pedido</button>
</div>
</div>
<app-mapa (blockSelected)="onBlockSelected($event)"></app-mapa>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CrearPedidoDialogComponent } from './crear-pedido-dialog.component';
describe('CrearPedidoDialogComponent', () => {
let component: CrearPedidoDialogComponent;
let fixture: ComponentFixture<CrearPedidoDialogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CrearPedidoDialogComponent]
})
.compileComponents();
fixture = TestBed.createComponent(CrearPedidoDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core';
@Component({
selector: 'app-crear-pedido-dialog',
templateUrl: './crear-pedido-dialog.component.html',
styleUrls: ['./crear-pedido-dialog.component.css']
})
export class CrearPedidoDialogComponent {
puntoDeRecogida: string | null = null;
puntoDeEntrega: string | null = null;
highlightedBlock: string | null = null; // Nuevo estado para el bloque resaltado
onBlockSelected(blockId: string): void {
if (!this.puntoDeRecogida) {
this.puntoDeRecogida = blockId;
this.highlightedBlock = blockId; // Resaltar el bloque seleccionado como punto de recogida
} else if (!this.puntoDeEntrega && this.puntoDeRecogida !== blockId) {
this.puntoDeEntrega = blockId;
// No es necesario resaltar el punto de entrega ya que se confirmará el pedido
}
}
getImagePath(id: string): string {
// Esta función debe devolver la ruta correcta para tus imágenes basadas en el ID
return `assets/${id}.png`;
}
resetSelection(): void {
this.puntoDeRecogida = null;
this.puntoDeEntrega = null;
this.highlightedBlock = null; // Eliminar el resaltado
}
confirmSelection(): void {
if (this.puntoDeRecogida && this.puntoDeEntrega) {
// Aquí agregarías la lógica para manejar la confirmación del pedido
// Por ejemplo, podrías llamar a un servicio que maneje la lógica de negocio
console.log('Pedido confirmado con:', this.puntoDeRecogida, this.puntoDeEntrega);
this.resetSelection(); // Resetear selección tras confirmar el pedido
}
}
highlightBlock(blockId: string): void {
if (!this.puntoDeRecogida || (this.puntoDeRecogida && blockId !== this.puntoDeRecogida)) {
this.highlightedBlock = blockId;
}
}
unhighlightBlock(blockId: string): void {
if (this.highlightedBlock === blockId) {
this.highlightedBlock = null;
}
}
}
.estado-pedido {
border: 5px solid #ccc;
border-radius: 8px;
padding: 40px;
margin: 50px 0;
background-color: #f9f9f9;
font-family: 'Arial', sans-serif;
color: #333;
flex: 0 0 auto; /* Esto evita que el elemento crezca, pero puede encogerse */
max-width: 400px; /* o la anchura máxima que desees */
font-size: 1.7em;
}
.estado-pedido .indicador {
display: inline-block;
width: 20px;
height: 20px;
border-radius: 50%;
margin-left: 5px;
}
.estado {
margin-bottom: 15px;
}
.puntosRecogida {
margin-top: 10px;
}
.pedido-en-curso {
color: green;
}
.sin-pedido {
color: red;
}
.estado-pedido .verde {
background-color: green;
}
.estado-pedido .rojo {
background-color: red;
}
\ No newline at end of file
<div class="estado-pedido">
<div class="estado">
Estado: <span [ngClass]="{'pedido-en-curso': pedidoEnCurso, 'sin-pedido': !pedidoEnCurso}">Pedido {{ pedidoEnCurso ? 'en curso' : 'no está en curso' }}</span>
<div class="indicador" [ngClass]="{'verde': pedidoEnCurso, 'rojo': !pedidoEnCurso}"></div>
</div>
<div *ngIf="pedidoEnCurso">
Punto de recogida: Casilla {{ puntoDeRecogida }}<br>
<div class="puntosRecogida">
Punto de entrega: Casilla {{ puntoDeEntrega }}
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EstadoPedidoComponent } from './estado-pedido.component';
describe('EstadoPedidoComponent', () => {
let component: EstadoPedidoComponent;
let fixture: ComponentFixture<EstadoPedidoComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [EstadoPedidoComponent]
})
.compileComponents();
fixture = TestBed.createComponent(EstadoPedidoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-estado-pedido',
templateUrl: './estado-pedido.component.html',
styleUrls: ['./estado-pedido.component.css']
})
export class EstadoPedidoComponent implements OnInit {
pedidoEnCurso: boolean = true;
puntoDeRecogida: string = '';
puntoDeEntrega: string = '';
constructor() { }
ngOnInit(): void {
// Aquí es donde se establecería el estado inicial del pedido
// Por defecto, no hay pedidos, por lo que `pedidoEnCurso` es falso
// Si hay un pedido activo, se deberían establecer los puntos de recogida y entrega y cambiar `pedidoEnCurso` a verdadero
}
}
import { TestBed } from '@angular/core/testing';
import { MapaService } from './mapa.service';
describe('MapaService', () => {
let service: MapaService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MapaService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class MapaService {
private idToImageMap: { [key: string]: string } = {};
constructor() {
this.idToImageMap = this.createIdToImageMap();
}
// Función para crear un mapa de id a imagen
private createIdToImageMap(): { [key: string]: string } {
const map: { [key: string]: string } = {};
for (let i = 0; i <= 11; i++) {
const key = i.toString().padStart(2, '0'); // Asegura que el id tenga dos dígitos
map[key] = key + '.png';
}
return map;
}
public getBlockImage(id: string): string {
return this.idToImageMap[id];
}
public createMapMatrix(mapStr: string, rows: number, cols: number): string[][] {
let blockIds = mapStr.match(/.{1,2}/g) || [];
let mapMatrix: string[][] = [];
for (let i = 0; i < blockIds.length; i += cols) {
mapMatrix.push(blockIds.slice(i, i + cols));
}
return mapMatrix;
}
}
.map-container {
display: flex;
flex-direction: column;
}
.map-row {
display: flex;
}
.map-block {
width: 100px; /* Ajusta este valor según tus necesidades */
height: 100px; /* Ajusta este valor según tus necesidades */
}
.map-block img {
width: 100%;
height: 100%;
object-fit: cover; /* Esto hará que la imagen se ajuste a su contenedor manteniendo su aspecto */
}
\ No newline at end of file
<div class="map-container">
<div *ngFor="let row of mapMatrix; let rowIndex = index" class="map-row">
<div *ngFor="let blockId of row; let colIndex = index" class="map-block" (click)="onBlockClick(blockId)">
<img [src]="'assets/' + getBlockImagePath(blockId)" [alt]="'Bloque ' + blockId">
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MapaComponent } from './mapa.component';
describe('MapaComponent', () => {
let component: MapaComponent;
let fixture: ComponentFixture<MapaComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [MapaComponent]
})
.compileComponents();
fixture = TestBed.createComponent(MapaComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { MapaService } from '../mapa.service';
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-mapa',
templateUrl: './mapa.component.html',
styleUrls: ['./mapa.component.css']
})
export class MapaComponent implements OnInit {
@Output() blockSelected = new EventEmitter<string>(); // Emisor de eventos para la selección de un bloque
mapMatrix: string[][] = [];
mapStr: string = "0202000105030705000200041109060110031000000200080101100110000106010701";
rows: number = 7;
cols: number = 5;
constructor(private MapaService: MapaService) {}
onBlockClick(blockId: string): void {
this.blockSelected.emit(blockId); // Emite el ID del bloque cuando se hace clic
}
ngOnInit(): void {
this.mapMatrix = this.MapaService.createMapMatrix(this.mapStr, this.rows, this.cols);
}
getBlockImagePath(id: string): string {
return this.MapaService.getBlockImage(id);
}
@Output() blockHovered = new EventEmitter<string>();
@Output() blockUnhovered = new EventEmitter<string>();
onBlockMouseOver(blockId: string): void {
this.blockHovered.emit(blockId);
}
// Añade nuevas propiedades para manejar los bordes
selectedPickupId: string | null = null;
selectedDeliveryId: string | null = null;
// Añade métodos para manejar el evento click
selectPickup(blockId: string): void {
this.selectedPickupId = blockId;
this.blockSelected.emit(blockId);
}
selectDelivery(blockId: string): void {
this.selectedDeliveryId = blockId;
this.blockSelected.emit(blockId);
}
onBlockMouseLeave(blockId: string): void {
this.blockUnhovered.emit(blockId);
}
}
export interface Pedido {
id: string; // Un identificador único para cada pedido
puntoDeRecogida: string;
puntoDeEntrega: string;
}
\ No newline at end of file
File mode changed
No preview for this file type
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ProyectoRobotAmbientales</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="mat-typography">
<app-root></app-root>
</body>
</html>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
/* You can add global styles to this file, and also import other style files */
html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"ES2022",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment