mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-23 01:00:33 +03:00
Fixed bug when setting drag limit when there are other components besides g-gantt-row in g-gantt-chart
Fixed drag limit when push-on-overlap dynamically changes
This commit is contained in:
Generated
+1
-6
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-ganttastic",
|
"name": "vue-ganttastic",
|
||||||
"version": "0.9.6",
|
"version": "0.9.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3174,11 +3174,6 @@
|
|||||||
"minimist": "1.2.5"
|
"minimist": "1.2.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moment": {
|
|
||||||
"version": "2.26.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz",
|
|
||||||
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw=="
|
|
||||||
},
|
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-ganttastic",
|
"name": "vue-ganttastic",
|
||||||
"version": "0.9.6",
|
"version": "0.9.8",
|
||||||
"description": "A simple and customizable Gantt chart component for Vue.js",
|
"description": "A simple and customizable Gantt chart component for Vue.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
"rollup-plugin-vue": "^5.1.9",
|
"rollup-plugin-vue": "^5.1.9",
|
||||||
"vue-template-compiler": "^2.6.11"
|
"vue-template-compiler": "^2.6.11"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"peerDependencies": {
|
||||||
"moment": "^2.26.0"
|
"moment": "^2.26.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isPosOutOfDragRange(xStart, xEnd){
|
isPosOutOfDragRange(xStart, xEnd){
|
||||||
|
if(!this.ganttChartProps.pushOnOverlap) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if(xStart && this.dragLimitLeft !== null && xStart < this.dragLimitLeft+2){
|
if(xStart && this.dragLimitLeft !== null && xStart < this.dragLimitLeft+2){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-3
@@ -107,7 +107,7 @@ export default {
|
|||||||
this.ganttBarChildrenList.forEach(ganttBarChild => {
|
this.ganttBarChildrenList.forEach(ganttBarChild => {
|
||||||
if(ganttBarChild.barConfig.bundle === gGanttBar.barConfig.bundle && ganttBarChild !== gGanttBar){
|
if(ganttBarChild.barConfig.bundle === gGanttBar.barConfig.bundle && ganttBarChild !== gGanttBar){
|
||||||
ganttBarChild.initDrag(e)
|
ganttBarChild.initDrag(e)
|
||||||
this.movedBarsInDrag.add(ganttBarChild)
|
this.movedBarsInDrag.add(ganttBarChild.bar)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -240,11 +240,15 @@ export default {
|
|||||||
let allBarsLeftOrRight = []
|
let allBarsLeftOrRight = []
|
||||||
if(side === "left"){
|
if(side === "left"){
|
||||||
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
||||||
return gBar.$parent === bar.$parent && gBar.$refs['g-gantt-bar'].offsetLeft < bar.$refs['g-gantt-bar'].offsetLeft
|
return gBar.$options.name === GGanttBar.name
|
||||||
|
&& gBar.$parent === bar.$parent
|
||||||
|
&& gBar.$refs['g-gantt-bar'].offsetLeft < bar.$refs['g-gantt-bar'].offsetLeft
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
allBarsLeftOrRight = bar.$parent.$children.filter(gBar => {
|
||||||
return gBar.$parent === bar.$parent && gBar.$refs['g-gantt-bar'].offsetLeft > bar.$refs['g-gantt-bar'].offsetLeft
|
return gBar.$options.name === GGanttBar.name
|
||||||
|
&& gBar.$parent === bar.$parent
|
||||||
|
&& gBar.$refs['g-gantt-bar'].offsetLeft > bar.$refs['g-gantt-bar'].offsetLeft
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if(allBarsLeftOrRight.length > 0){
|
if(allBarsLeftOrRight.length > 0){
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
:row-label-width="`${rowLabelWidth}%`"
|
:row-label-width="`${rowLabelWidth}%`"
|
||||||
:row-height="rowHeight"
|
:row-height="rowHeight"
|
||||||
:theme="selectedTheme"
|
:theme="selectedTheme"
|
||||||
|
@dragend-bar="onDragend($event)"
|
||||||
>
|
>
|
||||||
<template v-for="row in rowList">
|
<template v-for="row in rowList">
|
||||||
<g-gantt-row
|
<g-gantt-row
|
||||||
@@ -165,6 +166,12 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onDragend(e){
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user