fix: The knowledge base workflow upload defaults to selecting the first one (#4415)

This commit is contained in:
shaohuzhang1 2025-12-02 16:20:15 +08:00 committed by GitHub
parent bfb5949582
commit 0a233cae84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,7 @@
</DynamicsForm>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import { computed, ref, watch } from 'vue'
import { WorkflowKind, WorkflowType } from '@/enums/application'
import DynamicsForm from '@/components/dynamics-form/index.vue'
import type { FormField } from '@/components/dynamics-form/type'
@ -135,6 +135,18 @@ const validate = () => {
const get_data = () => {
return form_data.value
}
watch(
source_node_list,
() => {
if (!base_form_data.value.node_id) {
if (source_node_list.value && source_node_list.value.length > 0) {
sourceChange(source_node_list.value[0].id)
}
}
},
{ immediate: true },
)
defineExpose({ validate, get_data })
</script>
<style lang="scss" scoped></style>