EndNode.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!--
  2. * @Author: liuJie
  3. * @Date: 2026-01-25 15:24:20
  4. * @LastEditors: liuJie
  5. * @LastEditTime: 2026-01-25 18:49:09
  6. * @Describe: 结束节点
  7. -->
  8. <script lang="ts" setup>
  9. import { Position } from '@vue-flow/core'
  10. import CanvasHandle from '../handles/CanvasHandle.vue'
  11. import type { NodeProps } from '@vue-flow/core'
  12. import { Icon } from '@repo/ui'
  13. const props = withDefaults(defineProps<NodeProps>(), {
  14. selected: true
  15. })
  16. </script>
  17. <template>
  18. <div
  19. class="relative min-w-[200px] transition-all duration-300 ease-out hover:-translate-y-0.5"
  20. :class="{ 'scale-105': selected }"
  21. >
  22. <!-- 节点主体 -->
  23. <div
  24. class="flex items-center gap-3 px-4 py-3 bg-gradient-to-br from-white to-green-50 border-2 rounded-xl shadow-md transition-all duration-300 relative overflow-hidden"
  25. :class="
  26. selected
  27. ? 'border-green-500 shadow-green-200 shadow-lg'
  28. : 'border-green-300 hover:shadow-lg hover:shadow-green-100'
  29. "
  30. >
  31. <!-- 左侧装饰条 -->
  32. <div
  33. class="absolute right-0 top-0 bottom-0 w-1 bg-gradient-to-b from-green-500 to-green-400 rounded-l-xl"
  34. ></div>
  35. <!-- 图标区域 -->
  36. <div
  37. class="relative flex-shrink-0 flex items-center justify-center w-10 h-10 bg-gradient-to-br from-green-500 to-green-400 rounded-lg shadow-md shadow-green-200"
  38. >
  39. <!-- 光泽效果 -->
  40. <div
  41. class="absolute inset-0 bg-gradient-to-br from-white/30 to-transparent rounded-lg"
  42. ></div>
  43. <!-- 图标 -->
  44. <Icon icon="lucide:unplug" color="#ffffff" class="relative z-10" :size="20" />
  45. </div>
  46. <!-- 内容区域 -->
  47. <div class="flex-1 min-w-0">
  48. <div class="text-sm font-semibold text-gray-800 truncate">
  49. {{ data.label || '结束' }}
  50. </div>
  51. <div v-if="data.description" class="text-xs text-gray-500 mt-0.5 truncate">
  52. {{ data.description }}
  53. </div>
  54. </div>
  55. </div>
  56. <!-- 输入连接点 -->
  57. <CanvasHandle
  58. handle-id="code-node-input"
  59. type="target"
  60. :connections-count="1"
  61. :position="Position.Left"
  62. />
  63. </div>
  64. </template>
  65. <style lang="less" scoped>
  66. @keyframes pulse {
  67. 0%,
  68. 100% {
  69. opacity: 1;
  70. }
  71. 50% {
  72. opacity: 0.5;
  73. }
  74. }
  75. @keyframes ping {
  76. 75%,
  77. 100% {
  78. transform: scale(2);
  79. opacity: 0;
  80. }
  81. }
  82. </style>