feat(querying data): When querying data, the step of selecting a data source can be skipped by clicking "OK". #796

This commit is contained in:
dataeaseShu
2026-05-12 11:49:06 +08:00
committed by dataeaseShu
parent e8463fb75e
commit 45b63d3800
2 changed files with 17 additions and 2 deletions
+6
View File
@@ -75,6 +75,11 @@ function selectDsInDialog(ds: any) {
innerDs.value = ds.id
}
function selectDsDirectlyInDialog(ds: any) {
innerDs.value = ds.id
confirmSelectDs()
}
function confirmSelectDs() {
if (innerDs.value) {
if (assistantStore.getType == 1) {
@@ -207,6 +212,7 @@ defineExpose({
:is-selected="ele.id === innerDs"
:description="ele.description"
@select-ds="selectDsInDialog(ele)"
@select-ds-directly="selectDsDirectlyInDialog(ele)"
></Card>
</el-col>
</el-row>
+11 -2
View File
@@ -23,7 +23,7 @@ const props = withDefaults(
}
)
const emits = defineEmits(['selectDs'])
const emits = defineEmits(['selectDs', 'selectDsDirectly'])
const icon = computed(() => {
return (dsTypeWithImg.find((ele) => props.type === ele.type) || {}).img
})
@@ -31,10 +31,19 @@ const icon = computed(() => {
const SelectDs = () => {
emits('selectDs')
}
const SelectDsDirectly = () => {
emits('selectDsDirectly')
}
</script>
<template>
<div class="card" :class="isSelected && 'is-selected'" @click="SelectDs">
<div
class="card"
:class="isSelected && 'is-selected'"
@dblclick="SelectDsDirectly"
@click="SelectDs"
>
<div class="name-icon">
<img :src="icon" width="32px" height="32px" />
<div class="info">