This commit is contained in:
Eudes Inácio
2021-11-10 17:46:44 +01:00
45 changed files with 341 additions and 247 deletions
+19 -17
View File
@@ -8,8 +8,8 @@ import { DateService } from '../date.service';
export class ListBoxService {
constructor(
private dateService: DateService
){}
private dateService: DateService
){}
filterProfile(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all') {
@@ -26,32 +26,34 @@ export class ListBoxService {
})
}
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
return eventSource.filter( data => data.calendarName == segment)
}
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
return eventSource.filter( data => data.calendarName == segment)
}
daysBetween(){ }
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
// filter range
if(selectedDate) {
eventSource = eventSource.filter(data =>
data.startTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt') &&
data.endTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt')
)
}
// console.log('eventSource', eventSource ,'rangeStartDate', new Date(rangeStartDate).toLocaleDateString('pt') , 'randEndDate', new Date(randEndDate).toLocaleDateString('pt'))
if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment)
}
// // filter range
// if(selectedDate) {
// eventSource = eventSource.filter(data =>
// data.startTime.toLocaleDateString('pt') >= new Date(rangeStartDate).toLocaleDateString('pt') &&
// data.startTime.toLocaleDateString('pt') <= new Date(rangeStartDate).toLocaleDateString('pt')
// )
// }
if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment)
}
if(profile != 'all') {
eventSource = this.filterProfile(eventSource, profile)
}
let newStracture:CustomCalendarEvent[];
let newStracture:CustomCalendarEvent[];
if(profile == 'md') {
newStracture = this.encapsulation(eventSource, 'mdgpr');
+67
View File
@@ -24,6 +24,73 @@ export class ToastService {
toast.present();
}
async _successMessage(message?: any, callback?) {
let notification = document.createElement('div')
notification.className = 'notification'
notification.innerHTML = `
<div class="main-content width-100 pa-20">
<p class="message d-flex align-center success">
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
<p class="text">{{ message }}</p>
</p>
</div>
`
document.body.append(notification)
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
setTimeout(()=>{
if (callback) {
callback()
}
notification.style.right = "-100%"
setTimeout(()=>{
notification.remove()
},1000)
},6000)
}
async _badRequest(message?: string, callback?) {
let notification = document.createElement('div')
notification.className = 'notification'
notification.innerHTML = `
<div class="main-content width-100 pa-20">
<p class="message d-flex align-center faild">
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
<p class="text">{{ message }}</p>
</p>
</div>
`
notification.style.animationName = 'notification-top'
document.body.append(notification)
notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
setTimeout(()=>{
if (callback) {
callback()
}
notification.style.right = "-100%"
setTimeout(()=>{
notification.remove()
},1000)
},6000)
}
async successMessage(message?: any, callback?) {
let notification = document.createElement('div')