fix: Error parameter not popped up prompt during variable splitting and parameter extraction node verification (#4238)

This commit is contained in:
shaohuzhang1 2025-10-22 17:57:16 +08:00 committed by GitHub
parent fe2180ba3d
commit c5dfbde07c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 5 deletions

View File

@ -46,7 +46,7 @@ def get_default_model_params_setting(model_id):
def generate_properties(variable_list):
return {variable['field']: {'type': variable['parameter_type'], 'description': variable['desc'],
return {variable['field']: {'type': variable['parameter_type'], 'description': (variable.get('desc') or ""),
'title': variable['label']} for variable in
variable_list}

View File

@ -436,6 +436,7 @@ You are a master of problem optimization, adept at accurately inferring user int
addVariables: 'Add Variables',
editVariables: 'Edit Variables',
variablePlaceholder: 'Please enter variable',
variableListPlaceholder: 'Please add split variables',
expression: {
label: 'Expression',
placeholder: 'Please enter expression',
@ -446,6 +447,7 @@ You are a master of problem optimization, adept at accurately inferring user int
text: 'Use AI models to extract structured parameters',
extractParameters: {
label: 'Extract Parameters',
variableListPlaceholder: 'Please add extraction parameters',
parameterType: 'Parameter Type',
},
},

View File

@ -447,6 +447,7 @@ export default {
addVariables: '添加变量',
editVariables: '编辑变量',
variablePlaceholder: '请输入变量',
variableListPlaceholder: '请添加拆分变量',
expression: {
label: '表达式',
placeholder: '请输入表达式',
@ -457,6 +458,7 @@ export default {
text: '利用 AI 模型提取结构化参数',
extractParameters: {
label: '提取参数',
variableListPlaceholder: '请添加提取参数',
parameterType: '参数类型',
},
},

View File

@ -422,6 +422,7 @@ export default {
addVariables: '添加變量',
editVariables: '編輯變量',
variablePlaceholder: '請輸入變量',
variableListPlaceholder: '請添加折開變數',
expression: {
label: '表達式',
placeholder: '請輸入表達式',
@ -432,6 +433,7 @@ export default {
text: '利用 AI 模型提取結構化參數',
extractParameters: {
label: '提取參數',
variableListPlaceholder: '請添加選取參數',
parameterType: '參數類型',
},
},

View File

@ -79,7 +79,9 @@
<el-form-item
prop="variable_list"
:rules="{
message: $t('views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label'),
message: $t(
'views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder',
),
trigger: 'blur',
required: true,
}"
@ -184,7 +186,9 @@ const model_change = (model_id?: string) => {
const VariableSplittingRef = ref()
const validate = async () => {
return VariableSplittingRef.value.validate()
return VariableSplittingRef.value.validate().catch((err: any) => {
return Promise.reject({ node: props.nodeModel, errMessage: err })
})
}
onMounted(() => {

View File

@ -39,7 +39,9 @@
<el-form-item
prop="variable_list"
:rules="{
message: $t('views.applicationWorkflow.variable.placeholder'),
message: $t(
'views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder',
),
trigger: 'blur',
required: true,
}"
@ -81,7 +83,9 @@ const form_data = computed({
})
const VariableSplittingRef = ref()
const validate = async () => {
return VariableSplittingRef.value.validate()
return VariableSplittingRef.value.validate().catch((err: any) => {
return Promise.reject({ node: props.nodeModel, errMessage: err })
})
}
onMounted(() => {
set(props.nodeModel, 'validate', validate)