// src/views/flow/nodes/EndNode.js
import { CircleNode, CircleNodeModel } from '@logicflow/core'

export class EndNode extends CircleNode {}

export class EndNodeModel extends CircleNodeModel {
  constructor(data, graphModel) {
    super(data, graphModel)
    this.r = 30
    this.fill = '#ff4d4f'
    this.stroke = '#ff4d4f'
    this.text.value = '结束'
  }

  getConnectedTargetRules() {
    const rules = super.getConnectedTargetRules()
    rules.push({
      message: '结束节点不能作为连线的终点',
      validate: () => false
    })
    return rules
  }
}