mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
show two calendar at time
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
<!-- Debug line to print data -->
|
||||
<mat-form-field class="select-calendar" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda" *ngIf="calendarData?.length && showCalendarField">
|
||||
<div *ngIf="selectedUserCalendar != SessionStore.user.UserId && !hasChangeCalendar " style="margin-bottom: -20px;">PR </div>
|
||||
<div *ngIf="hasPrCalendar(calendarData) && !hasChangeCalendar " style="margin-bottom: -20px;">PR </div>
|
||||
<div *ngIf="selectedUserCalendar == SessionStore.user.UserId && !hasChangeCalendar " style="margin-bottom: -20px;">
|
||||
Minha agenda
|
||||
</div>
|
||||
@@ -76,9 +76,9 @@
|
||||
|
||||
</mat-option>
|
||||
|
||||
<!-- <mat-option value="PR+MDGPR" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && environment.presidential">
|
||||
<mat-option value="PR+MDGPR" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && environment.presidential">
|
||||
PR+MDGPR
|
||||
</mat-option> -->
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -282,6 +282,18 @@ export class AgendaPage implements OnInit {
|
||||
this.weekToShow()
|
||||
}
|
||||
|
||||
|
||||
hasPrCalendar(data: TableSharedCalendar[]) {
|
||||
for(const e of data) {
|
||||
if(e.roleId == this.RoleIdService.PRES) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
segmentChanged() {
|
||||
this.showCalendarField = true
|
||||
}
|
||||
@@ -299,7 +311,6 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.setCalendarByDefault(false)
|
||||
@@ -680,6 +691,9 @@ export class AgendaPage implements OnInit {
|
||||
this.myCal.loadEvents();
|
||||
} catch (error) {}
|
||||
|
||||
|
||||
console.log('selectedCalendarIds', selectedCalendarIds)
|
||||
|
||||
let load = 0;
|
||||
for (const selectedCalendar of selectedCalendarIds) {
|
||||
|
||||
@@ -748,11 +762,9 @@ export class AgendaPage implements OnInit {
|
||||
const data = await this.AgendaDataRepositoryService.geCalendars()
|
||||
|
||||
const prObject = data.find(e => e?.roleId == 100000014)
|
||||
const myCalendar = data.find(e => e?.wxUserId == SessionStore.user.UserId)
|
||||
|
||||
return[{
|
||||
...this.eventService.calendarNamesType['Meu calendario'],
|
||||
wxUserId: this.SessionStore.user.UserId
|
||||
}, {
|
||||
return[{...myCalendar}, {
|
||||
...prObject
|
||||
}]
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ export class AgendaDataRepositoryService {
|
||||
await this.createOwnCalendar()
|
||||
return await this.agendaLocalDataSourceService.bulkCreate(result.value.data)
|
||||
} else {
|
||||
await this.createOwnCalendar()
|
||||
return result
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -51,28 +51,16 @@ export class CalendarService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
removeRange(rangeStartDate, rangeEndDate, profile) {
|
||||
this._eventSource = this._eventSource.filter((e)=> {
|
||||
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
|
||||
new Date(rangeEndDate).getTime() >= new Date(e.endTime).getTime() && e.profile == profile) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
removeRangeForCalendar(rangeStartDate, rangeEndDate, profile, calendarId) {
|
||||
|
||||
this._eventSource = this._eventSource.filter((e)=> {
|
||||
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
|
||||
new Date(rangeEndDate).getTime() >= new Date(e.endTime).getTime() && e.CalendarId != calendarId) {
|
||||
new Date(rangeEndDate).getTime() >= new Date(e.endTime).getTime() && e.CalendarId == calendarId) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
pushEvent(eventsList: EventList, profile: 'pr' | 'md', CalendarId: string) {
|
||||
|
||||
Reference in New Issue
Block a user