fix: The intention is to identify the display issue of the node
parent
eb6873c329
commit
5328757521
|
|
@ -21,7 +21,8 @@
|
||||||
data.type === WorkflowType.AiChat ||
|
data.type === WorkflowType.AiChat ||
|
||||||
data.type === WorkflowType.ImageUnderstandNode ||
|
data.type === WorkflowType.ImageUnderstandNode ||
|
||||||
data.type === WorkflowType.ImageGenerateNode ||
|
data.type === WorkflowType.ImageGenerateNode ||
|
||||||
data.type === WorkflowType.Application
|
data.type === WorkflowType.Application ||
|
||||||
|
data.type == WorkflowType.IntentNode
|
||||||
"
|
"
|
||||||
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
|
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
|
||||||
>
|
>
|
||||||
|
|
@ -168,7 +169,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- AI 对话 / 问题优化-->
|
<!-- AI 对话 / 问题优化 / 意图识别-->
|
||||||
<template
|
<template
|
||||||
v-if="
|
v-if="
|
||||||
data.type == WorkflowType.AiChat ||
|
data.type == WorkflowType.AiChat ||
|
||||||
|
|
@ -808,7 +809,11 @@
|
||||||
<span class="color-secondary">
|
<span class="color-secondary">
|
||||||
{{ $t('views.applicationWorkflow.nodes.loopNode.loopArray.label') }}:</span
|
{{ $t('views.applicationWorkflow.nodes.loopNode.loopArray.label') }}:</span
|
||||||
>
|
>
|
||||||
{{ data.loop_type === 'NUMBER' ? data.number : Object.keys(data.loop_node_data) || '-' }}
|
{{
|
||||||
|
data.loop_type === 'NUMBER'
|
||||||
|
? data.number
|
||||||
|
: Object.keys(data.loop_node_data) || '-'
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h5 class="p-8-12">
|
<h5 class="p-8-12">
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
prop="content_list"
|
prop="content_list"
|
||||||
:label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
|
:label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
|
||||||
:rules="{
|
:rules="{
|
||||||
required: true,
|
required: true,
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
}"
|
}"
|
||||||
|
|
@ -76,7 +76,6 @@
|
||||||
:placeholder="$t('views.applicationWorkflow.nodes.textToSpeechNode.content.label')"
|
:placeholder="$t('views.applicationWorkflow.nodes.textToSpeechNode.content.label')"
|
||||||
v-model="form_data.content_list"
|
v-model="form_data.content_list"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('views.application.form.historyRecord.label')">
|
<el-form-item :label="$t('views.application.form.historyRecord.label')">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
|
|
@ -90,7 +89,6 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('views.applicationWorkflow.nodes.intentNode.classify.label')"
|
|
||||||
:rules="{
|
:rules="{
|
||||||
required: true,
|
required: true,
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
|
|
@ -99,28 +97,32 @@
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div>
|
<div>
|
||||||
<span>{{ $t('views.applicationWorkflow.nodes.intentNode.input.label') }}<span class="color-danger">*</span></span>
|
<span
|
||||||
|
>{{ $t('views.applicationWorkflow.nodes.intentNode.classify.label')
|
||||||
|
}}<span class="color-danger">*</span></span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button @click="addClassfiyBranch" type="primary" size="large" link>
|
||||||
@click="addClassfiyBranch"
|
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
link>
|
|
||||||
<el-icon><Plus /></el-icon>
|
<el-icon><Plus /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="(item,index) in form_data.branch"
|
<div
|
||||||
v-resize="(wh: any) => resizeBranch(wh, item, index)"
|
v-for="(item, index) in form_data.branch"
|
||||||
:key="item.id">
|
v-resize="(wh: any) => resizeBranch(wh, item, index)"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<el-row class="mb-8" :gutter="12" align="middle">
|
<el-row class="mb-8" :gutter="12" align="middle">
|
||||||
<el-col :span="21">
|
<el-col :span="21">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="item.content"
|
v-model="item.content"
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
:disabled="item.isOther"
|
:disabled="item.isOther"
|
||||||
:placeholder="$t('views.applicationWorkflow.nodes.intentNode.classify.placeholder')" />
|
:placeholder="
|
||||||
|
$t('views.applicationWorkflow.nodes.intentNode.classify.placeholder')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -128,8 +130,9 @@
|
||||||
size="large"
|
size="large"
|
||||||
class="mt-4"
|
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)"
|
||||||
|
>
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -176,16 +179,15 @@ const AIModeParamSettingDialogRef = ref<InstanceType<typeof AIModeParamSettingDi
|
||||||
function addClassfiyBranch() {
|
function addClassfiyBranch() {
|
||||||
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
|
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
|
||||||
const obj = {
|
const obj = {
|
||||||
id: randomId(),
|
id: randomId(),
|
||||||
content: '',
|
content: '',
|
||||||
isOther: false ,
|
isOther: false,
|
||||||
}
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function deleteClassifyBranch(id: string) {
|
function deleteClassifyBranch(id: string) {
|
||||||
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
|
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
|
||||||
|
|
||||||
|
|
@ -194,9 +196,9 @@ function deleteClassifyBranch(id: string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const commonItems = list.filter((item:any) => !item.isOther)
|
const commonItems = list.filter((item: any) => !item.isOther)
|
||||||
if (commonItems.length <= 1) {
|
if (commonItems.length <= 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 删除连接线
|
// 删除连接线
|
||||||
const delete_anchor_id = `${props.nodeModel.id}_${id}_right`
|
const delete_anchor_id = `${props.nodeModel.id}_${id}_right`
|
||||||
|
|
@ -225,10 +227,10 @@ function refreshBranchAnchor(list: Array<any>, is_add: boolean) {
|
||||||
.map((item, index) => {
|
.map((item, index) => {
|
||||||
const exist = branch_condition_list.find((b: any) => b.id === item.id)
|
const exist = branch_condition_list.find((b: any) => b.id === item.id)
|
||||||
if (exist) {
|
if (exist) {
|
||||||
return {index: index, height: exist.height, id: item.id}
|
return { index: index, height: exist.height, id: item.id }
|
||||||
} else {
|
} else {
|
||||||
if (is_add) {
|
if (is_add) {
|
||||||
return {index: index, height: 12, id: item.id}
|
return { index: index, height: 12, id: item.id }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -249,7 +251,7 @@ const resizeBranch = (wh: any, row: any, index: number) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
height: wh.height, //该分支高度
|
height: wh.height, //该分支高度
|
||||||
index: index
|
index: index,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
|
|
@ -258,7 +260,6 @@ const resizeBranch = (wh: any, row: any, index: number) => {
|
||||||
refreshBranchAnchor(props.nodeModel.properties.node_data.branch, true)
|
refreshBranchAnchor(props.nodeModel.properties.node_data.branch, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wheel = (e: any) => {
|
const wheel = (e: any) => {
|
||||||
if (e.ctrlKey === true) {
|
if (e.ctrlKey === true) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
@ -283,19 +284,18 @@ const form = {
|
||||||
{
|
{
|
||||||
id: randomId(),
|
id: randomId(),
|
||||||
content: '',
|
content: '',
|
||||||
isOther: false
|
isOther: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: randomId(),
|
id: randomId(),
|
||||||
content: t('views.applicationWorkflow.nodes.intentNode.other'),
|
content: t('views.applicationWorkflow.nodes.intentNode.other'),
|
||||||
isOther: true
|
isOther: true,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
dialogue_number: 1,
|
dialogue_number: 1,
|
||||||
content_list: [],
|
content_list: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refreshParam(data: any) {
|
function refreshParam(data: any) {
|
||||||
set(props.nodeModel.properties.node_data, 'model_params_setting', data)
|
set(props.nodeModel.properties.node_data, 'model_params_setting', data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue