mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
1 line
15 KiB
JSON
1 line
15 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 \"./publication-detail.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./publication-detail.page.scss?ngResource\";\nimport { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { ModalController } from '@ionic/angular';\nimport { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\nimport { PermissionService } from 'src/app/services/permission.service';\nimport { HttpErrorHandle } from 'src/app/services/http-error-handle.service';\nlet PublicationDetailPage = class PublicationDetailPage {\n constructor(modalController, publications, toastService, ThemeService, p, httpErrorHandle) {\n this.modalController = modalController;\n this.publications = publications;\n this.toastService = toastService;\n this.ThemeService = ThemeService;\n this.p = p;\n this.httpErrorHandle = httpErrorHandle;\n this.addNewPublication = new EventEmitter();\n this.closeDesktopComponent = new EventEmitter();\n this.goBackToViewPublications = new EventEmitter();\n /* this.folderId = this.navParams.get('folderIdId'); */\n this.publication = {\n DateIndex: null,\n DocumentId: null,\n ProcessId: '',\n Title: '',\n Message: '',\n /* image: null, */\n DatePublication: null,\n FileBase64: '',\n OriginalFileName: '',\n FileExtension: ''\n };\n }\n ngOnInit() {\n this.getPublicationDetail();\n }\n doRefresh(event) {\n this.getPublicationDetail();\n setTimeout(() => {\n try {\n event?.target?.complete();\n } catch (error) {}\n }, 2000);\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.showLoader = false;\n });\n }\n close() {\n this.modalController.dismiss();\n }\n deletePost() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const laoder = _this.toastService.loading();\n try {\n yield _this.publications.DeletePublication(_this.folderId, _this.publicationId).toPromise();\n _this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação');\n _this.goBackToViewPublications.emit();\n } catch (error) {\n _this.httpErrorHandle.httpStatusHandle(error);\n } finally {\n laoder.remove();\n }\n })();\n }\n editPost(publicationType) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n if (window.innerWidth < 701) {\n const modal = yield _this2.modalController.create({\n component: NewPublicationPage,\n componentProps: {\n publicationType: publicationType,\n publication: _this2.publication\n },\n cssClass: 'new-publication',\n backdropDismiss: false\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n setTimeout(() => {\n _this2.getPublicationDetail();\n }, 5000);\n });\n } else {\n _this2.addNewPublication.emit({\n publicationType: publicationType,\n folderId: _this2.folderI
|