Skip to content

Commit 526fb1b

Browse files
committed
feat(Data Source): Data source table structure supports field retrieval #447
1 parent 2b19f0b commit 526fb1b

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

frontend/src/api/datasource.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export const datasourceApi = {
1717
request.post(`/datasource/execSql/${id}`, { sql: sql }),
1818
chooseTables: (id: number, data: any) => request.post(`/datasource/chooseTables/${id}`, data),
1919
tableList: (id: number) => request.post(`/datasource/tableList/${id}`),
20-
fieldList: (id: number) => request.post(`/datasource/fieldList/${id}`),
20+
fieldList: (id: number, data = { fieldName: '' }) =>
21+
request.post(`/datasource/fieldList/${id}`, data),
2122
edit: (data: any) => request.post('/datasource/editLocalComment', data),
2223
previewData: (id: number, data: any) => request.post(`/datasource/previewData/${id}`, data),
2324
saveTable: (data: any) => request.post('/datasource/editTable', data),

frontend/src/i18n/en.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"Data Q&A": "Data Q&A",
55
"Data Connections": "Data Sources",
66
"Dashboard": "Dashboard",
7-
"AI Model Configuration": "AI Model Configuration",
7+
"AI Model Configuration": "AI Model Config",
88
"Details": "Details"
99
},
1010
"parameter": {
11-
"parameter_configuration": "Parameter Configuration",
11+
"parameter_configuration": "Parameter Config",
1212
"question_count_settings": "Question Count Settings",
1313
"model_thinking_process": "Expand Model Thinking Process",
1414
"rows_of_data": "Limit 1000 Rows of Data",
@@ -72,7 +72,7 @@
7272
"code_for_debugging": "Copy the following code for debugging",
7373
"full_screen_mode": "Full screen mode",
7474
"editing_terminology": "Editing Terminology",
75-
"professional_terminology": "Terminology Configuration",
75+
"professional_terminology": "Terminology Config",
7676
"term_name": "Term Name",
7777
"term_description": "Term Description",
7878
"search_term": "Search Term",
@@ -388,7 +388,7 @@
388388
"set_successfully": "Set successfully",
389389
"operate_with_caution": "After the system default model is replaced, the result of intelligent question will be affected, please operate with caution.",
390390
"system_default_model": "Do you want to set {msg} as the system default model?",
391-
"ai_model_configuration": "AI model configuration",
391+
"ai_model_configuration": "AI model config",
392392
"system_default_model_de": "System default model",
393393
"relevant_results_found": "No relevant results found",
394394
"add_model": "Add model",
@@ -508,7 +508,7 @@
508508
"find_user": "Find user",
509509
"add_successfully": "Add successfully",
510510
"member_management": "Member management",
511-
"permission_configuration": "Permission configuration",
511+
"permission_configuration": "Permission Config",
512512
"set": "Settings",
513513
"operate_with_caution": "After deletion, the users under the workspace will be removed and all resources will be deleted. Please operate with caution."
514514
},

frontend/src/views/ds/DataTable.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,17 @@ const renderHeader = ({ column }: any) => {
244244
return column.label
245245
}
246246
247+
const fieldNameSearch = () => {
248+
btnSelectClick(btnSelect.value)
249+
}
250+
const fieldName = ref('')
247251
const btnSelectClick = (val: any) => {
248252
btnSelect.value = val
249253
loading.value = true
250254
251255
if (val === 'd') {
252256
datasourceApi
253-
.fieldList(currentTable.value.id)
257+
.fieldList(currentTable.value.id, { fieldName: fieldName.value })
254258
.then((res) => {
255259
fieldList.value = res
256260
pageInfo.total = res.length
@@ -403,6 +407,15 @@ const btnSelectClick = (val: any) => {
403407
{{ t('ds.preview') }}
404408
</el-button>
405409
</div>
410+
<div v-if="btnSelect === 'd'" class="field-name">
411+
<el-input
412+
:placeholder="t('dashboard.search')"
413+
v-model="fieldName"
414+
@blur="fieldNameSearch"
415+
autocomplete="off"
416+
clearable
417+
/>
418+
</div>
406419

407420
<div
408421
v-if="!loading"
@@ -785,6 +798,14 @@ const btnSelectClick = (val: any) => {
785798
.table-content {
786799
padding: 16px 24px;
787800
height: calc(100% - 80px);
801+
position: relative;
802+
803+
.field-name {
804+
position: absolute;
805+
right: 16px;
806+
top: 16px;
807+
width: 240px;
808+
}
788809
789810
.btn-select {
790811
height: 32px;

0 commit comments

Comments
 (0)