mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
1 line
16 KiB
JSON
1 line
16 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 } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ModalController } from '@ionic/angular';\nimport { PublicationsService } from 'src/app/services/publications.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { NewPublicationPage } from '../../new-publication/new-publication.page';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';\nimport { RouteService } from 'src/app/services/route.service';\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, activatedRoute, RouteService, ThemeService, p, httpErrorHandle) {\n this.modalController = modalController;\n this.publications = publications;\n this.toastService = toastService;\n this.activatedRoute = activatedRoute;\n this.RouteService = RouteService;\n this.ThemeService = ThemeService;\n this.p = p;\n this.httpErrorHandle = httpErrorHandle;\n this.isModal = false;\n this.activatedRoute.paramMap.subscribe(params => {\n // console.log(params[\"params\"])\n if (params[\"params\"]) {\n this.folderId = params[\"params\"].folderId;\n this.publicationId = params[\"params\"].publicationId;\n this.isModal = params[\"params\"].isModal;\n // \n }\n });\n\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 = 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 }, error => {\n this.httpErrorHandle.httpStatusHandle(error);\n this.goBack();\n });\n }\n close() {\n this.modalController.dismiss();\n }\n goBack() {\n if (!window.location.href.includes('/home/publications/view-publications')) {\n this.close();\n } else {\n this.RouteService.goBack();\n }\n }\n deletePost() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const loader = _this.toastService.loading();\n try {\n yield _this.publications.DeletePublication(_this.folderId, _this.publicationId).toPromise();\n _this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação');\n if (window['app-view-publications-page-doRefresh']) {\n window['app-view-publications-page-doRefresh']();\n }\n _this.goBack();\n } catch (error) {\n _this.httpErrorHandle.httpStatusHandle(error);\n } finally {\n loader.remove();\n }\n })();\n }\n editPost(publicationType) {\n var _this
|