182182 {{ $t('aiChat.executionDetails.conditionResult') }}
183183 </h5 >
184184 <div class =" p-8-12 border-t-dashed lighter" >
185- {{ data.branch_name || '-' }}
185+ <el-tag type =" success" size =" small" >
186+ {{ data.branch_name || '-' }}
187+ </el-tag >
188+ </div >
189+ </div >
190+ <!-- 判断器执行细节 -->
191+ <div class =" card-never border-r-6 mt-8" v-if =" data.branch_details && data.branch_details.length > 0" v-for =" (branch, bIndex) in data.branch_details" :key =" bIndex" >
192+ <h5 class =" p-8-12" >
193+ <span class =" min-w-25" >
194+ <el-tag :type =" branch.is_matched ? 'success' : 'error'" size =" small" >
195+ {{ branch.type || '-' }}
196+ </el-tag >
197+ <span class =" ml-4" >{{ $t('aiChat.executionDetails.branchEvaluationDetails') }}</span >
198+ </span >
199+ <span v-if =" branch.type !== 'ELSE'" >
200+ <span class =" color-secondary" >{{ $t('workflow.nodes.conditionNode.conditions.info') }}</span >
201+ <el-tag type =" warn" size =" small" class =" ml-4" >
202+ {{ branch.condition_logic === 'and' ? $t('workflow.condition.AND') : $t('workflow.condition.OR') }}
203+ </el-tag >
204+ <span class =" color-secondary" >{{ $t('workflow.nodes.conditionNode.conditions.label') }}</span >
205+ </span >
206+ </h5 >
207+ <div v-if =" branch.conditions && branch.conditions.length > 0" class =" border-t-dashed lighter clean" style =" padding : 0 12px 8px 12px " >
208+ <div v-for =" (cond, cIndex) in branch.conditions" :key =" cIndex" class =" mt-8" >
209+ <el-tag type =" warn" size =" small" class =" f_val" :title =" formatValue(cond.field_value, cond.field_type)" >
210+ {{ formatValue(cond.field_value, cond.field_type) }}
211+ </el-tag >
212+ <el-tag type =" primary" size =" small" class =" ml-8" >{{ getCompareLabel(cond.compare) }}</el-tag >
213+ <el-tag type =" warn" size =" small" class =" f_val"
214+ v-if =" !['is_null', 'is_not_null', 'is_true', 'is_not_true', 'is_false', 'is_not_false'].includes(cond.compare)"
215+ >
216+ {{ formatValue(cond.target_value, cond.target_type) }}
217+ </el-tag >
218+ <span class =" ml-8" >=</span >
219+ <el-tag :type =" cond.result ? 'success' : 'danger'" size =" small" class =" ml-8" >
220+ {{ cond.result ? 'True' : 'False' }}
221+ </el-tag >
222+ </div >
186223 </div >
187224 </div >
188225 </template >
14001437import { ref , computed , type PropType } from ' vue'
14011438import ParagraphCard from ' @/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue'
14021439import DynamicsForm from ' @/components/dynamics-form/index.vue'
1440+ import { compareList } from ' @/workflow/common/data'
14031441import { iconComponent } from ' @/workflow/icons/utils'
14041442import { WorkflowType } from ' @/enums/application'
14051443import { getImgUrl } from ' @/utils/common'
@@ -1422,11 +1460,57 @@ const isKnowLedge = computed(() => props.type === 'knowledge')
14221460const currentLoopNode = ref (0 )
14231461const currentParagraph = ref (0 )
14241462const currentWriteContent = ref (0 )
1463+
1464+ // 格式化值显示
1465+ const formatValue = (value : any , value_type : any ): string => {
1466+ if (value === null || value === undefined ) {
1467+ return ' null'
1468+ }
1469+ if (value === ' ' ) {
1470+ return ` ${value_type }: "" `
1471+ }
1472+ if (typeof value === ' string' ) {
1473+ return ` ${value_type }: "${value }" `
1474+ }
1475+ if (Array .isArray (value )) {
1476+ return ` ${value_type }: ${JSON .stringify (value )} `
1477+ }
1478+ if (typeof value === ' object' ) {
1479+ return ` ${value_type }: ${JSON .stringify (value )} `
1480+ }
1481+ return ` ${value_type }: ${value } `
1482+ }
1483+
1484+ const compareMap: Record <string , string > = compareList .reduce ((acc , cur ) => {
1485+ acc [cur .value ] = cur .label
1486+ return acc
1487+ }, {} as Record <string , string >)
1488+
1489+ // 获取比较操作符标签
1490+ const getCompareLabel = (compare : string ): string => {
1491+ return compareMap [compare ] || compare
1492+ }
14251493 </script >
14261494<style lang="scss" scoped>
14271495.execution-detail-card {
14281496 :deep (.md-editor-previewOnly ) {
14291497 background : none !important ;
14301498 }
14311499}
1500+
1501+ .min-w-25 {
1502+ min-width : 38% ;
1503+ display : inline-block ;
1504+ }
1505+
1506+ .f_val {
1507+ margin-left : 4px ;
1508+ max-width : 30% ;
1509+
1510+ * {
1511+ overflow : hidden ;
1512+ text-overflow : ellipsis ;
1513+ white-space : nowrap ;
1514+ }
1515+ }
14321516 </style >
0 commit comments