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