Commit c379e14a authored by “lixuyan”'s avatar “lixuyan”

修改甘特图位置变化的问题

parent a0f20397
...@@ -24,6 +24,9 @@ export default { ...@@ -24,6 +24,9 @@ export default {
}) })
}, },
calcCriticalPath(link) { calcCriticalPath(link) {
const sPos = this.gantt.getScrollState() // {x:58,y:180}
const posX = sPos.x
const posY = sPos.y
// 找出当前link 同级 task link // 找出当前link 同级 task link
const peerTasks = this.getPeerTasks(link) const peerTasks = this.getPeerTasks(link)
const peerLinks = this.getPeerLinks(peerTasks) const peerLinks = this.getPeerLinks(peerTasks)
...@@ -73,6 +76,7 @@ export default { ...@@ -73,6 +76,7 @@ export default {
}) })
this.calcLinkSlack(peerLinks, peerTasks) this.calcLinkSlack(peerLinks, peerTasks)
this.gantt.parse(this.params) this.gantt.parse(this.params)
this.gantt.scrollTo(posX, posY)
}, },
modifyTask(task, operator) { modifyTask(task, operator) {
const _task = { const _task = {
......
...@@ -461,6 +461,9 @@ export default { ...@@ -461,6 +461,9 @@ export default {
// 删除连接后触发 // 删除连接后触发
ganttAss.attachEvent('onAfterLinkDelete', function(id, item) { ganttAss.attachEvent('onAfterLinkDelete', function(id, item) {
console.log('onAfterLinkDelete', id, item) console.log('onAfterLinkDelete', id, item)
const sPosDelete = ganttAss.getScrollState()
const posXDelete = sPosDelete.x
const posYDelete = sPosDelete.y
var target = ganttAss.getTask(item.target) var target = ganttAss.getTask(item.target)
that.calcCriticalPath(item) that.calcCriticalPath(item)
that.modifyLink(item, 'REMOVE') that.modifyLink(item, 'REMOVE')
...@@ -478,6 +481,7 @@ export default { ...@@ -478,6 +481,7 @@ export default {
}) })
} }
ganttAss.parse(data) ganttAss.parse(data)
ganttAss.scrollTo(posXDelete, posYDelete)
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment