fix: 分支节点级联选择修复

This commit is contained in:
zhanghao 2026-05-13 11:43:32 +08:00
parent 6d18c510b8
commit 80824c0381
3 changed files with 12 additions and 64 deletions

View File

@ -12,7 +12,6 @@
<el-input
v-model="localName"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -102,21 +101,10 @@ const emits = defineEmits(['setNodeName'])
const showTextTitle = ref(true)
const localName = ref('')
const isEditing = ref(false)
//
const startEditing = () => {
isEditing.value = true
showTextTitle.value = false
// 使 nextTick DOM
nextTick(() => {
if (inputRef.value && inputRef.value.input) {
inputRef.value.input.focus()
//
inputRef.value.input.select()
}
})
}
const confirmNodeName = () => {
@ -162,29 +150,10 @@ const execute = () => {
}
const handleInputFocus = (e) => {
console.log('Input focused')
// LogicFlow
e.stopPropagation()
e.preventDefault()
//
isEditing.value = true
//
setTimeout(() => {
if (inputRef.value && inputRef.value.input) {
inputRef.value.input.focus()
}
}, 0)
}
const handleInputBlur = (e) => {
console.log('Input blurred')
//
if (isEditing.value) {
//
//
}
}
const handleInputKeydown = (e) => {

View File

@ -73,7 +73,6 @@
placeholder="Select"
style="width: 240px"
@focus="handleInputFocus"
@blur="handleInputBlur"
@click.stop
@mousedown.stop
>
@ -84,16 +83,13 @@
</div>
<div class="form__container">
<el-row v-for="(property, pIndex) in params.list">
<!-- :prop="`nodeParams.${index}.list.${pIndex}.name`" :rules="[{ required: true, message: '请输入变量名', trigger: 'blur' }]" -->
<el-form-item
:label="pIndex === 0 ? '引用变量' : ''"
:prop="`nodeParams.${index}.list.${pIndex}.nameType`"
>
<!-- <el-input v-model="property.name" placeholder="请输入" clearable /> -->
<el-select
v-model="property.nameType"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -118,7 +114,6 @@
placeholder="请输入"
clearable
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -139,9 +134,9 @@
v-model="property.nameQuote"
:options="quoteOptions"
placeholder="请选择"
@visible-change="visibleChange"
:key="nameQuoteKey"
@visible-change="(val) => visibleChange(val, 'nameQuote', index, pIndex)"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -158,7 +153,6 @@
<el-select
v-model="property.condition"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -183,7 +177,6 @@
v-model="property.type"
@change="handleTypeChange(index, pIndex)"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -207,7 +200,6 @@
placeholder="请输入"
clearable
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -228,9 +220,8 @@
v-model="property.quote"
:options="quoteOptions"
placeholder="请选择"
@visible-change="visibleChange"
@visible-change="(val) => visibleChange(val, 'quote', index, pIndex)"
@focus="handleInputFocus"
@blur="handleInputBlur"
@keydown="handleInputKeydown"
@click.stop
@mousedown.stop
@ -416,11 +407,17 @@ const setNodeName = (name) => {
emits("contentChange");
}
const visibleChange = (value) => {
const visibleChange = async (value, type, index, pIndex) => {
if (value) {
const option = getInput(props.model.id);
if (option) {
quoteOptions.value = option;
const currentValue = formData.nodeParams[index].list[pIndex][type]
if (currentValue) {
formData.nodeParams[index].list[pIndex][type] = null
await nextTick();
formData.nodeParams[index].list[pIndex][type] = currentValue;
}
}
}
};
@ -456,31 +453,13 @@ const closePopover = () => {
}
}
const isEditing = ref(false)
const handleInputFocus = (e) => {
console.log('Input focused')
// LogicFlow
e.stopPropagation()
e.preventDefault()
//
isEditing.value = true
//
setTimeout(() => {
if (inputRef.value && inputRef.value.input) {
inputRef.value.input.focus()
}
}, 0)
}
const handleInputBlur = (e) => {
console.log('Input blurred')
//
if (isEditing.value) {
//
//
}
}
const handleInputKeydown = (e) => {
// Logic Flow

View File

@ -51,7 +51,7 @@ export default defineConfig(({mode, command}) => {
//李小龙 http://192.168.0.5:13080
// dev http://10.148.20.34:13080
// target: VITE_API_URL,
target: command === 'build' ? VITE_API_URL : 'http://192.168.0.5:13080',
target: command === 'build' ? VITE_API_URL : 'http://192.168.0.100:13080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}