fix: 修复画布事件冲突问题

This commit is contained in:
shaohuzhang1 2024-08-28 15:57:06 +08:00 committed by shaohuzhang1
parent 64e2e63e92
commit 7c218284a1
9 changed files with 21 additions and 69 deletions

View File

@ -1,8 +1,6 @@
<template>
<el-cascader
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
:teleported="false"
:options="options"
@visible-change="visibleChange"
@ -11,12 +9,7 @@
separator=" > "
>
<template #default="{ node, data }">
<span
class="flex align-center"
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
>
<span class="flex align-center" @wheel="wheel">
<component :is="iconComponent(`${data.type}-icon`)" class="mr-8" :size="18" />{{
data.label
}}</span
@ -42,10 +35,11 @@ const data = computed({
}
})
const options = ref<Array<any>>([])
const isKeyDown = ref(false)
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true

View File

@ -4,10 +4,6 @@
<el-card shadow="never" class="card-never" style="--el-card-padding: 12px">
<el-form
@submit.prevent
@mousemove.stop
@mousedown.stop
@keydown.stop
@click.stop
:model="chat_data"
label-position="top"
require-asterisk-position="right"
@ -44,8 +40,6 @@
<el-select
@change="model_change"
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
:teleported="false"
v-model="chat_data.model_id"
placeholder="请选择 AI 模型"
@ -138,8 +132,6 @@
</template>
<MdEditor
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
class="reply-node-editor"
style="height: 150px"
v-model="chat_data.prompt"
@ -216,11 +208,12 @@ import type { Provider } from '@/api/type/model'
import { isLastNode } from '@/workflow/common/data'
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
const { model, application } = useStore()
const isKeyDown = ref(false)
const { model } = useStore()
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true

View File

@ -2,9 +2,6 @@
<NodeContainer :nodeModel="nodeModel">
<el-form
@submit.prevent
@mousedown.stop
@keydown.stop
@click.stop
:model="form_data"
label-position="top"
require-asterisk-position="right"
@ -42,8 +39,6 @@
<el-form-item label="开场白">
<MdEditor
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
style="height: 150px"
v-model="form_data.prologue"
:preview="false"
@ -82,10 +77,11 @@ const form = {
prologue:
'您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?'
}
const isKeyDown = ref(false)
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true

View File

@ -6,11 +6,7 @@
require-asterisk-position="right"
label-width="auto"
ref="ConditionNodeFormRef"
@keydown.stop
@submit.prevent
@click.stop
@mousedown.stop
@mousemove.stop
>
<template v-for="(item, index) in form_data.branch" :key="item.id">
<el-card
@ -68,8 +64,6 @@
>
<el-select
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
:teleported="false"
v-model="condition.compare"
placeholder="请选择条件"
@ -158,16 +152,16 @@ const form = {
}
]
}
const isKeyDown = ref(false)
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true
}
}
const resizeCondition = (wh: any, row: any, index: number) => {
const branch_condition_list = cloneDeep(
props.nodeModel.properties.branch_condition_list

View File

@ -4,10 +4,6 @@
<h5 class="lighter mb-8">输入变量</h5>
<el-form
@submit.prevent
@mousemove.stop
@mousedown.stop
@keydown.stop
@click.stop
ref="FunctionNodeFormRef"
:model="chat_data"
label-position="top"

View File

@ -9,10 +9,6 @@
</div>
<el-form
@submit.prevent
@mousemove.stop
@mousedown.stop
@keydown.stop
@click.stop
ref="FunctionNodeFormRef"
:model="chat_data"
label-position="top"
@ -228,6 +224,4 @@ onMounted(() => {
}, 100)
})
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

View File

@ -4,10 +4,6 @@
<el-card shadow="never" class="card-never" style="--el-card-padding: 12px">
<el-form
@submit.prevent
@mousemove.stop
@mousedown.stop
@keydown.stop
@click.stop
:model="form_data"
label-position="top"
require-asterisk-position="right"
@ -44,8 +40,6 @@
<el-select
@change="model_change"
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
:teleported="false"
v-model="form_data.model_id"
placeholder="请选择 AI 模型"
@ -136,8 +130,6 @@
</template>
<MdEditor
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
class="reply-node-editor"
style="height: 150px"
v-model="form_data.prompt"
@ -216,10 +208,11 @@ import { isLastNode } from '@/workflow/common/data'
const AIModeParamSettingDialogRef = ref<InstanceType<typeof AIModeParamSettingDialog>>()
const { model } = useStore()
const isKeyDown = ref(false)
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true

View File

@ -3,9 +3,6 @@
<el-card shadow="never" class="card-never" style="--el-card-padding: 12px">
<el-form
@submit.prevent
@mousedown.stop
@keydown.stop
@click.stop
:model="form_data"
label-position="top"
require-asterisk-position="right"
@ -30,8 +27,6 @@
<MdEditor
v-if="form_data.reply_type === 'content'"
@wheel="wheel"
@keydown="isKeyDown = true"
@keyup="isKeyDown = false"
class="reply-node-editor"
style="height: 150px"
v-model="form_data.content"
@ -92,10 +87,11 @@ import { ref, computed, onMounted } from 'vue'
import { isLastNode } from '@/workflow/common/data'
const props = defineProps<{ nodeModel: any }>()
const isKeyDown = ref(false)
const wheel = (e: any) => {
if (isKeyDown.value) {
if (e.ctrlKey === true) {
e.preventDefault()
return true
} else {
e.stopPropagation()
return true

View File

@ -4,10 +4,6 @@
<el-card shadow="never" class="card-never">
<el-form
@submit.prevent
@mousemove.stop
@mousedown.stop
@keydown.stop
@click.stop
:model="form_data"
label-position="top"
require-asterisk-position="right"