Skip to content

Commit 5328757

Browse files
fix: The intention is to identify the display issue of the node
1 parent eb6873c commit 5328757

File tree

2 files changed

+71
-66
lines changed

2 files changed

+71
-66
lines changed

ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
data.type === WorkflowType.AiChat ||
2222
data.type === WorkflowType.ImageUnderstandNode ||
2323
data.type === WorkflowType.ImageGenerateNode ||
24-
data.type === WorkflowType.Application
24+
data.type === WorkflowType.Application ||
25+
data.type == WorkflowType.IntentNode
2526
"
2627
>{{ data?.message_tokens + data?.answer_tokens }} tokens</span
2728
>
@@ -168,7 +169,7 @@
168169
</div>
169170
</div>
170171
</template>
171-
<!-- AI 对话 / 问题优化-->
172+
<!-- AI 对话 / 问题优化 / 意图识别-->
172173
<template
173174
v-if="
174175
data.type == WorkflowType.AiChat ||
@@ -808,7 +809,11 @@
808809
<span class="color-secondary">
809810
{{ $t('views.applicationWorkflow.nodes.loopNode.loopArray.label') }}:</span
810811
>
811-
{{ data.loop_type === 'NUMBER' ? data.number : Object.keys(data.loop_node_data) || '-' }}
812+
{{
813+
data.loop_type === 'NUMBER'
814+
? data.number
815+
: Object.keys(data.loop_node_data) || '-'
816+
}}
812817
</div>
813818
</div>
814819
<h5 class="p-8-12">

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

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
</el-form-item>
5454
<el-form-item
5555
prop="content_list"
56-
:label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
57-
:rules="{
56+
:label="$t('views.applicationWorkflow.nodes.intentNode.input.label')"
57+
:rules="{
5858
required: true,
5959
trigger: 'change',
6060
}"
@@ -76,7 +76,6 @@
7676
:placeholder="$t('views.applicationWorkflow.nodes.textToSpeechNode.content.label')"
7777
v-model="form_data.content_list"
7878
/>
79-
8079
</el-form-item>
8180
<el-form-item :label="$t('views.application.form.historyRecord.label')">
8281
<el-input-number
@@ -89,53 +88,57 @@
8988
:step-strictly="true"
9089
/>
9190
</el-form-item>
92-
<el-form-item
93-
:label="$t('views.applicationWorkflow.nodes.intentNode.classify.label')"
94-
:rules="{
95-
required: true,
96-
trigger: 'change',
97-
}"
98-
>
99-
<template #label>
100-
<div class="flex-between">
101-
<div>
102-
<span>{{ $t('views.applicationWorkflow.nodes.intentNode.input.label') }}<span class="color-danger">*</span></span>
103-
</div>
104-
<el-button
105-
@click="addClassfiyBranch"
106-
type="primary"
107-
size="large"
108-
link>
109-
<el-icon><Plus /></el-icon>
110-
</el-button>
111-
</div>
112-
</template>
113-
<div>
114-
<div v-for="(item,index) in form_data.branch"
115-
v-resize="(wh: any) => resizeBranch(wh, item, index)"
116-
:key="item.id">
91+
<el-form-item
92+
:rules="{
93+
required: true,
94+
trigger: 'change',
95+
}"
96+
>
97+
<template #label>
98+
<div class="flex-between">
99+
<div>
100+
<span
101+
>{{ $t('views.applicationWorkflow.nodes.intentNode.classify.label')
102+
}}<span class="color-danger">*</span></span
103+
>
104+
</div>
105+
<el-button @click="addClassfiyBranch" type="primary" size="large" link>
106+
<el-icon><Plus /></el-icon>
107+
</el-button>
108+
</div>
109+
</template>
110+
<div>
111+
<div
112+
v-for="(item, index) in form_data.branch"
113+
v-resize="(wh: any) => resizeBranch(wh, item, index)"
114+
:key="item.id"
115+
>
117116
<el-row class="mb-8" :gutter="12" align="middle">
118117
<el-col :span="21">
119-
<el-input
120-
v-model="item.content"
121-
style="width: 210px"
122-
:disabled="item.isOther"
123-
:placeholder="$t('views.applicationWorkflow.nodes.intentNode.classify.placeholder')" />
118+
<el-input
119+
v-model="item.content"
120+
style="width: 210px"
121+
:disabled="item.isOther"
122+
:placeholder="
123+
$t('views.applicationWorkflow.nodes.intentNode.classify.placeholder')
124+
"
125+
/>
124126
</el-col>
125127
<el-col :span="3">
126-
<el-button
127-
link
128+
<el-button
129+
link
128130
size="large"
129-
class="mt-4"
130-
v-if="!item.isOther"
131-
:disabled="form_data.branch.filter((b:any) => !b.isOther).length <= 1"
132-
@click="deleteClassifyBranch(item.id)">
133-
<el-icon><Delete /></el-icon>
131+
class="mt-4"
132+
v-if="!item.isOther"
133+
:disabled="form_data.branch.filter((b: any) => !b.isOther).length <= 1"
134+
@click="deleteClassifyBranch(item.id)"
135+
>
136+
<el-icon><Delete /></el-icon>
134137
</el-button>
135138
</el-col>
136-
</el-row>
137-
</div>
138-
</div>
139+
</el-row>
140+
</div>
141+
</div>
139142
</el-form-item>
140143
</el-form>
141144
</el-card>
@@ -176,16 +179,15 @@ const AIModeParamSettingDialogRef = ref<InstanceType<typeof AIModeParamSettingDi
176179
function addClassfiyBranch() {
177180
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
178181
const obj = {
179-
id: randomId(),
180-
content: '',
181-
isOther: false ,
182+
id: randomId(),
183+
content: '',
184+
isOther: false,
182185
}
183-
list.splice(list.length - 1, 0 , obj)
186+
list.splice(list.length - 1, 0, obj)
184187
refreshBranchAnchor(list, true)
185188
set(props.nodeModel.properties.node_data, 'branch', list)
186189
}
187190
188-
189191
function deleteClassifyBranch(id: string) {
190192
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
191193
@@ -194,19 +196,19 @@ function deleteClassifyBranch(id: string) {
194196
return
195197
}
196198
197-
const commonItems = list.filter((item:any) => !item.isOther)
199+
const commonItems = list.filter((item: any) => !item.isOther)
198200
if (commonItems.length <= 1) {
199-
return
201+
return
200202
}
201203
// 删除连接线
202204
const delete_anchor_id = `${props.nodeModel.id}_${id}_right`
203205
const edgetToDelete = (props.nodeModel.outgoing?.edges || [])
204206
.filter((edge: any) => edge.sourceAnchorId === delete_anchor_id)
205207
.map((edge: any) => edge.id)
206-
208+
207209
if (edgetToDelete.length > 0) {
208210
props.nodeModel.graphModel.eventCenter.emit('delete_edge', edgetToDelete)
209-
}
211+
}
210212
211213
const newList = list.filter((item: any) => item.id !== id) // 删除分支
212214
@@ -225,19 +227,19 @@ function refreshBranchAnchor(list: Array<any>, is_add: boolean) {
225227
.map((item, index) => {
226228
const exist = branch_condition_list.find((b: any) => b.id === item.id)
227229
if (exist) {
228-
return {index: index, height: exist.height, id: item.id}
230+
return { index: index, height: exist.height, id: item.id }
229231
} else {
230232
if (is_add) {
231-
return {index: index, height: 12, id: item.id}
233+
return { index: index, height: 12, id: item.id }
232234
}
233235
}
234-
})
236+
})
235237
.filter((item) => item)
236238
237239
set(props.nodeModel.properties, 'branch_condition_list', new_branch_condition_list)
238240
props.nodeModel.refreshBranch()
239241
}
240-
242+
241243
const resizeBranch = (wh: any, row: any, index: number) => {
242244
const branch_condition_list = cloneDeep(
243245
props.nodeModel.properties.branch_condition_list
@@ -249,16 +251,15 @@ const resizeBranch = (wh: any, row: any, index: number) => {
249251
return {
250252
...item,
251253
height: wh.height, //该分支高度
252-
index: index
254+
index: index,
253255
}
254256
}
255257
return item
256258
})
257259
set(props.nodeModel.properties, 'branch_condition_list', new_branch_condition_list)
258-
refreshBranchAnchor(props.nodeModel.properties.node_data.branch, true)
260+
refreshBranchAnchor(props.nodeModel.properties.node_data.branch, true)
259261
}
260262
261-
262263
const wheel = (e: any) => {
263264
if (e.ctrlKey === true) {
264265
e.preventDefault()
@@ -283,19 +284,18 @@ const form = {
283284
{
284285
id: randomId(),
285286
content: '',
286-
isOther: false
287+
isOther: false,
287288
},
288289
{
289290
id: randomId(),
290291
content: t('views.applicationWorkflow.nodes.intentNode.other'),
291-
isOther: true
292-
}
292+
isOther: true,
293+
},
293294
],
294295
dialogue_number: 1,
295296
content_list: [],
296297
}
297298
298-
299299
function refreshParam(data: any) {
300300
set(props.nodeModel.properties.node_data, 'model_params_setting', data)
301301
}

0 commit comments

Comments
 (0)