feat: colorar numeros de semanas segun el registro de horas
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1c1e4cc176
commit
c8c48ea175
|
@ -207,14 +207,23 @@ export default class Calendar extends FormInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
repeatLast() {
|
repeatLast() {
|
||||||
if (!this.formatDay) return;
|
if (this.formatDay) {
|
||||||
|
const days = this.element.querySelectorAll('.days > .day');
|
||||||
|
for (let i = 0; i < days.length; i++) {
|
||||||
|
this.formatDay({
|
||||||
|
$day: this.days[i],
|
||||||
|
$element: days[i]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let days = this.element.querySelectorAll('.days > .day');
|
if (this.formatWeek) {
|
||||||
for (let i = 0; i < days.length; i++) {
|
const weeks = this.element.querySelectorAll('.weeks > .day');
|
||||||
this.formatDay({
|
for (const week of weeks) {
|
||||||
$day: this.days[i],
|
this.formatWeek({
|
||||||
$element: days[i]
|
$element: week
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,6 +237,7 @@ ngModule.vnComponent('vnCalendar', {
|
||||||
hasEvents: '&?',
|
hasEvents: '&?',
|
||||||
getClass: '&?',
|
getClass: '&?',
|
||||||
formatDay: '&?',
|
formatDay: '&?',
|
||||||
|
formatWeek: '&?',
|
||||||
displayControls: '<?',
|
displayControls: '<?',
|
||||||
hideYear: '<?',
|
hideYear: '<?',
|
||||||
hideContiguous: '<?',
|
hideContiguous: '<?',
|
||||||
|
|
|
@ -106,6 +106,7 @@
|
||||||
vn-id="calendar"
|
vn-id="calendar"
|
||||||
class="vn-pt-md"
|
class="vn-pt-md"
|
||||||
ng-model="$ctrl.date"
|
ng-model="$ctrl.date"
|
||||||
|
format-week="$ctrl.formatWeek($element)"
|
||||||
has-events="$ctrl.hasEvents($day)">
|
has-events="$ctrl.hasEvents($day)">
|
||||||
</vn-calendar>
|
</vn-calendar>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -345,6 +345,39 @@ class Controller extends Section {
|
||||||
this.vnApp.showError(this.$t(e.message));
|
this.vnApp.showError(this.$t(e.message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formatWeek($element) {
|
||||||
|
let weekNumber = $element.firstElementChild;
|
||||||
|
let weekNumberValue = $element.firstElementChild.innerHTML;
|
||||||
|
console.log(weekNumberValue);
|
||||||
|
const filter = {
|
||||||
|
where: {
|
||||||
|
workerFk: 9,
|
||||||
|
// year: this.date.getFullYear(),
|
||||||
|
// week: weekNumberValue - 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// const filter = {
|
||||||
|
// where: {
|
||||||
|
// and: [
|
||||||
|
// {workerFk: parseInt(this.$params.id)},
|
||||||
|
// {year: this.date.getFullYear()},
|
||||||
|
// {week: weekNumberValue - 1}
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
console.log(filter);
|
||||||
|
this.$http.get('WorkerTimeControlMails', {filter})
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.data.state);
|
||||||
|
const state = res.data.state;
|
||||||
|
if (state == 'CONFIRMED') weekNumber.style.color = '#97B92F';
|
||||||
|
else if (state == 'REVISE') weekNumber.style.color = '#FF4444';
|
||||||
|
else weekNumber.style.color = '#5151c0';
|
||||||
|
// weekNumber.title = event.name;
|
||||||
|
// weekNumber.style.backgroundColor = event.color;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.$inject = ['$element', '$scope', 'vnWeekDays'];
|
Controller.$inject = ['$element', '$scope', 'vnWeekDays'];
|
||||||
|
|
Loading…
Reference in New Issue