物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
893 B

  1. // 自定义辅助分组,用来创建虚拟节点,作为自由画线的开始和结束点
  2. const { EllipseResize } = window
  3. class HelperCirclePointModel extends EllipseResize.model {
  4. initNodeData(data) {
  5. super.initNodeData(data)
  6. this.rx = 5
  7. this.ry = 5
  8. this.virtual = true
  9. this.draggable = false
  10. }
  11. setToBottom() {
  12. this.zIndex = 0
  13. }
  14. getNodeStyle() {
  15. const style = super.getNodeStyle()
  16. style.fill = 'transparent'
  17. style.stroke = 'transparent'
  18. return style
  19. }
  20. getDefaultAnchor() {
  21. const {
  22. id,
  23. x,
  24. y,
  25. width,
  26. height,
  27. } = this
  28. const anchors = [
  29. {
  30. x,
  31. y,
  32. width: 2,
  33. height: 2,
  34. id,
  35. type: 'right',
  36. },
  37. ]
  38. return anchors
  39. }
  40. }
  41. export default {
  42. type: 'helper-circle-point',
  43. model: HelperCirclePointModel,
  44. view: EllipseResize.view,
  45. }