Skip to content

Commit b54774b

Browse files
committed
fix: The knowledge base workflow upload defaults to selecting the first one
1 parent d83d70a commit b54774b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ui/src/views/knowledge-workflow/component/action/DataSource.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</DynamicsForm>
4444
</template>
4545
<script setup lang="ts">
46-
import { computed, ref } from 'vue'
46+
import { computed, ref, watch } from 'vue'
4747
import { WorkflowKind, WorkflowType } from '@/enums/application'
4848
import DynamicsForm from '@/components/dynamics-form/index.vue'
4949
import type { FormField } from '@/components/dynamics-form/type'
@@ -135,6 +135,18 @@ const validate = () => {
135135
const get_data = () => {
136136
return form_data.value
137137
}
138+
watch(
139+
source_node_list,
140+
() => {
141+
if (!base_form_data.value.node_id) {
142+
if (source_node_list.value && source_node_list.value.length > 0) {
143+
sourceChange(source_node_list.value[0].id)
144+
}
145+
}
146+
},
147+
{ immediate: true },
148+
)
149+
138150
defineExpose({ validate, get_data })
139151
</script>
140152
<style lang="scss" scoped></style>

0 commit comments

Comments
 (0)