diff --git a/ui/src/locales/lang/en-US/views/application-workflow.ts b/ui/src/locales/lang/en-US/views/application-workflow.ts index 4288f0802..dfd354557 100644 --- a/ui/src/locales/lang/en-US/views/application-workflow.ts +++ b/ui/src/locales/lang/en-US/views/application-workflow.ts @@ -341,6 +341,7 @@ You are a master of problem optimization, adept at accurately inferring user int label: 'IntentNode', text: 'Match user questions with user-defined intent classifications', other: 'other', + error2: 'Repeated intent', placeholder: 'Please choose a classification option', classify: { label: 'Intent classify', diff --git a/ui/src/locales/lang/zh-CN/views/application-workflow.ts b/ui/src/locales/lang/zh-CN/views/application-workflow.ts index 6c5bcb0da..ed62cbb4a 100644 --- a/ui/src/locales/lang/zh-CN/views/application-workflow.ts +++ b/ui/src/locales/lang/zh-CN/views/application-workflow.ts @@ -341,6 +341,7 @@ export default { label: '意图识别', text: '将用户问题与用户预设的意图分类进行匹配', other: '其他', + error2: '意图重复', placeholder: '请选择分类项', classify: { label: '意图分类', diff --git a/ui/src/locales/lang/zh-Hant/views/application-workflow.ts b/ui/src/locales/lang/zh-Hant/views/application-workflow.ts index 632369cad..617866b86 100644 --- a/ui/src/locales/lang/zh-Hant/views/application-workflow.ts +++ b/ui/src/locales/lang/zh-Hant/views/application-workflow.ts @@ -334,6 +334,7 @@ export default { label: '意圖識別', text: '將用戶問題與用戶預設的意圖分類進行匹配', other: '其他', + error2: '意圖重複', placeholder: '請選擇分類項', classify: { label: '意圖分類', diff --git a/ui/src/workflow/nodes/intent-classify-node/index.vue b/ui/src/workflow/nodes/intent-classify-node/index.vue index 7a550ca84..6245040f4 100644 --- a/ui/src/workflow/nodes/intent-classify-node/index.vue +++ b/ui/src/workflow/nodes/intent-classify-node/index.vue @@ -90,10 +90,6 @@ /> @@ -113,6 +109,14 @@ v-for="(item, index) in form_data.branch" v-resize="(wh: any) => resizeBranch(wh, item, index)" :key="item.id" + > + @@ -138,6 +142,7 @@ + @@ -326,10 +331,15 @@ const IntentClassifyNodeFormRef = ref() const modelOptions = ref(null) const validate = () => { + return Promise.all([ nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''), IntentClassifyNodeFormRef.value?.validate(), - ]).catch((err: any) => { + ]).then(() => { + 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') + } + }).catch((err: any) => { return Promise.reject({ node: props.nodeModel, errMessage: err }) }) }