diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 0b5b64c5..eb6a3563 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -341,7 +341,7 @@ "there_are": "There are", "2_dashboards": "{msg} dashboards", "smart_data_centers": "{msg} smart data centers", - "confirm_to_delete": "This data source is in use. Deleting it will cause these resources to not work properly. Confirm to delete?", + "confirm_to_delete": "After the data source is deleted, the related questions can no longer be asked and the charts in the dashboard cannot be displayed normally. Please operate with caution!", "id_account_to_add": "Search user ID/account to add", "find_user": "Find user", "add_successfully": "Add successfully", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 53d07817..fc11d6a4 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -354,7 +354,7 @@ "there_are": "有 ", "2_dashboards": "{msg} 个仪表板", "smart_data_centers": "{msg} 个智能问数", - "confirm_to_delete": "正在使用此数据源,删除后会导致这些资源无法正常使用,确认删除?", + "confirm_to_delete": "数据源删除后,相关的问数不可继续提问,仪表板中的图表无法正常显示,请谨慎操作!", "id_account_to_add": "搜索用户ID/账号添加", "find_user": "查找用户", "add_successfully": "添加成功", diff --git a/frontend/src/views/ds/DataTable.vue b/frontend/src/views/ds/DataTable.vue index 491d131a..a0c66a2a 100644 --- a/frontend/src/views/ds/DataTable.vue +++ b/frontend/src/views/ds/DataTable.vue @@ -58,7 +58,7 @@ const keywords = ref('') const tableListWithSearch = computed(() => { if (!keywords.value) return tableList.value return tableList.value.filter((ele) => - ele.name.toLowerCase().includes(keywords.value.toLowerCase()) + ele.table_name.toLowerCase().includes(keywords.value.toLowerCase()) ) }) const total = ref(1000) @@ -181,6 +181,31 @@ const emits = defineEmits(['back', 'refresh']) const back = () => { emits('back') } + +const btnSelectClick = (val: any) => { + btnSelect.value = val + loading.value = true + + if (val === 'd') { + datasourceApi + .fieldList(currentTable.value.id) + .then((res) => { + fieldList.value = res + }) + .finally(() => { + loading.value = false + }) + } else { + datasourceApi + .previewData(props.info.id, buildData()) + .then((res) => { + previewData.value = res + }) + .finally(() => { + loading.value = false + }) + } +}