Skip to content

Commit d70d6e1

Browse files
committed
fix: Intent node height
1 parent f5fbbfc commit d70d6e1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ui/src/workflow/nodes/intent-classify-node/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,20 @@ class IntentModel extends AppNodeModel {
4848

4949
if (branch_condition_list) {
5050

51-
const FORM_ITEMS_HEIGHT = 382 // 上方表单占用高度
51+
const FORM_ITEMS_HEIGHT = 397 // 上方表单占用高度
5252

5353
for (let index = 0; index < branch_condition_list.length; index++) {
5454
const element = branch_condition_list[index]
55-
const h = get_up_index_height(branch_condition_list, index)
55+
5656
anchors.push({
5757
x: x + width / 2 - 10,
5858
y: showNode
59-
? y - height / 2 + FORM_ITEMS_HEIGHT + h + element.height / 2
59+
? y - height / 2 + FORM_ITEMS_HEIGHT + index *41.3
6060
: y - 15,
6161
id: `${id}_${element.id}_right`,
6262
type: 'right'
6363
})
64+
console.log(y - height / 2 + FORM_ITEMS_HEIGHT + 100/ 2)
6465
}
6566
}
6667
return anchors

ui/src/workflow/nodes/intent-classify-node/index.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@
107107
<div>
108108
<div
109109
v-for="(item, index) in form_data.branch"
110-
v-resize="(wh: any) => resizeBranch(wh, item, index)"
111110
:key="item.id"
112111
>
113-
<el-form-item
112+
<el-form-item
114113
:prop="`branch.${index}.content`"
115114
:rules="{
116115
message: $t('views.applicationWorkflow.nodes.intentNode.classify.placeholder'),
@@ -133,7 +132,6 @@
133132
<el-button
134133
link
135134
size="large"
136-
class="mt-4"
137135
v-if="!item.isOther"
138136
:disabled="form_data.branch.filter((b: any) => !b.isOther).length <= 1"
139137
@click="deleteClassifyBranch(item.id)"
@@ -192,6 +190,7 @@ function addClassfiyBranch() {
192190
list.splice(list.length - 1, 0, obj)
193191
refreshBranchAnchor(list, true)
194192
set(props.nodeModel.properties.node_data, 'branch', list)
193+
props.nodeModel.refreshBranch()
195194
}
196195
197196
function deleteClassifyBranch(id: string) {
@@ -336,7 +335,7 @@ const validate = () => {
336335
nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''),
337336
IntentClassifyNodeFormRef.value?.validate(),
338337
]).then(() => {
339-
if (form_data.value.branch.length != new Set(form_data.value.branch.map((item: any) => item.content)).size) {
338+
if (form_data.value.branch.length != new Set(form_data.value.branch.map((item: any) => item.content)).size) {
340339
throw t('views.applicationWorkflow.nodes.intentNode.error2')
341340
}
342341
}).catch((err: any) => {

0 commit comments

Comments
 (0)