mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -152,6 +152,10 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:'new-publication',
|
||||||
|
loadChildren: ()=> import('../shared/publication/new-publication/new-publication.module').then(m => m.NewPublicationPageModule)
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
||||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
<ion-input [(ngModel)]="pubTitle" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="publicationType!='1'" class="container-div">
|
<div *ngIf="publicationType!='1'" class="container-div">
|
||||||
|
|||||||
@@ -160,10 +160,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('Create');
|
console.log('Create');
|
||||||
console.log(this.pub);
|
|
||||||
|
|
||||||
console.log(this.publication);
|
console.log(this.publication);
|
||||||
/* this.publications.CreatePublication(this.folderId, this.publication); */
|
this.publications.CreatePublication(this.folderId, this.publication);
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||||
[folderId]="folderId"
|
[folderId]="folderId"
|
||||||
[publicationType]="publicationType"
|
[publicationType]="publicationType"
|
||||||
[publication]="publication"
|
|
||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails($event)"
|
(goBacktoPublicationDetails)="goBacktoPublicationDetails($event)"
|
||||||
(goBackToViewPublications)="goBackToViewPublications($event)"
|
(goBackToViewPublications)="goBackToViewPublications($event)"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="content-container">
|
<div class="content-container">
|
||||||
|
|
||||||
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
<div *ngIf="publicationType!='1'" class="ion-item-container">
|
||||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
<ion-input [(ngModel)]="pubTitle" name="title" placeholder="Título" ></ion-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import { LoadingService } from 'src/app/services/loading.service';
|
|||||||
})
|
})
|
||||||
export class NewPublicationPage implements OnInit {
|
export class NewPublicationPage implements OnInit {
|
||||||
showLoader: boolean;
|
showLoader: boolean;
|
||||||
pub: Publication = new Publication();
|
pub: Publication;
|
||||||
|
pubTitle:string;
|
||||||
image: Image = new Image();
|
image: Image = new Image();
|
||||||
|
|
||||||
publicationTitle:string;
|
publicationTitle:string;
|
||||||
@@ -34,8 +35,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
photo: SafeResourceUrl;
|
photo: SafeResourceUrl;
|
||||||
|
publication: Publication;
|
||||||
|
|
||||||
@Input() publication: Publication;
|
|
||||||
@Input() publicationType: string;
|
@Input() publicationType: string;
|
||||||
@Input() folderId: string;
|
@Input() folderId: string;
|
||||||
@Output() closeDesktopComponent = new EventEmitter<any>();
|
@Output() closeDesktopComponent = new EventEmitter<any>();
|
||||||
@@ -55,9 +56,16 @@ export class NewPublicationPage implements OnInit {
|
|||||||
private camera: Camera,
|
private camera: Camera,
|
||||||
) {
|
) {
|
||||||
this.publicationTitle = 'Nova Publicação';
|
this.publicationTitle = 'Nova Publicação';
|
||||||
|
this.pubTitle = 'new';
|
||||||
|
this.pub = new Publication();
|
||||||
|
this.pub.Title = 'title';
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.publication);
|
||||||
|
console.log(this.folderId);
|
||||||
|
console.log(this.publicationType);
|
||||||
|
|
||||||
this.setTitle();
|
this.setTitle();
|
||||||
this.clear();
|
this.clear();
|
||||||
this.takePicture();
|
this.takePicture();
|
||||||
@@ -104,7 +112,9 @@ export class NewPublicationPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(){
|
save(){
|
||||||
|
console.log(this.publicationType);
|
||||||
|
|
||||||
if(this.publicationType == '3'){
|
if(this.publicationType == '3'){
|
||||||
|
|
||||||
if(this.capturedImage != ''){
|
if(this.capturedImage != ''){
|
||||||
@@ -138,7 +148,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
console.log('Edit - keep image');
|
console.log('Edit - keep image');
|
||||||
console.log(this.publication);
|
console.log(this.publication);
|
||||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
|
/* this.publications.UpdatePublication(this.publication.ProcessId, this.publication); */
|
||||||
this.goBack();
|
this.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,18 +158,19 @@ export class NewPublicationPage implements OnInit {
|
|||||||
DateIndex: new Date(),
|
DateIndex: new Date(),
|
||||||
DocumentId:null,
|
DocumentId:null,
|
||||||
ProcessId:this.folderId,
|
ProcessId:this.folderId,
|
||||||
Title: this.pub.Title,
|
Title: this.pubTitle,
|
||||||
Message: this.pub.Message,
|
Message: this.pub.Message,
|
||||||
DatePublication: new Date(),
|
DatePublication: new Date(),
|
||||||
OriginalFileName: this.capturedImageTitle,
|
OriginalFileName: this.capturedImageTitle,
|
||||||
FileBase64: this.capturedImage,
|
FileBase64: this.capturedImage,
|
||||||
FileExtension: 'jpeg',
|
FileExtension: 'jpeg',
|
||||||
}
|
}
|
||||||
|
console.log(this.pubTitle);
|
||||||
|
console.log(this.pub);
|
||||||
console.log(this.publication);
|
console.log(this.publication);
|
||||||
this.publications.CreatePublication(this.folderId, this.publication);
|
//this.publications.CreatePublication(this.folderId, this.publication);
|
||||||
|
|
||||||
this.closeDesktopComponent.emit();
|
//this.closeDesktopComponent.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user