Skip to content

Commit d9ea476

Browse files
committed
fix: Visibility & exposed params edge cases
1 parent 740ee80 commit d9ea476

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

ui/src/components/ai-chat/component/inline-params/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ export const ALLOWED_EXPOSED_TYPES = [
1515
'TreeSelect',
1616
'SingleSelect',
1717
'MultiSelect',
18-
'RadioCard',
19-
'RadioRow',
2018
] as const

ui/src/components/ai-chat/component/inline-params/index.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ const show = (field: FormField) => {
197197
198198
defineExpose({
199199
validate: () => {
200+
for (const field of fieldList.value) {
201+
if (!show(field)) {
202+
formValue.value[field.field] = null
203+
}
204+
}
205+
200206
for (const item of exposedFields.value) {
201207
if (!show(item)) continue
202208
const isRequired = item.required ?? item.is_required

ui/src/workflow/nodes/form-node/index.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ const validate = () => {
281281
const v_list = [formNodeFormRef.value?.validate()]
282282
283283
const upstreamNodes = props.nodeModel.get_up_node_field_list(true, true)
284+
if (props.nodeModel.graphModel.get_up_node_field_list) {
285+
const outer = props.nodeModel.graphModel.get_up_node_field_list(true, true)
286+
outer.forEach((item: any) => upstreamNodes.push(item))
287+
}
288+
284289
for (const field of form_data.value.form_field_list) {
285290
for (const cond of field.visibility_rules?.conditions || []) {
286291
if (!cond.field || cond.field.length < 2 || !cond.field[0] || !cond.field[1]) continue
@@ -290,16 +295,8 @@ const validate = () => {
290295
v_list.push(Promise.reject(t('workflow.variable.NoReferencing')))
291296
}
292297
} else {
293-
// 跨节点:查上游
298+
// 跨节点:查上游(含循环外层 graph 的节点)
294299
const nodeEntry = upstreamNodes.find((n: any) => n.value === cond.field[0])
295-
console.log('cond.field:', cond.field)
296-
console.log(
297-
'upstreamNodes:',
298-
upstreamNodes.map((n: any) => ({
299-
value: n.value,
300-
children: n.children?.map((c: any) => c.value),
301-
})),
302-
)
303300
if (!nodeEntry || !nodeEntry.children?.some((c: any) => c.value === cond.field[1])) {
304301
v_list.push(Promise.reject(t('workflow.variable.NoReferencing')))
305302
}

0 commit comments

Comments
 (0)