diff --git a/ui/src/components/workflow/common/NodeControl.vue b/ui/src/components/workflow/common/NodeControl.vue index 84114277a..5eb4e9613 100644 --- a/ui/src/components/workflow/common/NodeControl.vue +++ b/ui/src/components/workflow/common/NodeControl.vue @@ -3,7 +3,7 @@ 放大 缩小 - 还原(大小&定位) + 适应 @@ -23,6 +23,7 @@ function $_zoomOut() { function $_reset() { props.lf?.resetZoom() props.lf?.resetTranslate() + props.lf?.fitView() } diff --git a/ui/src/components/workflow/icons/condition-node-icon.vue b/ui/src/components/workflow/icons/condition-node-icon.vue new file mode 100644 index 000000000..9a01ac96c --- /dev/null +++ b/ui/src/components/workflow/icons/condition-node-icon.vue @@ -0,0 +1,6 @@ + + diff --git a/ui/src/components/workflow/index.vue b/ui/src/components/workflow/index.vue index fd52dff84..12edcffa8 100644 --- a/ui/src/components/workflow/index.vue +++ b/ui/src/components/workflow/index.vue @@ -25,7 +25,7 @@ type ShapeItem = { className?: string disabled?: boolean properties?: Record - callback?: (lf: LogicFlow, container: HTMLElement) => void + callback?: (lf: LogicFlow, container?: HTMLElement) => void } const graphData = { @@ -52,24 +52,24 @@ const graphData = { id: '34902d3d-a3ff-497f-b8e1-0c34a44d7dd4', type: 'start-node', x: 180, - y: 623, + y: 723, properties: { height: 200, stepName: '开始', - // input: [{ key: '输入' }], + input: [{ key: '输入' }], output: [{ key: '输出' }] // node_data: { model: 'shanghai', name: '222222' } } }, { - id: '34902d3d-a3ff-497f-b8e1-0c34a44d7dd4', + id: '34902d3d-a3ff-497f-b8e1-0c34a44d7dd5', type: 'search-dataset-node', - x: 500, + x: 600, y: 250, properties: { height: 200, - stepName: '开始', - // input: [{ key: '输入' }], + stepName: '知识库检索', + input: [{ key: '输入' }], output: [{ key: '输出' }] // node_data: { model: 'shanghai', name: '222222' } } @@ -207,8 +207,8 @@ defineExpose({ position: relative; .control { position: absolute; - bottom: 50px; - right: 50px; + bottom: 24px; + left: 24px; z-index: 2; } } diff --git a/ui/src/components/workflow/menu-data.ts b/ui/src/components/workflow/menu-data.ts index 9dde01d3e..268a63365 100644 --- a/ui/src/components/workflow/menu-data.ts +++ b/ui/src/components/workflow/menu-data.ts @@ -31,11 +31,11 @@ const shapeList = [ { type: 'search-dataset-node', text: '关联知识库,查找与问题相关的分段', - label: '知识检索', + label: '知识库检索', icon: 'search-dataset-node-icon', properties: { height: '', - stepName: '知识检索', + stepName: '知识库检索', input: [ { key: '输入' diff --git a/ui/src/components/workflow/nodes/ai-chat-node/index.vue b/ui/src/components/workflow/nodes/ai-chat-node/index.vue index 27a59f0c2..6785d4970 100644 --- a/ui/src/components/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/components/workflow/nodes/ai-chat-node/index.vue @@ -41,6 +41,7 @@ + diff --git a/ui/src/components/workflow/nodes/search-dataset-node/index.vue b/ui/src/components/workflow/nodes/search-dataset-node/index.vue index 7310ab9b7..efa2b042e 100644 --- a/ui/src/components/workflow/nodes/search-dataset-node/index.vue +++ b/ui/src/components/workflow/nodes/search-dataset-node/index.vue @@ -108,6 +108,8 @@ const { const props = defineProps<{ nodeModel: any }>() +console.log(props.nodeModel) + const form = { dataset_id_list: [], dataset_setting: { @@ -156,7 +158,9 @@ function addDataset(val: Array) { } function openDatasetDialog() { - AddDatasetDialogRef.value.open(form_data.value.dataset_id_list) + if (AddDatasetDialogRef.value) { + AddDatasetDialogRef.value.open(form_data.value.dataset_id_list) + } } function getDataset() { diff --git a/ui/src/components/workflow/nodes/start-node/index.vue b/ui/src/components/workflow/nodes/start-node/index.vue index a83217cfd..aec6ae0e1 100644 --- a/ui/src/components/workflow/nodes/start-node/index.vue +++ b/ui/src/components/workflow/nodes/start-node/index.vue @@ -11,36 +11,6 @@ import NodeContainer from '@/components/workflow/common/node-container/index.vue import type { FormInstance } from 'element-plus' import { ref, computed, onMounted } from 'vue' -// const chat_data = computed({ -// get: () => { -// if (props.nodeModel.properties.node_data) { -// return props.nodeModel.properties.node_data -// } else { -// props.nodeModel.properties.node_data = { -// name: '', -// desc: '', -// prologue: -// '您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?' -// } -// } -// return props.nodeModel.properties.node_data -// }, -// set: (value) => { -// props.nodeModel.properties.node_data = value -// } -// }) const props = defineProps<{ nodeModel: any }>() -const handleFocus = () => { - props.nodeModel.isSelected = false -} -const aiChatNodeFormRef = ref() - -const validate = () => { - aiChatNodeFormRef.value?.validate() -} - -onMounted(() => { - props.nodeModel.validate = validate -})