mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add publication
This commit is contained in:
@@ -24,8 +24,7 @@ import { LoadingService } from 'src/app/services/loading.service';
|
||||
})
|
||||
export class NewPublicationPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
pub: Publication;
|
||||
pubTitle:string;
|
||||
pub: Publication = new Publication();
|
||||
image: Image = new Image();
|
||||
|
||||
publicationTitle:string;
|
||||
@@ -35,7 +34,8 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
publication: Publication;
|
||||
|
||||
publication: Publication = new Publication();
|
||||
|
||||
@Input() publicationType: string;
|
||||
@Input() folderId: string;
|
||||
@@ -56,16 +56,9 @@ export class NewPublicationPage implements OnInit {
|
||||
private camera: Camera,
|
||||
) {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
this.pubTitle = 'new';
|
||||
this.pub = new Publication();
|
||||
this.pub.Title = 'title';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.publication);
|
||||
console.log(this.folderId);
|
||||
console.log(this.publicationType);
|
||||
|
||||
this.setTitle();
|
||||
this.clear();
|
||||
this.takePicture();
|
||||
@@ -112,9 +105,7 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
save(){
|
||||
console.log(this.publicationType);
|
||||
|
||||
async save(){
|
||||
if(this.publicationType == '3'){
|
||||
|
||||
if(this.capturedImage != ''){
|
||||
@@ -148,7 +139,7 @@ save(){
|
||||
}
|
||||
console.log('Edit - keep image');
|
||||
console.log(this.publication);
|
||||
/* this.publications.UpdatePublication(this.publication.ProcessId, this.publication); */
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
@@ -158,19 +149,18 @@ save(){
|
||||
DateIndex: new Date(),
|
||||
DocumentId:null,
|
||||
ProcessId:this.folderId,
|
||||
Title: this.pubTitle,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: new Date(),
|
||||
OriginalFileName: this.capturedImageTitle,
|
||||
FileBase64: this.capturedImage,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
console.log(this.pubTitle);
|
||||
console.log(this.pub);
|
||||
|
||||
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