fix: 修复题目未聚焦时拖拽按钮失效问题 (#375)

Co-authored-by: jiangchunfu <jiangchunfu@kaike.la>
This commit is contained in:
Jiangchunfu 2024-08-04 12:38:59 +08:00 committed by GitHub
parent e58be83214
commit 0745d90a5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View File

@ -1,8 +1,8 @@
<template> <template>
<draggable <draggable
v-model="renderData" v-model="renderData"
handle=".question-wrapper.isSelected" handle=".question-wrapper.is-move"
filter=".question-wrapper.isSelected .question.isSelected" filter=".question-wrapper.is-move .question.isSelected"
:preventOnFilter="false" :preventOnFilter="false"
:group="DND_GROUP" :group="DND_GROUP"
:onEnd="checkEnd" :onEnd="checkEnd"

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
:class="itemClass" :class="[itemClass, { 'is-move': isSelected || isMove }]"
@mouseenter="onMouseenter" @mouseenter="onMouseenter"
@mouseleave="onMouseleave" @mouseleave="onMouseleave"
@click="clickFormItem" @click="clickFormItem"
@ -8,7 +8,12 @@
<div><slot v-if="moduleConfig.type !== 'section'"></slot></div> <div><slot v-if="moduleConfig.type !== 'section'"></slot></div>
<div :class="[showHover ? 'visibily' : 'hidden', 'hoverItem']"> <div :class="[showHover ? 'visibily' : 'hidden', 'hoverItem']">
<div class="item el-icon-rank" @click.stop.prevent="onMove"> <div
class="item el-icon-rank"
@click.stop.prevent
@mouseenter="setMoveState(true)"
@mouseleave="setMoveState(false)"
>
<i-ep-rank /> <i-ep-rank />
</div> </div>
<div v-if="showUp" class="item" @click.stop.prevent="onMoveUp"> <div v-if="showUp" class="item" @click.stop.prevent="onMoveUp">
@ -62,6 +67,7 @@ const emit = defineEmits(['changeSeq', 'select'])
const { getShowLogicText, hasShowLogic } = useShowLogicInfo(props.moduleConfig.field) const { getShowLogicText, hasShowLogic } = useShowLogicInfo(props.moduleConfig.field)
const isHover = ref(false) const isHover = ref(false)
const isMove = ref(false)
const itemClass = computed(() => { const itemClass = computed(() => {
return { return {
@ -154,7 +160,9 @@ const onDelete = async () => {
} }
} }
const onMove = () => {} const setMoveState = (state: boolean) => {
isMove.value = state
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>