Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
Intranet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Matteo
Intranet
Commits
ee044a3e
Commit
ee044a3e
authored
Aug 23, 2019
by
Matteo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload file funziona + disattivati loading alert da ios
parent
cf2d93a9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
parere.page.ts
src/app/pages/parere/parere.page.ts
+7
-1
parere.service.ts
src/app/service/parere.service.ts
+1
-1
util.service.ts
src/app/service/util.service.ts
+2
-0
No files found.
src/app/pages/parere/parere.page.ts
View file @
ee044a3e
...
...
@@ -99,6 +99,8 @@ export class ParerePage implements OnInit {
selection
:
boolean
=
false
;
clickCheckbox
:
boolean
=
false
;
filename
:
string
=
""
;
toggleGroup
(
id
:
number
)
{
if
(
this
.
clickCheckbox
)
...
...
@@ -210,7 +212,10 @@ export class ParerePage implements OnInit {
{
this
.
utilService
.
showLoading
();
this
.
idCliente
=
AuthService
.
clienteSelezionato
.
id
;
this
.
parereService
.
newParere
(
this
.
idCliente
,
form
.
value
.
title
,
form
.
value
.
question
,
result
.
file
,
form
.
value
.
file
).
subscribe
((
res
:
NewRichiestaResponse
)
=>
{
var
filename
;
if
(
this
.
platform
.
is
(
"ios"
))
filename
=
this
.
filename
;
else
filename
=
form
.
value
.
file
;
this
.
parereService
.
newParere
(
this
.
idCliente
,
form
.
value
.
title
,
form
.
value
.
question
,
result
.
file
,
filename
).
subscribe
((
res
:
NewRichiestaResponse
)
=>
{
this
.
utilService
.
closeLoading
();
if
(
res
.
error
){
this
.
utilService
.
presentAlert
(
"Errore"
,
""
,
res
.
error
,
[
"OK"
]);
...
...
@@ -340,6 +345,7 @@ upload(str:any)
{
var
element
:
HTMLInputElement
=
document
.
querySelector
(
'input[type=file]'
);
var
file
:
Blob
=
element
.
files
[
0
];
this
.
filename
=
element
.
value
;
var
reader
=
new
FileReader
();
reader
.
onloadend
=
function
()
{
...
...
src/app/service/parere.service.ts
View file @
ee044a3e
...
...
@@ -153,7 +153,7 @@ export class ParereService {
if
(
nomeFile
.
indexOf
(
'/'
)
!=
-
1
)
nomeFile
=
nomeFile
.
substring
(
nomeFile
.
lastIndexOf
(
'/'
)
+
1
);
else
if
(
nomeFile
.
indexOf
(
'
\
\'
) != -1) nomeFile = nomeFile.substring(nomeFile.lastIndexOf('
\\
')+1);
if(
!this.platform.is("ios") &&
file != null) file = file.substring(file.lastIndexOf('
base64
,
')+7);
if(file != null) file = file.substring(file.lastIndexOf('
base64
,
')+7);
var richiesta = this.creaRichiestaNuova(id, title, question, file, nomeFile);
var param = this.encodeNuovaRichiesta(richiesta);
return this.httpClient.post<NewRichiestaResponse>(this.httpClientDataService.BASE_ADDRESS+'
/
intranet
/
newrichiesta
.
do
', param, this.httpClientDataService.httpOptionsJson)
...
...
src/app/service/util.service.ts
View file @
ee044a3e
...
...
@@ -118,6 +118,7 @@ export class UtilService {
}
async
showLoading
()
{
if
(
this
.
platform
.
is
(
"ios"
))
return
null
;
this
.
loader
=
await
this
.
loadingCtrl
.
create
({
message
:
"Please wait..."
,
});
...
...
@@ -126,6 +127,7 @@ export class UtilService {
}
closeLoading
()
{
if
(
this
.
platform
.
is
(
"ios"
))
return
null
;
if
(
this
.
loaders
.
length
>
0
)
{
this
.
loader
=
this
.
loaders
.
pop
();
...
...
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