mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add attach to publication
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
<name>gabinete digital</name>
|
||||
<description>An awesome Ionic/Cordova app.</description>
|
||||
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
||||
<content original-src="index.html" src="http://localhost:8100" />
|
||||
<content src="index.html" />
|
||||
<access origin="*" />
|
||||
<allow-navigation href="http://*/*" />
|
||||
<allow-navigation href="https://*/*" />
|
||||
|
||||
@@ -81,6 +81,19 @@ export class HomePage implements OnInit {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
});
|
||||
|
||||
|
||||
// if (typeof Worker !== 'undefined') {
|
||||
// // Create a new
|
||||
// const worker = new Worker(new URL('./nice.worker.ts', import.meta.url));
|
||||
// worker.onmessage = ({ data }) => {
|
||||
// console.log(`page got message: ${data}`);
|
||||
// };
|
||||
// worker.postMessage('hello');
|
||||
// } else {
|
||||
// // Web workers are not supported in this environment.
|
||||
// // You should add a fallback so that your program still executes correctly.
|
||||
// }
|
||||
|
||||
{
|
||||
//this.folderId = this.navParams.get('folderId');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// / <reference lib="webworker" />
|
||||
|
||||
addEventListener('message', ({ data }) => {
|
||||
const response = `worker response to ${data}`;
|
||||
//postMessage(response);
|
||||
});
|
||||
@@ -1,9 +1,12 @@
|
||||
<ion-content fullscreen>
|
||||
<ion-item class="close" lines="none" text-center>
|
||||
<ion-content fullscreen class="d-flex flex-column">
|
||||
<div class="main-content">
|
||||
|
||||
<div class="d-flex justify-end">
|
||||
<ion-button (click)="close()" fill="clear" >
|
||||
<ion-icon name="close" slot="start">Fechar</ion-icon>
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div>
|
||||
<ion-slides>
|
||||
<ion-slide>
|
||||
<div class="swipper-zoom-container">
|
||||
@@ -11,4 +14,8 @@
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
|
||||
|
||||
<ion-content>
|
||||
<div class="content-container">
|
||||
<div class="content-container d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
<div class="div-title">
|
||||
<ion-label class="title">{{publicationTitle}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-y-auto">
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||
</div>
|
||||
@@ -23,13 +25,11 @@
|
||||
</div>
|
||||
<div *ngIf="capturedImage != '' " class="ion-item-container-no-border">
|
||||
<ion-label class="attached-title">Fotografia Anexada </ion-label>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="'data:image/png;base64,'+capturedImage"></ion-img>
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage"></ion-img>
|
||||
</ion-thumbnail>
|
||||
<!-- <ion-thumbnail *ngIf="!publication" slot="start">
|
||||
<ion-img [(ngModel)]="publication.imageUrl" [src]="guestPicture"></ion-img>
|
||||
</ion-thumbnail> -->
|
||||
<ion-label>
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
<p hidden>size</p>
|
||||
@@ -37,20 +37,18 @@
|
||||
<ion-icon (click)="clear()" name="close"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<!-- <ion-thumbnail>
|
||||
<ion-img src="{{imgUrl}}"></ion-img>
|
||||
</ion-thumbnail> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="picture d-flex pb-5 hide-desktop" *ngIf="publication.FileBase64 && capturedImage ==''">
|
||||
<div class="post-img">
|
||||
<div class="picture d-flex pb-5 hide-desktop" *ngIf="publication && capturedImage ==''">
|
||||
<div class="post-img" *ngIf="publication.FileBase64">
|
||||
<img src="{{publication.FileBase64}}" alt="image" >
|
||||
</div>
|
||||
<div class="d-flex flex-column pl-10">
|
||||
<div class="d-flex flex-column pl-10" *ngIf="publication.FileBase64">
|
||||
<div class="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
|
||||
<div class="size">75 Kb</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex align-center justify-end">
|
||||
<div class="flex-grow-1 d-flex align-center justify-end" *ngIf="publication.FileBase64">
|
||||
<div style="color: red;">X</div>
|
||||
</div>
|
||||
|
||||
@@ -67,7 +65,7 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<!-- <div class="ion-item-container-no-border">
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="laodPicture()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
@@ -76,7 +74,9 @@
|
||||
<ion-label>Anexar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -58,7 +58,6 @@ ion-toolbar{
|
||||
}
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.div-title{
|
||||
|
||||
@@ -95,9 +95,10 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.camera.getPicture(options).then((imageData) => {
|
||||
// imageData is either a base64 encoded string or a file URI
|
||||
// If it's base64 (DATA_URL):
|
||||
let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
this.capturedImage = imageData;
|
||||
// If it's base64 (DATA_URL): m
|
||||
//let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
|
||||
this.capturedImage = 'data:image/png;base64,'+imageData;
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
}, (err) => {
|
||||
/* console.log(err); */
|
||||
@@ -116,6 +117,8 @@ export class NewPublicationPage implements OnInit {
|
||||
const imageData = await this.fileToBase64Service.convert(file)
|
||||
this.capturedImage = imageData;
|
||||
this.capturedImageTitle = file.name
|
||||
|
||||
console.log(this.capturedImage)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import { AnimationController, ModalController, NavParams } from '@ionic/angular'
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
|
||||
@@ -27,6 +25,9 @@ export class PublicationDetailPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
|
||||
alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
||||
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
this.publication = {
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
<ion-header class="ion-no-border d-md-none">
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</ion-refresher>
|
||||
|
||||
<div class="content-container">
|
||||
<div *ngIf="publication.Title != ''" class="d-flex flex-column">
|
||||
<div *ngIf="publication.Title != ''" class="d-flex flex-column height-100">
|
||||
<div class="title-content px-20 width-100 ">
|
||||
<div class="back-icon cursor-pointer" (click)="goBack()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
@@ -33,6 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="publication.Title == ''" class="d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
<div class="back-icon cursor-pointer">
|
||||
|
||||
-1
@@ -59,7 +59,6 @@
|
||||
}
|
||||
.title-content {
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.back-icon{
|
||||
width: auto;
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params);
|
||||
if(params["params"]) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container background-white">
|
||||
<div class="main-container background-white height-100 overflow-y-auto">
|
||||
<ion-list>
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
|
||||
@@ -16,12 +16,11 @@ export class FileLoaderService {
|
||||
constructor() { }
|
||||
|
||||
|
||||
createInput(param:createInput): HTMLInputElement {
|
||||
createInput({accept, type = 'file'}:createInput): HTMLInputElement {
|
||||
|
||||
let input = document.createElement('input');
|
||||
input.type = param.type || 'file';
|
||||
input.accept = param.accept.join(', ')
|
||||
|
||||
input.type = type || 'file';
|
||||
input.accept = accept.join(', ')
|
||||
|
||||
// input.onchange = () => {
|
||||
// // you can use this method to get file and perform respective operations
|
||||
|
||||
@@ -147,25 +147,26 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
async viewPublicationDetail(publicationId:string) {
|
||||
|
||||
console.log(publicationId);
|
||||
|
||||
if( window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationDetailPage,
|
||||
componentProps:{
|
||||
publicationId: publicationId,
|
||||
},
|
||||
cssClass: 'publication-detail modal modal-desktop',
|
||||
//backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
this.doRefresh(event);
|
||||
});
|
||||
} else {
|
||||
// open publication details
|
||||
// if( window.innerWidth <= 1024) {
|
||||
// const modal = await this.modalController.create({
|
||||
// component: PublicationDetailPage,
|
||||
// componentProps:{
|
||||
// publicationId: publicationId,
|
||||
// },
|
||||
// cssClass: 'publication-detail modal modal-desktop',
|
||||
// //backdropDismiss: false
|
||||
// });
|
||||
// await modal.present();
|
||||
// modal.onDidDismiss().then(()=>{
|
||||
// this.doRefresh(event);
|
||||
// });
|
||||
// } else {
|
||||
// // open publication details
|
||||
// this.openPublicationDetails.emit(publicationId);
|
||||
// }
|
||||
|
||||
this.openPublicationDetails.emit(publicationId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user