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 *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 *ngIf="publicationType!='1'" class="container-div">
|
||||
|
||||
@@ -160,10 +160,8 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
console.log('Create');
|
||||
console.log(this.pub);
|
||||
|
||||
console.log(this.publication);
|
||||
/* this.publications.CreatePublication(this.folderId, this.publication); */
|
||||
this.publications.CreatePublication(this.folderId, this.publication);
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
[folderId]="folderId"
|
||||
[publicationType]="publicationType"
|
||||
[publication]="publication"
|
||||
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails($event)"
|
||||
(goBackToViewPublications)="goBackToViewPublications($event)"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="content-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>
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ import { LoadingService } from 'src/app/services/loading.service';
|
||||
})
|
||||
export class NewPublicationPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
pub: Publication = new Publication();
|
||||
pub: Publication;
|
||||
pubTitle:string;
|
||||
image: Image = new Image();
|
||||
|
||||
publicationTitle:string;
|
||||
@@ -34,8 +35,8 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
publication: Publication;
|
||||
|
||||
@Input() publication: Publication;
|
||||
@Input() publicationType: string;
|
||||
@Input() folderId: string;
|
||||
@Output() closeDesktopComponent = new EventEmitter<any>();
|
||||
@@ -55,9 +56,16 @@ 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();
|
||||
@@ -104,7 +112,9 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async save(){
|
||||
save(){
|
||||
console.log(this.publicationType);
|
||||
|
||||
if(this.publicationType == '3'){
|
||||
|
||||
if(this.capturedImage != ''){
|
||||
@@ -138,7 +148,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -148,18 +158,19 @@ export class NewPublicationPage implements OnInit {
|
||||
DateIndex: new Date(),
|
||||
DocumentId:null,
|
||||
ProcessId:this.folderId,
|
||||
Title: this.pub.Title,
|
||||
Title: this.pubTitle,
|
||||
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