Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aceite-tecnico-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Renan de Jesus Montenegro da Silva
aceite-tecnico-frontend
Commits
36615b5b
Commit
36615b5b
authored
Jul 22, 2025
by
RenanMontenegro3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:"alteração no tipo de array para berços selecionados"
parent
8472f529
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
46 deletions
+51
-46
aceite-add.component.html
...p/pages/crud-aceites/aceite-add/aceite-add.component.html
+5
-4
aceite-add.component.ts
...app/pages/crud-aceites/aceite-add/aceite-add.component.ts
+1
-1
visualizacao-aceite.component.ts
...ites/visualizacao-aceite/visualizacao-aceite.component.ts
+24
-21
visualizacao-navio.component.ts
...navios/visualizacao-navio/visualizacao-navio.component.ts
+21
-20
No files found.
src/app/pages/crud-aceites/aceite-add/aceite-add.component.html
View file @
36615b5b
...
...
@@ -109,15 +109,15 @@
</mat-error>
</mat-form-field>
</div>
<div
class=
"row"
>
<mat-form-field
class=
"field small"
appearance=
"outline"
*ngIf=
"selectedCategoriaNome === 'Granel Líquido'"
>
<div
class=
"row"
>
<mat-form-field
class=
"field small"
appearance=
"outline"
*ngIf=
"selectedCategoriaNome === 'Granel Líquido'"
>
<mat-label>
Ponte Mfold (m)
</mat-label>
<input
matInput
type=
"text"
[currencyMask]=
"{ prefix: '',thousands: '.', decimal: ',' }"
formControlName=
"ponte_mfold"
>
<mat-error
*ngIf=
"empForm.get('ponte_mfold')?.invalid"
>
{{ getErrorMessage('ponte_mfold') }}
</mat-error>
</mat-form-field>
</div>
</div>
<div
class=
"row"
>
<mat-form-field
class=
"field full-width"
appearance=
"outline"
>
<mat-label>
Observação
</mat-label>
...
...
@@ -153,13 +153,14 @@
<mat-form-field
class=
"field full-width"
appearance=
"outline"
>
<mat-label>
Berços
</mat-label>
<mat-select
formControlName=
"bercosSelecionados"
multiple
>
<mat-option
*ngFor=
"let berco of bercosDisponiveis"
[value]=
"berco.nome"
>
<mat-option
*ngFor=
"let berco of bercosDisponiveis"
[value]=
"
+
berco.nome"
>
Berço {{ berco.nome }}
</mat-option>
</mat-select>
<mat-hint>
Selecione um ou mais berços
</mat-hint>
</mat-form-field>
</div>
</div>
...
...
src/app/pages/crud-aceites/aceite-add/aceite-add.component.ts
View file @
36615b5b
...
...
@@ -80,7 +80,7 @@ export class AceiteAddComponent implements OnInit {
obs
:
[
data
?
data
.
obs
:
''
],
calado_entrada
:
[
''
,
Validators
.
required
],
calado_saida
:
[
''
,
Validators
.
required
],
bercosSelecionados
:
[
''
]
bercosSelecionados
:
[]
,
});
this
.
empForm
.
get
(
'
categoria
'
)?.
valueChanges
.
subscribe
(
catId
=>
{
...
...
src/app/pages/crud-aceites/visualizacao-aceite/visualizacao-aceite.component.ts
View file @
36615b5b
...
...
@@ -6,7 +6,7 @@ import { MatCardModule } from '@angular/material/card';
import
{
MatTabsModule
}
from
'
@angular/material/tabs
'
;
import
{
MatDialogModule
}
from
'
@angular/material/dialog
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
environment
}
from
'
../../../../environments/.env
'
;
@
Component
({
selector
:
'
app-visualizacao-aceite
'
,
standalone
:
true
,
...
...
@@ -41,25 +41,28 @@ export class VisualizacaoAceiteComponent implements OnInit {
}
return
null
;
}
downloadNavioFunction
()
{
this
.
httpClient
.
get
(
'
http://localhost:8080/api/download-file
'
,
{
params
:
{
filename
:
this
.
data
.
path
},
responseType
:
'
blob
'
// Adiciona 'blob' para lidar com arquivos binários
}).
subscribe
({
next
:
(
response
)
=>
{
// Criação de um URL temporário para o arquivo
const
blob
=
new
Blob
([
response
]);
const
link
=
document
.
createElement
(
'
a
'
);
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
);
link
.
download
=
this
.
data
.
path
||
'
download
'
;
// Define o nome do arquivo
link
.
click
();
// Libera o objeto URL após o download
window
.
URL
.
revokeObjectURL
(
link
.
href
);
console
.
log
(
'
Download iniciado:
'
,
this
.
data
.
path
);
},
error
:
(
error
)
=>
{
console
.
error
(
'
Erro ao baixar o arquivo:
'
,
error
);
}
});
this
.
httpClient
.
get
(
`
${
environment
.
API_URL
}
/api/download-file`
,
{
params
:
{
filename
:
this
.
data
.
path
},
responseType
:
'
blob
'
,
// Adiciona 'blob' para lidar com arquivos binários
})
.
subscribe
({
next
:
(
response
)
=>
{
// Criação de um URL temporário para o arquivo
const
blob
=
new
Blob
([
response
]);
const
link
=
document
.
createElement
(
'
a
'
);
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
);
link
.
download
=
this
.
data
.
path
||
'
download
'
;
// Define o nome do arquivo
link
.
click
();
// Libera o objeto URL após o download
window
.
URL
.
revokeObjectURL
(
link
.
href
);
console
.
log
(
'
Download iniciado:
'
,
this
.
data
.
path
);
},
error
:
(
error
)
=>
{
console
.
error
(
'
Erro ao baixar o arquivo:
'
,
error
);
},
});
}}
src/app/pages/crud-navios/visualizacao-navio/visualizacao-navio.component.ts
View file @
36615b5b
...
...
@@ -10,7 +10,7 @@ import { MatGridList } from '@angular/material/grid-list';
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
NavioService
}
from
'
../../../services/navio.service
'
;
import
{
environment
}
from
'
../../../../environments/.env
'
;
@
Component
({
selector
:
'
app-visualizacao-navio
'
,
standalone
:
true
,
...
...
@@ -380,7 +380,8 @@ export class VisualizacaoNavioComponent implements OnInit {
},
];
downloadNavioFunction
()
{
this
.
httpClient
.
get
(
'
http://localhost:8080/api/download-file
'
,
{
this
.
httpClient
.
get
(
`
${
environment
.
API_URL
}
/api/download-file`
,
{
params
:
{
filename
:
this
.
data
.
path
},
responseType
:
'
blob
'
// Adiciona 'blob' para lidar com arquivos binários
}).
subscribe
({
...
...
@@ -391,7 +392,7 @@ export class VisualizacaoNavioComponent implements OnInit {
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
);
link
.
download
=
this
.
data
.
path
||
'
download
'
;
// Define o nome do arquivo
link
.
click
();
// Libera o objeto URL após o download
window
.
URL
.
revokeObjectURL
(
link
.
href
);
console
.
log
(
'
Download iniciado:
'
,
this
.
data
.
path
);
...
...
@@ -402,26 +403,26 @@ export class VisualizacaoNavioComponent implements OnInit {
});
}
}
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