Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alejandro Martínez Muñoz
/
ProyectoRobotAmbientales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bfd54a46
authored
Apr 29, 2024
by
Alex
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Agregada lógica de mapa no interactuable en la pantalla principal, pero sí en el pop-up
parent
de0dd333
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
src/app/app.component.html
src/app/crear-pedido-dialog/crear-pedido-dialog.component.html
src/app/mapa/mapa.component.ts
src/app/app.component.html
View file @
bfd54a46
...
@@ -9,6 +9,6 @@
...
@@ -9,6 +9,6 @@
</div>
</div>
<!-- Columna derecha que contiene el componente del mapa -->
<!-- Columna derecha que contiene el componente del mapa -->
<div
class=
"right-column"
>
<div
class=
"right-column"
>
<app-mapa></app-mapa>
<app-mapa
[
interactivo
]="
false
"
></app-mapa>
</div>
</div>
</div>
</div>
src/app/crear-pedido-dialog/crear-pedido-dialog.component.html
View file @
bfd54a46
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<!-- Contenedor del mapa -->
<!-- Contenedor del mapa -->
<div
class=
"map-area"
>
<div
class=
"map-area"
>
<app-mapa
(
celdaSeleccionada
)="
enCeldaSeleccionada
($
event
)"
></app-mapa>
<app-mapa
[
interactivo
]="
true
"
(
celdaSeleccionada
)="
enCeldaSeleccionada
($
event
)"
></app-mapa>
</div>
</div>
</div>
</div>
src/app/mapa/mapa.component.ts
View file @
bfd54a46
import
{
MapaService
}
from
'../mapa.service'
;
import
{
MapaService
}
from
'../mapa.service'
;
import
{
Component
,
OnInit
,
Output
,
EventEmitter
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Output
,
EventEmitter
,
Input
}
from
'@angular/core'
;
@
Component
({
@
Component
({
...
@@ -16,6 +16,7 @@ import { Component, OnInit, Output, EventEmitter } from '@angular/core';
...
@@ -16,6 +16,7 @@ import { Component, OnInit, Output, EventEmitter } from '@angular/core';
* emitir eventos para bloques seleccionados y no seleccionables.
* emitir eventos para bloques seleccionados y no seleccionables.
*/
*/
export
class
MapaComponent
implements
OnInit
{
export
class
MapaComponent
implements
OnInit
{
@
Input
()
interactivo
:
boolean
=
true
;
@
Output
()
celdaSeleccionada
=
new
EventEmitter
<
{
id
:
string
,
row
:
number
,
col
:
number
}
>
();
@
Output
()
celdaSeleccionada
=
new
EventEmitter
<
{
id
:
string
,
row
:
number
,
col
:
number
}
>
();
@
Output
()
celdaInvalidaClickeada
=
new
EventEmitter
<
void
>
();
@
Output
()
celdaInvalidaClickeada
=
new
EventEmitter
<
void
>
();
mapMatrix
:
string
[][]
=
[];
mapMatrix
:
string
[][]
=
[];
...
@@ -92,6 +93,7 @@ export class MapaComponent implements OnInit {
...
@@ -92,6 +93,7 @@ export class MapaComponent implements OnInit {
* @param col La columna en la matriz del mapa donde está el bloque.
* @param col La columna en la matriz del mapa donde está el bloque.
*/
*/
enCeldaClickeada
(
celdaId
:
string
,
row
:
number
,
col
:
number
):
void
{
enCeldaClickeada
(
celdaId
:
string
,
row
:
number
,
col
:
number
):
void
{
if
(
this
.
interactivo
){
if
(
this
.
esCeldaValida
(
celdaId
,
row
,
col
))
{
if
(
this
.
esCeldaValida
(
celdaId
,
row
,
col
))
{
// Emitir también la fila y la columna
// Emitir también la fila y la columna
...
@@ -101,6 +103,9 @@ export class MapaComponent implements OnInit {
...
@@ -101,6 +103,9 @@ export class MapaComponent implements OnInit {
alert
(
'Esta casilla no es válida para selección.'
);
alert
(
'Esta casilla no es válida para selección.'
);
}
}
}
}
else
{
return
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment