工作流插件参与进入项目本体

This commit is contained in:
QM303176530
2020-10-24 17:04:04 +08:00
parent cebb9b3002
commit 84e35753cf
97 changed files with 6198 additions and 14 deletions
@@ -0,0 +1,37 @@
import editorStyle from "../util/defaultStyle";
import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';
export default function(G6) {
Shape.registerFactory('controlPoint', {
defaultShapeType: 'marker',
getShape: (type) => {
const shapeObj = Object.assign({}, shapeBase, {
type: 'marker',
itemType: type,
drawShape(cfg, group) {
const style = this.getShapeStyle(cfg);
const shape = group.addShape('marker', {
attrs: {
...style,
symbol: 'square'
},
name: 'controlPoint-shape',
draggable: true,
});
return shape;
},
setState(name, value, item) {
if (name === 'active') {
if (value) {
this.update({ style: { ...editorStyle.pointPointHoverStyle } }, item);
} else {
this.update({ style: { ...editorStyle.pointPointStyle } }, item);
}
}
}
});
return shapeObj;
}
});
}