lot of changes

This commit is contained in:
Eudes Inácio
2023-10-19 16:51:12 +01:00
parent ff52c56cde
commit 57f51903bc
51 changed files with 43514 additions and 1079 deletions
+2 -2
View File
@@ -9,9 +9,9 @@
{{Document.Assunto}}
</div>
<!-- <div class="right cursor-pointer" (click)="openOptions()">
<div class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
</div> -->
</div>
</div>
</ion-toolbar>
+60 -20
View File
@@ -4,6 +4,11 @@ import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-detail
import { AlertController, ModalController } from '@ionic/angular';
import { ProcessesService } from '../services/processes.service';
import { HttpErrorHandle } from '../services/http-error-handle.service';
import { timeout } from 'rxjs-compat/operator/timeout';
import { PopupQuestionPage } from '../modals/popup-question/popup-question.page';
import { ToastService } from '../services/toast.service';
import { TaskService } from 'src/app/services/task.service';
import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-tiny-mce',
templateUrl: './tiny-mce.page.html',
@@ -22,18 +27,33 @@ export class TinyMCEPage implements OnDestroy {
private intervalTime: number = 3000;
loadingTiny = true
InstanceID: any
FolderID: any
DraftIds: any
DraftNames: any
serialnumber: any
private saveTimeout: any;
constructor(
private navParams: NavParams,
private modalController: ModalController,
private processService: ProcessesService,
private erroHandler: HttpErrorHandle
private erroHandler: HttpErrorHandle,
private processes: ProcessesService,
private toastService: ToastService,
public TaskService: TaskService,
private RouteService: RouteService,
) {
this.Document = this.navParams.get('Document')
this.content = this.navParams.get('content')
this.InstanceID = this.navParams.get('InstanceId')
this.FolderID = this.navParams.get('FolderId')
this.DraftIds = this.navParams.get('DraftIds')
this.DraftNames = this.navParams.get('OriginalFileName')
this.serialnumber = this.navParams.get('Serialnumber');
this.waitForTiny();
@@ -57,6 +77,10 @@ export class TinyMCEPage implements OnDestroy {
this.loadingTiny = true
}
ngOnInit() {
console.log('this.InstanceID',this.serialnumber)
}
ngOnDestroy() {
// Certifique-se de limpar o intervalo quando o componente é destruído
window['tinyupdate']()
@@ -68,26 +92,35 @@ export class TinyMCEPage implements OnDestroy {
onEditorContentChange() {
console.log('Autosave successful! Content saved to local storage1.');
this.saveDraft()
if (this.saveTimeout) {
clearTimeout(this.saveTimeout);
}
this.saveTimeout = setTimeout(() => {
this.saveDraft();
clearTimeout(this.saveTimeout);
}, 5000);
}
saveDraft() {
// Lógica que deseja executar em intervalos regulares
console.log('Intervalo de 3 segundos...');
console.log(document)
let objectDraft = {
"status": false,
"description": this.Document.Assunto,
"content": this.content,
"path": this.Document.path,
"ownerId": this.Document.ownerId
}
this.processService.SaveDraftByID(this.Document.DocId, objectDraft).subscribe((res) => {
console.log('Saved tinymce')
}, (error) => {
this.erroHandler.httpStatusHandle(error)
})
// Lógica que deseja executar em intervalos regulares
console.log('Intervalo de 3 segundos...');
console.log(document)
let objectDraft = {
"status": false,
"description": this.Document.Assunto,
"content": this.content,
"path": this.Document.path,
"ownerId": this.Document.ownerId
}
this.processService.SaveDraftByID(this.Document.DocId, objectDraft).subscribe((res) => {
console.log('Saved tinymce')
}, (error) => {
this.erroHandler.httpStatusHandle(error)
})
}
somefunction() {
@@ -100,7 +133,12 @@ export class TinyMCEPage implements OnDestroy {
cssClass: 'model aside-modal search-submodal',
componentProps: {
Document: this.Document,
content: this.content
content: this.content,
InstanceId: this.InstanceID,
FolderId: this.FolderID,
DraftIds: this.DraftIds,
OriginalFileName: this.DraftNames,
Serialnumber: this.serialnumber
}
});
@@ -110,4 +148,6 @@ export class TinyMCEPage implements OnDestroy {
await modal.present();
}
}