|
@ -73,7 +73,7 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
// import node from './node.vue' |
|
|
// import node from './node.vue' |
|
|
import { inject, ref, provide, renderSlot, useSlots, watch, readonly, computed } from 'vue' |
|
|
import { inject, ref, provide, renderSlot, useSlots, watch, readonly, computed } from 'vue' |
|
|
import { isChildOf } from './util' |
|
|
import { findByKeyParent, isChildOf } from './util' |
|
|
import renderNode from './renderNode' |
|
|
import renderNode from './renderNode' |
|
|
import type { INiuTreeData, INiuTreeKey } from './type' |
|
|
import type { INiuTreeData, INiuTreeKey } from './type' |
|
|
import { ENiuTreeStatus } from './type'; |
|
|
import { ENiuTreeStatus } from './type'; |
|
@ -191,7 +191,13 @@ function onDragover(event: DragEvent) { |
|
|
if (props.data.children) { |
|
|
if (props.data.children) { |
|
|
status.value = ENiuTreeStatus.DragIn |
|
|
status.value = ENiuTreeStatus.DragIn |
|
|
} else if (!props.data.children && opts.sort) { |
|
|
} else if (!props.data.children && opts.sort) { |
|
|
|
|
|
const parentSource = findByKeyParent(props.dataSourceKey, props.list) |
|
|
|
|
|
const parentData = findByKeyParent(props.data.key, props.list) |
|
|
|
|
|
if(parentSource && parentData &&parentSource.key !== parentData.key){ |
|
|
status.value = ENiuTreeStatus.DragInner |
|
|
status.value = ENiuTreeStatus.DragInner |
|
|
|
|
|
}else if(parentSource != parentData){ |
|
|
|
|
|
status.value = ENiuTreeStatus.DragInner |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
emit('onDragover', props.data.key) |
|
|
emit('onDragover', props.data.key) |
|
|