fix: When dragging and adding a workflow function node, it prompts that the ID does not exist (#1932)

* fix: The application cannot be embedded

* fix: When dragging and adding a workflow function node, it prompts that the ID does not exist
This commit is contained in:
shaohuzhang1 2024-12-27 14:41:14 +08:00 committed by GitHub
parent 116ceefd0a
commit d39d4804a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -49,7 +49,7 @@
<div
class="workflow-dropdown-item cursor flex p-8-12"
@click.stop="clickNodes(functionLibNode, item, 'function')"
@mousedown.stop="onmousedown(functionLibNode, item)"
@mousedown.stop="onmousedown(functionLibNode, item, 'function')"
>
<component
:is="iconComponent(`function-lib-node-icon`)"
@ -229,6 +229,7 @@ function onmousedown(item: any, data?: any, type?: string) {
}
}
}
console.log('xx', item)
props.workflowRef?.onmousedown(item)
emit('onmousedown', item)
}

View File

@ -5,7 +5,7 @@
</template>
<script setup lang="ts">
import LogicFlow from '@logicflow/core'
import { ref, onMounted, computed, nextTick } from 'vue'
import { ref, onMounted, computed } from 'vue'
import AppEdge from './common/edge'
import Control from './common/NodeControl.vue'
import { baseNodes } from '@/workflow/common/data'

View File

@ -112,6 +112,10 @@ const validate = () => {
}
const update_field = () => {
if (!props.nodeModel.properties.node_data.function_lib_id) {
set(props.nodeModel.properties, 'status', 500)
return
}
applicationApi
.getFunctionLib(id, props.nodeModel.properties.node_data.function_lib_id)
.then((ok) => {