mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[timeline] overlapovanie rovnakych taskov, spravne zarovnavanie
This commit is contained in:
1 parent
278bdeabc7
commit
e2fe3cd894
4 files changed
+30
-14
No files matched your search
@@ -49,6 +49,7 @@ transition-group.vuecal__cell(
|
||||
:all-day="allDay"
|
||||
:cell-events="splitsCount ? split.events : events"
|
||||
:cellOverlaps="((splitsCount ? split.overlaps[event._eid] : cellOverlaps[event._eid]) || [])"
|
||||
:allOverlaps="((splitsCount ? split.overlaps : cellOverlaps) || [])"
|
||||
:event-position="((splitsCount ? split.overlaps[event._eid] : cellOverlaps[event._eid]) || []).position"
|
||||
:overlaps-streak="splitsCount ? split.overlapsStreak : cellOverlapsStreak")
|
||||
template(#event="{ event, view }")
|
||||
|
||||
@@ -41,6 +41,7 @@ export default {
|
||||
event: { type: Object, default: () => ({}) },
|
||||
cellEvents: { type: Array, default: () => [] },
|
||||
cellOverlaps: { type: Object, default: () => ({}) },
|
||||
allOverlaps: { type: Object, default: () => ({}) },
|
||||
// If multiple simultaneous events, the events are placed from left to right from the
|
||||
// one starting first to the last. (See utils/event.js > checkCellOverlappingEvents)
|
||||
eventPosition: { type: Number, default: 0 },
|
||||
@@ -225,14 +226,6 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
overlaps() {
|
||||
return this.cellOverlaps.overlaps
|
||||
},
|
||||
|
||||
sameOverlaps() {
|
||||
return this.cellOverlaps.sameOverlaps
|
||||
},
|
||||
|
||||
eventDimensions() {
|
||||
const { startTimeMinutes, endTimeMinutes } = this.segment || this.event;
|
||||
|
||||
@@ -270,20 +263,29 @@ export default {
|
||||
// let left = (100 - ((this.overlaps.length + 1) * 10 )) * this.eventPosition
|
||||
|
||||
let width = 100 - this.eventPosition * 10;
|
||||
let left = (10 * this.eventPosition) / 2;
|
||||
let left = 5 * this.eventPosition;
|
||||
let zIdnex = (this.eventPosition + 1) * 10;
|
||||
let background = this.event.master_task_color;
|
||||
|
||||
if (Array.isArray(this.cellOverlaps.sameOverlaps) && this.cellOverlaps.sameOverlaps.length) {
|
||||
width = 46
|
||||
left = 50 * this.eventPosition
|
||||
const sameOverlapsLength = this.cellOverlaps.sameOverlaps.length + 1
|
||||
const parentNotSameOverlaps = this.cellOverlaps.overlaps.filter(x => {
|
||||
if (!this.cellOverlaps.sameOverlaps.includes(x) && this.allOverlaps[this.event._eid].position > this.allOverlaps[x].position)
|
||||
return x
|
||||
})
|
||||
width = ((100 / sameOverlapsLength) - 5)
|
||||
left = (100 / sameOverlapsLength * (this.eventPosition - parentNotSameOverlaps.length)) + (5 * (this.eventPosition - parentNotSameOverlaps.length) / sameOverlapsLength)
|
||||
if (parentNotSameOverlaps.length) {
|
||||
width = width - (parentNotSameOverlaps.length * (10 / sameOverlapsLength))
|
||||
left = left + (5 * parentNotSameOverlaps.length - ((10 * parentNotSameOverlaps.length / sameOverlapsLength) * (this.eventPosition - parentNotSameOverlaps.length)))
|
||||
}
|
||||
zIdnex = 10
|
||||
}
|
||||
|
||||
if (this.vuecal.minEventWidth && width < this.vuecal.minEventWidth) {
|
||||
width = this.vuecal.minEventWidth;
|
||||
left =
|
||||
((100 - this.vuecal.minEventWidth) / this.overlaps.length) *
|
||||
((100 - this.vuecal.minEventWidth) / this.cellOverlaps.overlaps.length) *
|
||||
this.eventPosition;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user