<script  setup>
import { ref, onMounted, reactive, } from "vue";
import { VueFlow,Handle, useVueFlow,Position } from '@vue-flow/core'
const props = defineProps({
  node: {
    type: Object,
    required: true,
  },
})
onMounted(() => {
});
</script>
<template>
  <!-- <div v-if="props.node.data.label!='模块化'"> -->
  <div v-if="props.node.data!=null">
    <div class="custom-node icons  " :id="`node-${node.id}`"  >
      <img :src="props.node.data.image"/>
      <span>{{props.node.data.idCodeser }}</span>
    </div>
  <Handle id="target-a" type="source" :position="Position.Right" class="custom-handle"/>
  <Handle id="target-c" type="source" :position="Position.Top"  class="custom-handle"/> 
  <Handle id="target-b" type="source" :position="Position.Left" class="custom-handle"/> 
  <Handle id="target-d" type="source" :position="Position.Bottom"  class="custom-handle"/> 
  </div>
<!-- </div> -->
</template>
<style scoped> 

.icons img{
    width: 20px;

}
.icons span{
  display: block;
  font-size: 8px;
}


</style>
<style>
.custom-handle {
  background: #c11f1f; /* 更浅的颜色 */
  width: 6px;      /* 更小的尺寸 */
  height: 6px;     /* 更小的尺寸 */
  border-radius: 50%;
  border: 1px solid #fff;
  transition: all 0.2s ease;
}

.vue-flow__node-default .vue-flow__handle, .vue-flow__node-input .vue-flow__handle, .vue-flow__node-output .vue-flow__handle {
  background: #ddd;
}

.vue-flow__node-default .vue-flow__handle:hover,
.vue-flow__node-input .vue-flow__handle:hover,
.vue-flow__node-output .vue-flow__handle:hover {
  background: #161616; /* 悬停时稍深 */
}

.vue-flow__node-default, .vue-flow__node-input, .vue-flow__node-output{
  width: 50px;
  height: 50px;
  pointer-events: auto;
  border: none;
}

.vue-flow__node-default:not(.selected) {
  z-index: 1 !important; /* 强制设置未选中时的 z-index */
}

.vue-flow__node.draggable {
    background-color: rgba(0,0,0,0);
}

.vue-flow__node-default.selected, .vue-flow__node-default.selected:hover, .vue-flow__node-input.selected, .vue-flow__node-input.selected:hover, .vue-flow__node-output.selected, .vue-flow__node-output.selected:hover{
  box-shadow:none !important;
}
.vue-flow__node {
          stroke: none; /* 移除节点边框 */
        }

.vue-flow__node:hover{
  /* 移除 hover 时的阴影 */
  box-shadow: none !important;
}
        
 
.vue-flow__edge-text {
  display: block;
}
.vue-flow__node-custom {
    background: purple;
    color: white;
    border: 1px solid purple;
    border-radius: 4px;
    box-shadow: 0 0 0 1px purple;
    padding: 8px;
}
</style>
