guozhaolong / wfd-vue

flowable workflow designer for Vue base on @antv/g6
https://guozhaolong.github.io/wfd-vue/
995 stars 261 forks source link

更新g6版本后(4.26),不能连线了 #68

Open gzhanghui opened 3 years ago

gzhanghui commented 3 years ago

https://user-images.githubusercontent.com/42032734/114842313-50a8ca00-9e0b-11eb-80be-687c8b3ffcdd.mov

鼠标移到锚点时,此时触发了onNodeLeave事件,恰好把锚点remove了 active 状态不能作用了 求大佬指点

 // hoverNodeActived.js
  onNodeLeave(e){
      if(!(e.target instanceof Marker) && !this.graph.get('edgeDragging')) {
        this.graph.setItemState(e.item, 'show-anchor', false);
      }
    }
// hoverAnchorActived.js
   onAnchorEnter(e){
      if(!this.graph.get('edgeDragging'))
        this.graph.setItemState(e.item, 'active-anchor', true);
    }
guozhaolong commented 3 years ago

e.target instanceof Marker不能用了,你换成别的判断

gzhanghui commented 3 years ago

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

guanpenghui1993 commented 2 years ago

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

大佬,修改哪个文件?怎么改的有代码吗?

gotounix commented 2 years ago

@gzhanghui 老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js 中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接 import Item from '@antv/g6 不能用, shapeBase也没有。

谢谢。

guanpenghui1993 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

gzhanghui commented 2 years ago

@gzhanghui老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接import Item from '@antv/g6不能用,shapeBase也没有。

谢谢。 可以稍微看一下g6的目录解构 import { shapeBase } from '@antv/g6-core/lib/element/shapeBase'; import Shape from '@antv/g6-core/lib/element/shape';

gotounix commented 2 years ago

@gzhanghui 感谢,已解决。

guanpenghui1993 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

gzhanghui commented 2 years ago

shapeBase

@gzhanghui老哥,请教下,更新至4.1以上版本以后 shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢? 直接import Item from '@antv/g6不能用,shapeBase也没有。 谢谢。 可以稍微看一下g6的目录解构 import { shapeBase } from '@antv/g6-core/lib/element/shapeBase'; import Shape from '@antv/g6-core/lib/element/shape';


// package.json

"dependencies": {

"@antv/dom-util": "2.0.2",
"@antv/g-canvas": "^0.4.12",
"@antv/g6": "^4.2.6",
"@antv/g6-core": "^0.2.6",
"@antv/util": "~2.0.9",

}
```js
import { shapeBase } from '@antv/g6-core/lib/element/shapeBase';
huangtangtang commented 2 years ago

大佬好,请教个问题: 两个节点连线时,报如下错误信息 image

报错位置:dragEdge.js 下的 dragEdgeBeforeShowAnchor() 和 _clearAllAnchor() 该如何解决?