mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
27 KiB
JSON
1 line
27 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./new-publication.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./new-publication.page.scss?ngResource\";\nimport { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { Publication } from 'src/app/models/publication';\nimport { Image } from 'src/app/models/image';\nimport { PhotoService } from 'src/app/services/photo.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { Camera, CameraResultType, CameraSource } from '@capacitor/camera';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nlet NewPublicationPage = class NewPublicationPage {\n constructor(photoService, publications, toastService, ThemeService, httpErroHandle) {\n this.photoService = photoService;\n this.publications = publications;\n this.toastService = toastService;\n this.ThemeService = ThemeService;\n this.httpErroHandle = httpErroHandle;\n this.pub = new Publication();\n this.image = new Image();\n this.Defaultimage = '';\n this.validateFrom = false;\n this.publication = new Publication();\n this.closeDesktopComponent = new EventEmitter();\n this.openPublicationDetails = new EventEmitter();\n this.goBackToViewPublications = new EventEmitter();\n this.goBacktoPublicationDetails = new EventEmitter();\n this.capturedImage = '';\n this.photos = [];\n this.publicationTitle = 'Nova Publicação';\n }\n ngOnInit() {\n if (this.publicationType == '3') {\n this.getPublicationDetail();\n }\n this.setTitle();\n //this.clear();\n //this.takePicture();\n }\n\n getPublicationDetail() {\n this.showLoader = true;\n this.publications.GetPublicationById(this.publicationId).subscribe(res => {\n this.publication = {\n DateIndex: res.DateIndex,\n DocumentId: res.DocumentId,\n ProcessId: res.ProcessId,\n Title: res.Title,\n Message: res.Message,\n DatePublication: res.DatePublication,\n FileBase64: \"data:image/jpg;base64,\" + res.FileBase64,\n OriginalFileName: res.OriginalFileName,\n FileExtension: 'jpeg'\n };\n this.pub = this.publication;\n this.showLoader = false;\n });\n }\n takePicture() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const capturedImage = yield Camera.getPhoto({\n quality: 90,\n // allowEditing: true,\n resultType: CameraResultType.Base64,\n source: CameraSource.Camera\n });\n _this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;\n _this.capturedImageTitle = capturedImage.path;\n //\n })();\n }\n\n laodPicture() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n const capturedImage = yield Camera.getPhoto({\n quality: 90,\n resultType: CameraResultType.Base64,\n source: CameraSource.Photos\n });\n _this2.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;\n _this2.capturedImageTitle = capturedImage.path;\n })();\n }\n runValidation() {\n this.validateFrom = true;\n }\n injectValidation() {\n this.Form = new UntypedFormGroup({\n Subject: new UntypedFormControl(this.pub.Title, [Validators.required\n // Validators.minLength(4)\n ]),\n\n Message: new UntypedFormControl(this.pub.Message, [Validators.required, Validators.maxLength(1000)])\n });\n }\n save() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n _this3.injectValidation();\n _this3.runValidation();\n if (_this3.For
|