fix: Intent node height
parent
f5fbbfc06c
commit
d70d6e1fa7
|
|
@ -48,19 +48,20 @@ class IntentModel extends AppNodeModel {
|
||||||
|
|
||||||
if (branch_condition_list) {
|
if (branch_condition_list) {
|
||||||
|
|
||||||
const FORM_ITEMS_HEIGHT = 382 // 上方表单占用高度
|
const FORM_ITEMS_HEIGHT = 397 // 上方表单占用高度
|
||||||
|
|
||||||
for (let index = 0; index < branch_condition_list.length; index++) {
|
for (let index = 0; index < branch_condition_list.length; index++) {
|
||||||
const element = branch_condition_list[index]
|
const element = branch_condition_list[index]
|
||||||
const h = get_up_index_height(branch_condition_list, index)
|
|
||||||
anchors.push({
|
anchors.push({
|
||||||
x: x + width / 2 - 10,
|
x: x + width / 2 - 10,
|
||||||
y: showNode
|
y: showNode
|
||||||
? y - height / 2 + FORM_ITEMS_HEIGHT + h + element.height / 2
|
? y - height / 2 + FORM_ITEMS_HEIGHT + index *41.3
|
||||||
: y - 15,
|
: y - 15,
|
||||||
id: `${id}_${element.id}_right`,
|
id: `${id}_${element.id}_right`,
|
||||||
type: 'right'
|
type: 'right'
|
||||||
})
|
})
|
||||||
|
console.log(y - height / 2 + FORM_ITEMS_HEIGHT + 100/ 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return anchors
|
return anchors
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,9 @@
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in form_data.branch"
|
v-for="(item, index) in form_data.branch"
|
||||||
v-resize="(wh: any) => resizeBranch(wh, item, index)"
|
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:prop="`branch.${index}.content`"
|
:prop="`branch.${index}.content`"
|
||||||
:rules="{
|
:rules="{
|
||||||
message: $t('views.applicationWorkflow.nodes.intentNode.classify.placeholder'),
|
message: $t('views.applicationWorkflow.nodes.intentNode.classify.placeholder'),
|
||||||
|
|
@ -133,7 +132,6 @@
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
size="large"
|
size="large"
|
||||||
class="mt-4"
|
|
||||||
v-if="!item.isOther"
|
v-if="!item.isOther"
|
||||||
:disabled="form_data.branch.filter((b: any) => !b.isOther).length <= 1"
|
:disabled="form_data.branch.filter((b: any) => !b.isOther).length <= 1"
|
||||||
@click="deleteClassifyBranch(item.id)"
|
@click="deleteClassifyBranch(item.id)"
|
||||||
|
|
@ -192,6 +190,7 @@ function addClassfiyBranch() {
|
||||||
list.splice(list.length - 1, 0, obj)
|
list.splice(list.length - 1, 0, obj)
|
||||||
refreshBranchAnchor(list, true)
|
refreshBranchAnchor(list, true)
|
||||||
set(props.nodeModel.properties.node_data, 'branch', list)
|
set(props.nodeModel.properties.node_data, 'branch', list)
|
||||||
|
props.nodeModel.refreshBranch()
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteClassifyBranch(id: string) {
|
function deleteClassifyBranch(id: string) {
|
||||||
|
|
@ -336,7 +335,7 @@ const validate = () => {
|
||||||
nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''),
|
nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''),
|
||||||
IntentClassifyNodeFormRef.value?.validate(),
|
IntentClassifyNodeFormRef.value?.validate(),
|
||||||
]).then(() => {
|
]).then(() => {
|
||||||
if (form_data.value.branch.length != new Set(form_data.value.branch.map((item: any) => item.content)).size) {
|
if (form_data.value.branch.length != new Set(form_data.value.branch.map((item: any) => item.content)).size) {
|
||||||
throw t('views.applicationWorkflow.nodes.intentNode.error2')
|
throw t('views.applicationWorkflow.nodes.intentNode.error2')
|
||||||
}
|
}
|
||||||
}).catch((err: any) => {
|
}).catch((err: any) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue