From 8d4bad55f26c5ab42483d36295eeafd9916e0bec Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:52:43 +0800 Subject: [PATCH] fix: [Application] An application that adds interface parameters, clicks on the application list page to initiate a conversation, but does not carry interface parameters (#4122) --- ui/src/views/application/index.vue | 58 ++++++++++++++++-------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index f8049773f..4877ffa66 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -529,35 +529,39 @@ const search_type_change = () => { search_form.value = { name: '', create_user: '' } } -const apiInputParams = ref([]) - function toChat(row: any) { - row?.work_flow?.nodes - ?.filter((v: any) => v.id === 'base-node') - .map((v: any) => { - apiInputParams.value = v.properties.api_input_field_list - ? v.properties.api_input_field_list.map((v: any) => { - return { - name: v.variable, - value: v.default_value, - } - }) - : v.properties.input_field_list - ? v.properties.input_field_list - .filter((v: any) => v.assignment_method === 'api_input') - .map((v: any) => { - return { - name: v.variable, - value: v.default_value, - } - }) - : [] + const api = + row.type == 'WORK_FLOW' + ? (id: string) => ApplicationApi.getApplicationDetail(id) + : (id: string) => Promise.resolve({ data: row }) + api(row.id).then((ok) => { + let aips = ok.data?.work_flow?.nodes + ?.filter((v: any) => v.id === 'base-node') + .map((v: any) => { + return v.properties.api_input_field_list + ? v.properties.api_input_field_list.map((v: any) => { + return { + name: v.variable, + value: v.default_value, + } + }) + : v.properties.input_field_list + ? v.properties.input_field_list + .filter((v: any) => v.assignment_method === 'api_input') + .map((v: any) => { + return { + name: v.variable, + value: v.default_value, + } + }) + : [] + }) + .reduce((x: Array, y: Array) => [...x, ...y]) + aips = aips ? aips : [] + const apiParams = mapToUrlParams(aips) ? '?' + mapToUrlParams(aips) : '' + ApplicationApi.getAccessToken(row.id, loading).then((res: any) => { + window.open(application.location + res?.data?.access_token + apiParams) }) - const apiParams = mapToUrlParams(apiInputParams.value) - ? '?' + mapToUrlParams(apiInputParams.value) - : '' - ApplicationApi.getAccessToken(row.id, loading).then((res: any) => { - window.open(application.location + res?.data?.access_token + apiParams) }) }