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)

This commit is contained in:
shaohuzhang1 2025-09-26 14:52:43 +08:00 committed by GitHub
parent c56742f9b3
commit 8d4bad55f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<any>, y: Array<any>) => [...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)
})
}