mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-20 09:50:33 +03:00
Merge branch 'master' of https://github.com/InfectoOne/vue-ganttastic
This commit is contained in:
Generated
+974
-954
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -28,7 +28,7 @@
|
||||
"devDependencies": {
|
||||
"bili": "^4.10.0",
|
||||
"rollup-plugin-vue": "^5.1.9",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"moment": "^2.26.0"
|
||||
|
||||
+4
-4
@@ -124,8 +124,8 @@ export default {
|
||||
...(this.barConfig || {}),
|
||||
left: `${xStart}px`,
|
||||
width: `${xEnd - xStart}px`,
|
||||
height: `${this.ganttChartProps.rowHeight-6}px`,
|
||||
zIndex: this.isDragging ? 2 : 1
|
||||
height: `${this.ganttChartProps.rowHeight - 6}px`,
|
||||
zIndex: this.barConfig.zIndex || (this.isDragging ? 2 : 1)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -288,7 +288,7 @@ export default {
|
||||
},
|
||||
|
||||
manageOverlapping(){
|
||||
if(!this.ganttChartProps.pushOnOverlap){
|
||||
if(!this.ganttChartProps.pushOnOverlap || this.barConfig.pushOnOverlap === false){
|
||||
return
|
||||
}
|
||||
let currentBar = this.bar
|
||||
@@ -325,7 +325,7 @@ export default {
|
||||
let barEndMoment = moment(bar[this.barEnd])
|
||||
let overlapLeft, overlapRight, overlapInBetween
|
||||
let overlapBar = this.allBarsInRow.find(otherBar => {
|
||||
if(otherBar === bar){
|
||||
if(otherBar === bar || otherBar.ganttBarConfig.pushOnOverlap === false){
|
||||
return false
|
||||
}
|
||||
let otherBarStart = moment(otherBar[this.barStart])
|
||||
|
||||
+7
-5
@@ -128,7 +128,7 @@ export default {
|
||||
},
|
||||
|
||||
shouldSnapBackBar(ganttBar){
|
||||
if(this.snapBackOnOverlap){
|
||||
if(this.snapBackOnOverlap && ganttBar.barConfig.pushOnOverlap !== false){
|
||||
let {overlapBar} = ganttBar.getOverlapBarAndType(ganttBar.bar)
|
||||
return !!overlapBar
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
// note that if a bar from the same row belongs to a bundle
|
||||
// other rows might need to be taken into consideration, too
|
||||
setDragLimitsOfGanttBar(bar){
|
||||
if(!this.pushOnOverlap){
|
||||
if(!this.pushOnOverlap || bar.barConfig.pushOnOverlap === false){
|
||||
return
|
||||
}
|
||||
for(let side of ["left", "right"]){
|
||||
@@ -241,9 +241,10 @@ export default {
|
||||
if(side === "left"){
|
||||
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
||||
return gBar.$options.name === GGanttBar.name
|
||||
&& gBar.$parent === bar.$parent
|
||||
&& gBar.$refs['g-gantt-bar']
|
||||
&& gBar.$refs['g-gantt-bar'].offsetLeft < bar.$refs['g-gantt-bar'].offsetLeft
|
||||
&& gBar.$parent === bar.$parent
|
||||
&& gBar.$refs['g-gantt-bar']
|
||||
&& gBar.$refs['g-gantt-bar'].offsetLeft < bar.$refs['g-gantt-bar'].offsetLeft
|
||||
&& gBar.barConfig.pushOnOverlap !== false
|
||||
})
|
||||
} else {
|
||||
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
||||
@@ -251,6 +252,7 @@ export default {
|
||||
&& gBar.$parent === bar.$parent
|
||||
&& gBar.$refs['g-gantt-bar']
|
||||
&& gBar.$refs['g-gantt-bar'].offsetLeft > bar.$refs['g-gantt-bar'].offsetLeft
|
||||
&& gBar.barConfig.pushOnOverlap !== false
|
||||
})
|
||||
}
|
||||
if(allBarsLeftOrRight.length > 0){
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ export default {
|
||||
myStart: "2020-03-02 01:00",
|
||||
myEnd: "2020-03-02 07:00",
|
||||
label: "Bar",
|
||||
ganttBarConfig: {color:"white", backgroundColor: "#5effad"}
|
||||
ganttBarConfig: {color:"white", backgroundColor: "#5effad", pushOnOverlap: false, zIndex: 3}
|
||||
},
|
||||
{
|
||||
myStart: "2020-03-03 14:00",
|
||||
|
||||
Reference in New Issue
Block a user