mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: 修改edge点位置
This commit is contained in:
parent
008af5a39e
commit
3333349af4
|
|
@ -60,6 +60,14 @@ class Flow:
|
|||
start_node_list = [node for node in self.nodes if node.id == 'start-node']
|
||||
return start_node_list[0]
|
||||
|
||||
def is_valid(self):
|
||||
"""
|
||||
校验工作流数据
|
||||
"""
|
||||
self.is_valid_start_node()
|
||||
self.is_valid_base_node()
|
||||
self.is_valid_work_flow()
|
||||
|
||||
@staticmethod
|
||||
def is_valid_node_params(node: Node):
|
||||
get_node(node.type)(node, None, None)
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
work_flow = instance.get('work_flow')
|
||||
if work_flow is None:
|
||||
raise AppApiException(500, "work_flow是必填字段")
|
||||
Flow.new_instance(work_flow).is_valid_work_flow()
|
||||
Flow.new_instance(work_flow).is_valid()
|
||||
base_node = get_base_node_work_flow(work_flow)
|
||||
if base_node is not None:
|
||||
node_data = base_node.get('properties').get('node_data')
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ from django.db.models import QuerySet, Q
|
|||
from django.http import HttpResponse
|
||||
from rest_framework import serializers
|
||||
|
||||
from application.flow.workflow_manage import Flow
|
||||
from application.models import Chat, Application, ApplicationDatasetMapping, VoteChoices, ChatRecord, WorkFlowVersion, \
|
||||
ApplicationTypeChoices
|
||||
from application.models.api_key_model import ApplicationAccessToken
|
||||
|
|
@ -262,6 +263,7 @@ class ChatSerializers(serializers.Serializer):
|
|||
def open(self):
|
||||
self.is_valid(raise_exception=True)
|
||||
work_flow = self.data.get('work_flow')
|
||||
Flow.new_instance(work_flow).is_valid()
|
||||
chat_id = str(uuid.uuid1())
|
||||
application = Application(id=None, dialogue_number=3, model=None,
|
||||
dataset_setting={},
|
||||
|
|
|
|||
|
|
@ -71,13 +71,23 @@ class CustomEdge2 extends BezierEdge {
|
|||
}
|
||||
: {})
|
||||
}),
|
||||
h('foreignObject', { ...positionData, style: { overflow: 'visible' } }, [
|
||||
h('div', {
|
||||
id,
|
||||
style: wrapperStyle,
|
||||
className: 'lf-custom-edge-wrapper'
|
||||
})
|
||||
])
|
||||
h(
|
||||
'foreignObject',
|
||||
{
|
||||
...positionData,
|
||||
y: positionData.y + 5,
|
||||
x: positionData.x + 11,
|
||||
style: { overflow: 'visible' }
|
||||
},
|
||||
[
|
||||
h('div', {
|
||||
id,
|
||||
style: wrapperStyle,
|
||||
|
||||
className: 'lf-custom-edge-wrapper'
|
||||
})
|
||||
]
|
||||
)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue