This commit is contained in:
Peter Maquiran
2023-11-01 14:04:31 +01:00
parent f3efe630c8
commit 95281151d1
4 changed files with 70 additions and 50 deletions
@@ -191,6 +191,6 @@
<button *ngIf="taskType == '1'" class="btn-ok" shape="round" (click)="saveTask()">Solicitar</button> <button *ngIf="taskType == '1'" class="btn-ok" shape="round" (click)="saveTask()">Solicitar</button>
<button *ngIf="taskType == '2'" class="btn-ok" shape="round" (click)="saveTask()">Solicitar</button> <button *ngIf="taskType == '2'" class="btn-ok" shape="round" (click)="saveTask()">Solicitar</button>
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button> <button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
</div> </div>
</ion-footer> </ion-footer>
+49 -28
View File
@@ -220,7 +220,7 @@ export class AgendaPage implements OnInit {
} else if (this.eventService.hasSharedCalendar) { } else if (this.eventService.hasSharedCalendar) {
this.profile = "pr"; this.profile = "pr";
} }
} }
this.calendarHeight = ["height-356"]; this.calendarHeight = ["height-356"];
@@ -253,7 +253,7 @@ export class AgendaPage implements OnInit {
}, 1000) }, 1000)
} }
ngOnInit() { ngOnInit() {
@@ -270,18 +270,26 @@ export class AgendaPage implements OnInit {
this.segment = "Combinado"; this.segment = "Combinado";
} }
if (realoadCounter != 0) { if (realoadCounter != 0) {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
if(this.currentMoth.rangeStartDate != null) {
this.loadRangeEvents(this.currentMoth.rangeStartDate, this.currentMoth.rangeEndDate)
} else {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
this.updateEventListBox() this.updateEventListBox()
} }
realoadCounter++; realoadCounter++;
this.weekToShow() this.weekToShow()
} }
}); });
this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); //this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}); });
window.onresize = (event) => { window.onresize = (event) => {
// if not table remove all component // if not table remove all component
if (window.innerWidth <= 1024) { if (window.innerWidth <= 1024) {
@@ -296,7 +304,7 @@ export class AgendaPage implements OnInit {
setTimeout(() => { setTimeout(() => {
try { try {
let weekNum = 0; let weekNum = 0;
function Week(a) { function Week(a) {
for(let b of a.querySelectorAll('td')) { for(let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) { if(!b.className.includes('text-muted')) {
@@ -305,17 +313,17 @@ export class AgendaPage implements OnInit {
} }
} }
} }
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr'); const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
for (let week of weeks as any ){ for (let week of weeks as any ){
Week(week) Week(week)
} }
this.showCalendar = true this.showCalendar = true
this.listBoxService.height = (weekNum * dayBoxHeight) +'px' this.listBoxService.height = (weekNum * dayBoxHeight) +'px'
if(dayBoxHeight == 0) { if(dayBoxHeight == 0) {
this.weekToShow() this.weekToShow()
} }
@@ -424,10 +432,23 @@ export class AgendaPage implements OnInit {
this.eventSelectedDate2 = ev.selectedTime; this.eventSelectedDate2 = ev.selectedTime;
} }
currentMoth = {
rangeStartDate: null,
rangeEndDate: null
}
onRangeChanged(ev: { startTime: Date, endTime: Date }) { onRangeChanged(ev: { startTime: Date, endTime: Date }) {
this.rangeStartDate = ev.startTime; this.rangeStartDate = ev.startTime;
this.rangeEndDate = ev.endTime; this.rangeEndDate = ev.endTime;
if(this.currentMoth.rangeEndDate == null) {
this.currentMoth = {
rangeStartDate: ev.startTime,
rangeEndDate: ev.endTime
}
}
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
@@ -554,7 +575,7 @@ export class AgendaPage implements OnInit {
loadRangeEvents(startTime: Date, endTime: Date) { loadRangeEvents(startTime: Date, endTime: Date) {
this.weekToShow() this.weekToShow()
if(!this.eventService.hasAnyCalendar) { if(!this.eventService.hasAnyCalendar) {
return false return false
} }
@@ -602,7 +623,7 @@ export class AgendaPage implements OnInit {
} catch (error) { } catch (error) {
} }
let load = 0; let load = 0;
@@ -622,7 +643,7 @@ export class AgendaPage implements OnInit {
let eventsList = response; let eventsList = response;
this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.CalendarId) this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.CalendarId)
this.CalendarStore.pushEvent(eventsList, label); this.CalendarStore.pushEvent(eventsList, label);
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.updateEventListBox() this.updateEventListBox()
@@ -635,7 +656,7 @@ export class AgendaPage implements OnInit {
if(load == selectedCalendarIds.length) { if(load == selectedCalendarIds.length) {
this.showLoader = false; this.showLoader = false;
} }
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
this.updateEventListBox() this.updateEventListBox()
@@ -657,19 +678,19 @@ export class AgendaPage implements OnInit {
return result.concat(join) return result.concat(join)
} else { } else {
const calendar = this.eventService.calendarNamesType[this.CalendarName]; const calendar = this.eventService.calendarNamesType[this.CalendarName];
let Oficial = calendar?.['OficialId'] let Oficial = calendar?.['OficialId']
let Pessoal = calendar?.['PessoalId'] let Pessoal = calendar?.['PessoalId']
if(Oficial && Pessoal) { if(Oficial && Pessoal) {
return [ return [
{ {
CalendarId : Oficial, CalendarId : Oficial,
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarName: calendar.CalendarName CalendarName: calendar.CalendarName
}, },
{ {
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarId : Pessoal, CalendarId : Pessoal,
@@ -700,7 +721,7 @@ export class AgendaPage implements OnInit {
} }
} }
} }
@@ -743,7 +764,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox() this.updateEventListBox()
} else { } else {
} }
@@ -751,7 +772,7 @@ export class AgendaPage implements OnInit {
changeMonth = (month) => { changeMonth = (month) => {
const a = this.calendar.currentDate; const a = this.calendar.currentDate;
const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null'; const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null';
@@ -768,7 +789,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox() this.updateEventListBox()
} else { } else {
} }
} }
@@ -796,7 +817,7 @@ export class AgendaPage implements OnInit {
} }
changeProfile() { changeProfile() {
if (this.profile == "mdgpr") { if (this.profile == "mdgpr") {
this.profile = "pr"; this.profile = "pr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
@@ -839,7 +860,7 @@ export class AgendaPage implements OnInit {
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
backdropDismiss: false backdropDismiss: false
}); });
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if (data) { if (data) {
@@ -870,7 +891,7 @@ export class AgendaPage implements OnInit {
openAddEventDismiss(data) { openAddEventDismiss(data) {
try { try {
let postEvent: Event = data; let postEvent: Event = data;
if (postEvent.Subject != null) { if (postEvent.Subject != null) {
// this.eventSource.push({ // this.eventSource.push({
@@ -900,7 +921,7 @@ export class AgendaPage implements OnInit {
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } } let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras); this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
} }
// open component // open component
@@ -923,7 +944,7 @@ export class AgendaPage implements OnInit {
setTimeout(()=>{ setTimeout(()=>{
this.onCurrentChanged(this.eventSelectedDate) this.onCurrentChanged(this.eventSelectedDate)
}, 500) }, 500)
} }
@@ -1083,7 +1104,7 @@ export class AgendaPage implements OnInit {
} }
reloadCalendar() { reloadCalendar() {
// //
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
} }
@@ -40,7 +40,6 @@
<i class="far fa-clock font-15"></i> <i class="far fa-clock font-15"></i>
<ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label> <ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label>
</div> </div>
{{ RouteService.history }}
</div> </div>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
@@ -341,4 +340,4 @@
</div> </div>
</div> </div>
</ion-footer> </ion-footer>
@@ -128,26 +128,26 @@ export class ExpedientTaskModalPage implements OnInit {
this.taskType = this.navParams.get('taskAction'); this.taskType = this.navParams.get('taskAction');
try { // try {
if(this.document) { // if(this.document) {
const doc: any = this.document // const doc: any = this.document
this.documents.push({ // this.documents.push({
ApplicationId: (doc.ApplicationType || doc.ApplicationId), // ApplicationId: (doc.ApplicationType || doc.ApplicationId),
ApplicationType: (doc.ApplicationType || doc.ApplicationId), // ApplicationType: (doc.ApplicationType || doc.ApplicationId),
SourceId: (doc.Id || doc.DocId || doc.SourceId), // SourceId: (doc.Id || doc.DocId || doc.SourceId),
Id: (doc.Id || doc.DocId || doc.SourceId), // Id: (doc.Id || doc.DocId || doc.SourceId),
EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome), // EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome), // Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
Data: (doc.DocDate || doc.Data), // Data: (doc.DocDate || doc.Data),
DocDate: (doc.DocDate || doc.Data), // DocDate: (doc.DocDate || doc.Data),
Assunto: doc.Assunto, // Assunto: doc.Assunto,
} as any) // } as any)
} // }
} catch (error) { // } catch (error) {
console.log(error) // console.log(error)
} // }
console.log('this.document', this.document) // console.log('this.document', this.document)
this.selectedTypes = ['99999850']; this.selectedTypes = ['99999850'];