Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

任务之间能连线么? #75

Open
zzh4818 opened this issue Aug 24, 2021 · 2 comments
Open

任务之间能连线么? #75

zzh4818 opened this issue Aug 24, 2021 · 2 comments

Comments

@zzh4818
Copy link

zzh4818 commented Aug 24, 2021

任务间会有某个参数关联,关联参数如果相同,我们想通过线段连接起来,组件能实现任务间的连线么?
类似于 https://dhtmlx.com/vue/demos/gantt/#/many/default

@w1301625107
Copy link
Owner

不能,这个需要自己实现

@jiusak
Copy link

jiusak commented Aug 10, 2022

好像可以用leaderline(新人四处抄来的)

import LeaderLine from 'leader-line-vue';
import AnimEvent from "anim-event";
const that = this;
this.timer = setTimeout(
function () {
that.drawLeaderLine(that.myList);
// this.done = 1;
}, 1000)
drawLeaderLine(list) {

  list.forEach(element => {
    let start = document.getElementById(element.id)
    console.log(element.id)
    if (element.children && element.children.length) {
      element.children.forEach(child => {
        let line = LeaderLine.setLine(start, document.getElementById(child.id))
        line.color = 'rgba(30, 130, 250, 0.5)'
        line.path = 'grid'
        line.size = 3
        // line.setOptions({
        //     dash: {animation: true},
        // })
        line.setOptions({ startSocket: 'left', endSocket: 'left', startSocketGravity: [1, 20], });
        window.addEventListener('wheel', AnimEvent.add(function () {
          console.log("scroll")
          line.position()
          
        }), false);
        this.lines.push(line)
      })
      this.drawLeaderLine(element.children)
    }
  })
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants