sequence.js
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* @Date: 2025-03-12 11:59:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-12 12:01:40
* @FilePath: /logic-flow2/src/views/edge/sequence.js
* @Description: 文件描述
*/
import { PolylineEdge, PolylineEdgeModel } from '@logicflow/core'
class SequenceModel extends PolylineEdgeModel {
// 设置边样式
getEdgeStyle() {
const style = super.getEdgeStyle()
const { properties } = this
if (properties.isStrokeDashed) {
style.strokeDasharray = '4, 4'
}
style.stroke = 'orange'
return style
}
// 设置边文本样式
getTextStyle() {
const style = super.getTextStyle()
style.color = '#3451F1'
style.fontSize = 20
style.background = Object.assign({}, style.background, {
fill: '#F2F131',
})
return style
}
// 设置 hover 轮廓样式
getOutlineStyle() {
const style = super.getOutlineStyle()
style.stroke = 'blue'
return style
}
}
export default {
type: 'sequence',
view: PolylineEdge,
model: SequenceModel,
}