mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 05:42:51 +00:00
fix: bug修复
This commit is contained in:
parent
ef0eb09eb4
commit
bc096d0478
|
|
@ -30,7 +30,11 @@
|
|||
<div v-show="showPopover" class="workflow-dropdown-menu border border-r-4">
|
||||
<h5 class="title">基础组件</h5>
|
||||
<template v-for="(item, index) in menuNodes" :key="index">
|
||||
<div class="workflow-dropdown-item cursor flex p-8-12" @mousedown="onmousedown(item)">
|
||||
<div
|
||||
class="workflow-dropdown-item cursor flex p-8-12"
|
||||
@click="clickNodes(item)"
|
||||
@mousedown="onmousedown(item)"
|
||||
>
|
||||
<component :is="iconComponent(`${item.type}-icon`)" class="mr-8 mt-4" :size="32" />
|
||||
<div class="pre-line">
|
||||
<div class="lighter">{{ item.label }}</div>
|
||||
|
|
@ -158,6 +162,10 @@ function clickoutsideDebug() {
|
|||
showDebug.value = false
|
||||
}
|
||||
|
||||
function clickNodes(item: any) {
|
||||
// workflowRef.value?.addNode(item)
|
||||
}
|
||||
|
||||
function onmousedown(item: any) {
|
||||
workflowRef.value?.onmousedown(item)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ onMounted(() => {
|
|||
lf.value.deleteEdge(id)
|
||||
})
|
||||
})
|
||||
setTimeout(() => {
|
||||
lf.value?.fitView()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
const validate = () => {
|
||||
|
|
@ -102,19 +105,28 @@ const onmousedown = (shapeItem: ShapeItem) => {
|
|||
if (shapeItem.type) {
|
||||
lf.value.dnd.startDrag({
|
||||
type: shapeItem.type,
|
||||
properties: shapeItem.properties,
|
||||
icon: shapeItem.icon
|
||||
properties: shapeItem.properties
|
||||
})
|
||||
}
|
||||
if (shapeItem.callback) {
|
||||
shapeItem.callback(lf.value)
|
||||
}
|
||||
}
|
||||
const addNode = (shapeItem: ShapeItem) => {
|
||||
const virtualdata = lf.value.graphModel.getVirtualRectSize()
|
||||
lf.value.graphModel.addNode({
|
||||
type: shapeItem.type,
|
||||
properties: shapeItem.properties,
|
||||
x: virtualdata.virtualRectCenterPositionX,
|
||||
y: virtualdata.virtualRectCenterPositionY
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
onmousedown,
|
||||
validate,
|
||||
getGraphData
|
||||
getGraphData,
|
||||
addNode
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -83,7 +83,15 @@
|
|||
</el-row>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="检索问题输入">
|
||||
<el-form-item
|
||||
label="检索问题输入"
|
||||
prop="question_reference_address"
|
||||
:rules="{
|
||||
message: '请选择检索问题输入',
|
||||
trigger: 'blur',
|
||||
required: true
|
||||
}"
|
||||
>
|
||||
<NodeCascader
|
||||
:nodeModel="nodeModel"
|
||||
class="w-full"
|
||||
|
|
|
|||
Loading…
Reference in New Issue