mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user