diff --git a/ui/src/assets/icon_hi.svg b/ui/src/assets/icon_hi.svg new file mode 100644 index 000000000..84bb36ac2 --- /dev/null +++ b/ui/src/assets/icon_hi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/icon_start.svg b/ui/src/assets/icon_start.svg new file mode 100644 index 000000000..0b8d73064 --- /dev/null +++ b/ui/src/assets/icon_start.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/components/workflow/common/app-node/index.ts b/ui/src/components/workflow/common/app-node/index.ts index 8fecafea7..02138fea2 100644 --- a/ui/src/components/workflow/common/app-node/index.ts +++ b/ui/src/components/workflow/common/app-node/index.ts @@ -1,6 +1,6 @@ import Components from '@/components' import ElementPlus from 'element-plus' -import { HtmlNode, HtmlNodeModel } from '@logicflow/core' +import { HtmlNode, HtmlNodeModel, BaseEdge } from '@logicflow/core' import { createApp, h } from 'vue' import directives from '@/directives' @@ -80,6 +80,7 @@ class AppNodeModel extends HtmlNodeModel { } return style } + setHeight(height: number, inputContainerHeight: number, outputContainerHeight: number) { this.height = height + inputContainerHeight + outputContainerHeight + 100 this.baseHeight = height @@ -96,7 +97,7 @@ class AppNodeModel extends HtmlNodeModel { }) } setAttributes() { - this.width = 500 + this.width = 340 const circleOnlyAsTarget = { message: '只允许从右边的锚点连出', diff --git a/ui/src/components/workflow/common/edge/index.ts b/ui/src/components/workflow/common/edge/index.ts index df9c55089..338001649 100644 --- a/ui/src/components/workflow/common/edge/index.ts +++ b/ui/src/components/workflow/common/edge/index.ts @@ -7,8 +7,8 @@ class CustomEdgeModel2 extends BezierEdgeModel { const style = super.getEdgeStyle() // svg属性 - style.strokeWidth = 1 - style.stroke = '#ababac' + style.strokeWidth = 2 + style.stroke = '#BBBFC4' return style } /** diff --git a/ui/src/components/workflow/icons/base-node-icon.vue b/ui/src/components/workflow/icons/base-node-icon.vue new file mode 100644 index 000000000..a0b5d2752 --- /dev/null +++ b/ui/src/components/workflow/icons/base-node-icon.vue @@ -0,0 +1,6 @@ + + diff --git a/ui/src/components/workflow/icons/start-node-icon.vue b/ui/src/components/workflow/icons/start-node-icon.vue new file mode 100644 index 000000000..9a01ac96c --- /dev/null +++ b/ui/src/components/workflow/icons/start-node-icon.vue @@ -0,0 +1,6 @@ + + diff --git a/ui/src/components/workflow/index.vue b/ui/src/components/workflow/index.vue index a7682d351..de58d550c 100644 --- a/ui/src/components/workflow/index.vue +++ b/ui/src/components/workflow/index.vue @@ -6,11 +6,11 @@ + diff --git a/ui/src/components/workflow/nodes/start-node/index.ts b/ui/src/components/workflow/nodes/start-node/index.ts new file mode 100644 index 000000000..0c7df419b --- /dev/null +++ b/ui/src/components/workflow/nodes/start-node/index.ts @@ -0,0 +1,12 @@ +import ChatNodeVue from './index.vue' +import { AppNode, AppNodeModel } from '@/components/workflow/common/app-node/index' +class ChatNode extends AppNode { + constructor(props: any) { + super(props, ChatNodeVue) + } +} +export default { + type: 'start-node', + model: AppNodeModel, + view: ChatNode +} diff --git a/ui/src/components/workflow/nodes/start-node/index.vue b/ui/src/components/workflow/nodes/start-node/index.vue new file mode 100644 index 000000000..e221b6cfa --- /dev/null +++ b/ui/src/components/workflow/nodes/start-node/index.vue @@ -0,0 +1,54 @@ + + +