mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add document from gestao digital
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
||||||
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
||||||
<button (click)="anexarFoto()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
<button (click)="anexarFoto()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||||
<button hidden (click)="getDoc()" class="btn-cancel" shape="round" >Anexar Documento</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
||||||
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
this.modalController.dismiss('picture');
|
this.modalController.dismiss('picture');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addDocGestaoDocumental(){
|
||||||
|
this.modalController.dismiss('documentoGestaoDocumental');
|
||||||
|
}
|
||||||
|
|
||||||
laodPicture() {
|
laodPicture() {
|
||||||
const input = this.fileLoaderService.createInput({
|
const input = this.fileLoaderService.createInput({
|
||||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||||
@@ -171,7 +175,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.documents.push(data.selected);
|
this.documents.push(data.selected);
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -382,7 +382,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then( async(res)=>{
|
modal.onDidDismiss().then( async(res)=>{
|
||||||
alert('AQUI')
|
|
||||||
let body = res['data'];
|
let body = res['data'];
|
||||||
if(res['data']) {
|
if(res['data']) {
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { FileLoaderService } from '../file/file-loader.service';
|
import { FileLoaderService } from '../file/file-loader.service';
|
||||||
import { FileToBase64Service } from '../file/file-to-base64.service';
|
import { FileToBase64Service } from '../file/file-to-base64.service';
|
||||||
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
//Cordova
|
//Cordova
|
||||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ export class FileService {
|
|||||||
private camera: Camera,
|
private camera: Camera,
|
||||||
private fileLoaderService: FileLoaderService,
|
private fileLoaderService: FileLoaderService,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private iab: InAppBrowser,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
takePicture() {
|
takePicture() {
|
||||||
@@ -68,4 +70,9 @@ export class FileService {
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewDocumentByUrl(url) {
|
||||||
|
const browser = this.iab.create(url,"_blank");
|
||||||
|
browser.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,22 @@
|
|||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="messages">
|
||||||
<ion-label>{{msg.msg}}</ion-label>
|
<ion-label>{{msg.msg}}</ion-label>
|
||||||
<div *ngIf="msg.attachments">
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
<div *ngFor="let file of msg.attachments">
|
<div *ngFor="let file of msg.attachments">
|
||||||
<img src="{{file.image_url}}" alt="image" >
|
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||||
|
<div *ngIf="file.thumb_url">
|
||||||
|
<div class="file d-flex">
|
||||||
|
<ion-thumbnail slot="start">
|
||||||
|
<img src="{{file.thumb_url}}" alt="image">
|
||||||
|
</ion-thumbnail>
|
||||||
|
<ion-label>
|
||||||
|
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
|
||||||
|
<p *ngIf="file.text">{{file.text}}</p>
|
||||||
|
</ion-label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
|
|||||||
@@ -156,6 +156,20 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.messages{
|
||||||
|
.message-attachments{
|
||||||
|
.file{
|
||||||
|
align-items: center;
|
||||||
|
.file-title{
|
||||||
|
color: #000;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.file-title:hover{
|
||||||
|
color: #0782c9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-footer{
|
ion-footer{
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/ch
|
|||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
import { TimeService } from 'src/app/services/functions/time.service';
|
||||||
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
|
import { SearchList } from 'src/app/models/search-document';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -26,6 +30,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
message:any;
|
message:any;
|
||||||
messages:any;
|
messages:any;
|
||||||
allUsers:any[] = [];
|
allUsers:any[] = [];
|
||||||
|
documents:SearchList[] = [];
|
||||||
|
|
||||||
|
|
||||||
room:any = new Array();
|
room:any = new Array();
|
||||||
@@ -64,6 +69,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
private fileLoaderService: FileLoaderService,
|
private fileLoaderService: FileLoaderService,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private processesService: ProcessesService,
|
||||||
|
private fileService: FileService,
|
||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
@@ -435,6 +442,59 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async addDocGestaoDocumental(){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
select: true,
|
||||||
|
showSearchInput: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then(async res=>{
|
||||||
|
if(res){
|
||||||
|
const data = res.data;
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
console.log(res.data.selected);
|
||||||
|
console.log(res.data.selected.Id);
|
||||||
|
console.log(res.data.selected.ApplicationType);
|
||||||
|
|
||||||
|
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
|
||||||
|
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||||
|
console.log(url_no_options);
|
||||||
|
console.log('Oie');
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": this.roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": res.data.selected.Assunto,
|
||||||
|
"text": res.data.selected.DocTypeDesc,
|
||||||
|
"title_link": url_no_options,
|
||||||
|
"title_link_download": true,
|
||||||
|
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||||
|
"message_link": url_no_options,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
viewDocument(url:string){
|
||||||
|
this.fileService.viewDocumentByUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
async _openChatOptions() {
|
async _openChatOptions() {
|
||||||
|
|
||||||
const enterAnimation = (baseEl: any) => {
|
const enterAnimation = (baseEl: any) => {
|
||||||
@@ -485,6 +545,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
else if(res['data'] == 'picture'){
|
else if(res['data'] == 'picture'){
|
||||||
this.loadPicture();
|
this.loadPicture();
|
||||||
}
|
}
|
||||||
|
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||||
|
this.addDocGestaoDocumental();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user