fix(web): if-else node case show

This commit is contained in:
zhaoying
2026-04-09 17:45:42 +08:00
parent 9f9ac69f97
commit 33a1c178ff
2 changed files with 13 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ const caculateIsSet = (item: any, type: string) => {
case 'cases': {
if (!item.left) return false
if (['not_empty', 'empty'].includes(item.operator)) return true
return !!item.left && (!!item.right || typeof item.right === 'boolean')
return !!item.left && (!!item.right || typeof item.right === 'boolean' || typeof item.right === 'number')
}
}
}
@@ -22,7 +22,7 @@ const ConditionNode: ReactShapeConfig['component'] = ({ node }) => {
const data = node?.getData() || {};
const { t } = useTranslation()
const graphRef = useRef(node?.model?.graph)
const variableList = useVariableList(node ?? null, graphRef, [])
const variableList = useVariableList(node ?? null, graphRef, data.chatVariables ?? [])
const getLocaleField = (field: string, filedType: string) => {
const key = filedType === 'boolean' ? `workflow.config.if-else..boolean.${field}` : filedType === 'number' ? `workflow.config.if-else.num.${field}` : `workflow.config.if-else.${field}`