mldong-flow-designer-plus
Version:
本项目包含了作者为B站课堂视频[《工作流设计器开发最佳实践》](https://www.bilibili.com/cheese/play/ss24484)的过程源码。教程中开发的组件也可用于实际生产环境中。以下是和使用文档和课程章节说明。 ## 实战项目 [演示地址](https://flow-pro.mldong.com/)
26 lines (23 loc) • 790 B
text/typescript
import { PolylineEdge, PolylineEdgeModel } from "@logicflow/core";
import { ColorEnum, NodeStateEnum } from "../types/enums";
class TransitionModel extends PolylineEdgeModel {
getEdgeStyle() {
const theme = this.graphModel.props.theme;
const style = super.getEdgeStyle();
if(this.properties.state == NodeStateEnum.history) {
style.stroke = theme.historyColor || ColorEnum.historyColor;
} else if(this.properties.state == NodeStateEnum.active) {
style.stroke = theme.activeColor || ColorEnum.activeColor;
} else {
style.stroke = theme.edgePrimaryColor || ColorEnum.edgePrimaryColor;
}
return style;
}
}
class TransitionEdge extends PolylineEdge {
}
export default {
type: "transition",
view: TransitionEdge,
model: TransitionModel
}